Preserve the ignore count when we resolve a pending breakpoint. Also add
authorJim Ingham <jingham@apple.com>
Wed, 5 May 2004 21:18:11 +0000 (21:18 +0000)
committerJim Ingham <jingham@apple.com>
Wed, 5 May 2004 21:18:11 +0000 (21:18 +0000)
a test for this to pending.exp.

gdb/ChangeLog
gdb/breakpoint.c
gdb/testsuite/ChangeLog
gdb/testsuite/gdb.base/pending.exp

index d1b41015b0128a78b784eccfd529b352420f57ed..7f85ab2c86ae5e6469e7a39d34b1c0c749345173 100644 (file)
@@ -1,3 +1,9 @@
+2004-05-05  Jim Ingham  <jingham@apple.com>
+       
+       * breakpoint.c (create_breakpoints): Copy the ignore count and
+       thread id over from the pended breakpoint to the actual
+       breakpoint.
+       
 2004-05-05  Andrew Cagney  <cagney@redhat.com>
 
        * gdbarch.sh (PARM_BOUNDARY): Delete.
index 0fd4d23e41c1f9d6a313082a1ff5561281b3a495..650ea2a108f25568d30c891c87bfa515b95bf04f 100644 (file)
@@ -4948,6 +4948,10 @@ create_breakpoints (struct symtabs_and_lines sals, char **addr_string,
               be copied too.  */
            if (pending_bp->commands)
              b->commands = copy_command_lines (pending_bp->commands);
+           
+           /* We have to copy over the ignore_count and thread as well.  */
+           b->ignore_count = pending_bp->ignore_count;
+           b->thread = pending_bp->thread;
          }
        mention (b);
       }
index 40a0cf268ed25707d52a0820b1db7fe2b067f858..6def1a4ca53fef9d2f8009652479f56ddc4bd7a3 100644 (file)
@@ -1,3 +1,8 @@
+2004-05-05  Jim Ingham  <jingham@apple.com>
+
+       * gdb.base/pending.exp: Make sure pending breakpoints
+       preserve the ignore count.
+       
 2004-04-27  Jerome Guitton  <guitton@gnat.com>
 
        * i386-prologue.exp: Add testcase for jump instruction as first
index 315e544ee743ad87b9d1965e660871b6f6901121..9bc08020e8964e1f9898b8811e0227ab6fd76482 100644 (file)
@@ -207,6 +207,31 @@ gdb_test "info break" \
 \[0-9\]+\[\t \]+breakpoint     keep y.*PENDING.*pendshr.c:26 if x > 3.*" \
 "multiple pending breakpoints"
 
+
+#
+# Try a pending break for a line in a source file with ignore count:
+#
+
+gdb_test_multiple "break pendshr.c:27" "Set pending breakpoint 3" {
+     -re ".*Make breakpoint pending.*y or \\\[n\\\]. $" {
+           gdb_test "y" "Breakpoint.*pendshr.c:27.*pending." \
+               "Set pending breakpoint 3"
+     }
+}
+
+gdb_test {ignore $bpnum 2} "Will ignore next 2 crossings of breakpoint .*" \
+    "set ignore count on pending breakpoint 3"
+
+gdb_test "info break" \
+    "Num Type\[ \]+Disp Enb Address\[ \]+What.*
+\[0-9\]+\[\t \]+breakpoint     keep n.*PENDING.*pendfunc1.*
+\[\t \]+stop only if k == 1.*
+\[\t \]+print k.*
+\[0-9\]+\[\t \]+breakpoint     keep y.* in main at .*$srcfile:$mainline.*
+\[0-9\]+\[\t \]+breakpoint     keep y.*PENDING.*pendshr.c:26 if x > 3.*
+\[0-9\]+\[\t \]+breakpoint     keep y.*PENDING.*pendshr.c:27.*ignore next 2 hits.*" \
+"multiple pending breakpoints 2"
+
 #
 # Run to main which should resolve a pending breakpoint
 #
@@ -239,6 +264,19 @@ gdb_test "continue" \
 \[$\]1 = 1." \
 "continue to resolved breakpoint 1"
 
+#
+# Disable the other two breakpoints, and continue to the one with
+# the ignore count.  Make sure you hit it the third time, x should
+# be 3 then.
+#
+
+gdb_test "disable 7" "" "Disable other breakpoints"
+gdb_test "disable 5" "" "Disable other breakpoints"
+
+gdb_test "continue" \
+       {.*Breakpoint.*pendfunc1.*\(x=3\) at.*pendshr.c:27.*printf.*;} \
+"continue to resolved breakpoint 3"
+
 delete_breakpoints
 
 gdb_breakpoint "main"
@@ -259,6 +297,7 @@ gdb_test_multiple "break imaginary" "set imaginary pending breakpoint" {
 #
 
 rerun_to_main
+
 gdb_test "info break" \
     "Num Type\[ \]+Disp Enb Address\[ \]+What.*
 \[0-9\]+\[\t \]+breakpoint     keep y.* in main at .*$srcfile:$mainline.*