Re: [RFC] stept, nextt, finisht, untilt, continuet

Tom Tromey
2011-08-30T17:00:30Z

>>>>> "Doug" == Doug Evans <dje@google.com> writes:

Doug> Sometimes I want to run with scheduler-locking on, but having to
Doug> turn it on, perform the command, and remember to turn it off
Doug> afterwards is annoying.

Doug> Another way to go would be to add a "-t" option to these commands.

I was experimenting with generic prefix commands, e.g. "verbose". I
think of them as adverbs. This is just food for thought, I am ok with
any of these approaches.

Tom

import gdb

class VerboseCmd(gdb.Command):
def __init__(self, name):
gdb.Command.__init__(self, name, gdb.COMMAND_SUPPORT)

def invoke(self, arg, from_tty):
if gdb.parameter('verbose'):
save = 'on'
else:
save = 'off'
gdb.execute('set verbose on', to_string = True)
try:
gdb.execute(arg, from_tty)
finally:
gdb.execute('set verbose ' + save, to_string = True)

VerboseCmd('verbose')