Commit Graph

30 Commits

Author SHA1 Message Date
Elliott Hughes
c94cb65f21 Remove mips.
We aren't going to support riscv32, so we won't even need to reuse any
of this.

Test: treehugger
Change-Id: I80d6285ecbd0dfdeeb496be39ba63e06cbb30acd
2023-03-09 00:36:31 +00:00
David Srbecky
80547ae39d Remove parameters from symbolized stack traces.
The expanded parameters take a lot horizontal space
and almost always push the file:line of the screen,
or text-wrap generating multiple lines per frame.

This CL tries to make the output less cluttered by
removing parameters from the unmangled method names.

It is possible to add the parameters back using
the --verbose command line argument.

Test: Add unit tests, investigate crashes from logcat
Change-Id: I42d1e26dbc2fa9db8b7bd95ce449cb2bd93f93f8
2021-12-23 14:09:11 +00:00
Pirama Arumuga Nainar
a26dc346dd [scripts] Adjust FindClangDir
soong/scripts/get_clang_version.py now prints the whole prebuilt dir
(e.g. clang-r416183b1) instead of just the version number.

Test: invoke FindClangDir from the interpreter
Change-Id: I17363e6bc4a48fe6be345f87006baa4590371dc1
2021-07-02 09:24:07 -07:00
Pirama Arumuga Nainar
05b20a7ebf [scripts] Fix clang path in symbol.py
Bug: http://b/187231324

Test: Verify directory returned by FindClangDir exists
Change-Id: I84d1a7b2194003409b8110772e450b1286a2ee0c
2021-06-29 13:06:03 -07:00
Pirama Arumuga Nainar
8e96f31b36 [scripts] Remove hard-coded clang version
Bug: http://b/187231324

Instead,
- For local development, invoke build/soong/scripts/get_clang_version.py
to find the current clang version.
- In CI, find llvm-cxxfilt using glob expansion.

Test: development/scripts/symbol.py unittest for local development
      python-stack_core_test on presubmit
Change-Id: Id4258dd791626508520b6a478b8a1b54495ebb11
2021-06-24 17:38:32 -07:00
Pirama Arumuga Nainar
6ef65993e0 [scripts] Switch symbol.py to clang-r416183b1
Bug: http://b/189328402

Test: presubmit
Change-Id: I9cc12dc8e213b755745e81b93d21c88c8ac437b2
2021-06-24 09:19:52 -07:00
Julien Desprez
fd06c732e1 Attempt to run python-stack_core_test
Test: presubmit
Bug: 185900237
Change-Id: I7c41545d4e1fbdeebd729615b5b12ee64ba6a8b9
2021-05-06 09:17:45 -07:00
David Srbecky
fd1e41623d Make the stack script python3.5 compatible.
Ensure that the script works on buildbots.

Test: adb shell debuggerd -b <pid> | development/scripts/stack
Change-Id: I3fd4a0ed78ff3245d1ab2f6e842446888c5c7b8b
2021-04-27 22:24:36 +01:00
Krzysztof Kosiński
b136111f17 Upgrade the 'stack' script to python3.
Also hook up the test to Android.bp.

Test: unit test
Test: Ran with a tombstone file as parameter.
Test: Ran pasting in stack to stdin.
Change-Id: I25f40569cc49b7487553611bcc25d061179bfa8d
2021-04-09 13:21:32 -07:00
Christopher Ferris
49eda0e908 Remove gcc tools from script.
Replace all references to gcc tools with llvm tools. This change still
uses c++filt until llvm-cxxfilt is put in the prebuilts.

Test: Ran a backtrace through this script and the old script and verified
Test: no major differences.
Test: Ran unittests for symbol.py and stack_core.py.
Change-Id: Ic31c1a0707dae11c5037f9637943cd7932badf46
2020-12-09 14:34:01 -08:00
Andreas Gampe
e547eb3c9b Symbol: Add presubmit testing
Add symbol's unit tests to presubmit.

Test: atest python-symbol_test
Change-Id: I37eb4151365507ab2a95d7789408504cca78153c
2018-10-30 11:03:17 -07:00
Andreas Gampe
9240b454cc Symbol: Python 3 compatibility
Fix some minor issues.

Test: symbol test
Change-Id: Iaa9f304c079abfc26212de8213fba38f4e311ec1
2018-10-30 11:03:17 -07:00
Christopher Ferris
6fc7aefbba Handle IOExceptions if addr2line fails.
Bug: 112357697

Test: Verified that this doesn't cause any issues with a stack.
Test: Faked an exception and verified no crash.
Change-Id: I61982dbd44ac4f52b008bc35bbff2d9687f6ae25
2018-08-10 12:17:51 -07:00
Dan Willemsen
d3fc8faff6 Switch to new soong_ui dumpvar-mode
Stop using make directly.

Test: manual tests
Test: development/scripts/symbol.py
Change-Id: I9f75776251b693dbe979989942d2db49768224d2
2017-10-17 14:10:51 -07:00
Andreas Gampe
46b00d66ac Stack: Add subprocess caching
Add subprocess caching to the stack tool. This caches open pipes for
commands, improving symbolization speed for (sets of) stack traces with
duplicated libraries.

