This is the mail archive of the gdb-patches@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]

Re: [RFA 7/8] Add truncate_repeat_arguments function


>>>>> "Yao" == Yao Qi <qiyaoltc@gmail.com> writes:

Yao> This global variable worries me a little bit.  Is it possible that
Yao> different part of GDB request to execute the repeatable commands?  For
Yao> example, CLI and MI issues command, or different UIs issue command.

It's hard to reason about, I agree.

I think commands can either be run via "cmd_func", or by calling the
command function directly.

Direct calls can be directly audited -- and none of the callers of the
new set_repeat_arguments function are called this way.

There are also not many calls to cmd_func; and at least when I look at
these (I encourage you to check my work), I think only execute_command
can possibly call a command that calls set_repeat_arguments.

Since execute_command uses a scoped_restore to save and restore this
global, I think this must be ok.

It does seem a bit fragile.  For example, I'd recommend not adding new
callers of set_repeat_arguments.  I'm open to suggestions for another
way to approach this.

Tom


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