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]

[patch/testsuite] MI inferior's output in remote target


Hi,

I noticed one test fail when testing gdb with my remote stub,

  FAIL: gdb.mi/mi-console.exp: Testing console output inferior output
(time out)

The remote stub is able to "transfer" remote IO to host via `remote
fileio' packets, and output is printed to gdb_stdtarg or gdb_stdtargerr
(as indicated in remote-fileio.c:remote_fileio_func_write).  Here are
two problems,
 1.  In mi-console.exp, it is expected to read inferior's output from
another tty (a separate tty from gdb's), but the output is printed in
the same tty as gdb's.
 2.  In MI, gdb_stdtarg and gdb_stdtargerr is initialized by
mi_console_file_new (raw_stdout, "@", '"').  So, the output printed to
them is prefixed with "@".

I tried to fix these two problems [1], but it doesn't work.  Then, I
think of rewriting test case to fix this problem.  In MI tests, we'll
check inferior's output if gdb,noinferiorio is false.  This is not
enough.  In this case, the remote stub has the capability to transfer IO
back to host, so gdb,noinferiorio is false, but we still can't get
correct inferior's output.  I suggest that we check the inferior's
output if gdb,noinferiorio is false and is not a remote target.  This
patch is to reflect this idea.  After reading mi_gdb_test in
lib/mi-support.exp, this change looks accept to me, because the log of
checking inferior's output is naturally for native build.  The expect
code at the end of proc mi_gdb_test is to check the output from process
$mi_inferior_spawn_id, however, I am not sure what $mi_inferior_spawn_id
will be in remote testing.

Comments are welcome.

-- 
Yao (éå)

[1] I tried to fix these two problems by opening a new ui_file when
inferior-tty is changed, and update gdb_stdtarg/gdb_stdtargerr to it.
	gdb/testsuite/
	* lib/mi-support.exp (mi_gdb_test): Skip to check inferior's output
	if target is remote.
---
 gdb/testsuite/lib/mi-support.exp |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/gdb/testsuite/lib/mi-support.exp b/gdb/testsuite/lib/mi-support.exp
index 7849411..f99a48b 100644
--- a/gdb/testsuite/lib/mi-support.exp
+++ b/gdb/testsuite/lib/mi-support.exp
@@ -801,7 +801,7 @@ proc mi_gdb_test { args } {
     # If the GDB output matched, compare the inferior output.
     if { $result == 0 } {
 	if [ info exists ipattern ] {
-	    if { ![target_info exists gdb,noinferiorio] } {
+	    if { ![target_info exists gdb,noinferiorio] && ![is_remote target] } {
 		global mi_inferior_spawn_id
 		expect {
 		    -i $mi_inferior_spawn_id -re "$ipattern" {
-- 
1.7.0.4


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