OSDN Git Service

Remove unused support for target-based exception catching.
authorjimb <jimb>
Thu, 13 Dec 2007 02:00:04 +0000 (02:00 +0000)
committerjimb <jimb>
Thu, 13 Dec 2007 02:00:04 +0000 (02:00 +0000)
* 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/ChangeLog
gdb/breakpoint.c
gdb/breakpoint.h
gdb/inf-child.c
gdb/stack.c
gdb/target.c
gdb/target.h
gdb/testsuite/ChangeLog
gdb/testsuite/gdb.base/default.exp

index 4a89da3..e0428ed 100644 (file)
@@ -1,3 +1,38 @@
+2007-12-12  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.
+       
 2007-12-12  Nigel Stephens  <nigel@mips.com>
             Maciej W. Rozycki  <macro@mips.com>
 
index 26864d7..6c43fb1 100644 (file)
@@ -145,8 +145,6 @@ args_for_catchpoint_enable;
 
 static int watchpoint_check (void *);
 
-static int cover_target_enable_exception_callback (void *);
-
 static void maintenance_info_breakpoints (char *, int);
 
 static void create_longjmp_breakpoint (char *);
@@ -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)
@@ -1389,13 +1332,6 @@ update_breakpoints_after_exec (void)
        continue;
       }
 
-    /* Ditto the exception-handling catchpoints. */
-    if ((b->type == bp_catch_catch) || (b->type == bp_catch_throw))
-      {
-       delete_breakpoint (b);
-       continue;
-      }
-
     /* Don't delete an exec catchpoint, because else the inferior
        won't stop when it ought!
 
@@ -1631,16 +1567,6 @@ remove_breakpoint (struct bp_location *b, insertion_state_t is)
        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... */
 }
@@ -1895,14 +1819,6 @@ ep_is_shlib_catchpoint (struct breakpoint *ep)
     || (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 
 bpstat_free (bpstat bs)
 {
@@ -2255,68 +2171,6 @@ print_it_typical (bpstat bs)
       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:
     case bp_hardware_watchpoint:
       if (bs->old_val != NULL)
@@ -2778,9 +2632,7 @@ bpstat_stop_status (CORE_ADDR bp_addr, ptid_t ptid)
        && 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;
@@ -2854,10 +2706,6 @@ bpstat_stop_status (CORE_ADDR bp_addr, ptid_t ptid)
        && !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 */
 
     bs = bpstat_alloc (bl, bs);        /* Alloc a bpstat to explain stop */
@@ -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 ep_list, bpstat *cp_list)
       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 breakpoint *b,
     {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[] =
@@ -3675,28 +3507,6 @@ print_one_breakpoint_location (struct breakpoint *b,
          }
        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:
       case bp_hardware_breakpoint:
       case bp_until:
@@ -3885,8 +3695,6 @@ user_settable_breakpoint (const struct breakpoint *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 *bpt, enum bptype bp_type)
     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_call_start (void)
     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_call_stop (void)
     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 tempflag, int from_tty)
                                  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)
 {
@@ -6641,19 +6398,6 @@ catch_exception_command_1 (enum exception_event_kind ex_event, char *arg,
   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."));
 }
 
@@ -6736,23 +6480,6 @@ catch_assert_command (char *arg, int tempflag, int from_tty)
                                    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
 catch_command_1 (char *arg, int tempflag, int from_tty)
 {
@@ -7116,28 +6843,6 @@ delete_breakpoint (struct breakpoint *bpt)
   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_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:
@@ -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:
index 56b9a6e..21d69d3 100644 (file)
@@ -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. */
index da613d0..e3d0b68 100644 (file)
@@ -157,19 +157,6 @@ 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 *
 inf_child_pid_to_exec_file (int pid)
 {
@@ -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;
index c23529f..f09283f 100644 (file)
@@ -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
index c7461e2..e7e6798 100644 (file)
@@ -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_log_command, t);
       INHERIT (to_stratum, t);
@@ -625,12 +623,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);
@@ -2672,26 +2664,6 @@ debug_to_rcmd (char *command,
   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 *
 debug_to_pid_to_exec_file (int pid)
 {
@@ -2759,8 +2731,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;
 }
 \f
index cb8db9b..10fe04b 100644 (file)
@@ -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);
     void (*to_log_command) (const char *);
     enum strata to_stratum;
@@ -902,21 +898,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.  */
index 6ceb02f..5a7047a 100644 (file)
@@ -1,3 +1,7 @@
+2007-12-06  Jim Blandy  <jimb@codesourcery.com>
+
+       * gdb.base/default.exp: Update expected output for 'info catch'.
+
 2007-12-10  Jan Kratochvil  <jan.kratochvil@redhat.com>
 
        * lib/gdb.exp (build_id_debug_filename_get): OBJCOPY pipe being read
index 67afbf8..f40eab5 100644 (file)
@@ -300,7 +300,7 @@ gdb_test "info bogus-gdb-command" "Undefined info command: \"bogus-gdb-command\"
 #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"