From 56fcb715a9f6abddd51f981e15a14d88ae766fc5 Mon Sep 17 00:00:00 2001 From: Andrew Burgess Date: Tue, 14 Mar 2023 11:43:14 +0000 Subject: gdb/python: have PendingFrame methods accept keyword arguments Update the two gdb.PendingFrame methods gdb.PendingFrame.read_register and gdb.PendingFrame.create_unwind_info to accept keyword arguments. There's no huge benefit for making this change, both of these methods only take a single argument, so it is (maybe) less likely that a user will take advantage of the keyword arguments in these cases, but I think it's nice to be consistent, and I don't see any particular draw backs to making this change. For PendingFrame.read_register I've changed the argument name from 'reg' to 'register' in the documentation and used 'register' as the argument name in GDB. My preference for APIs is to use full words where possible, and given we didn't support named arguments before this change should not break any existing code. There should be no user visible changes (for existing code) after this commit. Reviewed-By: Eli Zaretskii Reviewed-By: Tom Tromey --- gdb/doc/python.texi | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'gdb/doc') diff --git a/gdb/doc/python.texi b/gdb/doc/python.texi index a4fd009..1315ddc 100644 --- a/gdb/doc/python.texi +++ b/gdb/doc/python.texi @@ -2756,11 +2756,11 @@ unwinding. An object passed to an unwinder (a @code{gdb.PendingFrame} instance) provides a method to read frame's registers: -@defun PendingFrame.read_register (reg) -This method returns the contents of the register @var{reg} in the +@defun PendingFrame.read_register (register) +This method returns the contents of @var{register} in the frame as a @code{gdb.Value} object. For a description of the -acceptable values of @var{reg} see -@ref{gdbpy_frame_read_register,,Frame.read_register}. If @var{reg} +acceptable values of @var{register} see +@ref{gdbpy_frame_read_register,,Frame.read_register}. If @var{register} does not name a register for the current architecture, this method will throw an exception. -- cgit v1.1