From: Andrew Burgess <andrew.burgess@embecosm.com>
To: Tom Tromey <tom@tromey.com>
Cc: Bernd Edlinger <bernd.edlinger@hotmail.de>, gdb-patches@sourceware.org
Subject: Re: [PATCHv2 2/2] gdb: Add support for tracking the DWARF line table is-stmt field
Date: Tue, 17 Mar 2020 22:21:17 +0000 [thread overview]
Message-ID: <20200317222117.GM3317@embecosm.com> (raw)
In-Reply-To: <878sjyybto.fsf@tromey.com>
* Tom Tromey <tom@tromey.com> [2020-03-17 14:18:43 -0600]:
> >>>>> "Andrew" == Andrew Burgess <andrew.burgess@embecosm.com> writes:
>
> Andrew> + /* If the previous entry is for the same line, at the same pc, and
> Andrew> + is marked as a statement, while we are trying to add a
> Andrew> + non-statement, then lets just drop this new non-statement. */
>
> I didn't try it yet, but I suspect it won't work, because the readelf
> output up-thread showed that the 2nd r.h line was not a statement:
>
> File name Line number Starting address View Stmt
> [...]
> r.h 6 0x80000042 2 x
> r.h 6 0x80000042 3
OK, but prior to the is-stmt patches GDB didn't track any
non-statement line table entries, so my thinking was that previously
we were spotting two sequential entries that were marked as
statements. This led me to think that deleting duplicate
non-statement entries would be fine.
With current HEAD of GDB the line table looks like this:
(gdb) maintenance info line-table
objfile: /home/andrew/tmp/r.x ((struct objfile *) 0x2ac3b90)
compunit_symtab: ((struct compunit_symtab *) 0x2aec530)
symtab: /home/andrew/tmp/r.c ((struct symtab *) 0x2aec5b0)
linetable: ((struct linetable *) 0x2b861d0):
INDEX LINE ADDRESS IS-STMT
0 END 0x0000000000010150 Y
1 8 0x0000000000010154
2 END 0x0000000000010158 Y
objfile: /home/andrew/tmp/r.x ((struct objfile *) 0x2ac3b90)
compunit_symtab: ((struct compunit_symtab *) 0x2aec530)
symtab: /home/andrew/tmp/r.h ((struct symtab *) 0x2aec5e0)
linetable: ((struct linetable *) 0x2b86190):
INDEX LINE ADDRESS IS-STMT
0 6 0x0000000000010150 Y
1 END 0x0000000000010154 Y
If we completely remove the hunk that you identified then the line
table becomes:
(gdb) maintenance info line-table
objfile: /home/andrew/tmp/r.x ((struct objfile *) 0x3040bd0)
compunit_symtab: ((struct compunit_symtab *) 0x306d2e0)
symtab: /home/andrew/tmp/r.c ((struct symtab *) 0x306d360)
linetable: ((struct linetable *) 0x31012c0):
INDEX LINE ADDRESS IS-STMT
0 END 0x0000000000010150 Y
1 8 0x0000000000010154
2 END 0x0000000000010158 Y
objfile: /home/andrew/tmp/r.x ((struct objfile *) 0x3040bd0)
compunit_symtab: ((struct compunit_symtab *) 0x306d2e0)
symtab: /home/andrew/tmp/r.h ((struct symtab *) 0x306d390)
linetable: ((struct linetable *) 0x3101270):
INDEX LINE ADDRESS IS-STMT
0 6 0x0000000000010150 Y
1 6 0x0000000000010150
2 END 0x0000000000010154 Y
Interestingly, without any of the is-stmt patches the GDB's line table
looks like this:
(gdb) maintenance info line-table
objfile: /home/andrew/tmp/r.x ((struct objfile *) 0x15da130)
compunit_symtab: ((struct compunit_symtab *) 0x15ca5c0)
symtab: /home/andrew/tmp/r.c ((struct symtab *) 0x15ca640)
linetable: ((struct linetable *) 0x1675df0):
INDEX LINE ADDRESS
0 0 0x0000000000010150
objfile: /home/andrew/tmp/r.x ((struct objfile *) 0x15da130)
compunit_symtab: ((struct compunit_symtab *) 0x15ca5c0)
symtab: /home/andrew/tmp/r.h ((struct symtab *) 0x15ca680)
linetable: ((struct linetable *) 0x1675dc0):
INDEX LINE ADDRESS
0 6 0x0000000000010150
So what happens is we run into this bit of code in
skip_prologue_using_sal:
/* If there is only one sal that covers the entire function,
then it is probably a single line function, like
"foo(){}". */
if (prologue_sal.end >= end_pc)
return 0;
So, it looks like we have two different parts of the is-stmt change
playing off against each other, the extra END marker is what changes
the function from a single entry line table to a multi-entry one, this
is what breaks thinks. Then when you remove the hunk you identified
this causes the prologue skipping to spot the dual entry case and we
do the right thing again.
It feels like this is more luck than design.
I need to revisit the code that added the extra END marker and
convince myself again that this is the right thing to do I think.
Hopefully I'll have an update tomorrow.
Thanks,
Andrew
next prev parent reply other threads:[~2020-03-17 22:21 UTC|newest]
Thread overview: 79+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-02-05 11:37 [PATCH 0/2] Line table is_stmt support Andrew Burgess
2020-02-05 11:37 ` [PATCH 2/2] gdb: Add support for tracking the DWARF line table is-stmt field Andrew Burgess
2020-02-05 17:55 ` Bernd Edlinger
2020-02-10 18:30 ` Bernd Edlinger
2020-02-11 13:57 ` Andrew Burgess
2020-02-14 20:05 ` Bernd Edlinger
2020-03-05 18:01 ` Bernd Edlinger
2020-03-08 12:50 ` [PATCHv2 0/2] Line table is_stmt support Andrew Burgess
2020-03-08 14:39 ` Bernd Edlinger
2020-03-10 23:01 ` Andrew Burgess
2020-03-11 6:50 ` Simon Marchi
2020-03-11 11:28 ` Andrew Burgess
2020-03-11 13:27 ` Simon Marchi
2020-04-03 22:21 ` [PATCH 0/2] More regression fixing from is-stmt patches Andrew Burgess
2020-04-03 22:21 ` [PATCH 1/2] gdb/testsuite: Move helper function into lib/dwarf.exp Andrew Burgess
2020-04-06 20:18 ` Tom Tromey
2020-04-14 11:18 ` Andrew Burgess
2020-04-03 22:21 ` [PATCH 2/2] gdb: Preserve is-stmt lines when switch between files Andrew Burgess
2020-04-04 18:07 ` Bernd Edlinger
2020-04-04 19:59 ` Bernd Edlinger
2020-04-04 22:23 ` Andrew Burgess
2020-04-05 0:04 ` Bernd Edlinger
2020-04-05 0:47 ` Bernd Edlinger
2020-04-05 8:55 ` Bernd Edlinger
2020-04-11 3:52 ` Bernd Edlinger
2020-04-12 17:13 ` Bernd Edlinger
2020-04-14 11:28 ` Andrew Burgess
2020-04-14 11:37 ` Bernd Edlinger
2020-04-14 11:41 ` Bernd Edlinger
2020-04-14 13:08 ` Andrew Burgess
2020-04-16 17:18 ` Andrew Burgess
2020-04-22 21:13 ` Tom Tromey
2020-04-25 7:06 ` Bernd Edlinger
2020-04-27 10:34 ` Andrew Burgess
2020-05-14 20:18 ` Tom Tromey
2020-05-14 22:39 ` Andrew Burgess
2020-05-15 3:35 ` Bernd Edlinger
2020-05-15 14:46 ` Andrew Burgess
2020-05-16 8:12 ` Bernd Edlinger
2020-05-17 17:26 ` Bernd Edlinger
2020-05-20 18:26 ` Andrew Burgess
2020-05-27 13:10 ` Andrew Burgess
2020-06-01 9:05 ` Andrew Burgess
2020-03-08 12:50 ` [PATCHv2 1/2] gdb/testsuite: Add is-stmt support to the DWARF compiler Andrew Burgess
2020-03-08 12:50 ` [PATCHv2 2/2] gdb: Add support for tracking the DWARF line table is-stmt field Andrew Burgess
2020-03-16 20:57 ` Tom Tromey
2020-03-16 22:37 ` Bernd Edlinger
2020-03-17 12:47 ` Tom Tromey
2020-03-17 18:23 ` Tom Tromey
2020-03-17 18:51 ` Bernd Edlinger
2020-03-17 18:56 ` Andrew Burgess
2020-03-17 20:18 ` Tom Tromey
2020-03-17 22:21 ` Andrew Burgess [this message]
2020-03-23 17:30 ` [PATCH 0/3] Keep duplicate line table entries Andrew Burgess
2020-03-23 17:30 ` [PATCH 1/3] gdb/testsuite: Add compiler options parameter to function_range helper Andrew Burgess
2020-04-01 18:31 ` Tom Tromey
2020-03-23 17:30 ` [PATCH 2/3] gdb/testsuite: Add support for DW_LNS_set_file to DWARF compiler Andrew Burgess
2020-04-01 18:32 ` Tom Tromey
2020-03-23 17:30 ` [PATCH 3/3] gdb: Don't remove duplicate entries from the line table Andrew Burgess
2020-04-01 18:34 ` Tom Tromey
2020-06-01 13:26 ` [PATCH 2/2] gdb: Add support for tracking the DWARF line table is-stmt field Pedro Alves
2020-02-06 9:01 ` Luis Machado
2020-02-11 15:39 ` Andrew Burgess
2020-02-09 21:07 ` [PATCH] Fix range end handling of inlined subroutines Bernd Edlinger
2020-02-10 21:48 ` Andrew Burgess
2020-02-22 6:39 ` [PATCHv2] " Bernd Edlinger
2020-03-08 14:57 ` [PATCHv3] " Bernd Edlinger
2020-03-11 22:02 ` Andrew Burgess
2020-03-12 18:21 ` Bernd Edlinger
2020-03-12 18:27 ` Christian Biesinger
2020-03-13 8:03 ` Bernd Edlinger
2020-03-17 22:27 ` Andrew Burgess
2020-03-19 1:33 ` Bernd Edlinger
2020-03-21 20:31 ` Bernd Edlinger
2020-03-23 17:53 ` Andrew Burgess
2020-03-23 20:58 ` Bernd Edlinger
2020-06-01 14:28 ` Pedro Alves
2020-03-13 12:47 ` [PATCHv4] " Bernd Edlinger
2020-02-05 11:37 ` [PATCH 1/2] gdb/testsuite: Add is-stmt support to the DWARF compiler Andrew Burgess
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=20200317222117.GM3317@embecosm.com \
--to=andrew.burgess@embecosm.com \
--cc=bernd.edlinger@hotmail.de \
--cc=gdb-patches@sourceware.org \
--cc=tom@tromey.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