This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [RFA] dwarf2loc, guard against null
Daniel Jacobowitz (drow@false.org):
> On Mon, Sep 17, 2007 at 02:26:54PM +0200, Jerome Guitton wrote:
> > * retry to print the variable => end up in dwarf_expr_frame_base,
> > no frame, crash.
> >
> > We are (probably) still using a wrong .debug_info at this point.
>
> Yeah. Shouldn't you have gotten a "no such variable in this scope"
> error? I'm not sure how symbol lookup found a local variable without
> any frame.
Right. Actually, it got the selected frame (deprecated_selected_frame)
in deprecated_safe_get_selected_frame. This function reads:
struct frame_info *
deprecated_safe_get_selected_frame (void)
{
if (!target_has_registers || !target_has_stack || !target_has_memory)
return NULL;
return get_selected_frame (NULL);
}
When the inferior is dead, target_has_registers (resp.
target_has_memory, target_has_stack) should be false and
deprecated_safe_get_selected_frame should return NULL. This is the bug
in my vxWorks-specific backend (I should pop some target vector at
mourn_inferior, I guess).
Anyway, when deprecated_safe_get_selected_frame returns NULL, I get the
message "Address of "db" is unknown". Much better.
Now back to the original problem: assertion or error? I guess that the
question is: in which cases get_frame_block can return NULL?