Commit Graph

524 Commits

Author SHA1 Message Date
Alex Light
35dd4d66b6 Make gdbclient respect custom OUT_DIR settings
Change-Id: Icb43798717f9b2aa6144f59624c2e3b7f59f42f8
2016-01-06 05:54:02 -08:00
Josh Gao
409ab9f212 Update gdbclient to use the multiarch gdb.
Bug: http://b/26224915
Change-Id: I9bfcc08e6c92c18f6c774ce7f9ad13c9b055fc68
2015-12-17 12:58:00 -08:00
Christopher Ferris
c14b612ba1 Modify the dso rule to allow spaces in [] names.
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
2015-11-30 16:29:57 -08:00
Josh Gao
44b84a8e03 Don't throw when we fail to find a device.
Instead, set it to None and let the caller handle things.

Change-Id: Ic4f27fdb52ebd6bc5b4048e4e688ec7bd2509bfa
2015-10-28 14:21:59 -07:00
Josh Gao
66bb9fa2cd Merge "gdbclient.py: set directory for gdb." 2015-10-22 23:20:01 +00:00
Josh Gao
19f18ce06a gdbclient.py: set directory for gdb.
Make sure gdb knows where the source files are, even when gdbclient.py
isn't being run from the root directory.

Change-Id: I8f604ba58f4c06b26f2a1f8e917e2a1c1c137ccd
2015-10-22 16:19:02 -07:00
David Pursell
639d1c491a gdb: allow gdbclient.py to find local files.
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
2015-10-21 10:25:25 -07:00
David Pursell
d1fe92f375 gdbclient.py: set PWD when querying makefiles.
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
2015-10-06 09:18:47 -07:00
David Pursell
320f881efe gdbclient.py: add gdb connect retry.
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
2015-10-06 09:18:36 -07:00
Josh Gao
6382f1768a Make gdbclient.py work in directories other than the root.
Change-Id: I8e383052e15f41919c7107bf960092120d2c621c
2015-10-02 15:58:57 -07:00
Josh Gao
043bad746f Add python reimplementation of gdbclient.
Bug: http://b/23715403
Bug: http://b/22946322
Bug: http://b/22946705
Bug: http://b/22120411
Bug: http://b/22715953
Change-Id: I2391ec03be8d2487a4738455b6e934874c7f595f
2015-10-01 14:30:29 -07:00
Andreas Gampe
57acd5f7da Development/scripts: Update stack tool
The tool was broken for ASAN traces. Add a missing key to the
dictionary.

Bug: 24133462
Change-Id: I6e5b60441c9c602cd1381c1cb32947a1425c7069
2015-09-17 11:44:21 -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
Andreas Gampe
d900d08d81 Development/scripts: Add sanitizer dump support to stack
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
2015-08-21 17:29:47 -07:00
Elliott Hughes
ef3f1e2c1a Warn if you're trying to use gdbclient without "adb root".
Bug: http://b/22715953
Change-Id: If729fbc89ccd65407e8900bc27df8fa4174dd64e
2015-07-24 10:32:07 -07:00
Nikola Veljkovic
4efdec68b0 Fix gdbclient to work with emulator builds
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
2015-07-09 12:05:13 +02:00
Dmitriy Ivanov
91dcbe968b Use ro.hardware property to detect the device
Bug: http://b/22120411
Change-Id: Ida9bc157b560edbe8c2db67f5df5109c192fef9d
2015-06-29 11:27:30 -07:00
Andreas Gampe
172283617b Merge "Development: change gdbclient GDB selection" 2015-06-02 00:08:29 +00:00
Andreas Gampe
876b092025 Development: change gdbclient GDB selection
Mips now uses the 64-bit version in general. Also simplify the x86
selection.

Bug: 21467410
Bug: 21555893
Change-Id: If0477356d3c3dbf9e0dfbfcabcb098dc7b8aeba2
2015-06-01 15:57:25 -07:00
Andreas Gampe
820ca728db Development: Mips64 stack-core test
Add a test for Mips64 stack-core.

Bug: 21555893
Change-Id: I2d6feba9bde3977cabc5e771bf14c55de1fbff53
2015-06-01 15:43:52 -07:00
Andreas Gampe
7d4a83600f Merge "Add mips64 to stack tool" 2015-05-26 16:59:37 +00:00
Andreas Gampe
5521841a42 Add mips64 to stack tool
Add register definitions to stack_core.

Change-Id: I2d9d2ae075efe8d8c92fac387d2ae30f9cbb999c
2015-05-21 14:56:40 -07:00
Christopher Ferris
8981aee6a9 Add a conditional removal of \r\n from adb output.
Bug: 21338668
Change-Id: Iea8804c462f3bd1e5cc24c8f6d12e41b09a15d53
2015-05-20 19:36:54 -07:00
Brian Carlstrom
73cd247e45 Delete dbt command for dalvik
Change-Id: I177097f65a5b70d12f758c118710efca07c2a0a2
2015-05-18 08:42:58 -07:00
Dan Albert
f1d27e2c9a Allow acov --prep to succeed in a clean build.
Change-Id: I8f72da827d660f9aad051738a8287463dccd0619
2015-04-14 13:46:57 -07:00
Andreas Gampe
512cc91be2 Development/scripts: Update gdbclient for native bridge
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
2015-04-06 13:29:57 -07:00
Dan Albert
a624edc117 Add gdbclient as a real script.
Makes the modify/test cycle much easier since we don't have to
re-source envsetup each time now.