Bug: 38226236
Test: m
Test: manual tests
Change-Id: Iadbd74255b9a40c86939be3a1b172275a0b34d54
2017-05-18 10:38:30 -07:00
Andreas Gampe
3d97a46124 Stack: Add symbol caching
Add symbol caching to the stack tool. This caches resolved symbols,
improving symbolization speed for (sets of) stack traces with duplicated
symbols.

Bug: 38226236
Test: m
Test: manual tests
Change-Id: Ia579234ba1bf227b12af0c5af5fa3955d0eed4fe
2017-05-17 15:14:07 -07:00
Christopher Ferris
5f1b4f0d9e Skip adding value lines for accidental matches.
If the value_line regex matches, and the symbol file happens to exist
as a directory, we'd call addr2line and crash. Fix this so that calling
addr2line on a directory doesn't happen.

There isn't an easy way to test this, but I added a single new unit test. The
real test was to use a tombstone file that used to crash, but no longer crashes.

Test: Wrote new unit test, ran over a tombstone file that used to crash.
Change-Id: I4331e3b032cee8d697d1b7f409638750c61971d6
2016-09-19 13:24:37 -07:00
Christopher Ferris
5b820ba6c9 Handle asan lines when determing abi.
Change-Id: I553bded15e76ecb1ffc7bc3eadcee198301e0a67
2016-09-09 10:54:45 -07:00
Christopher Ferris
bf8a940234 Find abi before trying to decode the stack.
The CallStack function prints stacks to the log. Unfortunately, our
stack script defaults to arm, so if the data is actually arm64, we'll
do nothing. Modify the script to parse the input trying to determine
the abi before processing the rest of the lines. At the very least,
we'll be able to correctly choose between arm and arm64.

The only downside, is that, the old method could take dumps from different
abis, but no one I know does this.

Bug: 26569638
Change-Id: I5935b82fe0af1e788b0d3edc535b9f0cbb7d1b28
2016-03-15 16:25:19 -07:00
Christopher Ferris
ece64c4bd5 Update the stack script for apk handling.
The dlopen of a shared library within an apk is not handled by
the stack tool. Modify to understand and search through the apk to
find the shared library associated with the offset. Then unzip
that shared library to use as the target of addr2line.

Change-Id: I404302f68dff45c35a1dc2a55547f42ea04f02bf
2015-09-04 10:51:22 -07:00
Yang Ni
e4b2a1a959 Made development/scripts/stack work on Mac.
Change-Id: I9be1e50c0a635068017326738af4f5c38dddddab
2014-11-07 09:45:56 -08:00
Elliott Hughes
c3c8619579 Make 'stack' able to find toolchains regardless of lunch.
This is needed by the internal stack decoding website, which
will be pulling symbols from the build servers anyway (so doesn't
need to be correctly lunched).

Bug: 16734486
Change-Id: I9190065148c0d4bb4eacec28bcc062fa95798917
2014-08-29 13:49:57 -07:00
Elliott Hughes
c3166bec1c Fix symbol.py's toolchain detection for x86.
x86 uses the x86_64 toolchain. There's no separate 32-bit toolchain.

I started to refactor so we could add FindToolchain tests, but that doesn't
work because FindToolchain depends on environment variables set up by 'lunch'.

Change-Id: I264b95e1e83a7e795f8cac49bc9e1cf497514029
2014-07-07 15:18:01 -07:00
Elliott Hughes
1ba94df0c9 Fix FindToolchain for mips.
Change-Id: Ib2689e24065e9d5a0c249a26c63e6493327fc0b1
2014-07-01 12:22:06 -07:00
Elliott Hughes
0836593b85 Use ANDROID_TOOLCHAIN and ANDROID_TOOLCHAIN_2ND_ARCH in 'stack'.
This fixes the bug where we can't (currently) find the toolchain
for arm because it's at a different GCC version (4.8) from arm64 (4.9).

Change-Id: I22351af55298255f3ac4adfcae7e20080712fba4
2014-06-16 10:40:22 -07:00
Brigid Smith
45a46c6138 Updating stack_core.py to recognize new ABI output from debuggerd.
Change-Id: Ib9736a0509edb97be15f5e89dbc3a5188e744416
2014-06-13 17:43:38 -07:00
Narayan Kamath
9649700787 Fix the stack/ tool for 64 bit archs.
pc values might now be 16 bytes wide. Also add support
for the arm64 architecture switch.

Change-Id: Ia2e0282f3bee03ef6092de285b0c32fa6da07cb0
2014-04-14 11:07:37 +01:00
Ben Cheng
b42dad0dee Clean up the stack trace symbolization tool.
Change-Id: Id71cacde653a5c1c92a028ee80f5aa8264e1963a
2013-04-25 15:34:14 -07:00
Romain Guy
fdc3519cd7 Fix stack tool to find the correct toolchain
Change-Id: Ie525b286a4d133512c72b234f03e54f8635c15ee
2012-11-30 14:56:39 -08:00
Iliyan Malchev
4929d6a562 development: copy stack tool over from vendor/google/tools
The stack tool is not really proprietary, and is needed by vendors and
third-party developers working on native code.

Change-Id: I37f34b0681a0063ecf71f5a078d2c4a1ba622973
Signed-off-by: Iliyan Malchev <malchev@google.com>
2011-08-04 17:44:40 -07:00