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]

[commit] remove useless call to gdbpy_print_stack


Hi.

I've committed this.
PyRun_SimpleFile will print a traceback itself, and clear the
error indicator, so calling gdbpy_print_stack is pointless.
Mea Culpa.

2010-05-19  Doug Evans  <dje@google.com>

	* python.c (source_python_script): Add comment.
	(source_python_script_for_objfile): Remove unnecessary call to
	gdbpy_print_stack.

Index: python.c
===================================================================
RCS file: /cvs/src/src/gdb/python/python.c,v
retrieving revision 1.36
diff -u -p -r1.36 python.c
--- python.c	17 May 2010 21:23:25 -0000	1.36
+++ python.c	19 May 2010 21:54:24 -0000
@@ -377,6 +377,8 @@ source_python_script (FILE *stream, cons
 
   cleanup = ensure_python_env (get_current_arch (), current_language);
 
+  /* Note: If an exception occurs python will print the traceback and
+     clear the error indicator.  */
   PyRun_SimpleFile (stream, file);
 
   do_cleanups (cleanup);
@@ -480,10 +482,9 @@ source_python_script_for_objfile (struct
   cleanups = ensure_python_env (get_objfile_arch (objfile), current_language);
   gdbpy_current_objfile = objfile;
 
-  /* We don't want to throw an exception here -- but the user
-     would like to know that something went wrong.  */
-  if (PyRun_SimpleFile (stream, file))
-    gdbpy_print_stack ();
+  /* Note: If an exception occurs python will print the traceback and
+     clear the error indicator.  */
+  PyRun_SimpleFile (stream, file);
 
   do_cleanups (cleanups);
   gdbpy_current_objfile = NULL;


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