summaryrefslogtreecommitdiffstats
path: root/libcorkscrew
Commit message (Collapse)AuthorAgeFilesLines
* Fix mips build.Christopher Ferris2014-02-011-1/+1
| | | | Change-Id: I5401ae6ca6553ebbec231166820c1c904355ec63
* Increase the scope of other reused definitions.Elliott Hughes2014-01-301-2/+2
| | | | | | (Testing this in a non-x86 tree, as I'd been doing, was no testing at all.) Change-Id: I6c5d08e9d566554c212feb8499238aeadf877dad
* Fix build by defining LOCAL_PATH early enough.Elliott Hughes2014-01-301-5/+4
| | | | Change-Id: I959b04e5539d6f24ce96cd6737434f932d717e1b
* Allow the host libcorkscrew to build.Elliott Hughes2014-01-301-2/+1
| | | | Change-Id: Iabe82720d3261a9bd35763c260d3c4b6d422e287
* Don't try to build libcorkscrew for LP64.Elliott Hughes2014-01-301-0/+4
| | | | Change-Id: I77e36b83048b40ba53b6790b7c31beac27feee56
* Switch mips libcorkscrew over to <sys/ucontext.h>.Elliott Hughes2014-01-291-40/+5
| | | | Change-Id: I4db233fb85c8f0b0c210771a8c75ae8e67dff96f
* Merge "Switch arm libcorkscrew over to <sys/ucontext.h>."Elliott Hughes2014-01-301-13/+1
|\
| * Switch arm libcorkscrew over to <sys/ucontext.h>.Elliott Hughes2014-01-291-13/+1
| | | | | | | | Change-Id: I90cf89453f2718fd4bec2bf17ea616ee8165d36a
* | Switch x86 libcorkscrew over to <ucontext.h>.Elliott Hughes2014-01-291-40/+1
|/ | | | Change-Id: I9fa536ea25f7e2d953488b0d317d8a5237b43d03
* Use the more portable <elf.h> instead of <sys/exec_elf.h>.Elliott Hughes2014-01-102-2/+2
| | | | | Bug: 12476126 Change-Id: I08684987e867371d5537dadf1acb3408b420ad0c
* Dwarf backtrace for MIPSChris Dearman2013-12-114-84/+1061
| | | | | | | The Dwarf parsing code was copied from backtrace-x86.c and modified for MIPS Change-Id: I62c698fbbea28be39320a921dd778269dc478528
* am 8fb85b37: am 2b2f1ae8: Merge "Add -Wno-unused-parameter to suppress the ↵Ben Cheng2013-09-041-2/+2
|\ | | | | | | | | | | | | warning." * commit '8fb85b37af1753ce6bc5d88a04485a6c805bb3a3': Add -Wno-unused-parameter to suppress the warning.
| * Add -Wno-unused-parameter to suppress the warning.Ben Cheng2013-09-041-2/+2
| | | | | | | | | | | | | | | | | | For example in system/core/libcorkscrew/arch-arm/backtrace-arm.c: system/core/libcorkscrew/arch-arm/backtrace-arm.c:555:49: error: unused parameter 'siginfo' [-Werror=unused-parameter] Change-Id: Ibe13e8761a2f57324c0f0d87d9add549a20aa37a
* | am bfe8e68a: am 2e5157fa: Merge "Fix build with gcc-4.8 and array boundaries ↵Elliott Hughes2013-08-271-15/+14
|\ \ | |/ | | | | | | | | | | issue" * commit 'bfe8e68a251046fe9a0d9838f4cecaeea19eaa6c': Fix build with gcc-4.8 and array boundaries issue
| * Fix build with gcc-4.8 and array boundaries issuePavel Chupin2013-08-061-15/+14
| | | | | | | | | | | | | | | | | | Remove unused parameters of static functions to avoid warning with 4.8. Fix array index out of bounds issue when register number exceeds limit. It shouldn't occur in real world, but static verifiers can detect it. Change-Id: Id237df905b40bad02fc8cbbeac31084040f58076 Signed-off-by: Pavel Chupin <pavel.v.chupin@intel.com>
* | Format stack trace PC offset to 8 digits with leading zeros.Ben Cheng2013-05-211-8/+9
|/ | | | | BUG: 9067999 Change-Id: Ib5bbf2d5c166dc27e35386d589536eeb6b078c6a
* am de1dadb7: Merge "Disable darwin build"Brian Carlstrom2013-05-151-1/+3
|\ | | | | | | | | * commit 'de1dadb73903a3b8d080ed6d2b5e916fe9654fc4': Disable darwin build
| * Disable darwin buildBrian Carlstrom2013-05-151-1/+3
| | | | | | | | Change-Id: Ie72bbaab8604cdc14082859b735458a2f73c3074
* | resolved conflicts for merge of 07db2970 to jb-mr2-dev-plus-aospBrian Carlstrom2013-05-148-44/+184
|\ \ | |/ | | | | Change-Id: Idf344a1fc7e2f8ec76232ae14a00298ddd322a55
| * Add flush_my_map_info_list() and fix a bug in the Mac load_map_info_list().Elliott Hughes2013-05-142-4/+21
| | | | | | | | | | | | | | | | | | (If you fclose(3) rather than pclose(3) a FILE* you got from popen(3), future popen(3)s fail obscurely, at least on Mac OS.) (cherry picked from commit 2bf76e143da933184d1392fb9bea3a3896c37e76) Change-Id: I5578fe06753061b0dbc5ee951ebf31eb2bab0389
| * Add basic Darwin support to libcorkscrew.Elliott Hughes2013-05-148-41/+164
| | | | | | | | | | | | | | | | | | This might not seem like much, but it's already better than Mac OS' backtrace(3). (cherry picked from commit 2a46f6293f19b9d6100187fbd53088088e671b88) Change-Id: I197b06c4c19f728ad6f194b2f473bd9dcd99b8a6
* | Add liblogYing Wang2013-04-091-2/+2
|/ | | | | Bug: 8580410 Change-Id: Iab3a9b4307f207c14a04a922cc7350c54e60e9ad
* debuggerd: Fix minor memory leakLiangtao Gao2013-03-201-0/+1
| | | | | | | | free_ptrace_context(context) doesn't free(context), which leaks the memory allocated to context. Change-Id: Ic199b257aefc9a05ec2d902958efa8a57a601fb1 Signed-off-by: Liangtao Gao <gliangtao@gmail.com>
* Unwinding implementation via eh_frame sections for x86Pavel Chupin2013-03-144-28/+894
| | | | | | | | | | | | | | | 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>
* Merge "Tidy up long lines"Jeffrey Brown2013-02-071-4/+7
|\
| * Tidy up long linesDuane Sand2012-09-241-4/+7
| | | | | | | | Change-Id: I22d90a343c351b90f460b8810bfb4bd28dc0792d
* | libcorkscrew will always HAVE_DLADDR.Elliott Hughes2013-01-251-4/+0
| | | | | | | | | | | | | | The only place we don't have dladdr(3) is Windows, and libcorkscrew is for Unix. Change-Id: If7633ee8398bccf9897add728facbe07592c0fcf
* | Include page protections in the debuggerd map output.Elliott Hughes2013-01-031-2/+9
| | | | | | | | | | Bug: 7941716 Change-Id: I3bf475425c628c06f7799340c8a6132aab741742
* | Fix ELF header parser bug.Ben Cheng2012-12-101-4/+7
| | | | | | | | | | | | | | | | Program header size should be 32 instead of 40. Bug: 7696928 Change-Id: I8298a030790e9c28e8e8a0d2ad4e9ef294708eb6
* | resolved conflicts for merge of a6405e9d to jb-mr1-devJean-Baptiste Queru2012-08-232-19/+57
|\ \ | |/ | | | | Change-Id: I2c698ec017f29c9ccc89231439cb6c8013914009
| * Merge "libcorkscrew: avoid future name collisions."Jean-Baptiste Queru2012-08-222-38/+46
| |\
| | * libcorkscrew: avoid future name collisions.David 'Digit' Turner2012-07-132-38/+46
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is a forward-compatibility patch used to avoid two problems: 1/ The C library <signal.h> is going to be updated to define 'struct sigcontext' properly soon. Avoid redefining this structure here when it's not really needed to prevent a type conflict. 2/ Similarly, proper ucontext_t support is going to be added, prevent conflict by using a macro renaming trick. Mainly because there is a slight chance that the C library definition will follow a slightly different layout/naming. For context, see details at: http://code.google.com/p/android/issues/detail?id=34784 https://android-review.googlesource.com/#/c/38875/1 Change-Id: Ie94eb5d77297f8e0bafd146b65a648bd8805a551
* | | am 417e3041: am 8124e073: Merge "Fix unused parameter warnings"Jean-Baptiste Queru2012-08-153-7/+10
|\ \ \ | |/ / | | | | | | | | | * commit '417e3041b8b6ba9582c2e4d2003cfcd77435fc21': Fix unused parameter warnings
| * | Merge "Fix unused parameter warnings"Jean-Baptiste Queru2012-08-153-7/+10
| |\ \
| | * | Fix unused parameter warningsEdwin Vane2012-08-133-7/+10
| | |/ | | | | | | | | | | | | | | | | | | | | | | | | -Werror is used for this project so these warnings were causing the clang build to fail. Change-Id: I18c447ce239645e05f59c3cf0e2b8bb17d9d3030 Author: Edwin Vane <edwin.vane@intel.com> Reviewed-by: Tarea A Siraj <tareq.a.siraj@intel.com>
* | | am 83c4398b: am cc12ed32: Merge "[MIPS] debuggerd and libcorkscrew support"Jean-Baptiste Queru2012-08-153-0/+228
|\ \ \ | |/ / | | | | | | | | | * commit '83c4398b4adb5c2cfaf6487699a8b94901ce0fb1': [MIPS] debuggerd and libcorkscrew support
| * | [MIPS] debuggerd and libcorkscrew supportChris Dearman2012-08-103-0/+228
| |/ | | | | | | Change-Id: I5a241dc2e470148be0ad2c138e31f1aba5ab8812
* | Fix a leak I caused in the libcorkscrew test program.Elliott Hughes2012-05-221-1/+1
| | | | | | | | Change-Id: Iecbe006721d462694d48f32bca1606443b9c9714
* | Fix libcorkscrew for x86 targets (bionic) as well as the host (glibc).Elliott Hughes2012-05-211-0/+18
| | | | | | | | | | | | | | | | Longer term, we might want to offer <ucontext.h> and have that be like glibc's, but not today. (Note that POSIX says nothing about mcontext_t and glibc, Mac OS, and the Linux kernel headers are all mutually incompatible.) Change-Id: Ia074b51f4567cd54e06bbe29721389c8d1278614
* | Test libcorkscrew's ELF symbol table decoder too.Elliott Hughes2012-05-181-1/+23
| | | | | | | | Change-Id: I3180ffe07b44245c698dd03a789a3b337f32872a
* | Support libcorkscrew on x86 hosts in binaries using glibc.Elliott Hughes2012-05-185-48/+132
| | | | | | | | Change-Id: I1f2b7f21cc7f8227dbe7d294fed88cb691a24d09
* | Add missing #includes.Elliott Hughes2012-05-172-0/+2
|/ | | | Change-Id: I81405d638f80fc96874ea0b21af3538229aa38a7
* Improve backtrace formatting.Jeff Brown2011-11-223-13/+50
| | | | | | | | | | | | | | | | | | | | Show the symbol offset, when available. Centralized formatting of native stack traces in libcorkscrew. It's handy for automated tools if all stacks look the same. Since we already made them all look them same, we might as well do the formatting in just one place. Do not strip the Thumb bit on ARM. This fixes an off-by-one issue that could happen when resolving a PC that was at the very beginning of a Thumb function, since the symbol table would have the Thumb bit set but since we stripped the bit from our PC, we would be looking for an address one byte before the one listed in the symbol table. It's also quite useful to see whether a given function is executing in Thumb mode just by glancing at the PC. Change-Id: Icaa29add85ce0bcafe24d5ce2098e138d809e2ab
* Minor robustness tweaks.Jeff Brown2011-11-181-12/+52
| | | | | | | | | | | Use the alternate stack specified by sigaltstack (if there is one). Use tgkill instead of kill to ensure that we send the signal to precisely the right thread. Added timeout logic. Change-Id: I72922137d1bc0c8becff98244926bde09fe3990e
* Link with libgccdemangle.so for name demangling.Jing Yu2011-11-092-12/+6
| | | | | | | | 1. X86 target will also have name demangling feature. 2. Remove dependency on libiberty.so, since it will not come with prebuilt toolchain in gcc-4.6 and after. Change-Id: Iefbb021c5c3171b9467954eafa54046ad6805753
* Improve stack unwinder robustness.Jeff Brown2011-11-047-138/+339
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* Rename (IF_)LOGV(_IF) to (IF_)ALOGV(_IF) DO NOT MERGESteve Block2011-10-262-6/+6
| | | | | Bug: 5449033 Change-Id: Ib453f869977a6e909095a578bbf0420851f887d2
* A wee little division by 8 makes all the difference.Jeff Brown2011-10-251-6/+10
| | | | Change-Id: Idff879a8461e1abc97dfa624c1441c16df1c7a69
* Add support for explicitly dumping native stacks.Jeff Brown2011-10-251-15/+25
| | | | | | | | | | | | | | | | | | | | | | | | | 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
* Add x86 stack unwinding support to libcorkscrew.Jeff Brown2011-10-223-0/+163
| | | | Change-Id: I1d4f4b11b4c8bf517b1dd07afccbedc41a84fd1b