From: Hui Zhu <hui_zhu@mentor.com>
To: gdb-patches ml <gdb-patches@sourceware.org>
Cc: Pedro Alves <palves@redhat.com>
Subject: [PATCH] Fix PR breakpoints/16494: gdb.base/dprintf.exp agent-printf failures with non-Z0-supporting gdbservers
Date: Tue, 11 Mar 2014 14:32:00 -0000 [thread overview]
Message-ID: <531F1E7B.8030301@mentor.com> (raw)
After the patch that commited by Pedro, the GDB can throw error about
gdbserver doesn't support agent commands.
But the test still get this error because the it doesn't try handle the
error when send dprintf to gdbserver.
So I make this patch.
It test OK and pass regression test in x86_64-linux and powerpc-linux.
Thanks,
Hui
2014-03-11 Hui Zhu <hui@codesourcery.com>
PR breakpoints/16494
* gdb.base/dprintf.exp: Add second check to make sure current
target support breakpoints that have target side commands.
* gdb.base/mi-dprintf.exp: Ditto.
* lib/mi-support.exp (mi_run_cmd_full): Add handle for error.
--- a/gdb/testsuite/gdb.base/dprintf.exp
+++ b/gdb/testsuite/gdb.base/dprintf.exp
@@ -109,6 +109,24 @@ gdb_test_multiple "set dprintf-style age
}
if $target_can_dprintf {
+ # Second check to make sure current target support breakpoints that have target side commands
+ gdb_run_cmd
+
+ gdb_test "" "Breakpoint"
+
+ set msg "Send dprintf to target"
+ gdb_test_multiple "continue" $msg {
+ -re "Warning:.*Target doesn't support breakpoints that have target side commands.*\r\n$gdb_prompt $" {
+ set target_can_dprintf 0
+ pass "$msg - cannot do"
+ }
+ -re ".*$gdb_prompt $" {
+ pass "$msg - can do"
+ }
+ }
+}
+
+if $target_can_dprintf {
gdb_run_cmd
gdb_test "" "Breakpoint"
@@ -120,7 +138,7 @@ if $target_can_dprintf {
gdb_test_sequence "info breakpoints" "dprintf info 2" {
"\[\r\n\]Num Type Disp Enb Address +What"
"\[\r\n\]2 breakpoint"
- "\[\r\n\]\tbreakpoint already hit 2 times"
+ "\[\r\n\]\tbreakpoint already hit 3 times"
"\[\r\n\]3 dprintf"
"\[\r\n\]\tbreakpoint already hit 2 times"
"\[\r\n\] agent-printf \"At foo entry\\\\n\""
--- a/gdb/testsuite/gdb.mi/mi-dprintf.exp
+++ b/gdb/testsuite/gdb.mi/mi-dprintf.exp
@@ -140,6 +140,14 @@ gdb_expect {
}
if $target_can_dprintf {
+ # Second check to make sure current target support breakpoints that have target side commands
+ if {[mi_run_cmd] < 0} {
+ set target_can_dprintf 0
+ unsupported "send dprintf to target"
+ }
+}
+
+if $target_can_dprintf {
mi_run_cmd
mi_expect_stop ".*" ".*" ".*" ".*" ".*" "" "mi expect stop"
--- a/gdb/testsuite/lib/mi-support.exp
+++ b/gdb/testsuite/lib/mi-support.exp
@@ -893,6 +893,7 @@ proc mi_run_cmd_full {use_mi_command arg
send_gdb "${run_prefix}continue\n"
gdb_expect 60 {
-re "${run_match}\\^running\[\r\n\]+\\*running,thread-id=\"\[^\"\]+\"\r\n$mi_gdb_prompt" {}
+ -re "${run_match}\\^error.*" {return -1}
default {}
}
return 0
next reply other threads:[~2014-03-11 14:32 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-03-11 14:32 Hui Zhu [this message]
2014-03-21 13:11 ` Pedro Alves
2014-03-23 11:36 ` Hui Zhu
2014-03-24 19:39 ` Fix PR breakpoints/16101: gdb.base/dprintf.exp agent-printf, " Pedro Alves
2014-03-25 8:27 ` 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=531F1E7B.8030301@mentor.com \
--to=hui_zhu@mentor.com \
--cc=gdb-patches@sourceware.org \
--cc=palves@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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).