This is the mail archive of the
gdb@sources.redhat.com
mailing list for the GDB project.
Re: breaking at for-loop test line
- From: Daniel Jacobowitz <drow at false dot org>
- To: Eli Zaretskii <eliz at gnu dot org>
- Cc: allenh at eecs dot berkeley dot edu, gdb at sources dot redhat dot com
- Date: Tue, 3 Aug 2004 15:19:58 -0400
- Subject: Re: breaking at for-loop test line
- References: <4108321A.6070306@eecs.berkeley.edu> <20040729152940.GA7326@nevyn.them.org> <2914-Fri30Jul2004134328+0300-eliz@gnu.org>
On Fri, Jul 30, 2004 at 01:43:28PM +0200, Eli Zaretskii wrote:
> > Date: Thu, 29 Jul 2004 11:29:40 -0400
> > From: Daniel Jacobowitz <drow@false.org>
> >
> > I've been thinking for a while about a better interface for this, but I
> > haven't come up with one yet.
>
> Does GCC tell us in any way (via the debug info) that a single source
> line has more than a single statement?
>
> If not, the only way for GDB to figure that out is to parse the source
> code by itself.
No, it doesn't, but there is more information available from the
machine code than there is from the source code. For "for" statements,
it's conceivable to work out that there are multiple places in the
statement which serve as branch targets, via assembly analysis. Better
would be to record this in the debug info; there's no way to do it,
yet, but someone was bouncing around a proposal to record it in the
line table.
> > GDB could also make it much easier to figure out where the condition is
> > than it does now...
>
> How?
By providing a version of "info line" which described all the ranges of
code belonging to a line instead of just the first one, or by a command
which disassembled an entire line.
--
Daniel Jacobowitz