public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: Simon Marchi <simark@simark.ca>
To: dark.ryu.550@gmail.com, gdb-patches@sourceware.org
Subject: Re: [PATCH 1/1] Add support for symbol addition to the Python API
Date: Fri, 6 Jan 2023 15:21:05 -0500	[thread overview]
Message-ID: <735caf65-fff8-bca0-2f55-6c2e8781eeb6@simark.ca> (raw)
In-Reply-To: <5c5901d9216f$700a9b10$501fd130$@gmail.com>

Same as with the other patches, I can't apply that patch, it seems
misformatted.

On 1/5/23 20:37, dark.ryu.550--- via Gdb-patches wrote:
> This patch adds support for symbol creation and registration. It currently 
> supports adding type symbols (VAR_DOMAIN/LOC_TYPEDEF), static symbols 
> (VAR_DOMAIN/LOC_STATIC) and goto target labels (LABEL_DOMAIN/LOC_LABEL). It 
> adds the `add_type_symbol`, `add_static_symbol` and `add_label_symbol`
> functions
> to the `gdb.Objfile` type, allowing for the addition of the aforementioned
> types of
> symbols.
> 
> This is done through building a new `compunit_symtab`s for each symbol that
> is
> to be added, owned by a given objfile and whose lifetimes is bound to it. i 
> might be missing something here, but there doesn't seem to be an intended
> way 
> to add new symbols to a compunit_symtab after it's been finished. if there
> is, 
> then the efficiency of this method could very much be improved. It could
> also be
> made more efficient by having a way to add whole batches of symbols at once,
> 
> which would then all get added to the same `compunit_symtab`.

Indeed, I don't think there's a way today to add symbols to a finished
compunit_symtab.  Maybe it would be worth exploring that.  First, to
avoid creating one compunit_symtab per created user symbol.  But also
because I wonder how user-created symbols interact with existing
symbols.  Let's say I have a symbol that comes from DWARF in an existing
compunit_symtab, and I create a user symbol for that function's address.
The new symbol is in a new compunit_symtab.  This means there is some
overlap in the addresses of two compunit_symtabs.  What would functions
like find_compunit_symtab_by_address return?  Should the new symbol be
added to an existing compunit_symtab, if the address falls into an
existing compunit_symtab's address range?

I think I'll have more questions / worries, but I'll wait until I can
actually apply the patch and read it (I can't read diffs, sorry).

Simon

  reply	other threads:[~2023-01-06 20:21 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-01-06  1:37 dark.ryu.550
2023-01-06 20:21 ` Simon Marchi [this message]
2023-01-12  2:00   ` [PATCH] " Matheus Branco Borella

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=735caf65-fff8-bca0-2f55-6c2e8781eeb6@simark.ca \
    --to=simark@simark.ca \
    --cc=dark.ryu.550@gmail.com \
    --cc=gdb-patches@sourceware.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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).