am ddcba6e8: am 27c7dbee: Merge "Fix log_backtrace assertion failure caused by LP64 fix."
* commit 'ddcba6e8eefb4331b103f60b2d233a2cb114874f': Fix log_backtrace assertion failure caused by LP64 fix.
This commit is contained in:
commit
3fc5dce69e
@ -37,6 +37,12 @@
|
|||||||
#include "debug_mapinfo.h"
|
#include "debug_mapinfo.h"
|
||||||
#include "private/libc_logging.h"
|
#include "private/libc_logging.h"
|
||||||
|
|
||||||
|
#if defined(__LP64__)
|
||||||
|
#define PAD_PTR "016" PRIxPTR
|
||||||
|
#else
|
||||||
|
#define PAD_PTR "08" PRIxPTR
|
||||||
|
#endif
|
||||||
|
|
||||||
/* depends how the system includes define this */
|
/* depends how the system includes define this */
|
||||||
#ifdef HAVE_UNWIND_CONTEXT_STRUCT
|
#ifdef HAVE_UNWIND_CONTEXT_STRUCT
|
||||||
typedef struct _Unwind_Context __unwind_context;
|
typedef struct _Unwind_Context __unwind_context;
|
||||||
@ -164,19 +170,14 @@ __LIBC_HIDDEN__ void log_backtrace(uintptr_t* frames, size_t frame_count) {
|
|||||||
const char* best_name = (demangled_symbol != NULL) ? demangled_symbol : symbol;
|
const char* best_name = (demangled_symbol != NULL) ? demangled_symbol : symbol;
|
||||||
|
|
||||||
__libc_format_log(ANDROID_LOG_ERROR, "libc",
|
__libc_format_log(ANDROID_LOG_ERROR, "libc",
|
||||||
" #%02zd pc %0*" PRIxPTR " %s (%s+%" PRIuPTR ")",
|
" #%02zd pc %" PAD_PTR " %s (%s+%" PRIuPTR ")",
|
||||||
i,
|
i, rel_pc, soname, best_name, frames[i] - offset);
|
||||||
static_cast<int>(2 * sizeof(void*)), rel_pc,
|
|
||||||
soname,
|
|
||||||
best_name, frames[i] - offset);
|
|
||||||
|
|
||||||
free(demangled_symbol);
|
free(demangled_symbol);
|
||||||
} else {
|
} else {
|
||||||
__libc_format_log(ANDROID_LOG_ERROR, "libc",
|
__libc_format_log(ANDROID_LOG_ERROR, "libc",
|
||||||
" #%02zd pc %0*" PRIxPTR " %s",
|
" #%02zd pc %" PAD_PTR " %s",
|
||||||
i,
|
i, rel_pc, soname);
|
||||||
static_cast<int>(2 * sizeof(void*)), rel_pc,
|
|
||||||
soname);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user