Commit Graph

11 Commits

Author SHA1 Message Date
Elliott Hughes
89e1ecf9a1 Fix gdbclient.py -p.
Bug: http://b/26413900
Test: manually ran gdbserver on device, connected with -p
Change-Id: If58b95e52167c38263e77fe85bea14e0d7401bf4
2017-06-30 14:03:32 -07:00
Elliott Hughes
1a2f12d23e Move away from device.get_props.
Properties can include \n so get_props isn't sound, and it's not obvious how
to fix it (without adding something like cat's -v to getprop, which wouldn't
help the intended use case of working with arbitrary old devices).

Bug: https://issuetracker.google.com/37093233
Test: gdbclient -r /system/bin/date
Change-Id: I96042fd44f1de17974968954fab6c916a9d13b61
2017-06-02 13:15:59 -07:00
Josh Gao
057c2739fc gdbrunner: take a run-as/su command instead of a user.
Switch from assuming that "root" meant su to an explicit prepended
argument, to allow things like `gdbclient.py --user shell`.

Test: gdbclient.py --user shell -r /system/bin/ls
Change-Id: I9d02eea7c6d79898ed8b13817e009630b0f9536a
2017-05-24 18:32:25 -07: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