From: Luis Machado <luis.machado@linaro.org>
To: Pedro Alves <pedro@palves.net>, Simon Marchi <simark@simark.ca>,
gdb-patches@sourceware.org
Subject: Re: [PATCH] Don't drop static function bp locations w/o debug info
Date: Thu, 24 Sep 2020 12:32:00 -0300 [thread overview]
Message-ID: <28a2dbf2-d9dc-0ffe-8b45-fa36a3522b25@linaro.org> (raw)
In-Reply-To: <bffa1851-a940-92b8-bb06-e52a19fe65b8@palves.net>
On 9/24/20 12:16 PM, Pedro Alves wrote:
> On 9/22/20 9:20 PM, Luis Machado wrote:
>> The new tests are failing for aarch64-linux-gnu on Ubuntu 18.04 (GCC 7.5.0).
>>
>> The breakpoint location patterns don't seem to be matching. Here's what I see...
>>
>> info breakpoint^M
>> Num Type Disp Enb Address What^M
>> 1 breakpoint keep y <MULTIPLE> ^M
>> 1.1 y 0x0000000000000794 <foo@plt+4>^M
>> 1.2 y 0x00000000000008bc <foo>^M
>
> The test is:
>
> test_info_break_2 \
> "<foo@plt.*>" \
> "<foo\\+$decimal>"
>
> So it should be trivial to adjust with
>
> - "<foo\\+$decimal>"
> + "<foo(\\+$decimal)?>"
>
>
> However, I wonder whether we're actually seeing a bug here.
> It seems like on x86, the breakpoint is set past the
> prologue (thus the "+$decimal"):
>
> Num Type Disp Enb Address What
> 1 breakpoint keep y <MULTIPLE>
> 1.1 y 0x0000000000001050 <foo@plt>
> 1.2 y 0x0000000000001165 <foo+8>
>
> while it is set exactly at the function's address on Aarch64.
>
> Why didn't GDB skip the prologue of <foo> on Aarch64?
> Is there really no instruction to skip?
>
> Here's what I see on x86-64, without debug info
> (outputs/gdb.base/msym-bp-shl/msym-bp-shl-0):
>
> (gdb) info breakpoints
> Num Type Disp Enb Address What
> 1 breakpoint keep y <MULTIPLE>
> 1.1 y 0x0000000000001050 <foo@plt>
> 1.2 y 0x0000000000001165 <foo+8>
>
> and on x86-64, with debug info
> (outputs/gdb.base/msym-bp-shl/msym-bp-shl-1):
>
> (gdb) info breakpoints
> Num Type Disp Enb Address What
> 1 breakpoint keep y <MULTIPLE>
> 1.1 y 0x0000000000001050 <foo@plt>
> 1.2 y 0x0000000000001165 in foo at src/gdb/testsuite/gdb.base/msym-bp-shl-main-2.c:21
>
> Note the location addresses are the same without vs with
> debug info: 0x1050 and 0x1165. Is that also the case on Aarch64?
It is the same case for AArch64. The reason for not skipping a prologue
is because there doesn't seem to be one. The generated code for aarch64
is the following:
(gdb) disass foo
0x00000000000008bc <+0>: nop
0x00000000000008c0 <+4>: ret
End of assembler dump.
I guess the assumptions of the test are valid for x86, but they're not
valid for aarch64.
next prev parent reply other threads:[~2020-09-24 15:32 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-06-12 19:21 Pedro Alves
2020-06-12 19:53 ` Simon Marchi
2020-09-13 13:25 ` Pedro Alves
2020-09-22 20:20 ` Luis Machado
2020-09-24 15:16 ` Pedro Alves
2020-09-24 15:32 ` Luis Machado [this message]
2020-09-24 15:35 ` Pedro Alves
2020-09-24 15:44 ` Luis Machado
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=28a2dbf2-d9dc-0ffe-8b45-fa36a3522b25@linaro.org \
--to=luis.machado@linaro.org \
--cc=gdb-patches@sourceware.org \
--cc=pedro@palves.net \
--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).