class BP(gdb.Breakpoint): def stop(self): raise ValueError will silently fail if "set python print-stack" is off. On Wed, Oct 19, 2011 at 10:56 PM, Tom Tromey <tromey@redhat.com> wrote: > Kevin> I don't know if Python allows to do it, but i think it would be nice > Kevin> to see something like: > >>> NameError: global name 'comp' is not define > > Kevin> which is the last line of a python stacktrace > > I think it could be done. > We can always add more values for "maint set python print-stack".
I'll pick this up and investigate. It seems selective (for example commands, functions, etc replicate and print the error correctly). "maint set python print-stack" has been depreciated btw, in favor of "set/show python print-stack"
CVSROOT: /cvs/src Module name: src Changes by: pmuldoon@sourceware.org 2011-12-16 15:55:40 Modified files: gdb : ChangeLog NEWS gdb/doc : ChangeLog gdb.texinfo gdb/python : python.c gdb/testsuite : ChangeLog gdb/testsuite/gdb.python: py-function.exp py-prettyprint.exp python.exp Log message: 2011-12-16 Phil Muldoon <pmuldoon@redhat.com> * testsuite/gdb.python/py-function.exp: Change "on" to "full" for python print-stack. Add set/show python print-stack off|full|message tests. 2011-12-16 Phil Muldoon <pmuldoon@redhat.com> * python/python.c: Define python_excp_enums. (eval_python_from_control_command): Do not call gdbpy_print_stack. (python_command): Ditto. (gdbpy_print_stack): Rewrite to use new enum constants. (maint_set_python): Remove function. (maint_show_python): Ditto. (_initialize_python): Do not add "maint" commands. Add "set/show python print-stack commands". * NEWS: Update to reflect removal for "maint set/show print-stack" 2011-12-16 Phil Muldoon <pmuldoon@redhat.com> * doc/gdb.texinfo (Python Commands): Remove "maint set/show print stack". Add documentation for "set/show python print-stack".