Patch to add argument parsing classes to gdb

Robert Lupton the Good
Fri Nov 11 19:38:00 GMT 2011

Dear GDB,

I'm attaching a patch that implements two classes, GdbOptionParser and GdbArgumentParser, which are built around python's standard optparse and argparse but play well with gdb (e.g. don't call exit if you make a typo or ask for help!).  The code imports with python >= 2.3, but only provides the argparse-based parser if you actually have argparse in your path (python == 2.7?).

The patch:
	Implements the classes
	Adds docs
	Adds test cases

What else do you need to get this into the source tree?  I'm not sure how to deal with copyright assignment.  

The patch comes from cvs, so I could just check it in, given the magic handshake, but I suspect that that's not the way you do things.  In git/hg I could issue a pull request...


P.S. Tom: this supersedes the patch I sent you a yesterday ago, and handles --help better

-------------- next part --------------
A non-text attachment was scrubbed...
Name: rhl.argumentParsing.patch.2
Type: application/octet-stream
Size: 27314 bytes
Desc: not available
URL: <>
-------------- next part --------------

More information about the Gdb mailing list