From 35b621c5f4c79959cd36fec0153c2c9c43ebe5f0 Mon Sep 17 00:00:00 2001 From: Elliott Hughes Date: Mon, 28 Jan 2013 16:27:36 -0800 Subject: Don't collect useless stack frames; do demangle C++ symbols. Previously, we'd collect every stack frame and then throw some away when we came to log them. This meant that stack traces were effectively shorter than the buffers that had been allocated for them. This patch only stores frames we'll actually output. Also dynamically call the C++ demangler so we don't have to try to read mangled names. Because no one knows the mangling of operator new[] for int arrays off the top of their head. Bug: 7291287 Change-Id: I42b022fd7cd61675d05171de4c3b2704d058ef2a --- libc/bionic/debug_stacktrace.h | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) (limited to 'libc/bionic/debug_stacktrace.h') diff --git a/libc/bionic/debug_stacktrace.h b/libc/bionic/debug_stacktrace.h index 800a172d9..2cf8636d1 100644 --- a/libc/bionic/debug_stacktrace.h +++ b/libc/bionic/debug_stacktrace.h @@ -32,14 +32,9 @@ #include #include -struct stack_crawl_state_t { - size_t count; - uintptr_t* addrs; -}; - -struct mapinfo_t; - -__LIBC_HIDDEN__ int get_backtrace(uintptr_t* stack_frames, size_t max_entries); -__LIBC_HIDDEN__ void log_backtrace(mapinfo_t* map_info, uintptr_t* stack_frames, size_t frame_count); +__LIBC_HIDDEN__ void backtrace_startup(); +__LIBC_HIDDEN__ void backtrace_shutdown(); +__LIBC_HIDDEN__ int get_backtrace(uintptr_t* stack_frames, size_t max_depth); +__LIBC_HIDDEN__ void log_backtrace(uintptr_t* stack_frames, size_t frame_count); #endif /* DEBUG_STACKTRACE_H */ -- cgit v1.2.3