From: Bruno Larsen <blarsen@redhat.com>
To: Andrew Burgess <aburgess@redhat.com>, gdb-patches@sourceware.org
Subject: Re: [PATCH 1/2] gdb/testsuite: allowed for function_range to deal with mangled functions
Date: Thu, 3 Nov 2022 16:46:05 +0100 [thread overview]
Message-ID: <0f035618-c071-b203-8985-d5db915c3224@redhat.com> (raw)
In-Reply-To: <874jvkcaq8.fsf@redhat.com>
On 31/10/2022 15:46, Andrew Burgess wrote:
> 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?
This sounds like a much better approach. Everyday I'm learning about
some new thing in GDB.
Will send it like this on v2
Cheers,
Bruno
> 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)
>
next prev parent reply other threads:[~2022-11-03 15: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
2022-11-03 15:46 ` Bruno Larsen [this message]
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=0f035618-c071-b203-8985-d5db915c3224@redhat.com \
--to=blarsen@redhat.com \
--cc=aburgess@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).