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
Given a serial number, applies correct ioctl()
to reset the USB device with that serial number.
Useful to avoid having to unplug/replug after
flashall + wipe of device.
Change-Id: I7402e1e53cabc19c423ef912a5dc7ade8221b08b
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
Make sure gdb knows where the source files are, even when gdbclient.py
isn't being run from the root directory.
Change-Id: I8f604ba58f4c06b26f2a1f8e917e2a1c1c137ccd
gdbclient.py is always downloading the stripped version of executable
files from the device. This CL first tries to find the unstripped local
file before falling back to the stripped version.
Bug: http://b/24947939
Change-Id: I7a49d0d8b28590ee99ce892d3e3476921f4ae974
Python's subprocess.check_output() cwd argument does not change the PWD
environmental variable, which is what dumpvar.mk uses to turn relative
paths into absolute paths. This led to incorrect symbol paths when
gdbclient was not run from the root directory.
This CL fixes the bug by manually setting PWD before calling the
makefile. It's possible that dumpvar.mk should be using a different
method to get the current directory, but I was scared to change any
core build logic and this approach seems to work just fine.
Change-Id: Ibe3db0bef6694934c512918f7562029313b1deae
gdbclient.py can sometimes attempt to connect to the server before it's
ready, especially when debugging on an emulator. This CL adds
functionality to retry the connection for up to 5 seconds.
Bug: http://b/24671386
Change-Id: I65e77f918c3ea8433f992e67122cd48e3647c67b
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
gdbclient got broken by:
https://android-review.googlesource.com/156974
To fix, check for special case when device is actually an emulator,
and set the $DEVICE variable accordingly.
Change-Id: I85d0d520ae1e2ea022aa3e2d08a10cd0b1cb491f
Mips now uses the 64-bit version in general. Also simplify the x86
selection.
Bug: 21467410
Bug: 21555893
Change-Id: If0477356d3c3dbf9e0dfbfcabcb098dc7b8aeba2
The Nexus Player has a mixed abi-list, but native applications are
still x86. Move x86 ahead to prefer it over arm.
Change-Id: I3e2f3dc0da97b94078f7fd5dc3fede711603961a
Also adds the ability to pass arbitrary arguments to lcov, in case the
user needs to override this behavior.
Change-Id: I66b842f92f546fee17a7f1033ef590a3380c14c4
The --clean flag clears ANDROID_PRODUCT_OUT and ANDROID_HOST_OUT of
all coverage files. If a source file that had a coverage notes file
(a .gcno) generated for it is renamed or removed, the build system
will not clean the old file, which means the coverage tool will still
try to find coverage data.
The --prep flag clears just coverage data files. This should be done
before any coverage run, as you don't want old coverage data affecting
your results.
Change-Id: Id68395d19369eba4589daff90461a10cf7aef66d
If you are debugging a native process, SIGSEGV gets ignored by default.
The gdbclient bash function has been modified to only call the art-on
macro when running gdbclient app_processXX.
Also, print a warning in case someone is trying to debug a native
process using app_process.
Bug: 17815162
Change-Id: I0666e6713b0a03ee713be7827c5b671938f2c263
acov is a tool for gathering coverage information from a device and
generating a report from that information. To use:
1. sudo apt-get install lcov
2. Build application/library with coverage information.
3. Push the new binaries to the device.
4. Run tests with the additional environment variables:
* GCOV_PREFIX=/data/local/tmp/gcov
* GCOV_PREFIX_STRIP=`echo $(ANDROID_BUILD_TOP) | grep -o / | wc -l`
5. Run `acov`.
acov will pull all coverage information from the device, push it to the
right directories, run lcov, and display the coverage report (currently
by opening it in your browser).
Bug: 10134489
Change-Id: I604c8ec2e9fa5d23ee9c279b515ff6cfc497dfa7
This adds two commands:
art-on
art-off
To the gdbclient script for debugging ART-based executables in gdb.
The default is 'art-on'
Bug: 17409881
Change-Id: I90a1aed603e50853a40d5f5ec1c9b168dc17ddc7