RFA: Remove unused support for target-based exception handling

Jim Blandy jimb@codesourcery.com
Fri Dec 7 07:02:00 GMT 2007


This was kind of like finding something old and nasty in the back of
the fridge.  :)

This causes no regressions on IA-32, and I think it should leave GDB's
behavior on every target completely unchanged (beyond the trivial
change noted in the test suite patch).

(I'd been hoping that this would let me delete print_frame_label_vars,
but when I got back there it turned out I'd misread the code, and
instead we now use it unconditionally... sigh.)

gdb/ChangeLog:
2007-12-06  Jim Blandy  <jimb@codesourcery.com>

	Remove unused support for target-based exception catching.
	* target.h (struct target_ops): Delete
	to_enable_exception_callback and to_get_current_exception_event
	members.
	(target_enable_exception_callback)
	(target_get_current_exception_event): Delete macros.
	* target.c (update_current_target): Remove code to inherit and
	default those members.
	(debug_to_enable_exception_callback)
	(debug_to_get_current_exception_event): Delete functions.
	(setup_target_debug): Don't install those methods.
	* inf-child.c (inf_child_enable_exception_callback)
	(inf_child_get_current_exception_event): Delete dummy functions.
	(inf_child_target): Don't install them in the target vector.
	* breakpoint.h (enum bptype): Delete bp_catch_catch,
	bp_catch_throw.
	* breakpoint.c (cover_target_enable_exception_callback)
	(ep_is_exception_catchpoint, create_exception_catchpoint): Delete
	functions.
	(insert_bp_location, update_breakpoints_after_exec)
	(remove_breakpoint, ep_is_catchpoint, print_it_typical)
	(bpstat_stop_status, bpstat_what)
	(bpstat_get_triggered_catchpoints, print_one_breakpoint_location)
	(user_settable_breakpoint, allocate_bp_location)
	(disable_watchpoints_before_interactive_call_start)
	(enable_watchpoints_after_interactive_call_stop, mention)
	(delete_breakpoint, breakpoint_re_set_one, disable_command)
	(enable_command): Remove exception catchpoint cases.
	(catch_exception_command_1): Don't try target-based exception
	handling.
	* stack.c (catch_info): Call print_frame_label_vars
	unconditionally.

gdb/testsuite/ChangeLog:
2007-12-06  Jim Blandy  <jimb@codesourcery.com>

	* gdb.base/default.exp: Update expected output for 'info catch'.

diff -r 862f19865777 gdb/breakpoint.c
--- a/gdb/breakpoint.c	Thu Dec 06 09:24:45 2007 -0800
+++ b/gdb/breakpoint.c	Thu Dec 06 15:48:33 2007 -0800
@@ -144,8 +144,6 @@ args_for_catchpoint_enable;
 args_for_catchpoint_enable;
 
 static int watchpoint_check (void *);
-
-static int cover_target_enable_exception_callback (void *);
 
 static void maintenance_info_breakpoints (char *, int);
 
@@ -1138,61 +1136,6 @@ in which its expression is valid.\n"),
       return val;
     }
 
-  else if (ep_is_exception_catchpoint (bpt->owner))
-    {
-      /* FIXME drow/2003-09-09: This code sets both a catchpoint and a
-	 breakpoint.  Once again, it would be better if this was represented
-	 as two bp_locations.  */
-
-      /* If we get here, we must have a callback mechanism for exception
-	 events -- with g++ style embedded label support, we insert
-	 ordinary breakpoints and not catchpoints. */
-      val = target_insert_breakpoint (&bpt->target_info);
-      if (val)
-	{
-	  /* Couldn't set breakpoint for some reason */
-	  fprintf_unfiltered (tmp_error_stream, 
-			      "Cannot insert catchpoint %d; disabling it.\n",
-			      bpt->owner->number);
-	  fprintf_filtered (tmp_error_stream, 
-			    "Error accessing memory address ");
-	  deprecated_print_address_numeric (bpt->address, 1, tmp_error_stream);
-	  fprintf_filtered (tmp_error_stream, ": %s.\n",
-			    safe_strerror (val));
-	  bpt->owner->enable_state = bp_disabled;
-	}
-      else
-	{
-	  /* Bp set, now make sure callbacks are enabled */
-	  /* Format possible error msg */
-	  char *message = xstrprintf ("Error inserting catchpoint %d:\n",
-				      bpt->owner->number);
-	  struct cleanup *cleanups = make_cleanup (xfree, message);
-	  int val;
-	  args_for_catchpoint_enable args;
-	  args.kind = bpt->owner->type == bp_catch_catch ? 
-	    EX_EVENT_CATCH : EX_EVENT_THROW;
-	  args.enable_p = 1;
-	  val = catch_errors (cover_target_enable_exception_callback,
-			      &args, message, RETURN_MASK_ALL);
-	  do_cleanups (cleanups);
-	  if (val != 0 && val != -1)
-	    bpt->inserted = 1;
-
-	  /* Check if something went wrong; val == 0 can be ignored */
-	  if (val == -1)
-	    {
-	      /* something went wrong */
-	      fprintf_unfiltered (tmp_error_stream, 
-				  "Cannot insert catchpoint %d; disabling it.\n",
-				  bpt->owner->number);
-	      bpt->owner->enable_state = bp_disabled;
-	    }
-	}
-
-      return val;
-    }
-
   else if (bpt->owner->type == bp_catch_fork
 	   || bpt->owner->type == bp_catch_vfork
 	   || bpt->owner->type == bp_catch_exec)
