This is the mail archive of the gdb-cvs@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]

[binutils-gdb] quit_force: Replace TRY_CATCH wrapper macros


https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=ece957c859c00fbea7152a2275674d7061dc468a

commit ece957c859c00fbea7152a2275674d7061dc468a
Author: Tom Tromey <tromey@redhat.com>
Date:   Sat Mar 7 14:50:04 2015 +0000

    quit_force: Replace TRY_CATCH wrapper macros
    
    More preparation for running the TRY_CATCH->TRY/CATCH conversion
    script.
    
    gdb/ChangeLog:
    2015-03-07  Tom Tromey  <tromey@redhat.com>
    
    	* top.c (quit_force): Inline and delete DO_TRY, DO_PRINT_EX.

Diff:
---
 gdb/ChangeLog |  4 ++++
 gdb/top.c     | 28 ++++++++++++----------------
 2 files changed, 16 insertions(+), 16 deletions(-)

diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 076aa36..641a94c 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,7 @@
+2015-03-07  Tom Tromey  <tromey@redhat.com>
+
+	* top.c (quit_force): Inline and delete DO_TRY, DO_PRINT_EX.
+
 2015-03-07  Pedro Alves  <palves@redhat.com>
 
 	* amd64-tdep.c (amd64_frame_cache, amd64_sigtramp_frame_cache)
diff --git a/gdb/top.c b/gdb/top.c
index 55c6896..699a399 100644
--- a/gdb/top.c
+++ b/gdb/top.c
@@ -1481,47 +1481,43 @@ quit_force (char *args, int from_tty)
   qt.args = args;
   qt.from_tty = from_tty;
 
-  /* Wrappers to make the code below a bit more readable.  */
-#define DO_TRY \
-  TRY_CATCH (ex, RETURN_MASK_ALL)
-
-#define DO_PRINT_EX \
-  if (ex.reason < 0) \
-    exception_print (gdb_stderr, ex)
-
   /* We want to handle any quit errors and exit regardless.  */
 
   /* Get out of tfind mode, and kill or detach all inferiors.  */
-  DO_TRY
+  TRY_CATCH (ex, RETURN_MASK_ALL)
     {
       disconnect_tracing ();
       iterate_over_inferiors (kill_or_detach, &qt);
     }
-  DO_PRINT_EX;
+  if (ex.reason < 0)
+    exception_print (gdb_stderr, ex);
 
   /* Give all pushed targets a chance to do minimal cleanup, and pop
      them all out.  */
-  DO_TRY
+  TRY_CATCH (ex, RETURN_MASK_ALL)
     {
       pop_all_targets ();
     }
-  DO_PRINT_EX;
+  if (ex.reason < 0)
+    exception_print (gdb_stderr, ex);
 
   /* Save the history information if it is appropriate to do so.  */
-  DO_TRY
+  TRY_CATCH (ex, RETURN_MASK_ALL)
     {
       if (write_history_p && history_filename
 	  && input_from_terminal_p ())
 	gdb_safe_append_history ();
     }
-  DO_PRINT_EX;
+  if (ex.reason < 0)
+    exception_print (gdb_stderr, ex);
 
   /* Do any final cleanups before exiting.  */
-  DO_TRY
+  TRY_CATCH (ex, RETURN_MASK_ALL)
     {
       do_final_cleanups (all_cleanups ());
     }
-  DO_PRINT_EX;
+  if (ex.reason < 0)
+    exception_print (gdb_stderr, ex);
 
   exit (exit_code);
 }


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