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: [RFC] GDB testsuite patch. (revised version)


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.
>


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