[RFC 8/8] mi/python: Allow redefinition of python MI commands

Tom Tromey tom@tromey.com
Wed May 8 18:00:00 GMT 2019


>>>>> "Simon" == Simon Marchi <simark@simark.ca> writes:

>>> If we know that we don't access that pointer after it is possibly stale, and
>>> we document that fact properly, I think we can keep what you had initially.
>>> Using shared_ptr has a cost, and it's not really essential here.
>>> 
>> 
>> All right. Thanks!

Simon> Well that's my opinion, let's see what Tom thinks about it.

I'm of two minds.

On the one hand, this sort of approach is fragile.  It's susceptible to
introducing bugs in the future.

On the other hand, it seems somewhat unlikely to actually be a cause of
bugs, since it's doubtful that more code will be added here.

I tend to suspect that using shared_ptr here is not too expensive, but I
don't mind either way I guess.

Tom



More information about the Gdb-patches mailing list