This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [RFC/RFA?] Should break FILE:LINENO skip prologue?
- From: Mark Kettenis <mark dot kettenis at xs4all dot nl>
- To: brobecker at adacore dot com
- Cc: gdb-patches at sourceware dot org
- Date: Wed, 9 Jan 2008 20:16:21 +0100 (CET)
- Subject: Re: [RFC/RFA?] Should break FILE:LINENO skip prologue?
- References: <20080109151745.GA13181@adacore.com>
> Date: Wed, 9 Jan 2008 07:17:45 -0800
> From: Joel Brobecker <brobecker@adacore.com>
>
> Hello,
>
> I would like to revive a discussion that started sometime in 2002.
> The idea is the following: When breaking on a given source line, if
> that line is inside a function prologue, skip the prologue (using
> the linetable to do so).
You've got me confused here. How can it be that if skipping using the
line table helps, the breakpoint location (which I assume has been
determined based on the line table) isn't right to begin with?
> In our experience, we have found that most users are not aware of
> the existence of function prologues. When they break on the line
> where a function is defined, they think the debugger is doing the
> same thing than it would do if it inserted the breakpoint using
> that function name. Unfortunately, it doesn't and they end up
> having problems trying to print parameter values [1].
Ultimately, the problem is that GCC is (still) generating the wrong
debug information, since either:
* The line table is wrong and the prologue instructions are wrongly
attributed to a line of source code.
* Instructions corresponding to source code have been scheduled into
the prologue, but the compiler didn't generate location expressions
for the arguments that are valid at that point.