aboutsummaryrefslogtreecommitdiff
path: root/gdb/testsuite/gdb.python/py-shared.exp
diff options
context:
space:
mode:
authorTom Tromey <tom@tromey.com>2022-06-05 07:42:12 -0600
committerTom Tromey <tom@tromey.com>2022-07-08 14:14:58 -0600
commitd19ca0b35c9536210c5e8bd30504489b7439f51f (patch)
treea488182e25b0d0a16eea68ab816c986988c28cfd /gdb/testsuite/gdb.python/py-shared.exp
parentfa17a6814113ac22d8059d61514aa2c6e29b0aae (diff)
downloadbinutils-d19ca0b35c9536210c5e8bd30504489b7439f51f.zip
binutils-d19ca0b35c9536210c5e8bd30504489b7439f51f.tar.gz
binutils-d19ca0b35c9536210c5e8bd30504489b7439f51f.tar.bz2
Accept gdb.Value in more Python APIs
PR python/27000 points out that gdb.block_for_pc will accept a Python integer, but not a gdb.Value. This patch corrects this oversight. I looked at all uses of GDB_PY_LLU_ARG and fixed these up to use get_addr_from_python instead. I also looked at uses of GDB_PY_LL_ARG, but those seemed relatively unlikely to be useful with a gdb.Value, so I didn't change them. My thinking here is that a Value will typically come from inferior memory, and something like a line number is not too likely to be found this way. Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=27000
Diffstat (limited to 'gdb/testsuite/gdb.python/py-shared.exp')
-rw-r--r--gdb/testsuite/gdb.python/py-shared.exp5
1 files changed, 4 insertions, 1 deletions
diff --git a/gdb/testsuite/gdb.python/py-shared.exp b/gdb/testsuite/gdb.python/py-shared.exp
index 2d33902..7075bc5 100644
--- a/gdb/testsuite/gdb.python/py-shared.exp
+++ b/gdb/testsuite/gdb.python/py-shared.exp
@@ -57,7 +57,10 @@ runto [gdb_get_line_number "Break to end."]
# Test gdb.solib_name
gdb_test "p &func1" "" "func1 address"
gdb_py_test_silent_cmd "python func1 = gdb.history(0)" "Aquire func1 address" 1
-gdb_test "python print (gdb.solib_name(int(func1)))" "py-shared-sl.sl" "test func1 solib location"
+gdb_test "python print (gdb.solib_name(int(func1)))" "py-shared-sl.sl" \
+ "test func1 solib location"
+gdb_test "python print (gdb.solib_name(func1))" "py-shared-sl.sl" \
+ "test func1 solib location using Value"
gdb_test "p &main" "" "main address"
gdb_py_test_silent_cmd "python main = gdb.history(0)" "Aquire main address" 1