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: Manoj Iyer <manjo at austin dot ibm dot com>
- To: Michael Chastain <mec dot gnu at mindspring dot com>
- Cc: gdb-patches at sources dot redhat dot com
- Date: Fri, 27 Aug 2004 09:54:15 -0500 (CDT)
- 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>
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.
Or
gdb_file_cmd can return a positive number like '1' when no debugging
information is found which can be checked for in gdb.gdb/*.exp and exit
the testcase. This way the other tests are not effected coz they check for
$return < 0
I will be happy to submit that patch, and see if you like my idea.
-----
manjo
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+ Cognito ergo sum +
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
On Fri, 27 Aug 2004, Michael Chastain wrote:
> Ouch, copying the whole text of gdb_file_cmd is no good, either!
> That much duplicate code is bad.
>
> Here is my plan.
>
> gdb_file_cmd has a return value. None of the callers of gdb_file_cmd
> uses the return vale, except for gdb_load, which simply returns the same
> value.
>
> There are about 300 callers of gdb_load. Most of them don't use the
> return value either. The exceptions are:
>
> gdb.base/remote.exp
> gdb.base/sepdebug.exp
> # does not use the return value but it wants to
> gdb.gdb/complaints.exp
> gdb.gdb/observer.exp
> gdb.gdb/selftest.exp
> gdb.gdb/xfullpath.exp
> gdb.stabs/weird.exp
> # does not use the return value but it wants to
> lib/gdb.exp:
> proc gdb_run_cmd
>
> So, I will do some infrastructure work: I will make gdb_load return
> a better return value that includes more information, like a list
> with more status information:
>
> success indicator
> whatever sepdebug.exp is looking for
> whatever weird.exp is looking for
> indicator of whether debug symbols found or not
>
> While I am in there, I will see if I can get back any commonality
> with mi_gdb_file_cmd. But that's optional.
>
> I expect to commit the new gdb_file_cmd sometime on Saturday. After
> that, it will be easy for you to change gdb.gdb/*.exp to just use the
> new information in the return value from gdb_load.
>
> Michael
>
> 2004-08-26 Manoj Iyer <manjo@austin.ibm.com
>
> * lib/gdb.exp (gdb_check_debuginfo): New procedure
> * gdb.gdb/complaints.exp: check if gdb has debug information.
> * gdb.gdb/observer.exp: check if gdb has debug information.
> * gdb.gdb/selftest.exp: check if gdb has debug information.
> * gdb.gdb/xfullpath.exp: check if gdb has debug information.
>