Re: [RFC/RFA?] Should break FILE:LINENO skip prologue?

Joel Brobecker
2008-01-11T05:36:15Z

> 1. int
> 2. foo (int i, double d)
> 3. {
> 4. int j = 42;
> 5. float f = sin(d);
> 6. ...
> 7. }
>
> the first assignment may be scheduled into the prologue, but the
> second almost certainly won't.

The prologue should never include any of the local variable assignments.

At -O0, the situation is very clear and easy, as the variable
assignments are always past the prologue. Each variable assignment
has its own line and you can break on them as usual. My patches
will not affect that.

The situation becomes trickier at -O1 and beyond, because parts of
the prologue may be delayed later inside the function body. But in
that case, the compiler will still emit a specific line for the
instruction block that does the assignment. So the actual linetable
will look like this:

Line 3: prologue
Line 4. assign j
Lin3 3. prologue
Line 5. call sin, assign f
...

In that case, the skipping will only skip the first part of the
prologue, and you can still break on any assignment if you'd like.
My patches do not affect that situation either.

> If we can somehow ascertain ourselves that indeed we can still put a
> breakpoint on the second assignment and have it break before entering
> sin(), I think Joels origional diff is actually acceptable.

Hopefully the explaination above convinces you that this is the case?

--
Joel