Commit graph

13 commits

Author SHA1 Message Date
Elliott Hughes
d7bb826a9c Fix a few demangler issues.
Specifically:

  * rvalue references.

  * St does not require N...E delimiters (explicit special case in the spec).

  * ".cfi" suffixes.

Bug: http://b/67678053
Test: ran tests
Change-Id: If8cabad448b46b165eefc6c5487996428c9c6975
2018-02-09 17:34:55 -08:00
Elliott Hughes
693d63f9cf Add OWNERS.
Bug: N/A
Test: N/A
Change-Id: Ie785058c0f5eb9b4086c98ccba6e63e3ed411b65
2017-12-07 13:30:03 -08:00
Christopher Ferris
5a72ea0f2f Add support for non-virtual thunk.
Bug: 67678053

Test: New unit tests pass.
Change-Id: If04f502e234da00a356e5ddd31acd22a6ad1a804
2017-11-01 16:24:55 -07:00
Christopher Ferris
584333e3b2 Fix template support.
- Fix template applying to function name without a starting N.
- Fix return types for templates handling.
- Add support for the T substitution parameter.
- Fix a case where the literal L handler was not being set properly.

Bug: 67678053

Test: New unit tests, fuzzer.
Change-Id: I4f831038047eb2cd8519426f16aa2bdcb846d92d
2017-10-31 15:00:54 -07:00
Christopher Ferris
0523275893 Add support for boolean literals.
Bug: 67678053

Test: Passes new unit tests.
Change-Id: I9d0ede56aa5d7071e682f366870148320545406e
2017-10-11 15:23:45 -07:00
Dan Willemsen
0f048675b2 Enable libdemangle and libunwindstack on host bionic
libunwindstack_test:UnwindTest.* are all failing, but at least this
builds.

Test: Enable host bionic; m
Test: out/soong/host/linux_bionic-x86/nativetest64/libdemangle_test/libdemangle_test
Test: out/soong/host/linux_bionic-x86/nativetest64/libunwindstack_test/libunwindstack_test
Change-Id: Ie6c774ecb4d7a467b5ea7ae977833e9cba178f2d
2017-09-20 13:16:13 -07:00
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