Hi,
I’m having problem generating a stack frame longer than one.
The problem I’m seeing is in stack_trace.c:trace_stack() where get_next_stack_frame() returns success,
but doesn’t set down.has_reg_data, which leads to only one frame being produced.
If I change the code so that stack crawler (crawl_stack_frame()) is always used to setup ‘down´, I get a full stack.
I’m not sure why this happens and have been debugging symbols.elf:get_stack_tracing_info() without
understanding why the number of registers (info->reg_cnt) is zero for the frame.
No exceptions are thrown during the call to get_stack_tracing_info().
It seems that the number of registers in the frame are copied from dwarf_stack_trace_regs_cnt,
but this is always zero for me, and when trying to identify where dwarf_stack_trace_regs_cnt could
be set to non-zero, I find the function dwarfframe.c:generate_command(), where calling
functions that can increase dwarf_stack_trace_regs_cnt is never called because reg->rule for
return address register is always zero.
reg = get_reg(&frame_regs, rules.return_address_register);
if (reg->rule != 0) {
Sorry about the imprecise description, but any pointers or suggestions are very welcome.
Thanks,
Claes