[RFA/commit] Delete BPSTAT_WHAT_CHECK_SHLIBS_RESUME_FROM_HOOK

Joel Brobecker brobecker@adacore.com
Mon Nov 17 18:57:00 GMT 2008


Hello,

Another little cleanup of an enumerate that's not used. It looks like
it hasn't been used for a long time (I looked at 4.17, 5.0, 5.1, 5.3,
6.0, 6.3 and 6.4, and I couldn't find any code setting a variable to
this value - maybe 4.18?). I am guessing that this was related to
the shlib load/unload catchpoints.

2008-11-16  Joel Brobecker  <brobecker@adacore.com>

        Remove the unused BPSTAT_WHAT_CHECK_SHLIBS_RESUME_FROM_HOOK.

        * breakpoint.h (enum bpstat_what_main_action): Remove
        BPSTAT_WHAT_CHECK_SHLIBS_RESUME_FROM_HOOK.
        * breakpoint.c (bpstat_what): Delete catch_shlib_event from enum class.
        Remove the BPSTAT_WHAT_CHECK_SHLIBS_RESUME_FROM_HOOK column from
        variable table.
        * infrun.c (wait_for_inferior): Remove handling of
        BPSTAT_WHAT_CHECK_SHLIBS_RESUME_FROM_HOOK.

Tested on x86-linux. No regression.
The reason I'm not committing this patch now is that I wouldn't mind
a second pair of eyes if anyone has the time.  I did this late yesterday
night, and I'm pretty sure I didn't screw up the table in bpstat_what.
But you never know.

Anyway, will commit sometime next week unless there are objections.

-- 
Joel
-------------- next part --------------
diff --git a/gdb/breakpoint.h b/gdb/breakpoint.h
--- a/gdb/breakpoint.h
+++ b/gdb/breakpoint.h
@@ -519,10 +519,6 @@ enum bpstat_what_main_action
        keep checking.  */
     BPSTAT_WHAT_CHECK_SHLIBS,
 
-    /* Check the dynamic linker's data structures for new libraries, then
-       resume out of the dynamic linker's callback, stop and print.  */
-    BPSTAT_WHAT_CHECK_SHLIBS_RESUME_FROM_HOOK,
-
     /* This is just used to keep track of how many enums there are.  */
     BPSTAT_WHAT_LAST
   };
diff --git a/gdb/breakpoint.c b/gdb/breakpoint.c
--- a/gdb/breakpoint.c
+++ b/gdb/breakpoint.c
@@ -3107,9 +3107,6 @@ bpstat_what (bpstat bs)
       /* We hit the shared library event breakpoint.  */
       shlib_event,
 
-      /* We caught a shared library event.  */
-      catch_shlib_event,
-
       /* This is just used to count how many enums there are.  */
       class_last
     };
@@ -3125,7 +3122,6 @@ bpstat_what (bpstat bs)
 #define clr BPSTAT_WHAT_CLEAR_LONGJMP_RESUME
 #define sr BPSTAT_WHAT_STEP_RESUME
 #define shl BPSTAT_WHAT_CHECK_SHLIBS
-#define shlr BPSTAT_WHAT_CHECK_SHLIBS_RESUME_FROM_HOOK
 
 /* "Can't happen."  Might want to print an error message.
    abort() is not out of the question, but chances are GDB is just
@@ -3146,14 +3142,13 @@ bpstat_what (bpstat bs)
      back and decide something of a lower priority is better.  The
      ordering is:
 
-     kc   < clr sgl shl shlr slr sn sr ss
-     sgl  < shl shlr slr sn sr ss
-     slr  < err shl shlr sn sr ss
-     clr  < err shl shlr sn sr ss
-     ss   < shl shlr sn sr
-     sn   < shl shlr sr
-     shl  < shlr sr
-     shlr < sr
+     kc   < clr sgl shl slr sn sr ss
+     sgl  < shl slr sn sr ss
+     slr  < err shl sn sr ss
+     clr  < err shl sn sr ss
+     ss   < shl sn sr
+     sn   < shl sr
+     shl  < sr
      sr   <
 
      What I think this means is that we don't need a damned table
@@ -3170,30 +3165,28 @@ bpstat_what (bpstat bs)
     table[(int) class_last][(int) BPSTAT_WHAT_LAST] =
   {
   /*                              old action */
-  /*       kc    ss    sn    sgl    slr   clr   sr   shl   shlr
+  /*       kc    ss    sn    sgl    slr   clr   sr   shl
    */
 /*no_effect */
-    {kc, ss, sn, sgl, slr, clr, sr, shl, shlr},
+    {kc, ss, sn, sgl, slr, clr, sr, shl},
 /*wp_silent */
-    {ss, ss, sn, ss, ss, ss, sr, shl, shlr},
+    {ss, ss, sn, ss, ss, ss, sr, shl},
 /*wp_noisy */
-    {sn, sn, sn, sn, sn, sn, sr, shl, shlr},
+    {sn, sn, sn, sn, sn, sn, sr, shl},
 /*bp_nostop */
-    {sgl, ss, sn, sgl, slr, slr, sr, shl, shlr},
+    {sgl, ss, sn, sgl, slr, slr, sr, shl},
 /*bp_silent */
-    {ss, ss, sn, ss, ss, ss, sr, shl, shlr},
+    {ss, ss, sn, ss, ss, ss, sr, shl},
 /*bp_noisy */
-    {sn, sn, sn, sn, sn, sn, sr, shl, shlr},
+    {sn, sn, sn, sn, sn, sn, sr, shl},
 /*long_jump */
-    {slr, ss, sn, slr, slr, err, sr, shl, shlr},
+    {slr, ss, sn, slr, slr, err, sr, shl},
 /*long_resume */
-    {clr, ss, sn, err, err, err, sr, shl, shlr},
+    {clr, ss, sn, err, err, err, sr, shl},
 /*step_resume */
-    {sr, sr, sr, sr, sr, sr, sr, sr, sr},
+    {sr, sr, sr, sr, sr, sr, sr, sr},
 /*shlib */
-    {shl, shl, shl, shl, shl, shl, sr, shl, shlr},
-/*catch_shlib */
-    {shlr, shlr, shlr, shlr, shlr, shlr, sr, shlr, shlr}
+    {shl, shl, shl, shl, shl, shl, sr, shl}
   };
 
 #undef kc
@@ -3206,7 +3199,6 @@ bpstat_what (bpstat bs)
 #undef sr
 #undef ts
 #undef shl
-#undef shlr
   enum bpstat_what_main_action current_action = BPSTAT_WHAT_KEEP_CHECKING;
   struct bpstat_what retval;
 
diff --git a/gdb/infrun.c b/gdb/infrun.c
--- a/gdb/infrun.c
+++ b/gdb/infrun.c
@@ -3121,7 +3121,6 @@ infrun: BPSTAT_WHAT_SET_LONGJMP_RESUME (
 	break;
 
       case BPSTAT_WHAT_CHECK_SHLIBS:
-      case BPSTAT_WHAT_CHECK_SHLIBS_RESUME_FROM_HOOK:
 	{
           if (debug_infrun)
 	    fprintf_unfiltered (gdb_stdlog, "infrun: BPSTAT_WHAT_CHECK_SHLIBS\n");


More information about the Gdb-patches mailing list