public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: Simon Marchi <simon.marchi@polymtl.ca>
To: Tom Tromey <tom@tromey.com>,
	Simon Marchi via Gdb-patches <gdb-patches@sourceware.org>
Subject: Re: [PATCH 2/4] gdb/dwarf2: move some things to read.h
Date: Tue, 14 Feb 2023 14:37:02 -0500	[thread overview]
Message-ID: <926cd3db-c686-78b3-ea8c-965f66f77f91@polymtl.ca> (raw)
In-Reply-To: <873579dttn.fsf@tromey.com>

On 2/13/23 18:33, Tom Tromey wrote:
>>>>>> "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?

I added those.

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

My bad, I just copy pasted the line from the definition and forgot to
adjust them.  Done now.

> 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.

Nice find, I thought it was used in .debug_names too, but no.  I will
revert this part of this patch, and the class will go to
read-gdb-index.c in the following patch.

Simon

  parent reply	other threads:[~2023-02-14 19:37 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
2023-02-14  2:24     ` Thiago Jung Bauermann
2023-02-14 19:35       ` Simon Marchi
2023-02-14 19:37     ` Simon Marchi [this message]
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=926cd3db-c686-78b3-ea8c-965f66f77f91@polymtl.ca \
    --to=simon.marchi@polymtl.ca \
    --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).