This is the mail archive of the gdb-patches@sources.redhat.com 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] Infinite backtraces...


> Yes, gdb already creates the frame object and then later constructs the 
> frame ID.  The build has been reduced to:
> 
> 	prev_frame = malloc ();
> 	prev_frame->next = this_frame;
> 	return prev_frame;
> 
> Also note that, unlike the past, the frame ID is separate to the ``frame 
> base'' the former can be NULL while the later is still valid.
> 
> >And then, after building each new frame, we display the information
> >for that new frame.
> 
> It is what lets us "up" on to an apparently corrupt frame.

Reviewing the code that does the backtrace, I don't see how this
would work. We're at the oldest frame, trying to unwind from it.
So we compute its ID, and then create the previous frame.

I didn't find where in our code, in particular in stack.c, we're
prepared to deal with a frame that we later find is invalid (via a null
frame ID). Perhaps it is simpler to modify the build sequence above to
add the computation of the frame ID and use that as a guard before
creating the new frame?

-- 
Joel


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