This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] Fix PR breakpoints/16494: gdb.base/dprintf.exp agent-printf failures with non-Z0-supporting gdbservers


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]