This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [RFC] Debug Operators with GDB Python
- From: Siva Chandra <sivachandra at google dot com>
- To: Tom Tromey <tromey at redhat dot com>
- Cc: gdb-patches at sourceware dot org, Doug Evans <dje at google dot com>
- Date: Sun, 2 Dec 2012 07:31:34 -0800
- Subject: Re: [RFC] Debug Operators with GDB Python
- References: <CAGyQ6gx6pYxK91gvsL2zSa18Wk5eJPJw4wr0fU6AdH+TLuiPpw@mail.gmail.com> <87r4nazs6y.fsf@fleche.redhat.com>
Siva> +PyObject *
Siva> +gdbpy_enable_debug_operators (PyObject *self, PyObject *args)
Tom> Rather than a special built-in function, you could just import the
Tom> appropriate module and refer to the functions by name. This is how the
Tom> typedef printing code works, see apply_type_printers. This seems clear
Tom> to me overall, but what do you think?
Siva> +class EnableDebugOperators(gdb.Command):
Siva> + def __init__(self):
Siva> + super(EnableDebugOperators, self).__init__("enable
debug-operators",
Siva> + gdb.COMMAND_SUPPORT)
Siva> +
Siva> + def invoke(self, arg, from_tty):
Siva> + gdb.operator.enable_debug_operators()
Tom> I'm not a fan of this. I think the feature should be enabled by default
Tom> and then individual operators (or groups, not sure) should be
Tom> disable-able by the user -- basically the way typedef- and value
Tom> pretty-printing work.
These were pointed out by Doug as well. Both the above pieces were
added to enable me to quickly test the meat of this feature. So yes, I
am going to change this to be consistent with the pretty printing
feature.
Thanks,
Siva Chandra