public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: Bruno Larsen <blarsen@redhat.com>
To: gdb-patches@sourceware.org
Cc: Bruno Larsen <blarsen@redhat.com>
Subject: [PATCH v2 0/2] Improve error messages with incomplete variables
Date: Fri,  4 Nov 2022 16:47:43 +0100	[thread overview]
Message-ID: <20221104154744.418906-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.

Changes for v2:
 * Used Andrew's suggestion for patch 1
 * Styling changes to code
 * Factored new code into a static function

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                   |   2 +-
 gdb/valops.c                                  |  53 ++++-
 4 files changed, 278 insertions(+), 5 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-11-04 15:52 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-04 15:47 Bruno Larsen [this message]
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
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=20221104154744.418906-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).