This is the mail archive of the 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] Debug Operators with GDB Python

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
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

Siva Chandra

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