diff options
author | Andrew Burgess <aburgess@redhat.com> | 2023-03-30 10:40:41 +0100 |
---|---|---|
committer | Andrew Burgess <aburgess@redhat.com> | 2023-04-06 15:03:55 +0100 |
commit | 02c7fce1ad07412838cd1e97d1c8ee34c59a3c60 (patch) | |
tree | 66ce20ad599493825a5d45343eee1d450507e805 /gdb/testsuite | |
parent | 56fcb715a9f6abddd51f981e15a14d88ae766fc5 (diff) | |
download | gdb-02c7fce1ad07412838cd1e97d1c8ee34c59a3c60.zip gdb-02c7fce1ad07412838cd1e97d1c8ee34c59a3c60.tar.gz gdb-02c7fce1ad07412838cd1e97d1c8ee34c59a3c60.tar.bz2 |
gdb/python: convert Frame.read_register to take named arguments
Following on from the previous commit, this updates
Frame.read_register to accept named arguments. As with the previous
commit there's no huge benefit for the users in accepting named
arguments here -- this function only takes a single argument after
all.
But I do think it is worth keeping Frame.read_register method in sync
with the PendingFrame.read_register method, this allows for the
possibility that the user has some code that can operate on either a
Frame or a Pending frame.
Minor update to allow for named arguments, and an extra test to check
the new functionality.
Reviewed-By: Tom Tromey <tom@tromey.com>
Diffstat (limited to 'gdb/testsuite')
-rw-r--r-- | gdb/testsuite/gdb.python/py-frame.exp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/gdb/testsuite/gdb.python/py-frame.exp b/gdb/testsuite/gdb.python/py-frame.exp index 5aebb6b..0799732 100644 --- a/gdb/testsuite/gdb.python/py-frame.exp +++ b/gdb/testsuite/gdb.python/py-frame.exp @@ -115,6 +115,12 @@ gdb_test "python print ('result = %s' % (f0.read_register('pc') == f0.pc()))" \ " = True" \ "test Frame.read_register(pc)" +# Repeat the previous test, but this time use named arguments for the +# read_register method call. +gdb_test "python print ('result = %s' % (f0.read_register(register = 'pc') == f0.pc()))" \ + " = True" \ + "test Frame.read_register() using named arguments" + # Test arch-specific register name. set pc "" if {[is_amd64_regs_target]} { |