OLD | NEW |
---|---|
1 /* | 1 /* |
2 * Copyright (C) 2003, 2006, 2007 Apple Inc. All rights reserved. | 2 * Copyright (C) 2003, 2006, 2007 Apple Inc. All rights reserved. |
3 * Copyright (C) 2007-2009 Torch Mobile, Inc. | 3 * Copyright (C) 2007-2009 Torch Mobile, Inc. |
4 * Copyright (C) 2011 University of Szeged. All rights reserved. | 4 * Copyright (C) 2011 University of Szeged. All rights reserved. |
5 * | 5 * |
6 * Redistribution and use in source and binary forms, with or without | 6 * Redistribution and use in source and binary forms, with or without |
7 * modification, are permitted provided that the following conditions | 7 * modification, are permitted provided that the following conditions |
8 * are met: | 8 * are met: |
9 * 1. Redistributions of source code must retain the above copyright | 9 * 1. Redistributions of source code must retain the above copyright |
10 * notice, this list of conditions and the following disclaimer. | 10 * notice, this list of conditions and the following disclaimer. |
(...skipping 249 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
260 | 260 |
261 WTFGetBacktrace(samples, &frames); | 261 WTFGetBacktrace(samples, &frames); |
262 WTFPrintBacktrace(samples + framesToSkip, frames - framesToSkip); | 262 WTFPrintBacktrace(samples + framesToSkip, frames - framesToSkip); |
263 } | 263 } |
264 | 264 |
265 void WTFPrintBacktrace(void** stack, int size) | 265 void WTFPrintBacktrace(void** stack, int size) |
266 { | 266 { |
267 for (int i = 0; i < size; ++i) { | 267 for (int i = 0; i < size; ++i) { |
268 const char* mangledName = 0; | 268 const char* mangledName = 0; |
269 char* cxaDemangled = 0; | 269 char* cxaDemangled = 0; |
270 #if OS(MACOSX) || OS(LINUX) | 270 #if OS(MACOSX) || OS(LINUX) && !defined(__UCLIBC__) |
jochen (gone - plz use gerrit)
2014/04/08 07:51:04
can you use brackets to make the condition clear?
Mostyn Bramley-Moore
2014/04/08 07:56:38
Done.
| |
271 Dl_info info; | 271 Dl_info info; |
272 if (dladdr(stack[i], &info) && info.dli_sname) | 272 if (dladdr(stack[i], &info) && info.dli_sname) |
273 mangledName = info.dli_sname; | 273 mangledName = info.dli_sname; |
274 if (mangledName) | 274 if (mangledName) |
275 cxaDemangled = abi::__cxa_demangle(mangledName, 0, 0, 0); | 275 cxaDemangled = abi::__cxa_demangle(mangledName, 0, 0, 0); |
276 #endif | 276 #endif |
277 const int frameNumber = i + 1; | 277 const int frameNumber = i + 1; |
278 if (mangledName || cxaDemangled) | 278 if (mangledName || cxaDemangled) |
279 printf_stderr_common("%-3d %p %s\n", frameNumber, stack[i], cxaDeman gled ? cxaDemangled : mangledName); | 279 printf_stderr_common("%-3d %p %s\n", frameNumber, stack[i], cxaDeman gled ? cxaDemangled : mangledName); |
280 else | 280 else |
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
378 | 378 |
379 void WTFLogAlways(const char* format, ...) | 379 void WTFLogAlways(const char* format, ...) |
380 { | 380 { |
381 va_list args; | 381 va_list args; |
382 va_start(args, format); | 382 va_start(args, format); |
383 vprintf_stderr_with_trailing_newline(format, args); | 383 vprintf_stderr_with_trailing_newline(format, args); |
384 va_end(args); | 384 va_end(args); |
385 } | 385 } |
386 | 386 |
387 } // extern "C" | 387 } // extern "C" |
OLD | NEW |