From: Yao Qi <yao@codesourcery.com>
To: <gdb-patches@sourceware.org>
Subject: [PATCH 1/3] Test of breakpoint output for dprintf
Date: Wed, 12 Dec 2012 04:13:00 -0000 [thread overview]
Message-ID: <1355285581-28889-2-git-send-email-yao@codesourcery.com> (raw)
In-Reply-To: <1355285581-28889-1-git-send-email-yao@codesourcery.com>
Hi,
We don't have a test to check the output of 'info breakpoints' and fields
in "=breakpoint-created" notificiation, which are all related to
'print_one_breakpoint_location'. This patch adds tests for dprintf.
Is it OK?
gdb/testsuite:
2012-12-12 Yao Qi <yao@codesourcery.com>
* gdb.base/dprintf.exp: Check the output of 'info breakpoints' for
dprintf.
* gdb.mi/mi-breakpoint-changed.exp (test_insert_delete_modify):
Check the fields in "=breakpoint-created" for dprintf.
---
gdb/testsuite/gdb.base/dprintf.exp | 13 +++++++++++++
gdb/testsuite/gdb.mi/mi-breakpoint-changed.exp | 2 +-
2 files changed, 14 insertions(+), 1 deletions(-)
diff --git a/gdb/testsuite/gdb.base/dprintf.exp b/gdb/testsuite/gdb.base/dprintf.exp
index bd0615b..979ceaf 100644
--- a/gdb/testsuite/gdb.base/dprintf.exp
+++ b/gdb/testsuite/gdb.base/dprintf.exp
@@ -43,6 +43,13 @@ gdb_test "dprintf foo,\"At foo entry\\n\"" \
gdb_test "dprintf $dp_location1,\"arg=%d, g=%d\\n\", arg, g" \
"Dprintf .*"
+gdb_test "info breakpoints" "3\[\t \]+dprintf .*
+\[\t \]+printf \"At foo entry\\\\n\".
+\[\t \]+continue.
+4\[\t \]+dprintf .*
+\[\t \]+printf \"arg=%d, g=%d\\\\n\", arg, g.
+\[\t \]+continue." "dprintf info 1"
+
gdb_test "break $bp_location1" \
"Breakpoint .*"
@@ -107,6 +114,12 @@ if $target_can_dprintf {
gdb_test "continue" "Breakpoint \[0-9\]+, foo .*" "2nd dprintf, agent"
+ gdb_test "info breakpoints" "3\[\t \]+dprintf .*
+\[\t \]+breakpoint already hit 2 times.
+\[\t \]+agent-printf \"At foo entry\\\\n\".
+4\[\t \]+dprintf .*
+\[\t \]+breakpoint already hit 2 times.
+\[\t \]+agent-printf \"arg=%d, g=%d\\\\n\", arg, g.*" "info dprintf 2"
}
gdb_test "set dprintf-style foobar" "Undefined item: \"foobar\"." \
diff --git a/gdb/testsuite/gdb.mi/mi-breakpoint-changed.exp b/gdb/testsuite/gdb.mi/mi-breakpoint-changed.exp
index ec10032..df6101c 100644
--- a/gdb/testsuite/gdb.mi/mi-breakpoint-changed.exp
+++ b/gdb/testsuite/gdb.mi/mi-breakpoint-changed.exp
@@ -96,7 +96,7 @@ proc test_insert_delete_modify { } {
$test
set test "dprintf marker, \"arg\" \""
mi_gdb_test $test \
- {.*=breakpoint-created,bkpt=\{number="6",type="dprintf".*\}.*\n\^done} \
+ {.*=breakpoint-created,bkpt=\{number="6",type="dprintf".*,script=\{\"printf \\\\\"arg\\\\\" \\\\\"\",\"continue\"\}.*\}\r\n\^done} \
$test
# 2. when modifying condition
--
1.7.7.6
next prev parent reply other threads:[~2012-12-12 4:13 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-12-12 4:13 [PATCH 0/3] dprintf tweaks Yao Qi
2012-12-12 4:13 ` Yao Qi [this message]
2013-01-09 20:35 ` [PATCH 1/3] Test of breakpoint output for dprintf Tom Tromey
2013-01-10 5:43 ` Joel Brobecker
2013-01-10 14:53 ` Yao Qi
2013-01-10 14:55 ` Tom Tromey
2013-01-11 15:22 ` [obv] Fix new FAIL on 64-bit targets [Re: [PATCH 1/3] Test of breakpoint output for dprintf] Jan Kratochvil
2012-12-12 4:13 ` [PATCH 3/3] Assert 'printf_line' is non-null Yao Qi
2013-01-09 21:43 ` Tom Tromey
2012-12-12 4:13 ` [PATCH 2/3] Remove dead code for dprintf Yao Qi
2013-01-09 20:45 ` Tom Tromey
2013-01-07 14:16 ` [ping]: [PATCH 0/3] dprintf tweaks Yao Qi
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=1355285581-28889-2-git-send-email-yao@codesourcery.com \
--to=yao@codesourcery.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