This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH] Improve MI inferior output check / mi-console.exp
- From: Pedro Alves <palves at redhat dot com>
- To: lgustavo at codesourcery dot com
- Cc: "'gdb-patches at sourceware dot org'" <gdb-patches at sourceware dot org>, iain at codesourcery dot com
- Date: Fri, 01 Nov 2013 12:06:04 +0000
- Subject: Re: [PATCH] Improve MI inferior output check / mi-console.exp
- Authentication-results: sourceware.org; auth=none
- References: <526DC9BB dot 6060100 at codesourcery dot com> <526E7DF2 dot 4050509 at redhat dot com> <526ECC81 dot 3000300 at codesourcery dot com> <526F974C dot 9030404 at redhat dot com> <5270FBD1 dot 7040908 at codesourcery dot com>
On 10/30/2013 12:30 PM, Luis Machado wrote:
> The following patch accomplishes that and tweaks things a little further.
>
> First, i removed the misleading test description. It does not seem to be
> aligned with what the test does nowadays. It is not restricted to
> remote/sim targets anymore.
>
> I've put back the mi-support.exp bit since that is required for remote
> targets, otherwise we will try to read from the spawn id.
>
> I'm explicitly checking for "remote" and "extended-remote" gdb_protocol
> values here since neither "isremote" nor "use_gdb_stub" seem to have a
> consistent meaning.
> Extended-remote should be both "use_gdb_stub" and "isremote", but it isn't.
No it shouldn't. ;-)
>
> Hopefully this version also addresses the gdb-simulator vs rsp-simulator
> confusion.
I don't think it does completely yet? A check for the
sim is missing. We'd need:
[target_info protocol] == "sim"
(see mi_gdb_target_load)
And, try:
$ grep noinferiorio /usr/share/dejagnu/* -rn
Where we find lots of random non-remote boards that
set gdb,noinferiorio 1.
And the patch makes all such boards fall to the
> + } else {
> global mi_inferior_spawn_id
bit. Shouldn't the patch be leaving the
if { ![target_info exists gdb,noinferiorio] } {
check as the outermost?
> +# The program's real output string.
> +set program_output "Hello \\\"!\r\n"
> +
> +# Prepare the pattern for the PTY output of a native target.
> +set output [string map {"\r\n" "\[\r\n\]+"} $program_output]
> +set output [string map {"\\" "\\\\"} $output]
> +
> +# Prepare the pattern for the semihosted output.
> +set semihosted_output [semihosted_string $program_output]
> +
> +# Combine both outputs in a single pattern.
> +set both_patterns "($semihosted_output|$output)"
BTW, I'd find that naming the variables like:
# The program's real output string.
set program_output "Hello \\\"!\r\n"
# Prepare the pattern for the PTY output of a native target.
set native_output [string map {"\r\n" "\[\r\n\]+"} $program_output]
set native_output [string map {"\\" "\\\\"} $native_output]
# Prepare the pattern for the semihosted output.
set semihosted_output [semihosted_string $program_output]
# Combine both outputs in a single pattern.
set output "($semihosted_output|$native_output)"
to be a bit clearer.
--
Pedro Alves