From: Keith Seitz <keiths@redhat.com>
To: Tom Tromey <tom@tromey.com>, gdb-patches@sourceware.org
Subject: Re: [PATCH 1/4] Rename objfile::sections
Date: Mon, 17 Apr 2023 10:57:52 -0700 [thread overview]
Message-ID: <fc5d650a-b34a-7e81-0150-bfa5c59a929b@redhat.com> (raw)
In-Reply-To: <20230416-remove-all-macros-v1-1-f118956faafe@tromey.com>
On 4/16/23 09:28, Tom Tromey wrote:
> I think objfile::sections makes sense as the name of the method to
> iterate over an objfile's sections, so this patch renames the existing
> field to objfile::sections_start in preparation for that.
I rather like this rename, tbh, because the related member is named
"sections_end". I like symmetry. :-)
Just one little comment...
> diff --git a/gdb/objfiles.h b/gdb/objfiles.h
> index 342aa09ac6a..0e326287907 100644
> --- a/gdb/objfiles.h
> +++ b/gdb/objfiles.h
> @@ -128,7 +128,7 @@ struct entry_info
> };
>
> #define ALL_OBJFILE_OSECTIONS(objfile, osect) \
> - for (osect = objfile->sections; osect < objfile->sections_end; osect++) \
> + for (osect = objfile->sections_start; osect < objfile->sections_end; osect++) \
> if (osect->the_bfd_section == NULL) \
> { \
> /* Nothing. */ \
> @@ -722,7 +722,7 @@ struct objfile
> structure data is only valid for certain sections
> (e.g. non-empty, SEC_ALLOC). */
>
... about a comment!
The paragraph/comment here needs updating, I think:
"SECTIONS points to the first entry in the table, [...]"
Keith
> - struct obj_section *sections = nullptr;
> + struct obj_section *sections_start = nullptr;
> struct obj_section *sections_end = nullptr;
>
> /* GDB allows to have debug symbols in separate object files. This is
next prev parent reply other threads:[~2023-04-17 17:57 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-04-16 16:28 [PATCH 0/4] Remove remaining ALL_ iterator macros Tom Tromey
2023-04-16 16:28 ` [PATCH 1/4] Rename objfile::sections Tom Tromey
2023-04-17 17:57 ` Keith Seitz [this message]
2023-05-07 18:43 ` Tom Tromey
2023-04-16 16:28 ` [PATCH 2/4] Remove ALL_OBJFILE_OSECTIONS Tom Tromey
2023-04-16 16:28 ` [PATCH 3/4] Remove ALL_DICT_SYMBOLS Tom Tromey
2023-04-16 16:28 ` [PATCH 4/4] Remove ALL_BREAKPOINTS_SAFE Tom Tromey
2023-05-08 2:24 ` Simon Marchi
2023-05-08 14:59 ` Simon Marchi
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=fc5d650a-b34a-7e81-0150-bfa5c59a929b@redhat.com \
--to=keiths@redhat.com \
--cc=gdb-patches@sourceware.org \
--cc=tom@tromey.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).