public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: Tom Tromey <tom@tromey.com>
To: Simon Marchi via Gdb-patches <gdb-patches@sourceware.org>
Cc: Simon Marchi <simon.marchi@polymtl.ca>
Subject: Re: [PATCH 2/4] gdb/dwarf2: move some things to read.h
Date: Mon, 13 Feb 2023 16:33:24 -0700	[thread overview]
Message-ID: <873579dttn.fsf@tromey.com> (raw)
In-Reply-To: <20230213145559.46676-3-simon.marchi@polymtl.ca> (Simon Marchi via Gdb-patches's message of "Mon, 13 Feb 2023 09:55:57 -0500")

>>>>> "Simon" == Simon Marchi via Gdb-patches <gdb-patches@sourceware.org> writes:

Simon> The following 2 patches move .gdb_index and .debug_names reading code to
Simon> their own file.  Prepare this by exposing some things used by that code
Simon> to read.h.

Simon> +/* If FILE_MATCHER is NULL or if PER_CU has
Simon> +   dwarf2_per_cu_quick_data::MARK set (see
Simon> +   dw_expand_symtabs_matching_file_matcher), expand the CU and call
Simon> +   EXPANSION_NOTIFY on it.  */
Simon> +
Simon> +bool
Simon> +dw2_expand_symtabs_matching_one
Simon> +  (dwarf2_per_cu_data *per_cu,
Simon> +   dwarf2_per_objfile *per_objfile,
Simon> +   gdb::function_view<expand_symtabs_file_matcher_ftype> file_matcher,
Simon> +   gdb::function_view<expand_symtabs_exp_notify_ftype> expansion_notify);

Don't we normally write "extern" in headers?

Also normally in declarations the type is on the same line as the
function name.

Simon> +/* This is a view into the index that converts from bytes to an
Simon> +   offset_type, and allows indexing.  Unaligned bytes are specifically
Simon> +   allowed here, and handled via unpacking.  */
Simon> +
Simon> +class offset_view
Simon> +{
Simon> +public:
Simon> +  offset_view () = default;

I think this type should be specific to .gdb_index.  It shouldn't be
needed anywhere else -- it's there to work around the lack of alignment.

If it is needed somewhere else, I suppose it's fine, it would just be
better to refactor so that this can be an implementation detail of
.gdb_index again.

Tom

  reply	other threads:[~2023-02-13 23:33 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-02-13 14:55 [PATCH 0/4] Move index reading code out of dwarf2/read.c Simon Marchi
2023-02-13 14:55 ` [PATCH 1/4] gdb/dwarf2: rename some things, index -> gdb_index Simon Marchi
2023-02-13 23:30   ` Tom Tromey
2023-02-14 19:55     ` Simon Marchi
2023-02-13 14:55 ` [PATCH 2/4] gdb/dwarf2: move some things to read.h Simon Marchi
2023-02-13 23:33   ` Tom Tromey [this message]
2023-02-14  2:24     ` Thiago Jung Bauermann
2023-02-14 19:35       ` Simon Marchi
2023-02-14 19:37     ` Simon Marchi
2023-02-13 14:55 ` [PATCH 3/4] gdb/dwarf2: split .gdb_index reading code to own file Simon Marchi
2023-02-13 23:35   ` Tom Tromey
2023-02-13 14:55 ` [PATCH 4/4] gdb/dwarf2: split .debug_names " Simon Marchi
2023-02-13 23:38   ` 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=873579dttn.fsf@tromey.com \
    --to=tom@tromey.com \
    --cc=gdb-patches@sourceware.org \
    --cc=simon.marchi@polymtl.ca \
    /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).