This includes removing the map_info.c source and replacing it with the
BacktraceMap class to handle all map related code.
Change all callers of libbacktrace map functionality.
Also modify the corkscrew thread code so that it doesn't need to build
the map twice (once in the corkscrew format and once in the libbacktrace
format).
Change-Id: I32865a39f83a3dd6f958fc03c2759ba47d12382e
Use the libbacktrace C++ interface instead of the C interface in debuggerd.
Reformat the debuggerd code to be closer to Google C++ style.
Fix all debuggerd casts to be C++ casts.
Add a frame number to the frame data structure for ease of formatting and
add another FormatFrameData function.
Change the format_test to use the new FormatFrameData function.
Modify all of the backtrace_test to use the C++ interface.
Change-Id: I10e1610861acf7f4a3ad53276b74971cfbfda464
This is part 1, only including the bare minimum changes because
our diff tool doesn't easily show differences when a file moves. This
also breaks it into a small chunk in case some other changes break things,
as unlikely as I think that will be.
Change-Id: Ib7a3e7a2cc1ac574d15b65fda23813ebcf5d31af
Allow the use of the same map info to be shared when getting information on
multiple threads from the same pid.
Change-Id: I2e460e20154a10f4894ae563331fb32179e4551f
Also remove a hack that claims to be "just like ARM", but which was
different from the ARM and MIPS behavior.
Change-Id: I9b16da9a56430998ded27d304ce52c7cc8bfedfc
The old code was essentially trying to be C++ in C and was awkward. This
change makes it all objects with a thin layer that C code can use.
There is a C++ backtrace object that is not very useful, this code will
replace it.
This change also includes moving the backtrace test to a gtest, and adding
coverage of all major functionality.
Bug: 8410085
Change-Id: Iae0f1b09b3dd60395f71ed66010c1ea5cdd37841
Remove all of the code in debuggerd that uses libcorkscrew directly
and replace with libbacktrace.
Also do a bit of refactoring to clean up some functions that were
passing around variables that weren't used.
Bug: 8410085
Change-Id: I27da4fbe3f12ce38a85b4432fc1119984c9c391b
Move the liblog headers to log/ instead of cutils/ to complete
the separation of libcutils and liblog. cutils/log.h still
exists and includes log/log.h in order to support the many existing
modules that use cutils/log.h.
Change-Id: I2758c9f4aedcb809ca7ba8383d0f55041dd44345
The system server may prematurely close the connection to
/data/system/ndebugsocket if it's not interested in the data
from debuggerd. If it does so, we don't want to die due to a
SIGPIPE.
Change-Id: Iaef1f497bcd630144e6df6a06644a3293b85b6e0
We should also add a test for heap corruption, but I failed to come up
with a kind of corruption that dlmalloc actually detects (rather than
just crashing accidentally).
Change-Id: I7457e732729635b171ffc44517c3de71f55608e6
Restore the logging of the mem maps around the fault address along
with the rest of the faulting thread's information. (It was still
being written to the tombstone file, but the logging got dropped on
the floor in the refactoring around AM report integration).
Bug 8654694
Change-Id: Id8851fa765dfe6b6ce41ccfc39e85eaac0acc629
Also fixed the LOG() macro to actually write to the log again, tracking
the change in _LOG() argument semantics.
Bug 8322568
Change-Id: I79330c85c26d3ffb734315b6d0f2c0bb80bd234a
The Activity Manager sets up a permission-guarded domain socket, which
debuggerd connects to when a crash happens. If this is successful,
the daemon then mirrors the logged crash report to that socket, then
closes it.
Bug 8322568
Change-Id: Ife0c772a628ef82e8457094e511ce1edbfe57460
Backtracing through eh_frame section is more effective allowing to reuse
ebp register for other purposes within routine. GCC with turned on
optimizations (-O1 and above) implicitly defines -fomit-frame-pointer
anyway. eh_frame sections are generated by default with GCC on any
optimization level.
This change implements remote unwinding (separate process unwinding).
Local unwinding is already implemented through _Unwind_Backtrace call
which is implemented in libgcc.
Change-Id: I1aea1ecd19c21710f9cf5f05dc272fc51b67b7aa
Signed-off-by: Pavel Chupin <pavel.v.chupin@intel.com>
bionic's __stack_chk_fail was preventing debuggerd from dumping
stacks, which was not helpful.
Bug: 2487269
Change-Id: Idba2a274037b960dfb2ac1c21686323268c4b372
So "thread-nostack" runs the "nostack" code on a new thread, and
"thread-abort" runs the "abort" code on a new thread, and so on.
Bug: http://code.google.com/p/android/issues/detail?id=16672
Change-Id: I026a0e43eea147f1a7a74243846954599bcf4238
If somebody sends debuggerd bad data, it logs a complaint
but doesn't give any indication of the source. Now we show
the pid and uid we get from SO_PEERCRED.
Bug 7704699
Change-Id: I2738eb972932cc868ad969b60e16dd0b623212a1
The only common one we were missing is SI_TKILL, but we've had the full
set on the dalvik-dev branch for some time now.
Change-Id: I7cf52d352b8624e0adb17a2ed440e7a10f490dfd
Restore the security contexts of tombstone directory
when initially created.
Change-Id: I25b53730991576eccb62ca57050decd584acc639
Signed-off-by: rpcraig <rpcraig@tycho.ncsc.mil>