Change-Id: Ibd942086c91b9cfa598c9329d4e8483102d65fa3
2015-02-12 12:38:17 -08:00
Dan Albert
f12f658224 Default to using clang compatible gcov for host.
Also adds the ability to pass arbitrary arguments to lcov, in case the
user needs to override this behavior.

Change-Id: I66b842f92f546fee17a7f1033ef590a3380c14c4
2015-01-29 17:00:16 -08:00
Dan Albert
6c3911d1a7 Merge "Add support for host coverage." 2015-01-24 21:53:01 +00:00
Dan Albert
72324d80f6 Add support for host coverage.
The --host flag will pull coverage results from the host output rather
than the target.

Change-Id: I88aac17d23feff22926fbb67416ade3c821b5b6c
2015-01-24 13:47:03 -08:00
Dan Albert
cf347cc5a4 Add acov --clean and acov --prep.
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
2015-01-24 13:45:58 -08:00
Dan Albert
6313a60dc5 Add aday, which converts build numbers to dates.
Change-Id: I8d4219f961951ef1d84d3027d361378005764ee6
2015-01-06 16:11:06 -08:00
Elliott Hughes
27db85ff16 Merge "Made development/scripts/stack work on Mac." 2014-11-08 19:00:32 +00:00
Yang Ni
e4b2a1a959 Made development/scripts/stack work on Mac.
Change-Id: I9be1e50c0a635068017326738af4f5c38dddddab
2014-11-07 09:45:56 -08:00
Christopher Ferris
de39486640 am bb0d2060: Merge "Do not call art-on macro by default." into lmp-dev
* commit 'bb0d2060884d131bdb0321c06ff49b04ba2196b4':
  Do not call art-on macro by default.
2014-10-05 19:22:59 +00:00
Christopher Ferris
436b740b70 Do not call art-on macro by default.
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
2014-10-03 17:31:41 -07:00
Dan Albert
48a1ff8685 am 9bc92deb: am 20d16a75: Merge "Silence lcov existence test output."
* commit '9bc92deb11d67f4288595c1ca64e28f66ce27cc9':
  Silence lcov existence test output.
2014-09-25 20:15:07 +00:00
Dan Albert
7d133d23f9 Silence lcov existence test output.
Change-Id: I72ea929c8358d82c5653d7b475a35ddcb918dac0
2014-09-25 11:23:30 -07:00
Dan Albert
f9026b3669 am cbe2394e: am 217d230a: Merge "Add acov for coverage gathering/reporting."
* commit 'cbe2394ef0c8717cdfc13f6134ec7e957326d5b9':
  Add acov for coverage gathering/reporting.
2014-09-22 16:40:02 +00:00
Dan Albert
98e2c644f2 Add acov for coverage gathering/reporting.
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
2014-09-22 09:15:45 -07:00
Dave Allison
8bc875bb40 am 72e4885c: Merge "Add support for debugging ART to the dalvik.gdb script." into lmp-dev
* commit '72e4885cb6152c6bb4e5607d3aa3df2b8ed3a79d':
  Add support for debugging ART to the dalvik.gdb script.
2014-09-09 21:56:11 +00:00
Dave Allison
22382a4774 Add support for debugging ART to the dalvik.gdb script.
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
2014-09-08 16:33:24 -07:00
Elliott Hughes
99c64a26fd am 6b9a4ef2: am 72bd0479: Merge "Make \'stack\' able to find toolchains regardless of lunch."
* commit '6b9a4ef217303018e44fcdfd67ec3e7395ec80b2':
  Make 'stack' able to find toolchains regardless of lunch.
2014-08-29 22:51:54 +00: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
Brigid Smith
f893e743b6 Stack tool 32/64 bit compatibility fixes.
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.

(cherry picked from commit 15142f793a)

Change-Id: Ide73171fc4e513b39bee74e2270252c3b32e23cd
2014-07-29 16:13:18 -07:00
Elliott Hughes
818b45f494 am 14a67c7e: am be5e8f72: Merge "Stack tool 32/64 bit compatibility fixes."
* commit '14a67c7e703553eaf722514f7e2e6eda48922819':
  Stack tool 32/64 bit compatibility fixes.
2014-07-17 12:59:04 +00:00
Brigid Smith
15142f793a Stack tool 32/64 bit compatibility fixes.
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
2014-07-16 15:56:46 -07:00
Elliott Hughes
5283a53663 am fbc66057: am 535decd2: Merge "Add the arm64 pstate register to the stack tool."
* commit 'fbc66057941a16a75c0a61afd64fab4cddd4e1a0':
  Add the arm64 pstate register to the stack tool.
2014-07-15 02:27:55 +00:00
Elliott Hughes
a8e31235e9 Add the arm64 pstate register to the stack tool.
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.

(cherry picked from commit be4de46d09)

Change-Id: I0a937ae1a36071c3aaa5d955f56ee034dfdfe7de
2014-07-14 19:01:02 -07:00
Elliott Hughes
be4de46d09 Add the arm64 pstate register to the stack tool.
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
2014-07-14 17:16:30 -07:00