@@ -1384,13 +1327,6 @@ update_breakpoints_after_exec (void)
 
     /* Step-resume breakpoints are meaningless after an exec(). */
     if (b->type == bp_step_resume)
-      {
-	delete_breakpoint (b);
-	continue;
-      }
-
-    /* Ditto the exception-handling catchpoints. */
-    if ((b->type == bp_catch_catch) || (b->type == bp_catch_throw))
       {
 	delete_breakpoint (b);
 	continue;
@@ -1631,16 +1567,6 @@ remove_breakpoint (struct bp_location *b
 	return val;
       b->inserted = (is == mark_inserted);
     }
-  else if ((b->owner->type == bp_catch_catch ||
-	    b->owner->type == bp_catch_throw)
-	   && breakpoint_enabled (b->owner)
-	   && !b->duplicate)
-    {
-      val = target_remove_breakpoint (&b->target_info);
-      if (val)
-	return val;
-      b->inserted = (is == mark_inserted);
-    }
 
   return 0;
 }
@@ -1880,9 +1806,7 @@ ep_is_catchpoint (struct breakpoint *ep)
     || (ep->type == bp_catch_unload)
     || (ep->type == bp_catch_fork)
     || (ep->type == bp_catch_vfork)
-    || (ep->type == bp_catch_exec)
-    || (ep->type == bp_catch_catch)
-    || (ep->type == bp_catch_throw);
+    || (ep->type == bp_catch_exec);
 
   /* ??rehrauer: Add more kinds here, as are implemented... */
 }
@@ -1893,14 +1817,6 @@ ep_is_shlib_catchpoint (struct breakpoin
   return
     (ep->type == bp_catch_load)
     || (ep->type == bp_catch_unload);
-}
-
-int
-ep_is_exception_catchpoint (struct breakpoint *ep)
-{
-  return
-    (ep->type == bp_catch_catch)
-    || (ep->type == bp_catch_throw);
 }
 
 void 
@@ -2253,68 +2169,6 @@ print_it_typical (bpstat bs)
 		       b->number,
 		       b->exec_pathname);
       return PRINT_SRC_AND_LOC;
