summaryrefslogtreecommitdiffstats
path: root/python-packages
diff options
context:
space:
mode:
authorJosh Gao <jmgao@google.com>2015-10-28 15:13:16 -0700
committerJosh Gao <jmgao@google.com>2015-10-28 15:20:57 -0700
commitacc0ba81cc0eea91562220d9f34e267909926305 (patch)
tree995587c4d25a3899343c8b3b64cae68016c856ef /python-packages
parent2c7e952f1cf1a7f28c99d8834d9b08dce920a65e (diff)
downloadandroid_development-acc0ba81cc0eea91562220d9f34e267909926305.tar.gz
android_development-acc0ba81cc0eea91562220d9f34e267909926305.tar.bz2
android_development-acc0ba81cc0eea91562220d9f34e267909926305.zip
Add a gdb_flags argument to gdbrunner.start_gdb.
Change-Id: I35aae1290f97a33c55e9bddd2b986a7c3e93d1df
Diffstat (limited to 'python-packages')
-rw-r--r--python-packages/gdbrunner/__init__.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/python-packages/gdbrunner/__init__.py b/python-packages/gdbrunner/__init__.py
index 5ece37547..493a4e71f 100644
--- a/python-packages/gdbrunner/__init__.py
+++ b/python-packages/gdbrunner/__init__.py
@@ -282,18 +282,19 @@ def get_binary_arch(binary_file):
raise RuntimeError("unknown architecture: 0x{:x}".format(e_machine))
-def start_gdb(gdb_path, gdb_commands):
+def start_gdb(gdb_path, gdb_commands, gdb_flags=None):
"""Start gdb in the background and block until it finishes.
Args:
gdb_path: Path of the gdb binary.
gdb_commands: Contents of GDB script to run.
+ gdb_flags: List of flags to append to gdb command.
"""
with tempfile.NamedTemporaryFile() as gdb_script:
gdb_script.write(gdb_commands)
gdb_script.flush()
- gdb_args = [gdb_path, "-x", gdb_script.name]
+ gdb_args = [gdb_path, "-x", gdb_script.name] + (gdb_flags or [])
gdb_process = subprocess.Popen(gdb_args)
while gdb_process.returncode is None:
try: