Add $ANDROID_BUILD_TOP to GDB source search paths
Without this change, GDB doesn't display the sources e.g. upon the
`list` command or when run with `--tui` option.
Test: art/test.py -v -j56 --host --64 --optimizing \
--ndebuggable --gdb -t 071-dexfile-map-clean \
--run-test
Test: art/test.py -v -j56 --host --64 --optimizing \
--ndebuggable --gdb-dex2oat -t 071-dexfile-map-clean \
--run-test
Change-Id: If7e43f3d0515333e5e9713f56cd62960e7e9a0c6
diff --git a/test/default_run.py b/test/default_run.py
index 6e334d0..c9dcb0a 100755
--- a/test/default_run.py
+++ b/test/default_run.py
@@ -653,7 +653,7 @@
GDB = f"{GDBSERVER_DEVICE} --no-startup-with-shell 127.0.0.1{GDBSERVER_PORT}"
else:
GDB = "gdb"
- GDB_ARGS += f" --args {DALVIKVM}"
+ GDB_ARGS += f" -d '{ANDROID_BUILD_TOP}' --args {DALVIKVM}"
if INTERPRETER:
INT_OPTS += " -Xint"
@@ -823,7 +823,8 @@
if USE_GDB_DEX2OAT:
nonlocal GDB_DEX2OAT_EXTRA_ARGS
- dex2oat_cmdline += f"gdb {GDB_DEX2OAT_EXTRA_ARGS} --args "
+ dex2oat_cmdline += f"gdb {GDB_DEX2OAT_EXTRA_ARGS} \
+ -d '{ANDROID_BUILD_TOP}' --args "
dex2oat_cmdline += f"'{ANDROID_ART_BIN_DIR}/{dex2oat_binary}' \
{COMPILE_FLAGS} \