Commit graph

7 commits

Author SHA1 Message Date
Jiyong Park
8944432589 Mark libdemangle as vendor_available
The lib is used by libc_malloc_debug_backtrace which is
vendor_available. libc_malloc_debug_backtrace is marked as such because
it is again used by libmemunreachable which is vendor_available.

Bug: 33241851
Test: BOARD_VNDK_VERSION=current m -j libmemunreachable.vendor
Change-Id: I978f8e34d354e4fe03a3c19dd0dbc6899f26a793
2017-06-14 18:58:22 +09:00
Christopher Ferris
4504bba7d0 Fix handling of _ZLXX.
Mangled names of the form _ZLXX, where XX is a number is now properly
demangled.

Test: Ran new unit tests.
Change-Id: I89fbb36d2294c46da428c75bd1a2f39f69ac4b43
2017-06-01 17:37:09 -07:00
Christopher Ferris
15d2e42ceb Fix bug found by fuzzer.
Also, add the demangle fuzzer code.

Test: Ran fuzzer, ran new unit tests.
Change-Id: If3e15e10af88b81602a8a0f0bfe071a015f6000b
2017-05-31 17:54:19 -07:00
Elliott Hughes
102183ee66 Make demangle work more like c++filt.
Also tweak the help output to fit the toybox style.

Bug: N/A
Test: readelf -aW | demangle
Change-Id: I110b9e385f583d5047c785364c8a5a33575d8357
2017-03-28 17:38:01 -07:00
Christopher Ferris
87bf2082cf Use the clang format 2 space as default.
Test: NA
Change-Id: I97418804086b83cfba1765eb0bee3e7ca18fb4ea
2017-03-14 13:06:19 -07:00
Christopher Ferris
a11dc8f962 Add a binary to dump demangled names.
Test: Ran the executable and verified names get demangled.
Test: Ran with the -c option to verify it compares demangled names.
Change-Id: I9118ccc4398980346d26f615cdfed0bb756b52fe
2017-03-13 16:10:08 -07:00
Christopher Ferris
9323b7219c Implement a simple demangler.
The purpose of this demangler is to avoid crashes for any string.

- It does one pass and should avoid going past the end of the string.
- The code avoids recursion to minimize the amount of stack required.
- It cannot demangle all mangled names, but it should be able to work
  on nearly all names in normal stack traces.
- If the mangled name is too large, it will stop demangling and return
  as if the name is not a demangled name.

Test: Passes new unit tests.

Change-Id: I596f74a533c0e093d1517c6bd11cced07009d321
2017-03-07 13:04:32 -08:00