summaryrefslogtreecommitdiffstats
path: root/debuggerd/arm
Commit message (Collapse)AuthorAgeFilesLines
* AArch64: Port debuggerdKévin PETIT2014-01-301-0/+43
| | | | | Change-Id: Ib18f76f375a1d70c84e0a09d221e17ac43144b96 Signed-off-by: Kévin PETIT <kevin.petit@arm.com>
* debuggerd: a few generic improvementsKévin PETIT2014-01-301-59/+0
| | | | | | | | | | This one makes dump_memory reasonably architecture-agnostic so it is possible to share the code between architectures. It also includes a few small improvements in tombstone.cpp. Change-Id: Ib8a9599bfa420b41e80207988e87aee1b9d79541 Signed-off-by: Kévin PETIT <kevin.petit@arm.com>
* Next phase of the move, reformat use C++ features.Christopher Ferris2014-01-131-140/+133
| | | | | | | | | | | | | | | | | 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
* Move to C++ for debuggerd.Christopher Ferris2014-01-101-0/+0
| | | | | | | | | 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
* Switch ARM debuggerd over to <sys/user.h>.Elliott Hughes2013-11-261-8/+5
| | | | Change-Id: I106d4e80a2e819f1d47ca81893340f567bb8b4d9
* Update debuggerd to use libbacktrace.Christopher Ferris2013-10-031-25/+19
| | | | | | | | | | | | 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
* Uploaded native crash dumps do not include memory contentsChristopher Tate2013-04-051-17/+20
| | | | | | | | | Also fixed the LOG() macro to actually write to the log again, tracking the change in _LOG() argument semantics. Bug 8322568 Change-Id: I79330c85c26d3ffb734315b6d0f2c0bb80bd234a
* Dump 256 bytes per chunk pointed by general-purpose registers.Ben Cheng2012-09-241-1/+5
| | | | | Bug: 7216522 Change-Id: Iddcec8399b00ad411be6863dd866a3f74377ba03
* Enhance native stack dumps.Jeff Brown2012-06-081-38/+82
| | | | | | | | | | | | | | | | | | | | | | | | | Provides a new mechanism for dumpstate (while running as root) to request that debuggerd dump the stacks of native processes that we care about in bug reports. In this mode, the backtrace is formatted to look similar to a Dalvik backtrace. Moved the tombstone generating code into a separate file to make it easier to maintain. Fixed a bug where sometimes the stack traces would be incomplete because we were not waiting for each thread to stop after issuing PTRACE_ATTACH, only the main thread. So sometimes we were missing traces for some threads. Refactored the logging code to prevent accidentally writing data to logcat when explicitly dumping a tombstone or backtrace from the console. Only root or system server can request to dump backtraces but only root can dump tombstones. Bug: 6615693 Change-Id: Ib3edcc16f9f3a687e414e3f2d250d9500566123b
* Improve stack unwinder robustness.Jeff Brown2011-11-041-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Keep track of whether memory maps are readable. Use the information in try_get_word to try to avoid accidentally dereferencing an invalid pointer within the current process. (Note that I haven't ever seen that happen during normal unwinding, but it pays to be a little more careful.) Refactored try_get_word a little to make it easier to pass it the needed state for validation checks by way of a little memory_t struct. Improved how the memory map for the current process is cached. This is important because we need up to date information about readable maps. Use a 5 second cache expiration. Improved the PC -> LR fallback logic in the unwinder so we can eke out an extra frame sometimes. Fixed a bug reading ELF program headers. The phnum & phentsize fields are half-words. We were incorrectly interpreting phnum as a whole word. Used android_atomic_* operations carefully in the unwinder to prevent possible memory races between the dumper and the dumpee. This was highly unlikely (or even impossible due to the presence of other barriers along the way) but the code is clearer now about its invariants. Fixed a bug in debuggerd where the pid was being passed to have its stack dump taken instead of the tid, resulting in short stacks because ptrace couldn't read the data if pid != tid. Did a full sweep to ensure that we use pid / tid correctly everywhere. Ported old code from debuggerd to rewind the program counter back one instruction so that it points to the branch instruction itself instead of the return address. Change-Id: Icc4eb08320052975a4ae7f0f5f0ac9308a2d33d7
* Add support for explicitly dumping native stacks.Jeff Brown2011-10-251-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | This change modifies debuggerd so that it can be used to grab the native stacks of a process that has hung and not just crashed. Note that only the root user can do this (for now). adb shell debuggerd <tid> Then use logcat to find the tombstone file that was generated which will have the native stacks of all threads in the requested process. The specified thread will be shown first and will also appear in the main log. Also made some minor tweaks to libcorkscrew so that we could handle statically compiled executables in the future if we compiled the library statically. Improved the "wait_for_user_action" function to support volume down as an alternative for devices that do not have home keys. Removed a mess of gotos. Change-Id: Ic149653986b0c2f503c7f0e8b7cb1f3be7c84d1e
* Use libcorkscrew in debuggerd.Jeff Brown2011-10-223-1296/+48
| | | | Change-Id: I5e3645a39d96c808f87075b49111d0262a19a0c8
* Enable verbose register memory dumpsAndy McFadden2011-10-191-1/+1
| | | | | | | | | | | | Dump some memory at addresses for all registers that look like they might have valid addresses. Previously this was only done for PC and LR. (This is expected to be disabled before ship.) Bug 5484924 Change-Id: I9802eaa396783e1286ae0c53eaf2473892c38a02
* Add log summary to tombstonesAndy McFadden2011-10-181-2/+7
| | | | | | | | | | | | | | | | | | | | | When the tombstones are uploaded to APR, they're truncated at 64KB. This causes the log data, which is at the end, to be lost if the process has more than about 12 threads (which many do). This change adds the last few lines of the log right below the report for the crashing thread, where we should be guaranteed to keep it. Also, clean up trailing newlines on log messages (which end up in the tombstone), and don't print a "------- log" banner if there aren't any messages in that log file (e.g. slog). Also also, don't try to show_nearby_maps unless this is the crashing thread. Bug 5471955 Change-Id: Iaa4fd2fafbaeda2f20bb95f202177d7744a91f9d
* Enhance debuggerd memory dumpsAndy McFadden2011-10-181-54/+103
| | | | | | | | | | | | | | | | | | | | | | | | | This makes two changes: (1) Display ASCII values next to the memory dumps. For example: I DEBUG: 00008ac4 706f6f4c 20676e69 74206425 73656d69 Looping %d times I DEBUG: 00008ad4 7453000a 6e69726f 6f742067 0a702520 ..Storing to %p. I DEBUG: 00008ae4 65642f00 657a2f76 55006f72 6c62616e ./dev/zero.Unabl (The hex values are still displayed as little-endian word values, while the ASCII part is byte oriented.) (2) Optionally display memory dumps for all registers, not just LR and PC, for the crashing thread. This is meant for situations where we crash dereferencing foo->bar and want to see what the memory near "foo" looks like -- could be handy if it got stomped by MUTF-16 text or something recognizable. Change #2 is currently disabled, via a compile-time setting. Bug 5471955 Change-Id: Iacfd01c314055bad81db2f43b7d239f10086fcfb
* Show maps near native fault addressAndy McFadden2011-10-131-0/+70
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | This adds some additional output to native crashes. For example, if something tried to access a bit of mmap(/dev/zero) memory that had been mprotect()ed, you might see output like this: I DEBUG : memory map around addr 4015a00c: I DEBUG : 40159000-4015a000 /system/lib/libstdc++.so I DEBUG : 4015a000-40162000 /dev/zero I DEBUG : b0001000-b0009000 /system/bin/linker The idea is to see what's in and around the fault address to make it easier to identify bus errors due to file truncation and segmentation faults caused by buffer over/underruns. No output is generated for accesses below 0x1000 (which are likely NULL pointer dereferences) or for signals that don't set si_addr. Also, suppress the fault address for signals that don't set si_addr: I DEBUG : signal 6 (SIGABRT), code 0 (?), fault addr -------- We still print "fault addr" followed by 8 characters for anything that is parsing the contents. The "address" shown for signals like SIGABRT was meaningless and possibly confusing. Bug 5358516 Change-Id: Icae8ef309ea2d89b129f68d30f96b2ca8a69cc6c
* Fix overflow prevention code in memory dump.Ben Cheng2011-02-241-19/+23
| | | | | | | | The delta between start and end pointers in memory dump has to be multiples of 4 or 16. Bug: 3486787 Change-Id: Ie34aa79ffb704ca647805dbc6a16f2c35adf849c
* debuggerd: Fix missing include.David 'Digit' Turner2011-02-011-0/+1
| | | | | | | | | | | | | | The structure user_vfp is incorrectly defined in bionic/libc/kernel/arch-arm/asm/ptrace.h at the moment, while it should be under bionic/libc/kernel/arch-arm/asm/user.h instead. Before moving its definition in the corresponding source files, we need to fix its users. It happens that debuggerd is the only one for now, so fix this by including <linux/user.h> instead (which will include <asm/user.h> and <asm/ptrace.h>). Also, make the debug output less chatty by specifying all symbols to be listed through XLOG2 instead of XLOG. Change-Id: I16e0fa700945d86efd44ee885a84ad609c0a9b58
* Prevent rollover when dumping data around PC, SP, etc.Paul Eastham2010-12-141-0/+15
| | | | Change-Id: Ifc5f0e8eb5fed191c39f0878869e04b4d4f3b9ca
* debuggerd: IA versionBruce Beare2010-11-291-1/+0
| | | | | | Change-Id: I0c0d9c2d7e476b8d117aaf505a9480a47c0b5c05 Signed-off-by: Lei Li <lei.l.li@intel.com> Signed-off-by: Bruce Beare <bruce.j.beare@intel.com>
* debuggerd: Reorganize to facilitate IA commitBruce Beare2010-11-294-0/+1272
Change-Id: I22dd02daf617672fc0a8ba7e396017c57f17e26e Signed-off-by: Bruce Beare <bruce.j.beare@intel.com>