[PATCH v2] Add a way to preserve overridden GDB commands for later invocation

Tom Tromey tom@tromey.com
Fri Nov 1 19:18:00 GMT 2019


>>>>> "Marco" == Marco Barisione <mbarisione@undo.io> writes:

Thanks for the patch.  I think it's a good idea -- in fact, I've wanted
it myself before :-)

Do you have a copyright assignment on file?

Marco> To avoid unexpected behavioural changes, new commands implemented in
Marco> Python are, by default, freed when overridden.  A command which wants
Marco> the new behaviour can pass the new preserve_when_overridden argument to
Marco> gdb.Command.__init__ ().

Could you say what unexpected behavioural changes you would anticipate?
I tend to think it would be clearer if all commands were treated
identically.

Is there some implementation difficulty doing it?  Or was it just that
you didn't think it was useful?

In this model, if a Python command overrides a built-in command, and
then is itself overridden, can the new command still access the
underlying built-in command?

What happens in the weird case that you have a command alias X, then
override X, and then override the thing that the original X was aliased
to?  Will calling the overridden X do the right thing?  Really I'm
wondering if that crashes -- maybe a counter-argument to my wish for
generality is that aliases should not be overridden.

I skimmed the patch and it seemed ok but I figured we'd want to address
these things first.

thanks,
Tom



More information about the Gdb-patches mailing list