Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Hui Zhu <teawater@gmail.com>
To: gdb-patches ml <gdb-patches@sourceware.org>
Subject: [PATCH] Fix bug 15293 Ignore-count does not work properly with dprintf
Date: Fri, 19 Apr 2013 14:31:00 -0000	[thread overview]
Message-ID: <CANFwon3vZ_AyasT=aLvbxS3zBA-AES5Ed3sXkAEvC-Xw+6Yj2w@mail.gmail.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 390 bytes --]

Hi,

This patch fix http://sourceware.org/bugzilla/show_bug.cgi?id=15293

Also I update dprintf.exp for this bug.

Please help me review it.

Thanks,
Hui

2013-04-19  Hui Zhu  <hui@codesourcery.com>

	PR gdb/15293

	* breakpoint.c (bpstat_what): Add BPSTAT_WHAT_SINGLE to bp_dprintf.

2013-04-19  Hui Zhu  <hui@codesourcery.com>

	PR gdb/15293

	* gdb.base/dprintf.exp: Add ignore command.

[-- Attachment #2: dprintf-ignore.txt --]
[-- Type: text/plain, Size: 309 bytes --]

--- a/gdb/breakpoint.c
+++ b/gdb/breakpoint.c
@@ -5529,7 +5529,10 @@ bpstat_what (bpstat bs_head)
 	  break;
 
 	case bp_dprintf:
-	  this_action = BPSTAT_WHAT_STOP_SILENT;
+	  if (bs->stop)
+	    this_action = BPSTAT_WHAT_STOP_SILENT;
+	  else
+	    this_action = BPSTAT_WHAT_SINGLE;
 	  break;
 
 	default:

[-- Attachment #3: dprintf-ignore-test.txt --]
[-- Type: text/plain, Size: 620 bytes --]

--- a/gdb/testsuite/gdb.base/dprintf.exp
+++ b/gdb/testsuite/gdb.base/dprintf.exp
@@ -40,6 +40,8 @@ gdb_breakpoint "main"
 gdb_test "dprintf foo,\"At foo entry\\n\"" \
   "Dprintf .*"
 
+gdb_test "ignore \$bpnum 1" ".*Will ignore next crossing of breakpoint.*"
+
 gdb_test "dprintf $dp_location1,\"arg=%d, g=%d\\n\", arg, g" \
   "Dprintf .*"
 
@@ -61,7 +63,7 @@ gdb_run_cmd
 
 gdb_test "" "Breakpoint"
 
-gdb_test "continue" "At foo entry.*arg=1234, g=1234.*" "1st dprintf, gdb"
+gdb_test "continue" "arg=1234, g=1234.*" "1st dprintf, gdb"
 
 gdb_test "continue" "At foo entry.*arg=1235, g=2222.*" "2nd dprintf, gdb"
 

             reply	other threads:[~2013-04-19  9:43 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-04-19 14:31 Hui Zhu [this message]
2013-04-19 18:40 ` Tom Tromey
2013-04-22  6:19   ` Hui Zhu
2013-04-22 23:53     ` Tom Tromey
2013-04-23 17:13       ` Hui Zhu
2013-04-25 12:24         ` Tom Tromey
2013-04-25 13:49           ` Hui Zhu

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='CANFwon3vZ_AyasT=aLvbxS3zBA-AES5Ed3sXkAEvC-Xw+6Yj2w@mail.gmail.com' \
    --to=teawater@gmail.com \
    --cc=gdb-patches@sourceware.org \
    /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