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/testsuite/ada] Add support for building Ada programs


On Mon, Mar 29, 2004 at 11:55:23AM -0800, Joel Brobecker wrote:
> Hello,
> 
> Based on the discussion between Daniel and myself that started with:
> 
>         http://sources.redhat.com/ml/gdb-patches/2004-02/msg00695.html
> 
> I suggest the addition of a new file in testsuite/lib: ada.exp.
> 
> This file contains 2 elements:
>   1. Two procedure that should be provided by dejagnu. The changes
>      needed to add support for Ada is not in there yet, so I duplicated
>      this code here for now. This only affect testing of Ada programs,
>      since a test would need to include "ada.exp" to see these different
>      procedures. The plan is also to keep them for a while after they
>      are part of a released version of dejagnu, to avoid increasing
>      the dejagnu version number requirement when running the GDB testsuite.

There's one problem here.  A recurring problem we've had is testcases
tainting other tests, because what you say above isn't quite right -
once ada.exp is loaded, it will remain loaded for the remainder of
the test run.

So, it's good to avoid loading these when not necessary.  Here's one
way to do it:

proc gdb_find_gnatmake {  } { ... }
proc gdb_default_target_compile { } { ... }

if {[info procs find_gnatmake] == ""} {
  proc find_gnatmake { } { return [gdb_find_gnatmake] }
  proc default_target_compile { source destfile type options } {
    return [gdb_default_target_compile $source $destfile $type $options]
  }
}

Yes, in TCL procedure definitions can be conditional.  This way, if a
version of DejaGNU which includes your patch is used, the code in GDB
will be ignored in favor of DejaGNU's.

Does the above work?

-- 
Daniel Jacobowitz
MontaVista Software                         Debian GNU/Linux Developer


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