public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: Andrew Burgess <aburgess@redhat.com>
To: Bruno Larsen <blarsen@redhat.com>, gdb-patches@sourceware.org
Subject: Re: [PATCH 1/2] gdb/testsuite: allowed for function_range to deal with mangled functions
Date: Mon, 31 Oct 2022 14:46:07 +0000	[thread overview]
Message-ID: <874jvkcaq8.fsf@redhat.com> (raw)
In-Reply-To: <20221013160114.4143323-2-blarsen@redhat.com>

Bruno Larsen via Gdb-patches <gdb-patches@sourceware.org> writes:

> When calling get_func_info inside a test case, it would cause failures
> if the function was printed using a C++ style mangled name. The current
> patch fixes this by allowing for mangled names along with the current
> rules.

Instead of this approach, I would like to propose an alternative which I
believe also addresses this issue.  What do you think of this?

Thanks,
Andrew

---

commit b6d59ad650cfc552487c82a4eef49442b0642bca
Author: Bruno Larsen via Gdb-patches <gdb-patches@sourceware.org>
Date:   Thu Oct 13 18:01:15 2022 +0200

    gdb/testsuite: allowed for function_range to deal with mangled functions
    
    When calling get_func_info inside a test case, it would cause failures
    if the function was printed using a C++ style mangled name.  Fix this
    by asking the disassembler to demangle symbols.

diff --git a/gdb/testsuite/lib/dwarf.exp b/gdb/testsuite/lib/dwarf.exp
index 593f4ea72f1..17faf06992e 100644
--- a/gdb/testsuite/lib/dwarf.exp
+++ b/gdb/testsuite/lib/dwarf.exp
@@ -400,7 +400,7 @@ proc function_range { func src {options {debug}} } {
     if { $func_length != 0 } {
 	set func_pattern "$func_pattern\\+$func_length"
     }
-    set test "x/2i $func+$func_length"
+    set test "with print asm-demangle on -- x/2i $func+$func_length"
     gdb_test_multiple $test $test {
 	-re ".*($hex) <$func_pattern>:\[^\r\n\]+\r\n\[ \]+($hex).*\.\r\n$gdb_prompt $" {
 	    set start $expect_out(1,string)


  reply	other threads:[~2022-10-31 14:46 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-10-13 16:01 [PATCH 0/2] Improve error messages with incomplete variables Bruno Larsen
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 [this message]
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=874jvkcaq8.fsf@redhat.com \
    --to=aburgess@redhat.com \
    --cc=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).