-      break;
-
-    case bp_catch_catch:
-      if (current_exception_event && 
-	  (CURRENT_EXCEPTION_KIND == EX_EVENT_CATCH))
-	{
-	  annotate_catchpoint (b->number);
-	  printf_filtered (_("\nCatchpoint %d (exception caught), "), 
-			   b->number);
-	  if (CURRENT_EXCEPTION_THROW_PC && CURRENT_EXCEPTION_THROW_LINE)
-	    printf_filtered (_("throw location %s:%d, "),
-			     CURRENT_EXCEPTION_THROW_FILE,
-			     CURRENT_EXCEPTION_THROW_LINE);
-	  else
-	    printf_filtered (_("throw location unknown, "));
-
-	  if (CURRENT_EXCEPTION_CATCH_PC && CURRENT_EXCEPTION_CATCH_LINE)
-	    printf_filtered (_("catch location %s:%d\n"),
-			     CURRENT_EXCEPTION_CATCH_FILE,
-			     CURRENT_EXCEPTION_CATCH_LINE);
-	  else
-	    printf_filtered (_("catch location unknown\n"));
-
-	  /* don't bother to print location frame info */
-	  return PRINT_SRC_ONLY;
-	}
-      else
-	{
-	  /* really throw, some other bpstat will handle it */
-	  return PRINT_UNKNOWN;	
-	}
-      break;
-
-    case bp_catch_throw:
-      if (current_exception_event && 
-	  (CURRENT_EXCEPTION_KIND == EX_EVENT_THROW))
-	{
-	  annotate_catchpoint (b->number);
-	  printf_filtered (_("\nCatchpoint %d (exception thrown), "),
-			   b->number);
-	  if (CURRENT_EXCEPTION_THROW_PC && CURRENT_EXCEPTION_THROW_LINE)
-	    printf_filtered (_("throw location %s:%d, "),
-			     CURRENT_EXCEPTION_THROW_FILE,
-			     CURRENT_EXCEPTION_THROW_LINE);
-	  else
-	    printf_filtered (_("throw location unknown, "));
-
-	  if (CURRENT_EXCEPTION_CATCH_PC && CURRENT_EXCEPTION_CATCH_LINE)
-	    printf_filtered (_("catch location %s:%d\n"),
-			     CURRENT_EXCEPTION_CATCH_FILE,
-			     CURRENT_EXCEPTION_CATCH_LINE);
-	  else
-	    printf_filtered (_("catch location unknown\n"));
-
-	  /* don't bother to print location frame info */
-	  return PRINT_SRC_ONLY; 
-	}
-      else
-	{
-	  /* really catch, some other bpstat will handle it */
-	  return PRINT_UNKNOWN;	
-	}
       break;
 
     case bp_watchpoint:
