This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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


>   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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]