public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: Andrew Burgess <aburgess@redhat.com>
To: Bernd Edlinger <bernd.edlinger@hotmail.de>, gdb-patches@sourceware.org
Subject: Re: [PATCHv5] gdb: fix handling of DW_AT_entry_pc of inlined subroutines
Date: Tue, 05 Nov 2024 16:52:24 +0000	[thread overview]
Message-ID: <871pzpsjw7.fsf@redhat.com> (raw)
In-Reply-To: <DU2PR08MB10263990282DB158FF5CDCCF1E4522@DU2PR08MB10263.eurprd08.prod.outlook.com>

Bernd Edlinger <bernd.edlinger@hotmail.de> writes:

> On 11/5/24 12:25, Andrew Burgess wrote:
>> Bernd Edlinger <bernd.edlinger@hotmail.de> writes:
>> 
>>> On 10/31/24 16:00, Andrew Burgess wrote:
>>>> +  /* Set this block's entry-pc to ADDR, which must lie between start() and
>>>> +     end().  */
>>>> +
>>>> +  void set_entry_pc (CORE_ADDR addr)
>>>> +  {
>>>> +    gdb_assert (addr >= this->start () && addr < this->end ());
>>>
>>> note that my patch series part 3/3 has an example where
>>> the inline funcion has an empty instruction range, I wonder
>>> if this assertion will break, maybe addr <= this->end ?
>> 
>> I ran the tests from the full optimised debug series.  Obviously there's
>> plenty of failures at this point, but there are no assertions triggered.
>> 
>
> Ah, okay, then this is probably just a complaint.
>
>> Using 'addr <= this->end' would, I think not be correct, as the block's
>> end() address is not inclusive.  That is, if 'addr == this->end ()' then
>> the entry-pc would be the first address outside the block's range, which
>> is clearly not correct.
>> 
>
> Yeah likely, but maybe with the exception when start==end && start==entry_pc?

But right now such empty ranges (when start == end) are discarded, so
this would appear as an entry_pc outside of the block's range, which
would mean we don't attempt to set the entry-pc.

If/when we later "fix" the handling of empty ranges then we might have
to do something here, but that will depend on how we choose to handle
the empty range problem.  I don't think we should preemptively try to
adjust for that future fix at this point.  But it's certainly something
we can keep in mind that might need investigating later on.

Thanks,
Andrew


  reply	other threads:[~2024-11-05 16:52 UTC|newest]

Thread overview: 41+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-10-16 15:47 [PATCH] " 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
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 [this message]
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=871pzpsjw7.fsf@redhat.com \
    --to=aburgess@redhat.com \
    --cc=bernd.edlinger@hotmail.de \
    --cc=gdb-patches@sourceware.org \
    /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).