This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: Fix for PR 1971 .
Hi Jim
I am not sure about removing the get_prev_frame. We need it for the
correct frame id . In case you were stepping over a recursive call and
deep inside after main had executed you would need the correct frame id
of the return frame and in the other case a null_frame_id.
Changing over breaks the behaviour of the backtrace over a recursive
call. Gives me extra failures inside break.exp .
cheers
Ramana
On Tue, 2006-01-03 at 21:55 -0800, Jim Blandy wrote:
> Hi --- thanks for revising the patch.
>
> +/* Insert a step resume breakpoint at the return address of the
> + caller. This is to ensure that on doing a next from before main completes
> + execution of the program without GDB dumping core. Look at PR 1971
> + for more details. */
>
> I don't think this is quite what you mean to say. The comment for a
> function should describe its behavior in terms of its arguments;
> "caller" is vague. Second, this isn't always used for "next"; it can
> get used when you "step" into a function with no debug info (if I'm
> reading right). Third, a more self-contained explanation of why the
> get_prev_frame-based approach isn't sufficient would be better.
>
> How about:
>
> /* Insert a step-resume breakpoint at the address to which
> RETURN_FRAME will return.
>
> Unlike insert_step_resume_breakpoint_at_frame (get_prev_frame (F)),
> this works even when F is the oldest frame. (Consider next-ing out
> of main when 'show backtrace past-main' is off.) */
>
> Finally --- could insert_step_resume_breakpoint_at_caller simply
> *always* use the frame_pc_unwind approach, and drop the check for
> get_prev_frame altogether? I understand that trying get_prev_frame
> first is guaranteed to give the least disturbance to the existing
> behavior, but I don't like leaving stuff like that in there unless we
> can explain why it's actually needed.
--
Ramana Radhakrishnan
GNU Tools
codito ergo sum (www.codito.com)
Ph: +91-20-26051367 (office) +91-9890040009 (mobile)