* [PATCH] Fix bug 15293 Ignore-count does not work properly with dprintf
@ 2013-04-19 14:31 Hui Zhu
2013-04-19 18:40 ` Tom Tromey
0 siblings, 1 reply; 7+ messages in thread
From: Hui Zhu @ 2013-04-19 14:31 UTC (permalink / raw)
To: gdb-patches ml
[-- 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"
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] Fix bug 15293 Ignore-count does not work properly with dprintf
2013-04-19 14:31 [PATCH] Fix bug 15293 Ignore-count does not work properly with dprintf Hui Zhu
@ 2013-04-19 18:40 ` Tom Tromey
2013-04-22 6:19 ` Hui Zhu
0 siblings, 1 reply; 7+ messages in thread
From: Tom Tromey @ 2013-04-19 18:40 UTC (permalink / raw)
To: Hui Zhu; +Cc: gdb-patches ml
>>>>> "Hui" == Hui Zhu <teawater@gmail.com> writes:
Hui> This patch fix http://sourceware.org/bugzilla/show_bug.cgi?id=15293
Hui> Also I update dprintf.exp for this bug.
Hui> Please help me review it.
After this patch, "ignore" doesn't cause the program to stop -- this
part seems correct.
But it seems to me that "ignore" should make the "dprintf" not print
anything at all. Otherwise, what is being ignored?
Hui> +gdb_test "ignore \$bpnum 1" ".*Will ignore next crossing of breakpoint.*"
I was surprised to find that this didn't interfere with the "info break"
test later on.
Tom
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] Fix bug 15293 Ignore-count does not work properly with dprintf
2013-04-19 18:40 ` Tom Tromey
@ 2013-04-22 6:19 ` Hui Zhu
2013-04-22 23:53 ` Tom Tromey
0 siblings, 1 reply; 7+ messages in thread
From: Hui Zhu @ 2013-04-22 6:19 UTC (permalink / raw)
To: Tom Tromey; +Cc: gdb-patches ml
On Sat, Apr 20, 2013 at 12:53 AM, Tom Tromey <tromey@redhat.com> wrote:
>>>>>> "Hui" == Hui Zhu <teawater@gmail.com> writes:
>
> Hui> This patch fix http://sourceware.org/bugzilla/show_bug.cgi?id=15293
> Hui> Also I update dprintf.exp for this bug.
> Hui> Please help me review it.
>
> After this patch, "ignore" doesn't cause the program to stop -- this
> part seems correct.
>
> But it seems to me that "ignore" should make the "dprintf" not print
> anything at all. Otherwise, what is being ignored?
If dprintf is not ignore, it will stop, print and continue.
If ignore, it will not stop. So it will not print anything.
>
> Hui> +gdb_test "ignore \$bpnum 1" ".*Will ignore next crossing of breakpoint.*"
>
> I was surprised to find that this didn't interfere with the "info break"
> test later on.
Because after breakpoint pass this ignore, it will not show in "info break"
>
> Tom
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] Fix bug 15293 Ignore-count does not work properly with dprintf
2013-04-22 6:19 ` Hui Zhu
@ 2013-04-22 23:53 ` Tom Tromey
2013-04-23 17:13 ` Hui Zhu
0 siblings, 1 reply; 7+ messages in thread
From: Tom Tromey @ 2013-04-22 23:53 UTC (permalink / raw)
To: Hui Zhu; +Cc: gdb-patches ml
>> But it seems to me that "ignore" should make the "dprintf" not print
>> anything at all. Otherwise, what is being ignored?
Hui> If dprintf is not ignore, it will stop, print and continue.
Hui> If ignore, it will not stop. So it will not print anything.
Ok, I see.
The first time I tried it I think I must have misread the output.
Hui> Because after breakpoint pass this ignore, it will not show in "info break"
Ok, thanks.
The patch is ok.
Tom
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] Fix bug 15293 Ignore-count does not work properly with dprintf
2013-04-22 23:53 ` Tom Tromey
@ 2013-04-23 17:13 ` Hui Zhu
2013-04-25 12:24 ` Tom Tromey
0 siblings, 1 reply; 7+ messages in thread
From: Hui Zhu @ 2013-04-23 17:13 UTC (permalink / raw)
To: Tom Tromey; +Cc: gdb-patches ml
On Tue, Apr 23, 2013 at 12:10 AM, Tom Tromey <tromey@redhat.com> wrote:
>>> But it seems to me that "ignore" should make the "dprintf" not print
>>> anything at all. Otherwise, what is being ignored?
>
> Hui> If dprintf is not ignore, it will stop, print and continue.
> Hui> If ignore, it will not stop. So it will not print anything.
>
> Ok, I see.
> The first time I tried it I think I must have misread the output.
>
> Hui> Because after breakpoint pass this ignore, it will not show in "info break"
>
> Ok, thanks.
>
> The patch is ok.
>
> Tom
Checked in to http://sourceware.org/ml/gdb-cvs/2013-04/msg00222.html
Can I check in this patch to 7.6 branch.
Thanks,
Hui
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] Fix bug 15293 Ignore-count does not work properly with dprintf
2013-04-23 17:13 ` Hui Zhu
@ 2013-04-25 12:24 ` Tom Tromey
2013-04-25 13:49 ` Hui Zhu
0 siblings, 1 reply; 7+ messages in thread
From: Tom Tromey @ 2013-04-25 12:24 UTC (permalink / raw)
To: Hui Zhu; +Cc: gdb-patches ml
>>>>> "Hui" == Hui Zhu <teawater@gmail.com> writes:
Hui> Checked in to http://sourceware.org/ml/gdb-cvs/2013-04/msg00222.html
Hui> Can I check in this patch to 7.6 branch.
Sure.
Tom
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] Fix bug 15293 Ignore-count does not work properly with dprintf
2013-04-25 12:24 ` Tom Tromey
@ 2013-04-25 13:49 ` Hui Zhu
0 siblings, 0 replies; 7+ messages in thread
From: Hui Zhu @ 2013-04-25 13:49 UTC (permalink / raw)
To: Tom Tromey; +Cc: gdb-patches ml
On Thu, Apr 25, 2013 at 4:53 AM, Tom Tromey <tromey@redhat.com> wrote:
>>>>>> "Hui" == Hui Zhu <teawater@gmail.com> writes:
>
> Hui> Checked in to http://sourceware.org/ml/gdb-cvs/2013-04/msg00222.html
>
> Hui> Can I check in this patch to 7.6 branch.
>
> Sure.
Checked in http://www.sourceware.org/ml/gdb-cvs/2013-04/msg00233.html
Thanks,
Hui
>
> Tom
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2013-04-25 1:47 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-04-19 14:31 [PATCH] Fix bug 15293 Ignore-count does not work properly with dprintf Hui Zhu
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
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox