This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH] Fix PR breakpoints/16494: gdb.base/dprintf.exp agent-printf failures with non-Z0-supporting gdbservers
- From: Pedro Alves <palves at redhat dot com>
- To: Hui Zhu <hui_zhu at mentor dot com>
- Cc: gdb-patches ml <gdb-patches at sourceware dot org>
- Date: Fri, 21 Mar 2014 13:11:16 +0000
- Subject: Re: [PATCH] Fix PR breakpoints/16494: gdb.base/dprintf.exp agent-printf failures with non-Z0-supporting gdbservers
- Authentication-results: sourceware.org; auth=none
- References: <531F1E7B dot 8030301 at mentor dot com>
On 03/11/2014 02:32 PM, Hui Zhu wrote:
> --- 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
Line too long. "make sure THE current target supportS". Period at end of sentence.
> + 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"
> + }
> + }
Why not simply merge this check with the existing code just
below, that does pretty much the same thing?
if $target_can_dprintf {
gdb_run_cmd
...
> 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
Likewise.
--
Pedro Alves