@@ -2778,9 +2632,7 @@ bpstat_stop_status (CORE_ADDR bp_addr, p
 	&& b->type != bp_hardware_breakpoint
 	&& b->type != bp_catch_fork
 	&& b->type != bp_catch_vfork
-	&& b->type != bp_catch_exec
-	&& b->type != bp_catch_catch
-	&& b->type != bp_catch_throw)	/* a non-watchpoint bp */
+	&& b->type != bp_catch_exec)	/* a non-watchpoint bp */
       {
 	if (bl->address != bp_addr) 	/* address doesn't match */
 	  continue;
@@ -2852,10 +2704,6 @@ bpstat_stop_status (CORE_ADDR bp_addr, p
 
     if ((b->type == bp_catch_exec)
 	&& !inferior_has_execd (PIDGET (inferior_ptid), &b->exec_pathname))
-      continue;
-
-    if (ep_is_exception_catchpoint (b) &&
-	!(current_exception_event = target_get_current_exception_event ()))
       continue;
 
     /* Come here if it's a watchpoint, or if the break address matches */
@@ -3299,18 +3147,6 @@ bpstat_what (bpstat bs)
 	       This requires no further action.  */
 	    bs_class = no_effect;
 	  break;
-	case bp_catch_catch:
-	  if (!bs->stop || CURRENT_EXCEPTION_KIND != EX_EVENT_CATCH)
-	    bs_class = bp_nostop;
-	  else if (bs->stop)
-	    bs_class = bs->print ? bp_noisy : bp_silent;
-	  break;
-	case bp_catch_throw:
-	  if (!bs->stop || CURRENT_EXCEPTION_KIND != EX_EVENT_THROW)
-	    bs_class = bp_nostop;
-	  else if (bs->stop)
-	    bs_class = bs->print ? bp_noisy : bp_silent;
-	  break;
 	case bp_call_dummy:
 	  /* Make sure the action is stop (silent or noisy),
 	     so infrun.c pops the dummy frame.  */
@@ -3373,9 +3209,7 @@ bpstat_get_triggered_catchpoints (bpstat
       if (ep == NULL)
 	break;
       if ((ep->type != bp_catch_load) &&
-	  (ep->type != bp_catch_unload) &&
-	  (ep->type != bp_catch_catch) &&
-	  (ep->type != bp_catch_throw))		
+	  (ep->type != bp_catch_unload))
 	/* pai: (temp) ADD fork/vfork here!!  */
 	continue;
 
@@ -3494,9 +3328,7 @@ print_one_breakpoint_location (struct br
     {bp_catch_unload, "catch unload"},
     {bp_catch_fork, "catch fork"},
     {bp_catch_vfork, "catch vfork"},
-    {bp_catch_exec, "catch exec"},
-    {bp_catch_catch, "catch catch"},
-    {bp_catch_throw, "catch throw"}
+    {bp_catch_exec, "catch exec"}
   };
   
   static char *bpdisps[] =
@@ -3673,28 +3505,6 @@ print_one_breakpoint_location (struct br
 	    ui_out_field_string (uiout, "what", b->exec_pathname);
 	    ui_out_text (uiout, "\" ");
 	  }
-	break;
-
-      case bp_catch_catch:
-	/* Field 4, the address, is omitted (which makes the columns
-	   not line up too nicely with the headers, but the effect
-	   is relatively readable).  */
-	if (addressprint)
-	  ui_out_field_skip (uiout, "addr");
-	annotate_field (5);
-	ui_out_field_string (uiout, "what", "exception catch");
-	ui_out_spaces (uiout, 1);
-	break;
-
-      case bp_catch_throw:
-	/* Field 4, the address, is omitted (which makes the columns
-	   not line up too nicely with the headers, but the effect
-	   is relatively readable).  */
-	if (addressprint)
-	  ui_out_field_skip (uiout, "addr");
-	annotate_field (5);
-	ui_out_field_string (uiout, "what", "exception throw");
-	ui_out_spaces (uiout, 1);
 	break;
 
       case bp_breakpoint:
@@ -3885,8 +3695,6 @@ user_settable_breakpoint (const struct b
 	  || b->type == bp_catch_fork
 	  || b->type == bp_catch_vfork
 	  || b->type == bp_catch_exec
-	  || b->type == bp_catch_catch
-	  || b->type == bp_catch_throw
 	  || b->type == bp_hardware_breakpoint
 	  || b->type == bp_watchpoint
 	  || b->type == bp_read_watchpoint
@@ -4294,8 +4102,6 @@ allocate_bp_location (struct breakpoint 
     case bp_catch_fork:
     case bp_catch_vfork:
     case bp_catch_exec:
-    case bp_catch_catch:
-    case bp_catch_throw:
       loc->loc_type = bp_loc_other;
       break;
     default:
@@ -4839,8 +4645,7 @@ disable_watchpoints_before_interactive_c
     if (((b->type == bp_watchpoint)
 	 || (b->type == bp_hardware_watchpoint)
 	 || (b->type == bp_read_watchpoint)
-	 || (b->type == bp_access_watchpoint)
-	 || ep_is_exception_catchpoint (b))
+	 || (b->type == bp_access_watchpoint))
 	&& breakpoint_enabled (b))
       {
 	b->enable_state = bp_call_disabled;
@@ -4859,8 +4664,7 @@ enable_watchpoints_after_interactive_cal
     if (((b->type == bp_watchpoint)
 	 || (b->type == bp_hardware_watchpoint)
 	 || (b->type == bp_read_watchpoint)
-	 || (b->type == bp_access_watchpoint)
-	 || ep_is_exception_catchpoint (b))
+	 || (b->type == bp_access_watchpoint))
 	&& (b->enable_state == bp_call_disabled))
       {
 	b->enable_state = bp_enabled;
@@ -4995,12 +4799,6 @@ mention (struct breakpoint *b)
 	printf_filtered (_("Catchpoint %d (exec)"),
 			 b->number);
 	break;
-      case bp_catch_catch:
-      case bp_catch_throw:
-	printf_filtered (_("Catchpoint %d (%s)"),
-			 b->number,
-			 (b->type == bp_catch_catch) ? "catch" : "throw");
-	break;
 
       case bp_until:
       case bp_finish:
@@ -6494,47 +6292,6 @@ catch_unload_command_1 (char *arg, int t
 				  dll_pathname, cond_string);
 }
 
-/* Commands to deal with catching exceptions.  */
-
-/* Set a breakpoint at the specified callback routine for an
-   exception event callback */
-
-static void
-create_exception_catchpoint (int tempflag, char *cond_string,
-			     enum exception_event_kind ex_event,
-			     struct symtab_and_line *sal)
-{
-  struct breakpoint *b;
-  int thread = -1;		/* All threads. */
-  enum bptype bptype;
-
-  if (!sal)			/* no exception support? */
-    return;
-
-  switch (ex_event)
-    {
-    case EX_EVENT_THROW:
-      bptype = bp_catch_throw;
-      break;
-    case EX_EVENT_CATCH:
-      bptype = bp_catch_catch;
-      break;
-    default:			/* error condition */
-      error (_("Internal error -- invalid catchpoint kind"));
-    }
-
-  b = set_raw_breakpoint (*sal, bptype);
-  set_breakpoint_count (breakpoint_count + 1);
-  b->number = breakpoint_count;
-  b->cond_string = (cond_string == NULL) ? 
-    NULL : savestring (cond_string, strlen (cond_string));
-  b->thread = thread;
-  b->addr_string = NULL;
-  b->enable_state = bp_enabled;
-  b->disposition = tempflag ? disp_del : disp_donttouch;
-  mention (b);
-}
-
 static enum print_stop_action
 print_exception_catchpoint (struct breakpoint *b)
 {
@@ -6640,19 +6397,6 @@ catch_exception_command_1 (enum exceptio
 
   if (handle_gnu_v3_exceptions (tempflag, cond_string, ex_event, from_tty))
     return;
-
-  /* See if we can find a callback routine */
-  sal = target_enable_exception_callback (ex_event, 1);
-
-  if (sal)
-    {
-      /* We have callbacks from the runtime system for exceptions.
-         Set a breakpoint on the sal found, if no errors */
-      if (sal != (struct symtab_and_line *) -1)
-	create_exception_catchpoint (tempflag, cond_string, ex_event, sal);
-      else
-	return;		/* something went wrong with setting up callbacks */
-    }
 
   warning (_("Unsupported with this platform/compiler combination."));
 }
@@ -6734,23 +6478,6 @@ catch_assert_command (char *arg, int tem
   sal = ada_decode_assert_location (arg, &addr_string, &ops);
   create_ada_exception_breakpoint (sal, addr_string, NULL, NULL, NULL, ops,
                                    tempflag, from_tty);
-}
-
-/* Cover routine to allow wrapping target_enable_exception_catchpoints
-   inside a catch_errors */
-
-static int
-cover_target_enable_exception_callback (void *arg)
-{
-  args_for_catchpoint_enable *args = arg;
-  struct symtab_and_line *sal;
-  sal = target_enable_exception_callback (args->kind, args->enable_p);
-  if (sal == NULL)
-    return 0;
-  else if (sal == (struct symtab_and_line *) -1)
-    return -1;
-  else
-    return 1;			/*is valid */
 }
 
 static void
@@ -7116,28 +6843,6 @@ delete_breakpoint (struct breakpoint *bp
   if (breakpoint_chain == bpt)
     breakpoint_chain = bpt->next;
 
-  /* If we have callback-style exception catchpoints, don't go through
-     the adjustments to the C++ runtime library etc. if the inferior
-     isn't actually running.  target_enable_exception_callback for a
-     null target ops vector gives an undesirable error message, so we
-     check here and avoid it. Since currently (1997-09-17) only HP-UX aCC's
-     exceptions are supported in this way, it's OK for now.  FIXME */
-  if (ep_is_exception_catchpoint (bpt) && target_has_execution)
-    {
-      /* Format possible error msg */
-      char *message = xstrprintf ("Error in deleting catchpoint %d:\n",
-				  bpt->number);
-      struct cleanup *cleanups = make_cleanup (xfree, message);
-      args_for_catchpoint_enable args;
-      args.kind = bpt->type == bp_catch_catch ? 
-	EX_EVENT_CATCH : EX_EVENT_THROW;
-      args.enable_p = 0;
-      catch_errors (cover_target_enable_exception_callback, &args,
-		    message, RETURN_MASK_ALL);
-      do_cleanups (cleanups);
-    }
-
-
   ALL_BREAKPOINTS (b)
     if (b->next == bpt)
     {
@@ -7583,9 +7288,6 @@ breakpoint_re_set_one (void *bint)
 	mention (b);
       value_free_to_mark (mark);
       break;
-    case bp_catch_catch:
-    case bp_catch_throw:
-      break;
       /* We needn't really do anything to reset these, since the mask
          that requests them is unaffected by e.g., new libraries being
          loaded. */
@@ -7876,8 +7578,6 @@ disable_command (char *args, int from_tt
       case bp_catch_fork:
       case bp_catch_vfork:
       case bp_catch_exec:
-      case bp_catch_catch:
-      case bp_catch_throw:
       case bp_hardware_breakpoint:
       case bp_watchpoint:
       case bp_hardware_watchpoint:
@@ -8014,8 +7714,6 @@ enable_command (char *args, int from_tty
       case bp_catch_fork:
       case bp_catch_vfork:
       case bp_catch_exec:
-      case bp_catch_catch:
-      case bp_catch_throw:
       case bp_hardware_breakpoint:
       case bp_watchpoint:
       case bp_hardware_watchpoint:
diff -r 862f19865777 gdb/breakpoint.h
--- a/gdb/breakpoint.h	Thu Dec 06 09:24:45 2007 -0800
+++ b/gdb/breakpoint.h	Thu Dec 06 15:48:33 2007 -0800
@@ -129,13 +129,6 @@ enum bptype
     bp_catch_fork,
     bp_catch_vfork,
     bp_catch_exec,
-
-    /* These are catchpoints to implement "catch catch" and "catch throw"
-       commands for C++ exception handling. */
-    bp_catch_catch,
-    bp_catch_throw
-
-
   };
 
 /* States of enablement of breakpoint. */
diff -r 862f19865777 gdb/inf-child.c
--- a/gdb/inf-child.c	Thu Dec 06 09:24:45 2007 -0800
+++ b/gdb/inf-child.c	Thu Dec 06 15:48:33 2007 -0800
@@ -155,19 +155,6 @@ inf_child_can_run (void)
 inf_child_can_run (void)
 {
   return 1;
-}
-
-static struct symtab_and_line *
-inf_child_enable_exception_callback (enum exception_event_kind kind,
-				     int enable)
-{
-  return (struct symtab_and_line *) NULL;
-}
-
-static struct exception_event_record *
-inf_child_get_current_exception_event (void)
-{
-  return (struct exception_event_record *) NULL;
 }
 
 static char *
@@ -210,8 +197,6 @@ inf_child_target (void)
   t->to_reported_exec_events_per_exec_call =
     inf_child_reported_exec_events_per_exec_call;
   t->to_can_run = inf_child_can_run;
-  t->to_enable_exception_callback = inf_child_enable_exception_callback;
-  t->to_get_current_exception_event = inf_child_get_current_exception_event;
   t->to_pid_to_exec_file = inf_child_pid_to_exec_file;
   t->to_stratum = process_stratum;
   t->to_has_all_memory = 1;
diff -r 862f19865777 gdb/stack.c
--- a/gdb/stack.c	Thu Dec 06 09:24:45 2007 -0800
+++ b/gdb/stack.c	Thu Dec 06 15:48:33 2007 -0800
@@ -1549,22 +1549,9 @@ catch_info (char *ignore, int from_tty)
 {
   struct symtab_and_line *sal;
 
-  /* Check for target support for exception handling */
-  sal = target_enable_exception_callback (EX_EVENT_CATCH, 1);
-  if (sal)
-    {
-      /* Currently not handling this.  Ideally, here we should
-         interact with the C++ runtime system to find the list of
-         active handlers, etc.  */
-      fprintf_filtered (gdb_stdout, _("\
-Info catch not supported with this target/compiler combination.\n"));
-    }
-  else
-    {
-      /* Assume g++ compiled code; old GDB 4.16 behaviour.  */
-      print_frame_label_vars (get_selected_frame (_("No frame selected.")),
-			      0, gdb_stdout);
-    }
+  /* Assume g++ compiled code; old GDB 4.16 behaviour.  */
+  print_frame_label_vars (get_selected_frame (_("No frame selected.")),
+                          0, gdb_stdout);
 }
 
 static void
diff -r 862f19865777 gdb/target.c
--- a/gdb/target.c	Thu Dec 06 09:24:45 2007 -0800
+++ b/gdb/target.c	Thu Dec 06 15:48:33 2007 -0800
@@ -445,8 +445,6 @@ update_current_target (void)
       INHERIT (to_stop, t);
       /* Do not inherit to_xfer_partial.  */
       INHERIT (to_rcmd, t);
-      INHERIT (to_enable_exception_callback, t);
-      INHERIT (to_get_current_exception_event, t);
       INHERIT (to_pid_to_exec_file, t);
       INHERIT (to_stratum, t);
       INHERIT (to_has_all_memory, t);
@@ -624,12 +622,6 @@ update_current_target (void)
   de_fault (to_rcmd,
 	    (void (*) (char *, struct ui_file *))
 	    tcomplain);
-  de_fault (to_enable_exception_callback,
-	    (struct symtab_and_line * (*) (enum exception_event_kind, int))
-	    nosupport_runtime);
-  de_fault (to_get_current_exception_event,
-	    (struct exception_event_record * (*) (void))
-	    nosupport_runtime);
   de_fault (to_pid_to_exec_file,
 	    (char *(*) (int))
 	    return_zero);
@@ -2669,26 +2661,6 @@ debug_to_rcmd (char *command,
 {
   debug_target.to_rcmd (command, outbuf);
   fprintf_unfiltered (gdb_stdlog, "target_rcmd (%s, ...)\n", command);
-}
-
-static struct symtab_and_line *
-debug_to_enable_exception_callback (enum exception_event_kind kind, int enable)
-{
-  struct symtab_and_line *result;
-  result = debug_target.to_enable_exception_callback (kind, enable);
-  fprintf_unfiltered (gdb_stdlog,
-		      "target get_exception_callback_sal (%d, %d)\n",
-		      kind, enable);
-  return result;
-}
-
-static struct exception_event_record *
-debug_to_get_current_exception_event (void)
-{
-  struct exception_event_record *result;
-  result = debug_target.to_get_current_exception_event ();
-  fprintf_unfiltered (gdb_stdlog, "target get_current_exception_event ()\n");
-  return result;
 }
 
 static char *
@@ -2758,8 +2730,6 @@ setup_target_debug (void)
   current_target.to_find_new_threads = debug_to_find_new_threads;
   current_target.to_stop = debug_to_stop;
   current_target.to_rcmd = debug_to_rcmd;
-  current_target.to_enable_exception_callback = debug_to_enable_exception_callback;
-  current_target.to_get_current_exception_event = debug_to_get_current_exception_event;
   current_target.to_pid_to_exec_file = debug_to_pid_to_exec_file;
 }
 
diff -r 862f19865777 gdb/target.h
--- a/gdb/target.h	Thu Dec 06 09:24:45 2007 -0800
+++ b/gdb/target.h	Thu Dec 06 15:48:33 2007 -0800
@@ -399,10 +399,6 @@ struct target_ops
     char *(*to_extra_thread_info) (struct thread_info *);
     void (*to_stop) (void);
     void (*to_rcmd) (char *command, struct ui_file *output);
-    struct symtab_and_line *(*to_enable_exception_callback) (enum
-							     exception_event_kind,
-							     int);
-    struct exception_event_record *(*to_get_current_exception_event) (void);
     char *(*to_pid_to_exec_file) (int pid);
     enum strata to_stratum;
     int to_has_all_memory;
@@ -901,21 +897,6 @@ int target_follow_fork (int follow_child
      (*current_target.to_rcmd) (command, outbuf)
 
 
-/* Get the symbol information for a breakpointable routine called when
-   an exception event occurs.
-   Intended mainly for C++, and for those
-   platforms/implementations where such a callback mechanism is available,
-   e.g. HP-UX with ANSI C++ (aCC).  Some compilers (e.g. g++) support
-   different mechanisms for debugging exceptions.  */
-
-#define target_enable_exception_callback(kind, enable) \
-     (*current_target.to_enable_exception_callback) (kind, enable)
-
-/* Get the current exception event kind -- throw or catch, etc.  */
-
-#define target_get_current_exception_event() \
-     (*current_target.to_get_current_exception_event) ()
-
 /* Does the target include all of memory, or only part of it?  This
    determines whether we look up the target chain for other parts of
    memory if this target can't satisfy a request.  */
diff -r 862f19865777 gdb/testsuite/gdb.base/default.exp
--- a/gdb/testsuite/gdb.base/default.exp	Thu Dec 06 09:24:45 2007 -0800
+++ b/gdb/testsuite/gdb.base/default.exp	Thu Dec 06 21:58:59 2007 -0800
@@ -300,7 +300,7 @@ gdb_test "info bogus-gdb-command" "Undef
 #test info breakpoints
 gdb_test "info breakpoints" "No breakpoints or watchpoints." "info breakpoints"
 #test info catch
-gdb_test "info catch" "You can't do that without a process to debug." "info catch"
+gdb_test "info catch" "No frame selected." "info catch"
 #test info copying
 # FIXME -- doesn't work worth a shit
 #send_gdb "info copying"



More information about the Gdb-patches mailing list