public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: Pedro Alves <pedro@palves.net>
To: Luis Machado <luis.machado@linaro.org>,
	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 16:16:55 +0100	[thread overview]
Message-ID: <bffa1851-a940-92b8-bb06-e52a19fe65b8@palves.net> (raw)
In-Reply-To: <1f254bd1-e75a-cdf3-e7c6-e89d51216635@linaro.org>

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?

Pedro Alves

  reply	other threads:[~2020-09-24 15:16 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 [this message]
2020-09-24 15:32         ` Luis Machado
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=bffa1851-a940-92b8-bb06-e52a19fe65b8@palves.net \
    --to=pedro@palves.net \
    --cc=gdb-patches@sourceware.org \
    --cc=luis.machado@linaro.org \
    --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).