Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Pedro Alves <pedro@palves.net>
To: Andrew Burgess <aburgess@redhat.com>, gdb-patches@sourceware.org
Subject: Re: [PATCHv2 2/3] gdb: introduce program_space::get_entry_point_info function
Date: Tue, 16 Jun 2026 19:36:09 +0100	[thread overview]
Message-ID: <e6b540f1-2ecf-451c-84f1-38034d9c2f2a@palves.net> (raw)
In-Reply-To: <87fr2op04p.fsf@redhat.com>

Hi!

On 2026-06-15 11:29, Andrew Burgess wrote:
> Pedro Alves <pedro@palves.net> writes:
> 
>> On 2026-06-11 22:59, Andrew Burgess wrote:
>>> +    # Only svr4 targets currently support querying the inferior entry
>>> +    # address.
>>> +    if {[istarget *-linux*]} {
>>
>> There are more svr4 targets than linux.  I think this style of allow-list has
>> a good chance of never getting updated.  Deny-lists are better, IMHO.  If the
>> test fails on some port, that might trigger someone to add the feature
>> there.
> 
> Hey Pedro,
> 
> I'm still looking at your other feedback, but before I start making this
> specific change, I just wanted to clarify how you see this as being
> different from what I have right now.
> 
> If I write this as a deny list, e.g.
> 
>  if { ![istarget ....] && ![istarget ....] } {
>    # Run tests.
>  }
> 
> Is there not the same problem?  We rely on someone realising that the
> reason the test isn't run on their target is some missing GDB
> functionality, and them adding the functionality and removing the
> `istarget` block for their target.


Speaking from principles, and not this particular case:

The difference is that there was a failure that made someone see that
some functionality is missing.  With the allow-list, nobody ever notices it.

With a target-based allow-list, even if someone adds some functionality
to a port, it's typical to not comb through the testsuite and
relax the relevant allow-lists to also allow their targets.  

And even if they want to, there's no easy marker to grep for.  E.g, say I
implement feature X on Windows, then how do I know that I need to
grep for "istarget Y" to find all the tests that I need to adjust?
And which Y?  And then which ones that hit my grep should I look at?

I'll give you one example, in gdb.threads/watchpoint-fork.exp:

 # Only GNU/Linux is known to support `set follow-fork-mode child'.
 if {[istarget "*-*-linux*"]} {
     test child FOLLOW_CHILD
 } else {
     untested "${testfile}: child"
 }

I think at least FreeBSD has supported that for over a decade.

> 
> Another option would be for me to just not add any test skipping right
> now.  I know this will lead to the test failing for some targets as the
> new feature is only implemented for svr4 targets.  Then, if someone on a
> failing target cares, they can add the missing feature.  This approach
> feels a bit mean, I don't like adding failing tests for others, but it
> does draw attention to the problem.

I think the best would be to just add a reasonable deny-list from
the get go.  I suspect this is going to be a good enough starting point:

proc supports_process_entry_point {} {
   if windows || darwin
     return 0

   if is_svr4_target 
     return 1 # works even if remote, svr4 is handled on the host.

   if remote
     return 0 # no RSP packet that gets us the info

   # Assume yes.
   return 1
}

> 
> I wonder if a better approach would to stick with my allow list, but add
> an 'unsupported' call in the else block.  Maybe someone on e.g. Windows,
> will periodically look at tests that report 'unsupported' and see if
> there is anything that could be done?  If 'unsupported' is the wrong
> type then I can use whatever you prefer.

I don't think so.  In my experience, people ignore/miss PASS -> UNSUPPORTED
regressions, let alone looking for UNSUPPORTED results indicating tests
they should/could enable.  It is still good to issue an UNSUPPORTED, but
I wouldn't make that the discovery mechanism.

Pedro Alves

> 
> I agree with your feedback on svr4 being wider than just Linux, I'll add
> a helper function for `is_svr4_target` to lib/gdb.exp and then make use
> of that, the svr4 list can then be improved over time.
> 

> Thanks,
> Andrew
> 


  reply	other threads:[~2026-06-16 18:36 UTC|newest]

Thread overview: 54+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-06-08 18:14 [PATCH] gdb: allow 'until' to work in outermost frame Andrew Burgess
2026-06-11 19:24 ` Guinevere Larsen
2026-06-11 20:40   ` Andrew Burgess
2026-06-12 12:49     ` Guinevere Larsen
2026-06-11 21:59 ` [PATCHv2 0/3] " Andrew Burgess
2026-06-11 21:59   ` [PATCHv2 1/3] gdb: rename program_space::entry_point_address* functions Andrew Burgess
2026-06-12 15:41     ` Pedro Alves
2026-06-11 21:59   ` [PATCHv2 2/3] gdb: introduce program_space::get_entry_point_info function Andrew Burgess
2026-06-12  6:07     ` Eli Zaretskii
2026-06-15 10:14       ` Andrew Burgess
2026-06-15 12:01         ` Eli Zaretskii
2026-06-12 15:41     ` Pedro Alves
2026-06-15 10:29       ` Andrew Burgess
2026-06-16 18:36         ` Pedro Alves [this message]
2026-06-23  9:46           ` Andrew Burgess
2026-06-23 10:20             ` Pedro Alves
2026-06-11 21:59   ` [PATCHv2 3/3] gdb: allow 'until' to work in outermost frame Andrew Burgess
2026-06-12 15:57     ` Pedro Alves
2026-06-16 19:47   ` [PATCHv3 0/4] " Andrew Burgess
2026-06-16 19:47     ` [PATCHv3 1/4] gdb: rename program_space::entry_point_address* functions Andrew Burgess
2026-06-16 19:47     ` [PATCHv3 2/4] gdb: introduce program_space::get_entry_point_info function Andrew Burgess
2026-06-17 11:52       ` Eli Zaretskii
2026-06-16 19:47     ` [PATCHv3 3/4] gdb: allow 'until' to work in outermost frame Andrew Burgess
2026-06-16 19:47     ` [PATCHv3 4/4] gdb: cache program space entry point information Andrew Burgess
2026-06-23 10:47     ` [PATCHv4 0/4] gdb: allow 'until' to work in outermost frame Andrew Burgess
2026-06-23 10:47       ` [PATCHv4 1/4] gdb: rename program_space::entry_point_address* functions Andrew Burgess
2026-06-23 10:47       ` [PATCHv4 2/4] gdb: introduce program_space::get_entry_point_info function Andrew Burgess
2026-06-23 10:47       ` [PATCHv4 3/4] gdb: allow 'until' to work in outermost frame Andrew Burgess
2026-06-23 10:47       ` [PATCHv4 4/4] gdb: cache program space entry point information Andrew Burgess
2026-06-25 15:26       ` [PATCHv5 0/4] gdb: allow 'until' to work in outermost frame Andrew Burgess
2026-06-25 15:26         ` [PATCHv5 1/4] gdb: rename program_space::entry_point_address* functions Andrew Burgess
2026-06-25 15:26         ` [PATCHv5 2/4] gdb: introduce program_space::get_entry_point_info function Andrew Burgess
2026-06-25 15:26         ` [PATCHv5 3/4] gdb: allow 'until' to work in outermost frame Andrew Burgess
2026-06-25 15:26         ` [PATCHv5 4/4] gdb: cache program space entry point information Andrew Burgess
2026-07-10 14:24         ` [PATCHv6 0/4] gdb: allow 'until' to work in outermost frame Andrew Burgess
2026-07-10 14:24           ` [PATCHv6 1/4] gdb: rename program_space::entry_point_address* functions Andrew Burgess
2026-07-10 14:24           ` [PATCHv6 2/4] gdb: introduce program_space::get_entry_point_info function Andrew Burgess
2026-07-10 15:39             ` Simon Marchi
2026-07-10 14:24           ` [PATCHv6 3/4] gdb: allow 'until' to work in outermost frame Andrew Burgess
2026-07-10 17:00             ` Simon Marchi
2026-07-10 17:01               ` Simon Marchi
2026-07-16 15:06               ` Andrew Burgess
2026-07-10 14:24           ` [PATCHv6 4/4] gdb: cache program space entry point information Andrew Burgess
2026-07-10 17:07             ` Simon Marchi
2026-07-18 13:11           ` [PATCHv7 0/4] gdb: allow 'until' to work in outermost frame Andrew Burgess
2026-07-18 13:11             ` [PATCHv7 1/4] gdb: rename program_space::entry_point_address* functions Andrew Burgess
2026-07-18 13:11             ` [PATCHv7 2/4] gdb: introduce program_space::get_entry_point_info function Andrew Burgess
2026-07-18 13:11             ` [PATCHv7 3/4] gdb: allow 'until' to work in outermost frame Andrew Burgess
2026-07-18 13:11             ` [PATCHv7 4/4] gdb: cache program space entry point information Andrew Burgess
2026-07-20  9:52             ` [PATCHv8 0/4] gdb: allow 'until' to work in outermost frame Andrew Burgess
2026-07-20  9:52               ` [PATCHv8 1/4] gdb: rename program_space::entry_point_address* functions Andrew Burgess
2026-07-20  9:52               ` [PATCHv8 2/4] gdb: introduce program_space::get_entry_point_info function Andrew Burgess
2026-07-20  9:52               ` [PATCHv8 3/4] gdb: allow 'until' to work in outermost frame Andrew Burgess
2026-07-20  9:52               ` [PATCHv8 4/4] gdb: cache program space entry point information 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=e6b540f1-2ecf-451c-84f1-38034d9c2f2a@palves.net \
    --to=pedro@palves.net \
    --cc=aburgess@redhat.com \
    --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