From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 16704 invoked by alias); 12 Mar 2008 20:49:34 -0000 Received: (qmail 16695 invoked by uid 22791); 12 Mar 2008 20:49:33 -0000 X-Spam-Check-By: sourceware.org Received: from qnxmail.qnx.com (HELO qnxmail.qnx.com) (209.226.137.76) by sourceware.org (qpsmtpd/0.31) with ESMTP; Wed, 12 Mar 2008 20:49:11 +0000 Received: from smtp.ott.qnx.com (smtp.ott.qnx.com [10.42.96.5]) by hub.ott.qnx.com (8.9.3/8.9.3) with ESMTP id QAA07110; Wed, 12 Mar 2008 16:30:26 -0400 Received: from [10.42.100.129] (dhcp-100-129 [10.42.100.129]) by smtp.ott.qnx.com (8.8.8/8.6.12) with ESMTP id PAA19537; Wed, 12 Mar 2008 15:49:08 -0500 Message-ID: <47D841C4.4040004@qnx.com> Date: Wed, 12 Mar 2008 20:49:00 -0000 From: Aleksandar Ristovski User-Agent: Thunderbird 2.0.0.12 (Windows/20080213) MIME-Version: 1.0 To: Daniel Jacobowitz CC: Vladimir Prus , gdb-patches@sources.redhat.com Subject: Re: [RFC] gdb.mi tests References: <47D6DE48.8090003@qnx.com> <47D82C77.8020705@qnx.com> <20080312193423.GA837@caradoc.them.org> In-Reply-To: <20080312193423.GA837@caradoc.them.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-IsSubscribed: yes Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2008-03/txt/msg00136.txt.bz2 Daniel Jacobowitz wrote: > On Wed, Mar 12, 2008 at 10:25:12PM +0300, Vladimir Prus wrote: >> Aleksandar Ristovski wrote: >> >>>> Something like the diffs attached (I manually removed some things from my diff >>>> so the diff may not be patchable, but it should be sufficient to illustrate what >>>> am I talking about. >>>> >>> Attached working diff. Comments welcome. >> I don't have any objections to this course of action, if this simplifies >> your testing. >> >> But just for the record, can you tell how you override mi_gdb_start? Of course, >> assuming it's not some proprietary information. > > FWIW, I tried something similar long ago and Elena preferred it the > way it is - you'll see that sid and gdbserver target support is also > in mi-support.exp, not in config/ with the other pieces. > > http://sources.redhat.com/ml/gdb-patches/2002-07/msg00227.html > > However, CodeSourcery's test harness goes to some trouble to work > around this - you still can, you just need to be handy with TCL to do > it. We load mi-support.exp in our board files and use "rename". > Which is a bit silly to have to do. > The way I understand it, tcl is dynamically scoped language (I hope I used the right term) and will, effectively override a definition with the subsequent redefinition. This means that the order in which files are loaded matters and the latter in the process a file gets loaded, it carries more 'overriding' capabilities. Therefore, first files loaded should be very generic, going towards customization files. If tests are run with --verbose flag, the order of loaded files is clear: /usr/share/dejagnu/runtest.exp as main test driver$ site.exp (generated by the makefile, specifies tool name and such) site.exp (global site.exp as defined by DEJAGNU env. var - optional, I use it to add my baseboard directory) then follow bunch of dejagnu framework files loaded by runtest.exp: Loading /usr/share/dejagnu/utils.exp Loading /usr/share/dejagnu/framework.exp ... Loading /usr/share/dejagnu/libgloss.exp Loading library file ../../../gdb/testsuite/lib/gdb.exp After that, boardfile is loaded and finally the test file. For gdb.base tests, gdb_start, gdb_load and such are easily overriden by redefinition in baseboard file. However, due to the fact that mi-support.exp is explicitly loaded from gdb.mi/* tests, it will have the final say, thus preventing us from overriding mi_gdb_load and such in the baseboard file. Thanks, Aleksandar