From: Alan Hayward <Alan.Hayward@arm.com>
To: "gdb-patches@sourceware.org" <gdb-patches@sourceware.org>
Cc: nd <nd@arm.com>, Alan Hayward <Alan.Hayward@arm.com>
Subject: [PATCH 1/2] Allow function prologues to have multiple repeating lines
Date: Wed, 24 Oct 2018 09:04:00 -0000 [thread overview]
Message-ID: <20181024090427.22721-1-alan.hayward@arm.com> (raw)
Compiling gdb.cp/ovldbreak.cc on Ubuntu places two identical line numbers
in the function prologue.
x86_64 Ubtunu 16.04 with GCC 5.4.0-6ubuntu1~16.04.4
000000000040052f <main>:
Line 48
40052f: 55 push %rbp
400530: 48 89 e5 mov %rsp,%rbp
400533: 53 push %rbx
400534: 48 81 ec 88 00 00 00 sub $0x88,%rsp
Line 48
40053b: 64 48 8b 04 25 28 00 mov %fs:0x28,%rax
400542: 00 00
400544: 48 89 45 e8 mov %rax,-0x18(%rbp)
400548: 31 c0 xor %eax,%eax
Line 49
40054a: c6 45 85 02 movb $0x2,-0x7b(%rbp)
Line 50
40054e: c6 45 86 03 movb $0x3,-0x7a(%rbp)
etc
Aarch64 Ubuntu 16.04 with GCC 7.2.0-1ubuntu1~16.04
0000000000400708 <main>:
Line 48
400708: d102c3ff sub sp, sp, #0xb0
40070c: a9027bfd stp x29, x30, [sp,#32]
400710: 910083fd add x29, sp, #0x20
400714: f9001bf3 str x19, [sp,#48]
Line 48
400718: 90000100 adrp x0, 420000 <_GLOBAL_OFFSET_TABLE_+0x28>
40071c: 9100e000 add x0, x0, #0x38
400720: f9400001 ldr x1, [x0]
400724: f90047a1 str x1, [x29,#136]
400728: d2800001 mov x1, #0x0 // #0
Line 49
40072c: 52800040 mov w0, #0x2 // #2
400730: 3900b7a0 strb w0, [x29,#45]
Line 50
400734: 52800060 mov w0, #0x3 // #3
400738: 3900bba0 strb w0, [x29,#46]
etc
Compare to openSUSE 13.3 AArch64 with GCC 7.2.1 20171020
00000000004005e4 <main>:
Line 48
4005e4: d102c3ff sub sp, sp, #0xb0
4005e8: a9027bfd stp x29, x30, [sp, #32]
4005ec: 910083fd add x29, sp, #0x20
4005f0: f9001bf3 str x19, [sp, #48]
Line 49
4005f4: 52800040 mov w0, #0x2 // #2
4005f8: 39023fa0 strb w0, [x29, #143]
Line 50
4005fc: 52800060 mov w0, #0x3 // #3
400600: 39023ba0 strb w0, [x29, #142]
skip_prologue_using_sal () does did not allow for the case where there might
be two SALs with the same line number in a function prologue. Allow this.
Fixes over 50 tests on Aarch64 Ubuntu.
2018-10-24 Alan Hayward <alan.hayward@arm.com>
* symtab.c (skip_prologue_using_sal): Don't break for equal line
numbers.
---
gdb/symtab.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/gdb/symtab.c b/gdb/symtab.c
index 2e48d6527e..67ab5d40fa 100644
--- a/gdb/symtab.c
+++ b/gdb/symtab.c
@@ -3925,9 +3925,9 @@ skip_prologue_using_sal (struct gdbarch *gdbarch, CORE_ADDR func_addr)
sal = find_pc_line (prologue_sal.end, 0);
if (sal.line == 0)
break;
- /* Assume that a consecutive SAL for the same (or larger)
- line mark the prologue -> body transition. */
- if (sal.line >= prologue_sal.line)
+ /* Assume that a SAL to a larger line marks the prologue -> body
+ transition. */
+ if (sal.line > prologue_sal.line)
break;
/* Likewise if we are in a different symtab altogether
(e.g. within a file included via #include). */
--
2.17.1 (Apple Git-112)
next reply other threads:[~2018-10-24 9:04 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-10-24 9:04 Alan Hayward [this message]
2018-10-24 9:04 ` [PATCH 2/2] Check for line notes on GCC as well as Clang Alan Hayward
2018-11-05 4:16 ` Simon Marchi
2018-10-31 16:26 ` [PING][PATCH 1/2] Allow function prologues to have multiple repeating lines Alan Hayward
2018-11-05 3:50 ` [PATCH " Simon Marchi
2018-11-05 16:04 ` Alan Hayward
2018-11-30 20:10 ` Tom Tromey
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=20181024090427.22721-1-alan.hayward@arm.com \
--to=alan.hayward@arm.com \
--cc=gdb-patches@sourceware.org \
--cc=nd@arm.com \
/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).