From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 7758 invoked by alias); 1 Jul 2011 15:55:40 -0000 Received: (qmail 7658 invoked by uid 22791); 1 Jul 2011 15:55:38 -0000 X-SWARE-Spam-Status: No, hits=-2.5 required=5.0 tests=AWL,BAYES_00,DKIM_SIGNED,DKIM_VALID,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW X-Spam-Check-By: sourceware.org Received: from mail-gx0-f169.google.com (HELO mail-gx0-f169.google.com) (209.85.161.169) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 01 Jul 2011 15:55:22 +0000 Received: by gxk23 with SMTP id 23so1690750gxk.0 for ; Fri, 01 Jul 2011 08:55:22 -0700 (PDT) Received: by 10.91.201.4 with SMTP id d4mr3275638agq.41.1309535722099; Fri, 01 Jul 2011 08:55:22 -0700 (PDT) MIME-Version: 1.0 Received: by 10.90.92.18 with HTTP; Fri, 1 Jul 2011 08:55:02 -0700 (PDT) In-Reply-To: <201107011616.21075.pedro@codesourcery.com> References: <201003182126.17119.vapier@gentoo.org> <201107011016.57120.pedro@codesourcery.com> <201107011616.21075.pedro@codesourcery.com> From: Mike Frysinger Date: Fri, 01 Jul 2011 15:55:00 -0000 Message-ID: Subject: Re: [PATCH/RFC] gdb: tests: add support for testing FLAT toolchains To: Pedro Alves Cc: gdb-patches@sourceware.org, toolchain-devel@blackfin.uclinux.org Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable 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: 2011-07/txt/msg00021.txt.bz2 On Fri, Jul 1, 2011 at 11:16, Pedro Alves wrote: > On Friday 01 July 2011 15:28:17, Mike Frysinger wrote: >> On Fri, Jul 1, 2011 at 05:16, Pedro Alves wrote: >> > On Friday 01 July 2011 01:24:41, Mike Frysinger wrote: >> >> From: Jie Zhang >> >> >> >> FLAT toolchains output a FLAT binary for the named output and create >> >> another file with a .gdb suffix that is used for debugging. =C2=A0So = when >> >> testing a FLAT toolchain and we need to load up a file, use the .gdb. >> > >> > Sounds a lot like the recently added >> > lib/gdb.exp:exec_target_file/exec_symbol_file hooks? =C2=A0We added th= em >> > to solve the exact same problem. =C2=A0We then have this in our board = file >> > for uclinux/flat toolchains: >> > >> > =C2=A0 =C2=A0 =C2=A0 proc exec_target_file { binfile } { >> > =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 return ${binfile}.flt >> > =C2=A0 =C2=A0 =C2=A0 } >> >> probably ... this code does date back years ago, and when i poked >> things again one year ago, it still needed to be done. =C2=A0i'll take a >> look at what you refer to now though. > > I took another look at how we do things. =C2=A0Those hooks I pointed at > are only part of the story, and are not enough for what you > need --- we _also_ override gdb_compile in our board files, calling > the existing version, and then doing the renaming very similarly to > what your patch does. > > (What I've wondered before was if it was possible to pass enough > switches to the tools in order to have them output the files > with the names we need in the first place, in order to avoid the > renaming.) it is possible if the link is done twice, but that isnt better. bfin-uclinux-gcc ... -o foo -no-elf2flt bfin-uclinux-gcc ... -o foo.flt (of course, you would have an extra foo.flt.gdb) > I'm not super keen on having these target and environment pecularities > straight in the core testsuite code. =C2=A0I'd rather we had enough > hooks to make it easy for a board file or a config file to do what > it needs to. =C2=A0E.g., symbian toolchains also have separate binary > and symbol files (the reason shlib_target_file/shlib_symbol_file > were added a while ago, uppon which exec_target_file/exec_symbol_file > were later modelled on), and the extension is not .flt then, > of course. =C2=A0Maybe we could do something like > gdb/testsuite/config/gdbserver.exp/gdb/testsuite/lib/gdbserver-support.exp > instead? =C2=A0That is, move your code to new gdb/testsuite/config/flt.exp > gdb/testsuite/lib/flt-support.exp files that do what you > have, but by overriding what needs overriding (gdb_compile > and the exec_*_file hooks mainly)? =C2=A0WDYT? i dont need the logic to be in the core gdb testsuite, but i think it does have to be in the gdb testsuite somewhere. i dont think making all board porters do the same thing over and over again is the right path. after all, this is going to be the same issue across all toolchains that target this binary format. which is what we just found out since i doubt the code you have is for Blackfin processors :). it seems like the shlib/exec hooks you mention should be sufficient. do you know why in your setup you still need to bang on gdb_compile ? -mike