Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Mike Frysinger <vapier@gentoo.org>
To: Pedro Alves <pedro@codesourcery.com>
Cc: gdb-patches@sourceware.org, toolchain-devel@blackfin.uclinux.org
Subject: Re: [PATCH/RFC] gdb: tests: add support for testing FLAT toolchains
Date: Fri, 01 Jul 2011 15:55:00 -0000	[thread overview]
Message-ID: <BANLkTinFh_dMpsyXZUMt6iRxRJs95QNq4w@mail.gmail.com> (raw)
In-Reply-To: <201107011616.21075.pedro@codesourcery.com>

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 <jie@codesourcery.com>
>> >>
>> >> FLAT toolchains output a FLAT binary for the named output and create
>> >> another file with a .gdb suffix that is used for debugging.  So 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?  We added them
>> > to solve the exact same problem.  We then have this in our board file
>> > for uclinux/flat toolchains:
>> >
>> >       proc exec_target_file { binfile } {
>> >           return ${binfile}.flt
>> >       }
>>
>> probably ... this code does date back years ago, and when i poked
>> things again one year ago, it still needed to be done.  i'll take a
>> look at what you refer to now though.
>
> I took another look at how we do things.  Those 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.  I'd rather we had enough
> hooks to make it easy for a board file or a config file to do what
> it needs to.  E.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.  Maybe we could do something like
> gdb/testsuite/config/gdbserver.exp/gdb/testsuite/lib/gdbserver-support.exp
> instead?  That 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)?  WDYT?

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


  reply	other threads:[~2011-07-01 15:55 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-03-18  7:10 [PATCH 02/16] " Mike Frysinger
2010-03-18  7:13 ` Mike Frysinger
2010-03-18 13:38 ` Daniel Jacobowitz
2010-03-19  1:26   ` Mike Frysinger
2011-07-01  0:24     ` [PATCH/RFC] " Mike Frysinger
2011-07-01  9:17       ` Pedro Alves
2011-07-01 14:28         ` Mike Frysinger
2011-07-01 15:16           ` Pedro Alves
2011-07-01 15:55             ` Mike Frysinger [this message]
2011-07-01 16:24               ` Pedro Alves

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=BANLkTinFh_dMpsyXZUMt6iRxRJs95QNq4w@mail.gmail.com \
    --to=vapier@gentoo.org \
    --cc=gdb-patches@sourceware.org \
    --cc=pedro@codesourcery.com \
    --cc=toolchain-devel@blackfin.uclinux.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox