aboutsummaryrefslogtreecommitdiff
path: root/libctf/ctf-open.c
diff options
context:
space:
mode:
authorAndrew Burgess <aburgess@redhat.com>2025-04-23 10:22:32 +0100
committerAndrew Burgess <aburgess@redhat.com>2025-04-24 00:13:23 +0100
commit90fa7d2fd5a26bd0eb933c5cd9297c0e0801dacb (patch)
tree73d3eebe09ba0e424945e09f19029e5bf6ab4e10 /libctf/ctf-open.c
parent2eead96aeba1ec15d258b0952b37cb5d8bfc4c4a (diff)
downloadbinutils-90fa7d2fd5a26bd0eb933c5cd9297c0e0801dacb.zip
binutils-90fa7d2fd5a26bd0eb933c5cd9297c0e0801dacb.tar.gz
binutils-90fa7d2fd5a26bd0eb933c5cd9297c0e0801dacb.tar.bz2
gdb/python: keyword arguments for gdb.Color.escape_sequence
GDB's Python documentation does make it clear that keywords arguments are supported for functions that take 2 or more arguments. The documentation makes no promise for keyword argument support on functions that only take a single argument. That said, I'm a fan of keyword arguments, I think they help document the code, and make intentions clearer, even for single argument functions. As I'm changing gdb.Color anyway (see previous commit), I'd like to add keyword argument support to gdb.Color.escape_sequence, even though this is a single argument method. This should be harmless for anyone who doesn't want to use keywords, but adds the option for those of us that do. I've also removed a redundant check that the 'self' argument was a gdb.Color object; Python already ensures this is the case. And I have folded the check that the single argument is a bool into the gdb_PyArg_ParseTupleAndKeywords call, this means that the error message will include the incorrect type name now, which should make debugging issues easier. Tests have been extended to cover both cases -- it appears the incorrect argument type error was not previously tested, so it is now. Approved-By: Tom Tromey <tom@tromey.com>
Diffstat (limited to 'libctf/ctf-open.c')
0 files changed, 0 insertions, 0 deletions