Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Jim Ingham <jingham@apple.com>
To: Andrew Cagney <cagney@gnu.org>
Cc: gdb-patches@sources.redhat.com
Subject: Re: Pending breakpoints & ignore
Date: Wed, 05 May 2004 18:27:00 -0000	[thread overview]
Message-ID: <F8C71699-9EC1-11D8-9DB9-000A958F4C44@apple.com> (raw)
In-Reply-To: <40990042.6090405@gnu.org>

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


  reply	other threads:[~2004-05-05 18:27 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-04-16  1:07 Jim Ingham
2004-05-05 14:55 ` Andrew Cagney
2004-05-05 18:27   ` Jim Ingham [this message]
2004-05-05 20:20     ` Andrew Cagney

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=F8C71699-9EC1-11D8-9DB9-000A958F4C44@apple.com \
    --to=jingham@apple.com \
    --cc=cagney@gnu.org \
    --cc=gdb-patches@sources.redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox