* DWARF is_stmt flag (revisited)
@ 2009-06-16 18:39 Cary Coutant
2009-06-23 18:36 ` Cary Coutant
2009-06-23 18:49 ` Daniel Jacobowitz
0 siblings, 2 replies; 3+ messages in thread
From: Cary Coutant @ 2009-06-16 18:39 UTC (permalink / raw)
To: gdb-patches
Daniel Jacobowitz posted a patch for discussion last October to make
gdb ignore line table rows where is_stmt == 0:
http://sourceware.org/ml/gdb-patches/2008-10/msg00055.html
There are still a couple of remaining testsuite failures that are
triggered by the new discriminator support in gcc, and fixing these
failures is going to require that gcc emit line table entries where
is_stmt == 0. The problem is that the new line table row that gcc adds
to change the discriminator is now seen as a new potential breakpoint
location, and a place to stop when single-stepping. The solution is to
change gcc so that any new rows to set the discriminator (that would
not otherwise have been emitted) should have is_stmt == 0, and for gdb
to ignore such rows.
The patch below is almost the same as Daniel's original patch; I also
fixed a bug where the basic_block flag was being initialized to the
wrong value after a special opcode.
Longer term, I think that gdb will need to record the is_stmt flag
with each line table row, so that it can provide accurate pc -> line
number mappings for optimized code, while still ignoring !is_stmt
lines when setting breakpoints and single-stepping. The compiler will
eventually need to start using the is_stmt flag when scheduling causes
the line number to hop around, so that we don't stop multiple times on
one line of code.
Tested on x86_64. No new regressions with a compiler that does not set
is_stmt == 0. OK for trunk?
-cary
* dwarf2read.c (dwarf_decode_lines): Ignore rows where is_stmt is 0.
Set basic_block to 0 after a special opcode.
Index: dwarf2read.c
===================================================================
RCS file: /cvs/src/src/gdb/dwarf2read.c,v
retrieving revision 1.308
diff -u -p -r1.308 dwarf2read.c
--- dwarf2read.c 13 Jun 2009 04:23:34 -0000 1.308
+++ dwarf2read.c 16 Jun 2009 18:26:52 -0000
@@ -7318,7 +7318,7 @@ dwarf_decode_lines (struct line_header *
else
{
lh->file_names[file - 1].included_p = 1;
- if (!decode_for_pst_p)
+ if (!decode_for_pst_p && is_stmt)
{
if (last_subfile != current_subfile)
{
@@ -7331,7 +7331,7 @@ dwarf_decode_lines (struct line_header *
check_cu_functions (address, cu));
}
}
- basic_block = 1;
+ basic_block = 0;
}
else switch (op_code)
{
@@ -7396,7 +7396,7 @@ dwarf_decode_lines (struct line_header *
else
{
lh->file_names[file - 1].included_p = 1;
- if (!decode_for_pst_p)
+ if (!decode_for_pst_p && is_stmt)
{
if (last_subfile != current_subfile)
{
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: DWARF is_stmt flag (revisited)
2009-06-16 18:39 DWARF is_stmt flag (revisited) Cary Coutant
@ 2009-06-23 18:36 ` Cary Coutant
2009-06-23 18:49 ` Daniel Jacobowitz
1 sibling, 0 replies; 3+ messages in thread
From: Cary Coutant @ 2009-06-23 18:36 UTC (permalink / raw)
To: gdb-patches
Ping: http://sourceware.org/ml/gdb-patches/2009-06/msg00406.html
-cary
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: DWARF is_stmt flag (revisited)
2009-06-16 18:39 DWARF is_stmt flag (revisited) Cary Coutant
2009-06-23 18:36 ` Cary Coutant
@ 2009-06-23 18:49 ` Daniel Jacobowitz
1 sibling, 0 replies; 3+ messages in thread
From: Daniel Jacobowitz @ 2009-06-23 18:49 UTC (permalink / raw)
To: Cary Coutant; +Cc: gdb-patches
On Tue, Jun 16, 2009 at 11:39:05AM -0700, Cary Coutant wrote:
> Longer term, I think that gdb will need to record the is_stmt flag
> with each line table row, so that it can provide accurate pc -> line
> number mappings for optimized code, while still ignoring !is_stmt
> lines when setting breakpoints and single-stepping. The compiler will
> eventually need to start using the is_stmt flag when scheduling causes
> the line number to hop around, so that we don't stop multiple times on
> one line of code.
Agreed completely.
>
> Tested on x86_64. No new regressions with a compiler that does not set
> is_stmt == 0. OK for trunk?
>
> -cary
>
>
> * dwarf2read.c (dwarf_decode_lines): Ignore rows where is_stmt is 0.
> Set basic_block to 0 after a special opcode.
OK.
--
Daniel Jacobowitz
CodeSourcery
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2009-06-23 18:49 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-06-16 18:39 DWARF is_stmt flag (revisited) Cary Coutant
2009-06-23 18:36 ` Cary Coutant
2009-06-23 18:49 ` Daniel Jacobowitz
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox