summaryrefslogtreecommitdiffstats
path: root/libbacktrace
Commit message (Collapse)AuthorAgeFilesLines
* Don't demangle symbol names.Josh Gao2016-03-251-16/+0
| | | | | Bug: http://b/27299236 Change-Id: I26ef47f80d4d6048a316ba51e83365ff65d70439
* Add a logging handler on timeout.Christopher Ferris2015-09-031-1/+17
| | | | | | | | | | | | If the signal handler doesn't fire in the given time when trying to unwind a thread, put on a logging handler. This prevents crashes if the signal does eventually fire. Bug: 23783762 (cherry picked from commit d7226f9a1485ba19f714369fd7f8b444d66feb61) Change-Id: Ib990a06733cc93717752ab4998f4ae26afd7e249
* Display the map offset for each frame.Christopher Ferris2015-08-202-0/+14
| | | | | | | | | | | The dlopen of a shared library in an apk results in large map offsets. Unfortunately, the current way that the frame data is printed, it's impossible to tell what the relative pc is relative to. With the addition of the offset, it's possible to figure out what the relative pc actually references. Bug: 23348999 Change-Id: Ia51b669ea3f810158cfd0d71d9ae89bf9a3170d3
* Remove PtraceRead error message.Christopher Ferris2015-06-121-2/+0
| | | | | | | | | | | | | | This error message has no meaning and makes it look like an unwinding failure occurred. These messages are showing up more often now that a lot more of debuggerd is using the ReadWord and Read calls. If a higher level function wants to indicate there is an error, then it can add a more meaningful error. Bug: 21818730 (cherry picked from commit 35c8136d96a6007ac83f828ac02cc6b75d3f5cc0) Change-Id: Ie6e20fbc18702fde935f2cf8cbf1b297fda43282
* Modify the code to avoid potential deadlocks.Christopher Ferris2015-06-014-17/+40
| | | | | | | | | | | | | | | | | | | If the signal to dump a thread is never delivered, then it's possible for a deadlock. The signal handler is responsible for unlocking and deleting the ThreadEntry created for the pid/tid combination. This means if the signal is lost, the ThreadEntry gets stuck locked and never deleted. If a second attempt to get a backtrace of this thread occurs, there is a deadlock. Also, decrease the timeout from 10 seconds to 5 seconds. The original 10 seconds was because the unwind was actually done in the signal handler. Now the signal handler does nothing but copy the ucontext structure and let the caller do the unwind. Bug: 21086132 (cherry picked from commit 2d09171758b7d98c77f27e439a4caf35dd84c311) Change-Id: I414c500eb08983a5017caf3fce4f499465575a9d
* Prevent crashes if a map cannot be created.Christopher Ferris2015-05-153-1/+13
| | | | | | | | | | | | | | | Under some conditions, /proc/<pid>/maps might return nothing. If we try and unwind in this case, we'll crash. Check this case and fail the unwind. Add checks that no other functions try and use map_ without checking for nullptr. Add logging when an unwind fails so it's clear what happened. Bug: 21162746 Change-Id: I56ce51dda0cfc9db20475a441f118108196aa07c (cherry picked from commit 30c942cf1024bf791c28ab9b67a1f752de72248c)
* Add tests for elf unwinding in memory.Christopher Ferris2015-05-132-4/+304
| | | | | | | Bug: 19517541 (cherry picked from commit 67aba6881d8857d3017e11695207eb2ade45a274) Change-Id: I914636ccd814e041475b6b2d81119cac1745a9ff
* Remove libbacktrace definition of gettid.Dan Albert2015-05-135-25/+15
| | | | | | | | | | | Also simplifies the Darwin implementation of gettid, because apparently libbacktrace had a better way of doing it. Bug: 19517541 (cherry picked from commit 23f750b068ddf5b20fb5d153a798b22562368992) Change-Id: I2f888e8ed7a2f5719973786cbcbb399a81867ee9
* Fix small ptrace reads.Christopher Ferris2015-05-062-16/+35
| | | | | | | | | | | The BacktracePtrace::Read function crashes if the number of bytes to read is less than the number of bytes needed to align the read to a word_t boundary. Fix this and add a test for this case. Change-Id: I50808849ece44928f65dba1d25309e3885c829a2 (cherry picked from commit 944f417ccb86441060ffb670b4bdc2975fda08fc)
* Add offset to map data.Christopher Ferris2015-05-061-0/+2
| | | | | | | | Also, print the offset in the maps section. Bug: 20864928 Change-Id: I71f005726e5ef73cf75bbcb8f829fd5127cb9d61 (cherry picked from commit 5c8856854de4ae7836fc1073d534f4b7b7a03eb9)
* Add load base to map for relocation packing.Christopher Ferris2015-05-013-6/+14
| | | | | | | | | | The new linker relocation packing support uses non-zero load bases, so we better handle them properly. Also print out the load base for a map if it's non-zero. Bug: 20687795 Change-Id: Iec2d1db2051e7b4a278c1dfa57d745128a7f2974
* Remove libunwind-ptrace dependency.Christopher Ferris2015-04-151-1/+0
| | | | Change-Id: Iae4a73546f672c208ffe1b224e8d9a9e693f95f0
* Update the test for better output on error.Christopher Ferris2015-04-021-14/+31
| | | | Change-Id: Id3b0b96a33441ce5d908aac38e639ac3598a7a89
* Discards frames for code within library.Christopher Ferris2015-04-014-17/+54
| | | | | | | | When doing a local unwind, do not include the frames that come from either libunwind or libbacktrace. Bug: 11518609 Change-Id: I0ec8d823aebbfa0903e61b16b7e5663f3fd65e78
* Merge "Refactor the code."Christopher Ferris2015-03-3122-758/+761
|\
| * Refactor the code.Christopher Ferris2015-03-3122-758/+761
| | | | | | | | | | | | | | | | The object hierarchy was confusing and convoluted. This removes a lot of unnecessary code, and consolidates the BacktraceCurrent and BacktraceThread code into BacktraceCurrent. Change-Id: I01c8407d493712a48169df49dd3ff46db4a7c3ae
* | Merge "Add -Wno-inline-asm to Clang flags."Stephen Hines2015-03-312-0/+7
|\ \ | |/ |/|
| * Add -Wno-inline-asm to Clang flags.Stephen Hines2015-03-312-0/+7
| | | | | | | | | | | | | | | | The latest clang (r230699) does not allow SP/PC to be declared in inline asm lists. This is a problem for libraries that are attempting to save all register state. Change-Id: I1ce80530f8be85fd74e949d0c65b60080e0aaf2a
* | Remove uses of libcxx.mk.Dan Albert2015-03-271-3/+0
| | | | | | | | | | | | This is a no-op. Change-Id: Iecbcd5f6d818abbf98767a2e996c10f454b652e4
* | Libbacktrace: Use frame-pointer on hostAndreas Gampe2015-03-261-1/+1
|/ | | | | | Otherwise it may have problems unwinding over itself. Change-Id: I9b0d108018ae3f5d98b9ae6fb62d0af83a77d18e
* Add variable length read to Backtrace.Christopher Ferris2015-03-173-87/+327
| | | | | | | | | | Included tests for this new feature. Changed the NULLs to nullptr in backtrace_test. Changed UniquePtr to std::unique_ptr in backtrace_test. Change-Id: I92375465b8f8ba84589834cc162db5915bf1be81
* Move map data into backtrace data proper.Christopher Ferris2015-02-068-32/+46
| | | | | | | | | | | The backtrace structure used to include a pointer to a backtrace_map_t that represented the map data for a particular pc. This introduced a race condition where the pointer could be discarded, but the backtrace structure still contained a pointer to garbage memory. Now all of the map information is right in the structure. Bug: 19028453 Change-Id: If7088a73f3c6bf1f3bc8cdd2bb4b62e7cab831c0
* Remove link to gccdemangle.Christopher Ferris2015-02-051-1/+0
| | | | | Bug: 18930951 Change-Id: Ib7fd332b6e02241c0676ef33d2fa210a72efe1b1
* Cleanup libbacktrace Android.mkTrevor Drake2014-12-121-3/+0
| | | | | | Removed unnecessary libbacktrace_c_includes variable Change-Id: I2ef29dc9810f7d9a7dcf5c232e9e85d2fc2fd5e8
* Convert futex to cond wait.Christopher Ferris2014-11-144-24/+56
| | | | | | | | | | | | | Switch to the better supported pthread_cond to handle the Wait/Wake functions. Also, increase the number of simultaneous threads in the thread tests. Bug: 18381207 (cherry picked from commit db44538387b08f367fc2419653639866f4c2fbd6) Change-Id: Id326a7a7b92cb61573def3f761597c40f3ef2f4b
* Add LOCAL_MULTILIB := both to Darwin libbacktrace.Dan Albert2014-11-131-0/+2
| | | | | | | This was previously set for libbacktrace_libc++, but apparently never was for libbacktrace. Change-Id: I85dc44b356710c6367f5cea3bc0a4d6c817ca202
* Remove the stlport linked libbacktrace.Dan Albert2014-11-112-71/+1
| | | | | | | Rename the libc++ linked libbacktrace to the normal name. Bug: 15193147 Change-Id: I75caf1ee527e3703825e0db757497fb8fa3dd122
* am 2ea89b63: am 936a236b: Merge "Add uncached argument to ↵Brian Carlstrom2014-08-051-1/+1
|\ | | | | | | | | | | | | BacktraceMap::Create on darwin" * commit '2ea89b631d58ecd8edd7165ed8840d1e1047aa72': Add uncached argument to BacktraceMap::Create on darwin
| * Add uncached argument to BacktraceMap::Create on darwinBrian Carlstrom2014-08-051-1/+1
| | | | | | | | Change-Id: I247a98fc3b98879a0c34a975f9914ccec95d1a04
| * Allow getting an uncached process map.Christopher Ferris2014-08-041-2/+6
| | | | | | | | | | | | (cherry picked from commit f02593b0e61f8108449770094caa7bb39a646ec1) Change-Id: I2012bf2dc553ebc663345b9eac6d794e80df9c00
* | am f02593b0: Allow getting an uncached process map.Christopher Ferris2014-08-051-2/+6
|\ \ | | | | | | | | | | | | * commit 'f02593b0e61f8108449770094caa7bb39a646ec1': Allow getting an uncached process map.
| * | Allow getting an uncached process map.Christopher Ferris2014-08-041-2/+6
| | | | | | | | | | | | Change-Id: I58d7e90a7b5c4476a4b9f51640c54d13748ac220
* | | am 83ddddaa: am 4795ce06: Merge "Update makefiles for host clang."Tim Murray2014-07-251-0/+1
|\ \ \ | |/ / |/| / | |/ | | * commit '83ddddaaba0fea8a1c0dcc64e795112bed67815f': Update makefiles for host clang.
| * Update makefiles for host clang.Tim Murray2014-07-241-0/+1
| | | | | | | | | | | | bug 16172793 Change-Id: If7484c5dbcccce7d925bec97bff0a3e4c30e9434
* | am 38dda3b8: am c309b97e: am e4022279: Merge "libbacktrace_libc++ needs to ↵Ian Rogers2014-06-251-0/+2
|\ \ | |/ | | | | | | | | | | be multilib on the Mac too." * commit '38dda3b8887286c44964dda0ce1c96425d9744f0': libbacktrace_libc++ needs to be multilib on the Mac too.
| * libbacktrace_libc++ needs to be multilib on the Mac too.Ian Rogers2014-06-241-0/+2
| | | | | | | | Change-Id: I2053345253c1d57c3485b790163ba0b4b10cc326
* | am 44367492: am 4ac17e3b: am 4dfe6faa: Merge "Enable host multilib for ART ↵Ian Rogers2014-06-172-0/+3
|\ \ | |/ | | | | | | | | | | testing." * commit '4436749284dc2b74e6e0f430d0f803d1b7862d19': Enable host multilib for ART testing.
| * Enable host multilib for ART testing.Ian Rogers2014-06-172-0/+3
| | | | | | | | Change-Id: Ic3ae5122eba13565fb5a4cb1bd0e7e465fb2140c
* | am 2b958116: am a31dab8a: am a9aa0f2c: Merge "Build the libc++ variant of ↵Ian Rogers2014-06-111-0/+17
|\ \ | |/ | | | | | | | | | | libbacktrace on the host for Mac." * commit '2b95811601b05db7894359f037005a008274a973': Build the libc++ variant of libbacktrace on the host for Mac.
| * Build the libc++ variant of libbacktrace on the host for Mac.Ian Rogers2014-06-111-0/+17
| | | | | | | | | | Bug: 13751317 Change-Id: Iefadec1cd9b3ca109ac436bd5eb7c096c2dcbe40
* | am 012090e5: am a0962b68: am d917d64f: Merge "Only copy mcontext data from ↵Christopher Ferris2014-05-232-5/+9
|\ \ | |/ | | | | | | | | | | sigcontext." * commit '012090e57b697133ad6f7d989e103d71302749f8': Only copy mcontext data from sigcontext.
| * Only copy mcontext data from sigcontext.Christopher Ferris2014-05-232-5/+9
| | | | | | | | | | | | | | | | | | | | The ucontext_t data structure could be bigger than the kernel data structure. Since the unwinder only cares about the mcontext data, only copy that out of the structure. The mcontext data is the same size in the kernel and in the ucontext_t structure. Bug: 15189014 Change-Id: I5978169c4425b8212e11db85a57eb319cd0e264b
* | am 633a2e3b: am 3ab1d61b: am 3b5cd911: Merge "Remove libstdc++ dependency ↵Dan Albert2014-05-221-0/+3
|\ \ | |/ | | | | | | | | | | from host libbacktrace" * commit '633a2e3b6a1d00257965a5772a5467a6df9911a5': Remove libstdc++ dependency from host libbacktrace
| * Merge "Remove libstdc++ dependency from host libbacktrace"Dan Albert2014-05-221-0/+3
| |\
| | * Remove libstdc++ dependency from host libbacktraceDan Albert2014-05-211-0/+3
| | | | | | | | | | | | | | | | | | | | | The libc++ version of libbacktrace on the host was still linking against libstdc++, and this was causing problems in art. Change-Id: I1d14fb9e18abd074affcf46c8044407041970669
* | | am 219e867f: am 7f8ebb81: am 30291f21: Merge "Add missing headers"Dan Albert2014-05-221-0/+1
|\ \ \ | |/ / | | | | | | | | | * commit '219e867f61755720af3cddb5e8d2fe0e198a27ab': Add missing headers
| * | Add missing headersDan Albert2014-05-211-0/+1
| |/ | | | | | | | | | | | | These headers are needed for pid_t and free when using libc++ headers (POSIX does not require that the symbols be exposed with the previous includes). Change-Id: Ia51a4fdfdbae7377130a43c401c2d8d241671d1e
* | am c6112ca4: am 5b654f15: am 201bf676: Merge "Really fixes the ub branches"Dan Albert2014-05-201-1/+1
|\ \ | |/ | | | | | | * commit 'c6112ca4b8d0712fdd4c0ab3258d3ceaf2f8064e': Really fixes the ub branches
| * Really fixes the ub branchesDan Albert2014-05-191-1/+1
| | | | | | | | Change-Id: I1d78f4e6c1d8086c2895f6739c3202e9ef74fee2
* | am 3f01965b: am 121f209d: am e1efe23f: Merge "Fix unbundled branches"Dan Albert2014-05-191-0/+3
|\ \ | |/ | | | | | | * commit '3f01965b3d1335ffff57e15fd47e5d99400dad3f': Fix unbundled branches