Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* [patch/rfc] Deprecate throw_reason
@ 2005-01-18 20:58 Andrew Cagney
  2005-01-18 21:39 ` Eli Zaretskii
  0 siblings, 1 reply; 4+ messages in thread
From: Andrew Cagney @ 2005-01-18 20:58 UTC (permalink / raw)
  To: gdb-patches

[-- Attachment #1: Type: text/plain, Size: 135 bytes --]

Throw reason should be superseeded by:

	e = catch_exception (....);
	if ....
	  throw_exception (e);

I'll commit eventually.

Andrew

[-- Attachment #2: diffs --]
[-- Type: text/plain, Size: 7750 bytes --]

2005-01-18  Andrew Cagney  <cagney@gnu.org>

	* exceptions.h (deprecated_throw_reason): Rename throw_reason.
	* exceptions.c (deprecated_throw_reason): Rename throw_reason.
	* utils.c (internal_verror, quit): Update.
	* remote-sds.c (interrupt_query): Update.
	* remote-mips.c (mips_error, mips_kill): Update.
	* remote-fileio.c (remote_fileio_ctrl_c_signal_handler): Update.
	* remote.c (interrupt_query): Update.
	* ocd.c (interrupt_query): Update.
	* nto-procfs.c (interrupt_query): Update.
	* monitor.c (monitor_interrupt_query): Update.
	* breakpoint.c (break_command_1): Update.

Index: breakpoint.c
===================================================================
RCS file: /cvs/src/src/gdb/breakpoint.c,v
retrieving revision 1.195
diff -p -u -r1.195 breakpoint.c
--- breakpoint.c	18 Jan 2005 17:04:27 -0000	1.195
+++ breakpoint.c	18 Jan 2005 20:40:05 -0000
@@ -5144,7 +5144,7 @@ break_command_1 (char *arg, int flag, in
 	     error.  */
 
 	  if (pending_break_support == AUTO_BOOLEAN_FALSE)
-	    throw_reason (RETURN_ERROR);
+	    deprecated_throw_reason (RETURN_ERROR);
 
           /* If pending breakpoint support is auto query and the user
 	     selects no, then simply return the error code.  */
Index: exceptions.c
===================================================================
RCS file: /cvs/src/src/gdb/exceptions.c,v
retrieving revision 1.15
diff -p -u -r1.15 exceptions.c
--- exceptions.c	16 Jan 2005 21:20:05 -0000	1.15
+++ exceptions.c	18 Jan 2005 20:40:05 -0000
@@ -239,7 +239,7 @@ throw_exception (struct exception except
 static char *last_message;
 
 NORETURN void
-throw_reason (enum return_reason reason)
+deprecated_throw_reason (enum return_reason reason)
 {
   struct exception exception;
   memset (&exception, 0, sizeof exception);
Index: exceptions.h
===================================================================
RCS file: /cvs/src/src/gdb/exceptions.h,v
retrieving revision 1.9
diff -p -u -r1.9 exceptions.h
--- exceptions.h	14 Jan 2005 23:27:13 -0000	1.9
+++ exceptions.h	18 Jan 2005 20:40:05 -0000
@@ -85,13 +85,16 @@ extern void exception_fprintf (struct ui
    Wombat.  */
 
 extern NORETURN void throw_exception (struct exception exception) ATTR_NORETURN;
-extern NORETURN void throw_reason (enum return_reason reason) ATTR_NORETURN;
 extern NORETURN void throw_verror (enum errors, const char *fmt,
 				   va_list ap) ATTR_NORETURN;
 extern NORETURN void throw_vfatal (const char *fmt, va_list ap) ATTR_NORETURN;
 extern NORETURN void throw_error (enum errors error, const char *fmt,
 				  ...) ATTR_NORETURN ATTR_FORMAT (printf, 2, 3);
 
+/* Instead of deprecated_throw_reason, code should use catch_exception
+   and throw_exception.  */
+extern NORETURN void deprecated_throw_reason (enum return_reason reason) ATTR_NORETURN;
+
 /* Call FUNC(UIOUT, FUNC_ARGS) but wrapped within an exception
    handler.  If an exception (enum return_reason) is thrown using
    throw_exception() than all cleanups installed since
Index: monitor.c
===================================================================
RCS file: /cvs/src/src/gdb/monitor.c,v
retrieving revision 1.54
diff -p -u -r1.54 monitor.c
--- monitor.c	15 Jan 2005 02:33:19 -0000	1.54
+++ monitor.c	18 Jan 2005 20:40:05 -0000
@@ -1030,7 +1030,7 @@ monitor_interrupt_query (void)
 Give up (and stop debugging it)? "))
     {
       target_mourn_inferior ();
-      throw_reason (RETURN_QUIT);
+      deprecated_throw_reason (RETURN_QUIT);
     }
 
   target_terminal_inferior ();
Index: nto-procfs.c
===================================================================
RCS file: /cvs/src/src/gdb/nto-procfs.c,v
retrieving revision 1.9
diff -p -u -r1.9 nto-procfs.c
--- nto-procfs.c	15 Jan 2005 02:33:19 -0000	1.9
+++ nto-procfs.c	18 Jan 2005 20:40:05 -0000
@@ -592,7 +592,7 @@ interrupt_query (void)
 Give up (and stop debugging it)? "))
     {
       target_mourn_inferior ();
-      throw_reason (RETURN_QUIT);
+      deprecated_throw_reason (RETURN_QUIT);
     }
 
   target_terminal_inferior ();
Index: ocd.c
===================================================================
RCS file: /cvs/src/src/gdb/ocd.c,v
retrieving revision 1.34
diff -p -u -r1.34 ocd.c
--- ocd.c	15 Jan 2005 02:33:19 -0000	1.34
+++ ocd.c	18 Jan 2005 20:40:05 -0000
@@ -397,7 +397,7 @@ interrupt_query (void)
 Give up (and stop debugging it)? "))
     {
       target_mourn_inferior ();
-      throw_reason (RETURN_QUIT);
+      deprecated_throw_reason (RETURN_QUIT);
     }
 
   target_terminal_inferior ();
Index: remote-fileio.c
===================================================================
RCS file: /cvs/src/src/gdb/remote-fileio.c,v
retrieving revision 1.9
diff -p -u -r1.9 remote-fileio.c
--- remote-fileio.c	14 Jan 2005 23:27:14 -0000	1.9
+++ remote-fileio.c	18 Jan 2005 20:40:05 -0000
@@ -480,7 +480,7 @@ remote_fileio_ctrl_c_signal_handler (int
   remote_fileio_sig_set (SIG_IGN);
   remote_fio_ctrl_c_flag = 1;
   if (!remote_fio_no_longjmp)
-    throw_reason (RETURN_QUIT);
+    deprecated_throw_reason (RETURN_QUIT);
   remote_fileio_sig_set (remote_fileio_ctrl_c_signal_handler);
 }
 
Index: remote-mips.c
===================================================================
RCS file: /cvs/src/src/gdb/remote-mips.c,v
retrieving revision 1.59
diff -p -u -r1.59 remote-mips.c
--- remote-mips.c	15 Jan 2005 02:33:19 -0000	1.59
+++ remote-mips.c	18 Jan 2005 20:40:06 -0000
@@ -497,7 +497,7 @@ mips_error (char *string,...)
   printf_unfiltered ("Ending remote MIPS debugging.\n");
   target_mourn_inferior ();
 
-  throw_reason (RETURN_ERROR);
+  deprecated_throw_reason (RETURN_ERROR);
 }
 
 /* putc_readable - print a character, displaying non-printable chars in
@@ -2148,7 +2148,7 @@ Give up (and stop debugging it)? "))
 	  printf_unfiltered ("Ending remote MIPS debugging.\n");
 	  target_mourn_inferior ();
 
-	  throw_reason (RETURN_QUIT);
+	  deprecated_throw_reason (RETURN_QUIT);
 	}
 
       target_terminal_inferior ();
Index: remote-sds.c
===================================================================
RCS file: /cvs/src/src/gdb/remote-sds.c,v
retrieving revision 1.36
diff -p -u -r1.36 remote-sds.c
--- remote-sds.c	15 Jan 2005 02:33:19 -0000	1.36
+++ remote-sds.c	18 Jan 2005 20:40:06 -0000
@@ -386,7 +386,7 @@ interrupt_query (void)
 Give up (and stop debugging it)? "))
     {
       target_mourn_inferior ();
-      throw_reason (RETURN_QUIT);
+      deprecated_throw_reason (RETURN_QUIT);
     }
 
   target_terminal_inferior ();
Index: remote.c
===================================================================
RCS file: /cvs/src/src/gdb/remote.c,v
retrieving revision 1.162
diff -p -u -r1.162 remote.c
--- remote.c	18 Jan 2005 16:15:39 -0000	1.162
+++ remote.c	18 Jan 2005 20:40:06 -0000
@@ -2730,7 +2730,7 @@ interrupt_query (void)
 Give up (and stop debugging it)? "))
     {
       target_mourn_inferior ();
-      throw_reason (RETURN_QUIT);
+      deprecated_throw_reason (RETURN_QUIT);
     }
 
   target_terminal_inferior ();
Index: utils.c
===================================================================
RCS file: /cvs/src/src/gdb/utils.c,v
retrieving revision 1.145
diff -p -u -r1.145 utils.c
--- utils.c	14 Jan 2005 21:34:36 -0000	1.145
+++ utils.c	18 Jan 2005 20:40:07 -0000
@@ -779,7 +779,7 @@ NORETURN void
 internal_verror (const char *file, int line, const char *fmt, va_list ap)
 {
   internal_vproblem (&internal_error_problem, file, line, fmt, ap);
-  throw_reason (RETURN_ERROR);
+  deprecated_throw_reason (RETURN_ERROR);
 }
 
 NORETURN void
@@ -920,7 +920,7 @@ quit (void)
     fprintf_unfiltered (gdb_stderr,
 			"Quit (expect signal SIGINT when the program is resumed)\n");
 #endif
-  throw_reason (RETURN_QUIT);
+  deprecated_throw_reason (RETURN_QUIT);
 }
 
 /* Control C comes here */

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [patch/rfc] Deprecate throw_reason
  2005-01-18 20:58 [patch/rfc] Deprecate throw_reason Andrew Cagney
@ 2005-01-18 21:39 ` Eli Zaretskii
  2005-01-19 21:14   ` Andrew Cagney
  0 siblings, 1 reply; 4+ messages in thread
From: Eli Zaretskii @ 2005-01-18 21:39 UTC (permalink / raw)
  To: Andrew Cagney; +Cc: gdb-patches

> Date: Tue, 18 Jan 2005 15:56:20 -0500
> From: Andrew Cagney <cagney@gnu.org>
> 
> Index: breakpoint.c
> ===================================================================
> RCS file: /cvs/src/src/gdb/breakpoint.c,v
> retrieving revision 1.195
> diff -p -u -r1.195 breakpoint.c
> --- breakpoint.c	18 Jan 2005 17:04:27 -0000	1.195
> +++ breakpoint.c	18 Jan 2005 20:40:05 -0000
> @@ -5144,7 +5144,7 @@ break_command_1 (char *arg, int flag, in
>  	     error.  */
>  
>  	  if (pending_break_support == AUTO_BOOLEAN_FALSE)
> -	    throw_reason (RETURN_ERROR);
> +	    deprecated_throw_reason (RETURN_ERROR);

It's IMHO not nice that we have deprecated_something in a core-GDB
source file such as breakpoint.c.  Can we replace this with a
party-line code?

> --- utils.c	14 Jan 2005 21:34:36 -0000	1.145
> +++ utils.c	18 Jan 2005 20:40:07 -0000

Same here.


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [patch/rfc] Deprecate throw_reason
  2005-01-18 21:39 ` Eli Zaretskii
