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
Manually count input stack trace lines that match the regexps instead of
relying on the output of addr2line. Random changes to the libraries
listed in the test case could cause addr2line to land in an inlined
function and print multiple lines for each input stack frame.
Test: development/scripts/stack_core.py
Change-Id: I87f45466df4e814ec59a4c5f7e201fd1f3ee8419
To make the comparison meaningful, better compare integrals rather
than strings.
Test: ./stack_core.py
Change-Id: Ie24bea75d7c0bc57a1b7683b91e62fafead70341
The previous code used unzip to get the offsets of the files in
the zip file. This was an estimate, and it turns out to be wrong
in many cases. Replace that with zipinfo -v which gives the exact
offset of the files in the zip.
Also update the tmp files so that they are in a dictionary of their
own by apk, instead of embedded in the offset list.
Change-Id: I8f5efd95f2d2e39e20cc0b6b6571b799be21ef32
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
Some of the map names have spaces in them, but only the ones that look
like:
[anon:atexit handlers]
So allow spaces between a [ and a ].
Change-Id: I09f1b50533fcd2e79acda199dcc3fb99c6d8428f
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
Add trace parsing for sanitizer output. The output is different
from debuggerd output (and we do not have control over it). Use
two separate regexes and factor out the parsing into a method
returning a tuple of data.
Note: as we have no control over the prologue of the dump, we
cannot change it to include information like the ABI. Thus, this
functionality only works in a lunched tree, where the tool
implicitly uses the symbols directory.
Change-Id: Ic1189f4f65cf7728d1baec7055ecb549b0aa5f62
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
Left the default symbol.ARCH value intact and changed stack_core instead
so that it will assume the ABI is arm until it sees an ABI line. This
allows compatibility for people who are used to pasting portions of a
tombstone instead of the whole thing (assuming said tombstone is arm)
while additionally supporting other architectures if a whole tombstone
is pasted in.
Change-Id: Ib8b5754920d2e2aa5017c29daeca59abcf4b547d
Also take into account the fact that the arm pcsr register is the
fifth entry on its line, so the stack tool previously stripped that
off.
Change-Id: I1dd2d11060e572b4d8ffd8710cf1df4d970671e4
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
The value corresponds to whether or not the line has matched one of the
detected formats (registers, header, backtrace, etc.) and can be used to
identify what logcat lines don't correspond to one of these formats.
Change-Id: Ibd7bc5a211dcfe86ea2f92d7e7941091afff4fc4
Every architecture was at least slightly wrong. Rather than try to
tune the heuristics, let's just keep lists of all the registers.
Also start adding some unit tests.
Change-Id: I490dcc9855f7af1e3529734711400f366ffc4e0f
This includes the fairly large change of refactoring stack_core.py into
a class so that its behavior is compatible with adbs. Additionally, if
the ABI line does not come before lines that require it to determine
proper widths (registers, stack), then it will assume that the ABI is
32 bit and not 64.
Change-Id: I6ad84a55337d86d25f7f8197048dc93868b0a01a