diff options
author | Markus Metzger <markus.t.metzger@intel.com> | 2016-06-20 11:12:14 +0200 |
---|---|---|
committer | Markus Metzger <markus.t.metzger@intel.com> | 2016-10-07 09:02:56 +0200 |
commit | 68dadef54c216f7ec75c27d74193897b18c5f9ab (patch) | |
tree | c4545c6f0d844e90507c78b58c6b05911c1c9467 /gdb/testsuite/gdb.python | |
parent | 50e03d47b77d5730f96f6b6bb66187654e66c797 (diff) | |
download | binutils-68dadef54c216f7ec75c27d74193897b18c5f9ab.zip binutils-68dadef54c216f7ec75c27d74193897b18c5f9ab.tar.gz binutils-68dadef54c216f7ec75c27d74193897b18c5f9ab.tar.bz2 |
python: accept address and explicit locations in gdb.decode_line
The gdb.decode_line python function is documented to support the same location
expressions as the "break" command. It currently expects a linespec location.
Instead of creating a linespec location directly, create the location via
string_to_event_location_basic.
Diffstat (limited to 'gdb/testsuite/gdb.python')
-rw-r--r-- | gdb/testsuite/gdb.python/python.exp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/gdb/testsuite/gdb.python/python.exp b/gdb/testsuite/gdb.python/python.exp index 3f8c46f..4072fa3 100644 --- a/gdb/testsuite/gdb.python/python.exp +++ b/gdb/testsuite/gdb.python/python.exp @@ -251,6 +251,13 @@ gdb_py_test_silent_cmd {python symtab = gdb.decode_line ("func1,func2")} \ "test decode_line func1,func2" 1 gdb_test {python print (symtab[0])} ",func2" "stop at comma in linespec" +gdb_py_test_silent_cmd "python symtab = gdb.decode_line(\"*0\")" "Test decode_line *0" 1 +gdb_test "python print (len(symtab))" "2" "Test decode_line *0 result length" +gdb_test "python print (symtab\[0\])" "None" "Test decode_line *0 unparsed" +gdb_test "python print (len(symtab\[1\]))" "1" "Test decode_line *0 locations length" +gdb_test "python print (symtab\[1\]\[0\].symtab)" "None" "Test decode_line *0 filename" +gdb_test "python print (symtab\[1\]\[0\].pc)" "0" "Test decode_line *0 pc" + # gdb.write gdb_test "python print (sys.stderr)" ".*gdb.GdbOutputErrorFile (instance|object) at.*" "Test stderr location" gdb_test "python print (sys.stdout)" ".*gdb.GdbOutputFile (instance|object) at.*" "Test stdout location" |