@ 2005-01-19 21:14   ` Andrew Cagney
  2005-01-19 21:53     ` Eli Zaretskii
  0 siblings, 1 reply; 4+ messages in thread
From: Andrew Cagney @ 2005-01-19 21:14 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: gdb-patches

Eli Zaretskii wrote:
>>Date: Tue, 18 Jan 2005 15:56:20 -0500
>>From: Andrew Cagney <cagney@gnu.org>
>>
>>Index: breakpoint.c
>>===================================================================
>>RCS file: /cvs/src/src/gdb/breakpoint.c,v
>>retrieving revision 1.195
>>diff -p -u -r1.195 breakpoint.c
>>--- breakpoint.c	18 Jan 2005 17:04:27 -0000	1.195
>>+++ breakpoint.c	18 Jan 2005 20:40:05 -0000
>>@@ -5144,7 +5144,7 @@ break_command_1 (char *arg, int flag, in
>> 	     error.  */
>> 
>> 	  if (pending_break_support == AUTO_BOOLEAN_FALSE)
>>-	    throw_reason (RETURN_ERROR);
>>+	    deprecated_throw_reason (RETURN_ERROR);
> 
> 
> It's IMHO not nice that we have deprecated_something in a core-GDB
> source file such as breakpoint.c.  Can we replace this with a
> party-line code?

Yes, we most certainly can, and will.  But in the interum, I'll check 
this in.

Andrew

>>--- utils.c	14 Jan 2005 21:34:36 -0000	1.145
>>+++ utils.c	18 Jan 2005 20:40:07 -0000
> 
> 
> Same here.
> 


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [patch/rfc] Deprecate throw_reason
  2005-01-19 21:14   ` Andrew Cagney
@ 2005-01-19 21:53     ` Eli Zaretskii
  0 siblings, 0 replies; 4+ messages in thread
From: Eli Zaretskii @ 2005-01-19 21:53 UTC (permalink / raw)
  To: Andrew Cagney; +Cc: gdb-patches

> Date: Wed, 19 Jan 2005 16:14:00 -0500
> From: Andrew Cagney <cagney@gnu.org>
> Cc: gdb-patches@sources.redhat.com
> 
> > It's IMHO not nice that we have deprecated_something in a core-GDB
> > source file such as breakpoint.c.  Can we replace this with a
> > party-line code?
> 
> Yes, we most certainly can, and will.  But in the interum, I'll check 
> this in.

In case it wasn't clear, I was asking you not to.


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2005-01-19 21:53 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-01-18 20:58 [patch/rfc] Deprecate throw_reason Andrew Cagney
2005-01-18 21:39 ` Eli Zaretskii
2005-01-19 21:14   ` Andrew Cagney
2005-01-19 21:53     ` Eli Zaretskii

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox