From: Hui Zhu <teawater@gmail.com>
To: Tom Tromey <tromey@redhat.com>
Cc: gdb-patches ml <gdb-patches@sourceware.org>
Subject: Re: [PATCH] Let dprintf can be saved
Date: Mon, 22 Apr 2013 00:24:00 -0000 [thread overview]
Message-ID: <CANFwon2zciiZg=Zes7D-XB5YBN3JhWCUtQay6eyx_SLdRZ45Jw@mail.gmail.com> (raw)
In-Reply-To: <CANFwon0Hu6zqh_Ro5T_=Fxm-A0HyqyRkOp8RC-3MEVMOJh2hOg@mail.gmail.com>
[-- Attachment #1: Type: text/plain, Size: 1034 bytes --]
Hi,
This is patch add test for dprintf to save-bp.exp.
Thanks,
Hui
2013-04-20 Hui Zhu <hui@codesourcery.com>
PR gdb/15165
* gdb.base/save-bp.exp: Add test for dprintf.
On Sat, Apr 20, 2013 at 3:04 PM, Hui Zhu <teawater@gmail.com> wrote:
> On Sat, Apr 20, 2013 at 12:34 AM, Tom Tromey <tromey@redhat.com> wrote:
>>>>>>> "Hui" == Hui Zhu <teawater@gmail.com> writes:
>>
>> Hui> +static void
>> Hui> +dprintf_print_recreate (struct breakpoint *tp, struct ui_file *fp)
>>
>> This needs a short introductory comment.
>> See the other print_recreate methods for examples.
>
> Fixed.
>
>>
>> I think this patch could use a test case.
>> It could be added wherever the existing "save" tests live.
>
> OK. I will post a patch for it later.
>
> Thanks,
> Hui
>
>>
>> Tom
>
> 2013-04-18 Hui Zhu <hui@codesourcery.com>
>
> PR gdb/15165
>
> * breakpoint.c (dprintf_print_recreate): New.
> (save_breakpoints): Let it not save dprintf commands.
> (initialize_breakpoint_ops): Set dprintf_print_recreate.
[-- Attachment #2: dprintf-save-test.txt --]
[-- Type: text/plain, Size: 1566 bytes --]
--- a/gdb/testsuite/gdb.base/save-bp.exp
+++ b/gdb/testsuite/gdb.base/save-bp.exp
@@ -46,6 +46,8 @@ set loc_bp5 [gdb_get_line_number "with c
gdb_breakpoint ${srcfile}:${loc_bp5}
gdb_test "commands\nsilent\nend" "End with.*" "add breakpoint commands"
+gdb_test "dprintf ${srcfile}:${loc_bp5},\"At foo entry\\n\"" "Dprintf .*"
+
# Now, save the breakpoints into a file...
remote_file host delete "bps"
gdb_test "save breakpoint bps"
@@ -65,5 +67,6 @@ gdb_test "source bps"
# Now, verify that all breakpoints have been created correctly...
set bp_row_start "\[0-9\]+ +breakpoint +keep +y +0x\[0-9a-f\]+ +in"
+set dprintf_row_start "\[0-9\]+ +dprintf +keep +y +0x\[0-9a-f\]+ +in"
gdb_test "info break" \
- " *Num +Type +Disp +Enb +Address +What\r\n$bp_row_start break_me at .*$srcfile:\[0-9\]+\r\n$bp_row_start main at .*$srcfile:$loc_bp2\r\n$bp_row_start main at .*$srcfile:$loc_bp3 +thread 1\r\n\[ \t]+stop only in thread 1\r\n$bp_row_start main at .*$srcfile:$loc_bp4\r\n\[ \t\]+stop only if i == 1( \\((host|target) evals\\))?\r\n$bp_row_start main at .*$srcfile:$loc_bp5\r\n\[ \t\]+silent"
+ " *Num +Type +Disp +Enb +Address +What\r\n$bp_row_start break_me at .*$srcfile:\[0-9\]+\r\n$bp_row_start main at .*$srcfile:$loc_bp2\r\n$bp_row_start main at .*$srcfile:$loc_bp3 +thread 1\r\n\[ \t]+stop only in thread 1\r\n$bp_row_start main at .*$srcfile:$loc_bp4\r\n\[ \t\]+stop only if i == 1( \\((host|target) evals\\))?\r\n$bp_row_start main at .*$srcfile:$loc_bp5\r\n\[ \t\]+silent\r\n$dprintf_row_start main at .*$srcfile:$loc_bp5\r\n\[ \t\]+printf.*"
next prev parent reply other threads:[~2013-04-20 7:38 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-04-18 17:04 Hui Zhu
2013-04-19 18:33 ` Tom Tromey
2013-04-19 18:36 ` Keith Seitz
2013-04-22 0:19 ` Hui Zhu
2013-04-22 0:24 ` Hui Zhu [this message]
2013-04-22 23:26 ` Tom Tromey
2013-04-23 16:53 ` Hui Zhu
2013-04-24 14:34 ` Joel Brobecker
2013-04-24 14:35 ` Hui Zhu
2013-04-22 23:47 ` Tom Tromey
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='CANFwon2zciiZg=Zes7D-XB5YBN3JhWCUtQay6eyx_SLdRZ45Jw@mail.gmail.com' \
--to=teawater@gmail.com \
--cc=gdb-patches@sourceware.org \
--cc=tromey@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