public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: Bruno Larsen <blarsen@redhat.com>
To: Simon Marchi <simark@simark.ca>, gdb-patches@sourceware.org
Subject: Re: [PATCH v2 2/2] gdb/c++: Improve error messages in overload resolution
Date: Thu, 10 Nov 2022 16:29:43 +0100	[thread overview]
Message-ID: <5eb453d2-5583-eec2-3aa2-ea0880894a71@redhat.com> (raw)
In-Reply-To: <860e668a-75b0-3a6a-26e1-5fe11f87ce53@simark.ca>

On 10/11/2022 16:19, Simon Marchi wrote:
>
> On 11/4/22 11:47, Bruno Larsen via Gdb-patches wrote:
>> When resolving overloaded functions, GDB relies on knowing relationships
>> between types, i.e. if a type inherits from another. However, some
>> compilers may not add complete information for given types as a way to
>> reduce unnecessary debug information. In these cases, GDB would just say
>> that it couldn't resolve the method or function, with no extra
>> information.
>>
>> The problem is that sometimes the user may not know that the type
>> information is incomplete, and may just assume that there is a bug in
>> GDB. To improve the user experience, we attempt to detect if the
>> overload match failed because of an incomplete type, and warn the user
>> of this.
>>
>> This commit also adds a testcase confirming that the message is only
>> triggered in the correct scenario. This test was not developed as an
>> expansion of gdb.cp/overload.cc because it needed the dwarf assembler,
>> and porting all of overload.cc seemed unnecessary.
> I get some new failures starting from this patch (tested both on Ubuntu
> 22.04 and a fairly recent Arch Linux):
>
> FAIL: gdb.cp/converts.exp: p foo3_1 (0, 1)
> FAIL: gdb.cp/converts.exp: p foo1_7(ta)
> FAIL: gdb.cp/converts.exp: strict type checking on: p foo1_type_check (123)
> FAIL: gdb.cp/converts.exp: strict type checking on: p foo2_type_check (0, 1)
> FAIL: gdb.cp/converts.exp: strict type checking on: p foo2_type_check (1, 0)
> FAIL: gdb.cp/converts.exp: strict type checking on: p foo2_type_check (1, 1)
> FAIL: gdb.cp/converts.exp: strict type checking on: p foo3_type_check (0, 0, 1)
> FAIL: gdb.cp/converts.exp: strict type checking on: p foo3_type_check (0, 1, 0)
> FAIL: gdb.cp/converts.exp: strict type checking on: p foo3_type_check (1, 0, 0)
> FAIL: gdb.cp/converts.exp: strict type checking on: p foo3_type_check (0, 1, 1)
> FAIL: gdb.cp/converts.exp: strict type checking on: p foo3_type_check (1, 1, 0)
> FAIL: gdb.cp/converts.exp: strict type checking on: p foo3_type_check (1, 1, 1)

/me facepalms

I'm very sorry, got tunnel visioned in fixing the issue, forgot to run 
the rest of the tests. Will fix all of these.

> FAIL: gdb.cp/enum-class.exp: print overload2(77)
> FAIL: gdb.cp/enum-class.exp: print overload3(E1::THERE)
> FAIL: gdb.cp/koenig.exp: p foo(ix)
> FAIL: gdb.cp/koenig.exp: p foo (p_union)
> FAIL: gdb.cp/local-static.exp: c++: print S::method()
> FAIL: gdb.cp/local-static.exp: c++: print S::inline_method()
> FAIL: gdb.cp/local-static.exp: c++: print S2<int>::method()
> FAIL: gdb.cp/local-static.exp: c++: print S2<int>::inline_method()
> FAIL: gdb.cp/operator.exp: namespace alias
> FAIL: gdb.cp/operator.exp: imported declaration
> FAIL: gdb.cp/pr12028.exp: p D::foo(b)
> FAIL: gdb.cp/rvalue-ref-overload.exp: passing lvalue arg to rvalue parameter
However, I'm not getting these fails... is gcc only emitting delaration 
DIEs for these tests, or is it something else?

-- 
Cheers,
Bruno

> Simon


  reply	other threads:[~2022-11-10 15:29 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-04 15:47 [PATCH v2 0/2] Improve error messages with incomplete variables Bruno Larsen
2022-11-04 15:47 ` [PATCH v2 1/2] gdb/testsuite: allowed for function_range to deal with mangled functions Bruno Larsen
2022-11-09 17:15   ` Tom Tromey
2022-11-10 11:41     ` Bruno Larsen
2022-11-10 13:44       ` Tom Tromey
2022-11-10 13:52         ` Bruno Larsen
2022-11-04 15:47 ` [PATCH v2 2/2] gdb/c++: Improve error messages in overload resolution Bruno Larsen
2022-11-09 17:47   ` Tom Tromey
2022-11-10 15:19   ` Simon Marchi
2022-11-10 15:29     ` Bruno Larsen [this message]
2022-11-10 15:45       ` Simon Marchi

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=5eb453d2-5583-eec2-3aa2-ea0880894a71@redhat.com \
    --to=blarsen@redhat.com \
    --cc=gdb-patches@sourceware.org \
    --cc=simark@simark.ca \
    /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).