public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: Simon Marchi <simark@simark.ca>
To: Tom Tromey <tromey@adacore.com>, gdb-patches@sourceware.org
Subject: Re: [PATCH 3/6] Pass section index to start_compunit_symtab
Date: Wed, 18 Jan 2023 16:55:18 -0500	[thread overview]
Message-ID: <56ff147d-d09f-2093-efac-50b1eee555d0@simark.ca> (raw)
In-Reply-To: <20230118153025.342512-4-tromey@adacore.com>


>  /* Subroutine of augment_type_symtab to simplify it.
> diff --git a/gdb/buildsym.h b/gdb/buildsym.h
> index 9724607f3d9..0464c738114 100644
> --- a/gdb/buildsym.h
> +++ b/gdb/buildsym.h
> @@ -146,18 +146,23 @@ struct buildsym_compunit
>       (or NULL if not known).
>  
>       NAME and NAME_FOR_ID have the same purpose as for the start_subfile
> -     method.  */
> +     method.
> +
> +     SECTION_INDEX is the index of the section for the compunit and
> +     for block symbols in this compunit.  Normally SECT_OFF_TEXT.  */

I don't understand this comment, specifically how a compunit can "have"
a single section.  Don't compunits define data and text symbols, which
have different sections, for instance?

From what I can see, this section index is ultimately use to apply /
unapply a relocation offset when dealing with call sites (e.g.
compunit_symtab::find_call_site), so it makes sense that we want the
text section (call site addresses are code addresses).  So maybe the
comment and / or the field name could reflect that this is the section
index for the code / text section.  Just saying "section index" doesn't
tell much about which section it is.

I'm curious to know why we have to store that and we can't always use
SECT_OFF_TEXT, but I guess that will come with the following patches.

Simon

  reply	other threads:[~2023-01-18 21:55 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-01-18 15:30 [PATCH 0/6] Change how symbol section indices are set Tom Tromey
2023-01-18 15:30 ` [PATCH 1/6] Use default section indexes in fixup_symbol_section Tom Tromey
2023-01-18 17:19   ` Simon Marchi
2023-01-18 19:13     ` Tom Tromey
2023-01-18 15:30 ` [PATCH 2/6] Set section indices when symbols are made Tom Tromey
2023-01-18 21:43   ` Simon Marchi
2023-01-18 22:00     ` Tom Tromey
2023-01-18 15:30 ` [PATCH 3/6] Pass section index to start_compunit_symtab Tom Tromey
2023-01-18 21:55   ` Simon Marchi [this message]
2023-01-18 22:02     ` Tom Tromey
2023-01-18 22:06       ` Simon Marchi
2023-01-19 13:36         ` Tom Tromey
2023-02-08 16:28           ` Tom Tromey
2023-01-18 15:30 ` [PATCH 4/6] Set section index when setting a symbol's block Tom Tromey
2023-01-18 15:30 ` [PATCH 5/6] Remove most calls to fixup_symbol_section Tom Tromey
2023-01-18 15:30 ` [PATCH 6/6] Merge fixup_section and fixup_symbol_section Tom Tromey
2023-02-08 16:28 ` [PATCH 0/6] Change how symbol section indices are set Tom Tromey

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=56ff147d-d09f-2093-efac-50b1eee555d0@simark.ca \
    --to=simark@simark.ca \
    --cc=gdb-patches@sourceware.org \
    --cc=tromey@adacore.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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).