This is the mail archive of the gdb-patches@sources.redhat.com 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: [RFA: mi testsuite] Gdbserver support for the MI testsuite


Daniel Jacobowitz writes:
 > On Mon, Sep 08, 2003 at 03:53:38PM -0400, Elena Zannoni wrote:
 > > Daniel Jacobowitz writes:
 > >  > Updated and improved version of a patch I've posted several times over the
 > >  > last year and a half or so.  This adds support for gdbserver-style remote
 > >  > stubs to the MI testsuite; the differences between the MI support and non-MI
 > >  > support are mostly cosmetic at this point (i.e. it doesn't go out of its way
 > >  > to use -target-select).  Just handles the different prompt.
 > >  > 
 > >  > There's still an unnecessary restart of gdbserver every test; fixing that is
 > >  > going to take some serious work.
 > >  > 
 > >  > Results with the patch are OK: linux-proc tests fail, not surprisingly;
 > >  > gcore fails; there are some new thread failures since I last updated it
 > >  > which I will have to investigate.  But most of the MI tests pass instead of
 > >  > timing out.
 > >  > 
 > >  > Does this patch look OK for 6.0?
 > >  > 
 > > 
 > > I still have the same objection I had back then. I'd like to see the
 > > mi_* functions be moved to mi-support.exp.
 > > see: http://sources.redhat.com/ml/gdb-patches/2002-07/msg00227.html
 > > 
 > > I'd still like to have mi-support.exp be loaded only when the mi tests
 > > are being done. 
 > > 
 > > The flo is like this: an mi test file calls mi_gdb_load (indirectly,
 > > via mi_run_to_main), which in turn decides what different mechanism to
 > > use depenging on the target. This stuff you are adding is just another
 > > kind of target that should be handled from the same central core
 > > place.  If you really are that desperate to keep the mi_ versions in
 > > gdbserver.exp and monitor.exp, could those be called from
 > > mi-support.exp at least, so that the path of execution is consistent
 > > with the rest?
 > 
 > Hi Elena,
 > 
 > I'm a little dense but after a couple of tries I think I've got it :)
 > The attached patch:
 >   - breaks mi_gdb_file_cmd out of mi_gdb_load, as before.
 >   - Moves the new mi_gdb_target_cmd from monitor.exp to mi-support.exp
 >     (keeps it with all the other MI support, and it's really not
 >     monitor-related anyway).
 >   - Adds a case to mi_gdb_load for gdbserver.
 >   - Breaks gdb_load up into two functions, one for the actions of
 >     starting a server (common to both cases) and the other for the
 >     non-MI overriding of gdb_load.
 > 
 > Also included is a change local to gdbserver.exp which improves the way
 > we start gdbserver to be more reliable (and less prone to leaving
 > zombies!).  The trick of waiting for an output character doesn't appear
 > to work 100% (I believe gdbserver prints the message too early) but
 > with the five-second retry in mi_gdb_target_cmd everything works OK.
 > 
 > Testsuite results, with NPTL disabled (gdbserver doesn't support NPTL
 > yet; I'll fix it sometime soon...):
 > 
 >                 === gdb Summary ===
 > 
 > # of expected passes            9791
 > # of unexpected failures        89
 > # of expected failures          62
 > # of unknown successes          28
 > # of known failures             40
 > # of unresolved testcases       1
 > # of untested testcases         6
 > # of unsupported tests          6
 > /opt/src/binutils/x86-as/gdb/testsuite/../../gdb/gdb version 2003-11-23-cvs -nx
 > 
 > Not stellar, but it's definitely progress, and this patch is much
 > cleaner than the last.
 > 
 > OK?
 > 
 > -- 
 > Daniel Jacobowitz
 > MontaVista Software                         Debian GNU/Linux Developer
 > 
 > 2003-06-22  Daniel Jacobowitz  <drow@mvista.com>
 > 
 > 	* config/gdbserver.exp (gdbserver_gdb_load): Rename from gdb_load.
 > 	Remove downloading, guessing the host executable, the calls to
 > 	gdb_file_cmd and gdb_target_cmd, and "load" support.
 > 	(infer_host_exec): New function broken out from gdb_load.
 > 	(gdb_load): New wrapper for gdbserver_gdb_load.
 > 	* lib/mi-support.exp (mi_gdb_target_cmd): New function, based on
 > 	gdb_target_cmd.
 > 	(mi_gdb_file_cmd): New function, broken out from mi_gdb_load.
 > 	Download binaries to the host.  Clear last_mi_remote_file when
 > 	we load a new binary.
 > 	(mi_gdb_load): Call mi_gdb_file_cmd.  If gdbserver.exp is loaded,
 > 	call gdbserver_gdb_load and mi_gdb_target_cmd.
 > 

Ok, but one more thing. see below

 > Index: lib/mi-support.exp
 > ===================================================================
 > RCS file: /cvs/src/src/gdb/testsuite/lib/mi-support.exp,v
 > retrieving revision 1.23
 > diff -u -p -r1.23 mi-support.exp
 > --- lib/mi-support.exp	22 Jun 2003 00:04:27 -0000	1.23
 > +++ lib/mi-support.exp	24 Nov 2003 03:43:08 -0000
 > @@ -1,4 +1,4 @@
 > -# Copyright 1999, 2000, 2002 Free Software Foundation, Inc.
 > +# Copyright 1999, 2000, 2002, 2003 Free Software Foundation, Inc.
 >  
 >  # This program is free software; you can redistribute it and/or modify
 >  # it under the terms of the GNU General Public License as published by
 > @@ -281,35 +281,95 @@ proc mi_gdb_reinitialize_dir { subdir } 
 >      }
 >  }
 >  
 > +# Send GDB the "target" command.
 > +# FIXME: Some of these patterns are not appropriate for MI.  Based on
 > +# config/monitor.exp:gdb_target_command.

 > +# FIXME: Should use -target-select.

please use -target-select. mi_gdb_load already uses it. 

 > +proc mi_gdb_target_cmd { targetname serialport } {
 > +    global mi_gdb_prompt
 > +
 > +    for {set i 1} {$i <= 3} {incr i} {
 > +	send_gdb "target $targetname $serialport\n"


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