This is the mail archive of the gdb-prs@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]

[Bug gdb/16157] the function get_pc_function_start (CORE_ADDR pc) maybe inaccurate


https://sourceware.org/bugzilla/show_bug.cgi?id=16157

--- Comment #9 from ggs334 <guosheng_gao at realsil dot com.cn> ---
> That's not sufficient, the frame that was frame #0 before the step must be 
> frame #1 after the step for GDB to consider this was a subroutine call.  
> That's this part of the condition:
>
>      && (frame_id_eq (frame_unwind_caller_id (get_current_frame ()),
>		       ecs->event_thread->control.step_stack_frame_id)

> Then I don't understand how that frame_id_eq returned true.  Well, unless 
> both were outer_frame_id.  Please check that.


I have checked it, frame_id_eq() return true, but frame_unwind_caller_id() and
ecs->event_thread->control.step_stack_frame_id are not outer_frame_id.

If frame_unwind_caller_id() can find a valid function address in register $ra,
the returned frame id id equal to 
ecs->event_thread->control.step_stack_frame_id 
and the vlaue is:
struct frame_id
{
  stack_addr=0xffffffff;
  code_addr=0x80001470;//The address of _start(entry point)
  special_addr=0x0;
  stack_addr_p=0x1;
  code_addr_p=0x1;
  special_addr_p=0x0;
  artificial_depth=0x0;
};


If can't find a valid function address in register $ra, GDB will print
============
warning: GDB can't find the start of the function at 0xfffffffc.

    GDB is unable to find the start of the function at 0xfffffffc
and thus can't determine the size of that function's stack frame.
This means that GDB may be unable to access that stack frame, or
the frames below it.
    This problem is most likely caused by an invalid program counter or
stack pointer.
    However, if you think GDB should simply search farther back
from 0xfffffffc for code which looks like the beginning of a
function, you can increase the range of the search using the `set
heuristic-fence-post' command.
============

SoïI think you are rightïmaybe something odd in the unwinder. But the unwinder
is foreign for me, Can you give some advices?

-- 
You are receiving this mail because:
You are on the CC list for the bug.

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