This is the mail archive of the gdb-patches@sources.redhat.com 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]

[patch] Add comment to return_to_top_level()


This documents the functions behavour.  As that comment hints, it is 
very near time for a name change.

Checked in as desperatly needed.

Andrew
2001-11-19  Andrew Cagney  <ac131313@redhat.com>

	* defs.h (return_to_top_level): Comment.

Index: defs.h
===================================================================
RCS file: /cvs/src/src/gdb/defs.h,v
retrieving revision 1.64
diff -p -r1.64 defs.h
*** defs.h	2001/10/17 20:35:31	1.64
--- defs.h	2001/11/19 20:47:50
*************** enum return_reason
*** 1112,1117 ****
--- 1112,1132 ----
  #define RETURN_MASK_ALL		(RETURN_MASK_QUIT | RETURN_MASK_ERROR)
  typedef int return_mask;
  
+ /* Throw an exception of type RETURN_REASON.  Will execute a LONG JUMP
+    to the inner most containing exception handler (established using
+    catch_exceptions() or the legacy catch_errors()).
+ 
+    Useful when a section of code that caught an exception finds it
+    needs to repropagate that exception up the call chain.
+ 
+    The name return_to_top_level() dates back to a time when GDB had
+    only one exception handler installed at the top level.  This really
+    did return to the top level.  The name should probably be changed.
+ 
+    NOTE: Some sections of code are using error_begin() in conjunction
+    with return_to_top_level() to throw the initial exception.  That
+    code should, instead, use either error() or error_string().  */
+ 
  extern NORETURN void return_to_top_level (enum return_reason) ATTR_NORETURN;
  
  /* Call FUNC(UIOUT, FUNC_ARGS) but wrapped within an exception

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