Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Mike Frysinger <vapier@gentoo.org>
To: Nick Clifton <nickc@redhat.com>
Cc: gdb-patches@sourceware.org
Subject: Re: [PATCH] sim: unify symbol table handling
Date: Mon, 15 Aug 2016 13:31:00 -0000	[thread overview]
Message-ID: <20160815133128.GY30544@vapier.lan> (raw)
In-Reply-To: <9c6fd370-885a-4290-160c-e9898a87e051@redhat.com>

[-- Attachment #1: Type: text/plain, Size: 1733 bytes --]

On 15 Aug 2016 10:22, Nick Clifton wrote:
> Hi Mike,
> > diff --git a/sim/aarch64/memory.h b/sim/aarch64/memory.h
> > -extern void         mem_add_blk (sim_cpu *, uint64_t, char *, uint64_t, bfd_boolean);
> 
> (I have no problem with this part of the patch, but just to note
> that it is nothing to do with unifying symbol table handling...)

true, but it was collateral damage.  by removing the (now unused &
unneeded) bfd.h include from this header, this prototype broke (as
it uses bfd_boolean).  so i had to drop it as well.

> > +int
> > +trace_load_symbols (SIM_DESC sd)
> > +{
> 
> Wouldn't it make sense for trace_load_symbols to also remove useless
> symbols and then sort the table ?  Isn't this something that all 
> sims will want ?  [The code for remove_useless_symbols in aarch64/interp.c
> is basically generic, not aarch64 specific].

i hadn't fully digested this bit of logic ... i was focusing on the bits
the core already handled, and were requiring custom clean ups/callbacks
in the non-common code.  you're right though that we could update the
core to include this code for the benefit of all.

> > +bfd_vma
> > +trace_sym_value (SIM_DESC sd, const char *name)
> > +{
> > [...]
> > +  for (i = 0; i < STATE_PROG_SYMS_COUNT (sd); ++i)
> > +    if (strcmp (asymbols[i]->name, name) == 0)
> > +      return bfd_asymbol_value (asymbols[i]);
> 
> If there was a flag to say that the symbol table was sorted, then
> this lookup could be done using bsearch().
> 
> 
> So basically as far as I can see there is nothing wrong with the patch.
> Certainly not from an AArch64 of MSP430 point of view.

thanks.  i'll merge this as-is, and add your ideas to my TODO list :).
-mike

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

  reply	other threads:[~2016-08-15 13:31 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-08-13 19:55 Mike Frysinger
2016-08-15  9:22 ` Nick Clifton
2016-08-15 13:31   ` Mike Frysinger [this message]
2016-08-15 14:21   ` Trevor Saunders
2016-08-15 16:57     ` Mike Frysinger

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=20160815133128.GY30544@vapier.lan \
    --to=vapier@gentoo.org \
    --cc=gdb-patches@sourceware.org \
    --cc=nickc@redhat.com \
    /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