From: Tom Tromey <tom@tromey.com>
To: Tom de Vries <tdevries@suse.de>
Cc: Tom Tromey <tromey@adacore.com>, gdb-patches@sourceware.org
Subject: Re: [PATCH] Check record types for compatibility in ada_type_match
Date: Thu, 27 Aug 2026 10:08:05 -0600 [thread overview]
Message-ID: <87bjana6my.fsf@tromey.com> (raw)
In-Reply-To: <8c8a38de-5db7-4857-95d1-4abf2a010d54@suse.de> (Tom de Vries's message of "Thu, 27 Aug 2026 16:17:47 +0200")
>>>>> "Tom" == Tom de Vries <tdevries@suse.de> writes:
>> +/* Helper for ada_type_match that checks that two record types
>> are
>> + compatible. As with that function, FTYPE is the formal type and
>> + ATYPE is the actual type.
>> +
>> + Note that it is ok if this function is not precise, as long as
>> + there aren't too many false negatives. That is, it's better to
>> + return 'true', because that will result in a menu being presented
>> + to the user. */
>> +
Tom> I don't fully understand the reasoning here. AFAIU, if there is only
Tom> one match, no menu will be presented. In that case, is returning true
Tom> still a conservative choice?
Returning true means that gdb will consider the types compatible.
If there are multiple overloads of some function, ada-lang.c checks them
for compatibility with the actual arguments; see ada_resolve_function.
If multiple functions then survive this compatibility check, gdb will
present a menu.
So, if there's some doubt, returning true will mean that more possible
overloads will be considered matches; and in this case a menu will be
presented.
Mainly here we are interested in filtering out the types that definitely
do not match. IME it's annoying when debugging Ada to be given
nonsensical choices. I'd like to even further refine this code, but Ada
is pretty complicated and so it's not easy to do.
Tom
prev parent reply other threads:[~2026-08-27 16:08 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-26 20:13 Tom Tromey
2026-08-27 14:17 ` Tom de Vries
2026-08-27 16:08 ` Tom Tromey [this message]
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=87bjana6my.fsf@tromey.com \
--to=tom@tromey.com \
--cc=gdb-patches@sourceware.org \
--cc=tdevries@suse.de \
--cc=tromey@adacore.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