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: [RFC] stept, nextt, finisht, untilt, continuet


>>>>> "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')


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