aboutsummaryrefslogtreecommitdiff
path: root/gdb/python/python-internal.h
diff options
context:
space:
mode:
authorAndrew Burgess <aburgess@redhat.com>2025-08-01 12:22:38 +0100
committerAndrew Burgess <aburgess@redhat.com>2025-09-23 18:40:00 +0100
commitce1b10c1ab3fc6f32621f1f23cc116ee8e39d473 (patch)
tree93053d73bab4de237b89c04a318763c720099dd7 /gdb/python/python-internal.h
parentc87df013cbc2c5072f1ef95626ed493e2b54506c (diff)
downloadbinutils-ce1b10c1ab3fc6f32621f1f23cc116ee8e39d473.zip
binutils-ce1b10c1ab3fc6f32621f1f23cc116ee8e39d473.tar.gz
binutils-ce1b10c1ab3fc6f32621f1f23cc116ee8e39d473.tar.bz2
gdbserver: allow gnu style arguments to gdbserver
Now that we use getopt_long for argument processing in gdbserver, it is relatively easy to support GNU style arguments, that is, arguments passed without an '=' between the argument and the value. As support for GNU style arguments is the default from getopt_long, the first part of this commit is to remove the code which deliberately disables the GNU argument support. With that done, we now need to consider optional arguments. In this case, getopt_long doesn't automatically grab the next word from ARGV to be the argument value, so I've added some code to do this. I've also tried to make this code a little smart. As the first argument passed to gdbserver that doesn't have a '--' at the start is the PORT number, the new code block I've added tries to spot if the argument value might be the port number. If it is, then we don't allow the port number to become the argument value, and instead, we pretend the argument value is missing. This seems to give better error messages. There are going to be UI changes in how gdbserver handles incorrect arguments after this commit. However, the behaviour for valid command lines should be unchanged. Approved-By: Tom Tromey <tom@tromey.com>
Diffstat (limited to 'gdb/python/python-internal.h')
0 files changed, 0 insertions, 0 deletions