This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
Re: [RFC] GDB testsuite patch. (revised version)
- From: Michael Chastain <mec dot gnu at mindspring dot com>
- To: manjo at austin dot ibm dot com
- Cc: gdb-patches at sources dot redhat dot com
- Date: Fri, 27 Aug 2004 12:01:09 -0400
- Subject: Re: [RFC] GDB testsuite patch. (revised version)
- References: <Pine.LNX.4.58.0408191014360.21237@lazy><41251A45.nail58D215HD7@mindspring.com><Pine.LNX.4.58.0408191637370.21237@lazy><4125BB8B.nailJWP1FZGHJ@mindspring.com><Pine.LNX.4.58.0408242319060.7065@lazy><20040825124945.GA25217@nevyn.them.org><412C98BD.nail10P1YTPHK@mindspring.com><Pine.LNX.4.58.0408261009010.27764@lazy><412F49BA.nailEDT11A0NY@mindspring.com><Pine.LNX.4.58.0408270947150.30583@lazy>
Manoj Iyer <manjo@austin.ibm.com> wrote:
> The problem is that there are other tests that run just fine even if no
> debugging symbols are found. This means if you change gdb_load to check if
> no debugging symbols are found and return a -ive value this might harm the
> other testcase.
Right. You tried that, and Daniel pointed out that it was wrong,
and I agreed.
> I will be happy to submit that patch, and see if you like my idea.
It's such a good idea, I already started implementing something
like that.
Here is the new header for gdb_file_cmd:
# Load a file into the debugger.
# The return value is a list with the following information:
#
# { message word ... }
#
# MESSAGE has the following values:
#
# "" file was loaded successfully
# "..." file was not loaded successfully.
# An error or perror has been generated with MESSAGE.
#
# If the MESSAGE is "", then there is an optional set of words.
# The words may be:
#
# nodebug this file does not contain debug information
#
# TODO: gdb.base/sepdebug.exp and gdb.stabs/weird.exp might
# be able to use this if they can get more information
# in the return value.
TCL is all about lists and strings, and it makes life a lot
easier to return a nice list of strings.
If this still looks like a good idea in a few hours, and I commit it,
then you can write gdb.gdb/*.exp like this:
set oldtimeout $timeout
set timeout 600
verbose "Timeout is now $timeout seconds" 2
set status [gdb_load $executable]
set timeout $oldtimeout
verbose "Timeout is now $timeout seconds" 2
if { [lindex $status 0] != "" } then {
# Error has already been printed.
return -1
}
if { [lsearch -exact [lreplace $status 0 0] "nodebug"] } then {
untested "no debugging information for $executable"
return -1
}
Or something like that.
How does that look?