From: "Gerlicher, Klaus" <klaus.gerlicher@intel.com>
To: Tom Tromey <tom@tromey.com>, Andrew Burgess <aburgess@redhat.com>
Cc: "gdb-patches@sourceware.org" <gdb-patches@sourceware.org>,
Bernd Edlinger <bernd.edlinger@hotmail.de>
Subject: RE: [PATCH] gdb: fix handling of DW_AT_entry_pc of inlined subroutines
Date: Fri, 18 Oct 2024 10:26:50 +0000 [thread overview]
Message-ID: <SN7PR11MB70911E2743262DC4ABFD8BA8E8402@SN7PR11MB7091.namprd11.prod.outlook.com> (raw)
In-Reply-To: <87y12mcxac.fsf@tromey.com>
Hi Andrew, Tom,
Just an observation on the concern for size of the block struct. Inline.
> -----Original Message-----
> From: Tom Tromey <tom@tromey.com>
> Sent: Thursday, October 17, 2024 10:03 PM
> To: Andrew Burgess <aburgess@redhat.com>
> Cc: gdb-patches@sourceware.org; Bernd Edlinger
> <bernd.edlinger@hotmail.de>
> Subject: Re: [PATCH] gdb: fix handling of DW_AT_entry_pc of inlined
> subroutines
>
> >>>>> "Andrew" == Andrew Burgess <aburgess@redhat.com> writes:
>
> Andrew> This commit extends the block class to carry the entry PC as a
> Andrew> separate member variable. Then the DWARF reader is extended to
> read
> Andrew> and set the entry PC for the block. Now in block::entry_pc(), if the
> Andrew> entry PC has been set to a specific value, this is the value returned.
>
> I wonder what the size cost is of adding a field to block -- I mean the
> overall cost, not just sizeof(block).
>
> But I suppose in the end it's not very important, since we normally
> operate on the assumption that most CUs won't be expanded.
>
> Andrew> CORE_ADDR entry_pc () const
> Andrew> {
> Andrew> - if (this->is_contiguous ())
> Andrew> + if (m_entry_pc.has_value ())
> Andrew> + return *m_entry_pc;
> Andrew> + else if (this->is_contiguous ())
> Andrew> return this->start ();
> Andrew> else
> Andrew> return this->ranges ()[0].start ();
>
> Andrew> +
> Andrew> + /* If set this is the entry PC for the block. */
> Andrew> +
> Andrew> + std::optional<CORE_ADDR> m_entry_pc;
> Andrew> };
>
> std::optional here means carrying an extra word for just the flag bit.
>
> However I wonder if it would work to use CORE_ADDR here and use 0 as a
> sentinel to mean unset; or some other scheme making it so the entry PC
> and the 'start' are identical by default.
>
If size of a block struct is a concern, couldn't we remove m_start and m_end in favour of only using
the m_ranges member? This comment seems to indicate that they are kind of exclusive...
/* Address ranges for blocks with non-contiguous ranges. If this
is NULL, then there is only one range which is specified by
startaddr and endaddr above. */
struct blockranges *m_ranges = nullptr;
Thanks
Klaus
> Tom
Intel Deutschland GmbH
Registered Address: Am Campeon 10, 85579 Neubiberg, Germany
Tel: +49 89 99 8853-0, www.intel.de
Managing Directors: Sean Fennelly, Jeffrey Schneiderman, Tiffany Doon Silva
Chairperson of the Supervisory Board: Nicole Lau
Registered Office: Munich
Commercial Register: Amtsgericht Muenchen HRB 186928
next prev parent reply other threads:[~2024-10-18 10:26 UTC|newest]
Thread overview: 41+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-10-16 15:47 Andrew Burgess
2024-10-17 20:03 ` Tom Tromey
2024-10-18 10:06 ` Andrew Burgess
2024-10-18 13:57 ` Andrew Burgess
2024-10-18 10:26 ` Gerlicher, Klaus [this message]
2024-10-18 13:55 ` Andrew Burgess
2024-10-18 13:53 ` [PATCHv2] " Andrew Burgess
2024-10-28 13:45 ` [PATCHv3] " Andrew Burgess
2024-10-29 14:49 ` [PATCHv4] " Andrew Burgess
2024-10-29 15:28 ` Bernd Edlinger
2024-10-31 10:57 ` Andrew Burgess
2024-10-31 14:01 ` Bernd Edlinger
2024-10-31 14:56 ` Andrew Burgess
2024-10-29 16:34 ` Bernd Edlinger
2024-10-31 10:59 ` Andrew Burgess
2024-10-31 15:00 ` [PATCHv5] " Andrew Burgess
2024-11-01 18:13 ` Tom Tromey
2024-11-01 20:27 ` Bernd Edlinger
2024-11-05 11:25 ` Andrew Burgess
2024-11-05 15:26 ` Bernd Edlinger
2024-11-05 16:52 ` Andrew Burgess
2024-11-05 19:57 ` Bernd Edlinger
2024-11-05 11:21 ` [PATCHv6] " Andrew Burgess
2024-11-13 13:49 ` Andrew Burgess
2024-11-13 16:59 ` Andrew Burgess
2024-11-14 9:20 ` Tom de Vries
2024-11-14 19:33 ` Andrew Burgess
2024-11-15 8:50 ` Tom de Vries
2024-11-15 10:53 ` Bernd Edlinger
2024-11-15 14:00 ` Andrew Burgess
2024-11-15 14:30 ` Tom de Vries
2024-11-15 16:46 ` Andrew Burgess
2024-11-15 19:24 ` Andrew Burgess
2024-11-17 23:52 ` Bernd Edlinger
2024-11-19 9:29 ` Andrew Burgess
2024-11-15 17:00 ` Bernd Edlinger
2024-11-15 13:45 ` Andrew Burgess
2024-10-29 15:29 ` [PATCHv3] " Sam James
2024-10-31 9:48 ` Andrew Burgess
2024-10-18 14:24 ` [PATCH] " Bernd Edlinger
2024-10-28 13:26 ` Andrew Burgess
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=SN7PR11MB70911E2743262DC4ABFD8BA8E8402@SN7PR11MB7091.namprd11.prod.outlook.com \
--to=klaus.gerlicher@intel.com \
--cc=aburgess@redhat.com \
--cc=bernd.edlinger@hotmail.de \
--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).