summaryrefslogtreecommitdiffstats
path: root/libbacktrace/UnwindCurrent.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Discards frames for code within library.Christopher Ferris2015-04-011-17/+22
| | | | | | | | When doing a local unwind, do not include the frames that come from either libunwind or libbacktrace. Bug: 11518609 Change-Id: I0ec8d823aebbfa0903e61b16b7e5663f3fd65e78
* Refactor the code.Christopher Ferris2015-03-311-74/+36
| | | | | | | | 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
* Move map data into backtrace data proper.Christopher Ferris2015-02-061-2/+1
| | | | | | | | | | | 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
* Only include ucontext.h when necessary.Christopher Ferris2014-05-091-1/+1
| | | | Change-Id: I29014f6c6b82e0a9797e5d76147b3c4e3d82a7f5
* Rewrite unwind thread handling.Christopher Ferris2014-05-081-48/+37
| | | | | | | | | | | | | | | | | | This new version doesn't require any specialized thread implementation, it uses the Current implementation to do its job. In addition, it runs much faster when multiple threads are trying to unwind at the same time since the global signal lock is held for only a small amount of time. Even running through the threads one at a time should be faster since it no longer requires two passes through the unwound stacks. The new code now allows multiple simultaneous unwinds of the same thread. Finally, add the ability to unwind from a ucontext_t passed in. This functionality doesn't work for remote unwinds yet. Change-Id: I4d181d7ca5ffd2acfd1686e668e6d21e36b425cb
* Avoid logging functions from signal handler.Christopher Ferris2014-04-151-7/+13
| | | | | | (cherry picked from commit 9007677fcbcd7cf01725e155920a8abfcb323c56) Change-Id: Ic0163f43308c6a281ab3757d90933e5127843fed
* Create an UnwindMapLocal object.Christopher Ferris2014-04-031-2/+1
| | | | | | | | | | | | | The way libunwind handles local unwinds is different from remote unwinds, so create a new map object to handle the differences. Add new test to verify the map data is being generated correctly. Add new tests to check for leaks. Refactor the BACK_LOGW code into a single header file. Change-Id: I01f3cbfc4b927646174ea1b614fa25d23b9b3427
* LP64: Enable debuggerd/libbacktrace/libunwind.Pavel Chupin2014-01-301-2/+1
| | | | | Change-Id: I2e432839f86c33c2adbaac8cc12ca8961956044b Signed-off-by: Pavel Chupin <pavel.v.chupin@intel.com>
* Clean up UnwindCurrent.cpp's use of ucontext.h.Christopher Ferris2014-01-301-21/+2
| | | | Change-Id: I9eff7486b9fe89eac57b5555649b871bc6f1cc77
* Re-enable libunwind for arm.Christopher Ferris2014-01-281-6/+3
| | | | | | | | | | Update to handle the new optimized way that libunwind works. In addition, a small refactor of the BacktraceMap code. A few new tests of for good measure. Change-Id: I2f9b4f5ad5a0dfe907b31febee76e4b9b94fb76f
* Get arm64 to compile.Christopher Ferris2014-01-271-1/+1
| | | | Change-Id: Ica021aa134388fe7069a5de5df8036ecf0d570f8
* Rewrite libbacktrace to be all C++.Christopher Ferris2014-01-161-30/+19
| | | | | | | | | | | | | 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
* Next phase of the move, reformat use C++ features.Christopher Ferris2014-01-131-0/+1
| | | | | | | | | | | | | | | | | 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
* Refactor to share map_info amongst threads.Christopher Ferris2014-01-081-4/+4
| | | | | | | Allow the use of the same map info to be shared when getting information on multiple threads from the same pid. Change-Id: I2e460e20154a10f4894ae563331fb32179e4551f
* Fix the ucontext for mips/x86.Christopher Ferris2014-01-071-15/+4
| | | | | | | | | | | Remove the mips ucontext definition, there is no need for it any more. Fix the mips/x86 ucontext copy code to copy the entire uc_mcontext data across. Fix a potential memory leak too. Change-Id: I4272022da5281ed881e2d59a3e19e7f33c01aceb
* More libbacktrace fixes.Christopher Ferris2013-10-301-28/+21
| | | | | | | | | | | | Included in minor fix ups is the addition of a warning macro to replace all of the ALOGW calls. Fix a race where multiple threads could be attempting to unwind the threads of the current process at the same time. Bug: 8410085 Change-Id: I02a65dc778dde690e5f95fc8ff069a32d0832fd1
* Rewrite libbacktrace using C++.Christopher Ferris2013-10-281-0/+222
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