OLD | NEW |
1 // Copyright (c) 2017, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2017, the Dart project authors. Please see the AUTHORS file |
2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
4 | 4 |
5 #include "platform/globals.h" | 5 #include "platform/globals.h" |
6 | 6 |
7 #if defined(DART_USE_TCMALLOC) && !defined(PRODUCT) && \ | 7 #if defined(DART_USE_TCMALLOC) && !defined(PRODUCT) && \ |
8 !defined(TARGET_ARCH_DBC) && !defined(HOST_OS_FUCHSIA) | 8 !defined(TARGET_ARCH_DBC) && !defined(HOST_OS_FUCHSIA) |
9 | 9 |
10 #include "platform/assert.h" | 10 #include "platform/assert.h" |
(...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
149 (helper_start_address <= address) && (helper_end_address >= address); | 149 (helper_start_address <= address) && (helper_end_address >= address); |
150 EXPECT(first_result); | 150 EXPECT(first_result); |
151 address = sample->At(1); | 151 address = sample->At(1); |
152 bool second_result = | 152 bool second_result = |
153 (test_start_address <= address) && (test_end_address >= address); | 153 (test_start_address <= address) && (test_end_address >= address); |
154 EXPECT(second_result); | 154 EXPECT(second_result); |
155 | 155 |
156 if (!(first_result && second_result)) { | 156 if (!(first_result && second_result)) { |
157 OS::PrintErr( | 157 OS::PrintErr( |
158 "If this test is failing, it's likely that the value set for" | 158 "If this test is failing, it's likely that the value set for" |
159 "the number of frames to skip in malloc_hooks.cc is " | 159 " the number of frames to skip in malloc_hooks.cc is " |
160 "incorrect for this configuration/platform. This value can be" | 160 "incorrect for this configuration/platform. This value can be" |
161 " found in malloc_hooks.cc in the AllocationInfo class, and " | 161 " found in malloc_hooks.cc in the AllocationInfo class, and " |
162 "is stored in the kSkipCount constant."); | 162 "is stored in the kSkipCount constant.\n"); |
| 163 OS::PrintErr("First result: %d Second Result: %d\n", first_result, |
| 164 second_result); |
| 165 OS::PrintErr("Dumping sample stack trace:\n"); |
| 166 sample->DumpStackTrace(); |
163 } | 167 } |
164 | 168 |
165 free(var); | 169 free(var); |
166 MallocHooks::TearDown(); | 170 MallocHooks::TearDown(); |
167 MallocHooks::set_stack_trace_collection_enabled(enable_stack_traces_saved); | 171 MallocHooks::set_stack_trace_collection_enabled(enable_stack_traces_saved); |
168 FLAG_enable_malloc_hooks = enable_malloc_hooks_saved; | 172 FLAG_enable_malloc_hooks = enable_malloc_hooks_saved; |
169 } | 173 } |
170 | 174 |
171 | 175 |
172 ISOLATE_UNIT_TEST_CASE(StackTraceMallocHookSimpleJSONTest) { | 176 ISOLATE_UNIT_TEST_CASE(StackTraceMallocHookSimpleJSONTest) { |
(...skipping 27 matching lines...) Expand all Loading... |
200 | 204 |
201 free(var); | 205 free(var); |
202 MallocHooks::TearDown(); | 206 MallocHooks::TearDown(); |
203 MallocHooks::set_stack_trace_collection_enabled(enable_stack_traces_saved); | 207 MallocHooks::set_stack_trace_collection_enabled(enable_stack_traces_saved); |
204 FLAG_enable_malloc_hooks = enable_malloc_hooks_saved; | 208 FLAG_enable_malloc_hooks = enable_malloc_hooks_saved; |
205 } | 209 } |
206 | 210 |
207 }; // namespace dart | 211 }; // namespace dart |
208 | 212 |
209 #endif // defined(DART_USE_TCMALLOC) && !defined(PRODUCT) | 213 #endif // defined(DART_USE_TCMALLOC) && !defined(PRODUCT) |
OLD | NEW |