public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: Bruno Larsen <blarsen@redhat.com>
To: gdb-patches@sourceware.org
Subject: [PATCH 0/2] Improve error messages with incomplete variables
Date: Thu, 13 Oct 2022 18:01:13 +0200	[thread overview]
Message-ID: <20221013160114.4143323-1-blarsen@redhat.com> (raw)

Currently, if a user attempts to call a C++ fuction by hand using an
incomplete variable, GDB might be unable to find the correct overload,
but the error message in this situation is not intuitive at all. This
series attempts improve those messages with a hint.

To create a reasonably reproducible test, I decided to use the DWARF
assembler, but it needed some fixing to deal with C++ mangled names, so
the first patch happened.

Bruno Larsen (2):
  gdb/testsuite: allowed for function_range to deal with mangled
    functions
  gdb/c++: Improve error messages in overload resolution

 .../gdb.cp/incomplete-type-overload.cc        |  45 +++++
 .../gdb.cp/incomplete-type-overload.exp       | 183 ++++++++++++++++++
 gdb/testsuite/lib/dwarf.exp                   |  12 ++
 gdb/valops.c                                  |  49 ++++-
 4 files changed, 285 insertions(+), 4 deletions(-)
 create mode 100644 gdb/testsuite/gdb.cp/incomplete-type-overload.cc
 create mode 100644 gdb/testsuite/gdb.cp/incomplete-type-overload.exp

-- 
2.37.3


             reply	other threads:[~2022-10-13 16:05 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-10-13 16:01 Bruno Larsen [this message]
2022-10-13 16:01 ` [PATCH 1/2] gdb/testsuite: allowed for function_range to deal with mangled functions Bruno Larsen
2022-10-31 14:46   ` Andrew Burgess
2022-11-03 15:46     ` Bruno Larsen
2022-10-13 16:01 ` [PATCH 2/2] gdb/c++: Improve error messages in overload resolution Bruno Larsen
2022-10-31 15:04   ` Andrew Burgess
2022-11-04 13:55     ` Bruno Larsen

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=20221013160114.4143323-1-blarsen@redhat.com \
    --to=blarsen@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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).