This is the mail archive of the gdb-prs@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug python/15637] override a command from Python


https://sourceware.org/bugzilla/show_bug.cgi?id=15637

--- Comment #2 from Tom Tromey <tromey at redhat dot com> ---
It occurred to me that a single change could fix both
this and bug #13077.

If we had an API to get an existing gdb command as a
Command object, then we could simply invoke methods on it.
Redefining the CLI command would still work fine, since
the new command could simply keep a reference to the old
command.

For this to work nicely I think we'd want to have the
API return both a command and the unparsed part of a command
line (for completion).  So:

(command, remainder) = gdb.command('p x * y')

would yield the <print> command and the string "x * y".

-- 
You are receiving this mail because:
You are on the CC list for the bug.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]