Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* Pending breakpoints & ignore
@ 2004-04-16  1:07 Jim Ingham
  2004-05-05 14:55 ` Andrew Cagney
  0 siblings, 1 reply; 4+ messages in thread
From: Jim Ingham @ 2004-04-16  1:07 UTC (permalink / raw)
  To: gdb-patches

Oh, yes, one more thing.  We probably need to copy the ignore count and 
thread over from the pended breakpoint to the actual breakpoint.  This 
should work:

(gdb) break SomeNotLoadedFunction
(gdb) ignore $bpnum 5

but it doesn't right now.

Like:

2004-04-15  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.

Index: breakpoint.c
===================================================================
RCS file: /cvs/src/src/gdb/breakpoint.c,v
retrieving revision 1.166
diff -p -p -r1.166 breakpoint.c
*** breakpoint.c        8 Apr 2004 21:18:12 -0000       1.166
--- breakpoint.c        16 Apr 2004 01:02:00 -0000
*************** create_breakpoints (struct symtabs_and_l
*** 4937,4942 ****
--- 4937,4946 ----
                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);
         }

Jim
--
Jim Ingham                                   jingham@apple.com
Developer Tools
Apple Computer


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

* Re: Pending breakpoints & ignore
  2004-04-16  1:07 Pending breakpoints & ignore Jim Ingham
@ 2004-05-05 14:55 ` Andrew Cagney
  2004-05-05 18:27   ` Jim Ingham
  0 siblings, 1 reply; 4+ messages in thread
From: Andrew Cagney @ 2004-05-05 14:55 UTC (permalink / raw)
  To: Jim Ingham; +Cc: gdb-patches

> 
> (gdb) break SomeNotLoadedFunction
> (gdb) ignore $bpnum 5
> 
> but it doesn't right now.
> 
> Like:
> 
> 2004-04-15  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.

Yes, oops.  Can you add an addition to pending.exp - at least to test 
the ignore count?

Andrew



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

* Re: Pending breakpoints & ignore
  2004-05-05 14:55 ` Andrew Cagney
@ 2004-05-05 18:27   ` Jim Ingham
  2004-05-05 20:20     ` Andrew Cagney
  0 siblings, 1 reply; 4+ messages in thread
From: Jim Ingham @ 2004-05-05 18:27 UTC (permalink / raw)
  To: Andrew Cagney; +Cc: gdb-patches

Andrew,

Yeah, I am happy to do the ignore count, I will leave it to more daring 
folks to do the thread one...  How 'bout:

ChangeLog:

2004-04-27  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.

testsuite/ChangeLog:

2004-04-27  Jim Ingham  <jingham@apple.com>

         * gdb.base/pending.exp: Make sure pending breakpoints
         preserve the ignore count.


Index: breakpoint.c
===================================================================
RCS file: /cvs/src/src/gdb/breakpoint.c,v
retrieving revision 1.170
diff -p -r1.170 breakpoint.c
*** breakpoint.c        2 May 2004 00:21:41 -0000       1.170
--- breakpoint.c        5 May 2004 18:24:41 -0000
*************** create_breakpoints (struct symtabs_and_l
*** 4948,4953 ****
--- 4948,4957 ----
                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: testsuite/gdb.base/pending.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.base/pending.exp,v
retrieving revision 1.3
diff -p -r1.3 pending.exp
*** testsuite/gdb.base/pending.exp      23 Feb 2004 19:27:46 -0000      
1.3
--- testsuite/gdb.base/pending.exp      5 May 2004 18:18:30 -0000
*************** gdb_test "info break" \
*** 207,212 ****
--- 207,237 ----
   \[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
   #
*************** gdb_test "continue" \
*** 239,244 ****
--- 264,282 ----
   \[$\]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"

This patch will cause a bunch of failures in the unpatched gdb, because 
you will hit the breakpoint you should have ignored right away, and the 
rest of the tests will go south from there...  But this is the simplest 
way to write the test.

Is this okay to check in?

Jim

On May 5, 2004, at 7:54 AM, Andrew Cagney wrote:

>> (gdb) break SomeNotLoadedFunction
>> (gdb) ignore $bpnum 5
>> but it doesn't right now.
>> Like:
>> 2004-04-15  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.
>
> Yes, oops.  Can you add an addition to pending.exp - at least to test 
> the ignore count?
>
> Andrew
>
>
>
--
Jim Ingham                                   jingham@apple.com
Developer Tools
Apple Computer


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

* Re: Pending breakpoints & ignore
  2004-05-05 18:27   ` Jim Ingham
@ 2004-05-05 20:20     ` Andrew Cagney
  0 siblings, 0 replies; 4+ messages in thread
From: Andrew Cagney @ 2004-05-05 20:20 UTC (permalink / raw)
  To: Jim Ingham; +Cc: gdb-patches

> Andrew,
> 
> Yeah, I am happy to do the ignore count, I will leave it to more daring folks to do the thread one...  How 'bout:

(I figured that).  Yep, thanks.

Andrew

> ChangeLog:
> 
> 2004-04-27  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.
> 
> testsuite/ChangeLog:
> 
> 2004-04-27  Jim Ingham  <jingham@apple.com>
> 
>         * gdb.base/pending.exp: Make sure pending breakpoints
>         preserve the ignore count. 



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

end of thread, other threads:[~2004-05-05 20:20 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-04-16  1:07 Pending breakpoints & ignore Jim Ingham
2004-05-05 14:55 ` Andrew Cagney
2004-05-05 18:27   ` Jim Ingham
2004-05-05 20:20     ` Andrew Cagney

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