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 #3 from ggs334 <guosheng_gao at realsil dot com.cn> ---
look the code in the function get_pc_function_start(CORE_ADDR pc)   
> CORE_ADDR
> get_pc_function_start (CORE_ADDR pc)
> {
> ...........
> ...........
> ...........
> ...........
> ...........
> ...........

>  msymbol = lookup_minimal_symbol_by_pc (pc);
>  if (msymbol)
>    {
>     CORE_ADDR fstart = SYMBOL_VALUE_ADDRESS (msymbol);
>      if (find_pc_section (fstart))
>	return fstart;
>    }

>  return 0;
>}
the label lop2 and lop3 hava adress values, if the pc value is equal to the
address of lop2 or lop3, the msymbol returned from
lookup_minimal_symbol_by_pc() must be lop2 or lop3, then uses
SYMBOL_VALUE_ADDRESS (msymbol) to get the address, and treats the address as
function start address.

I Think this is the problem, is it accurate?

-- 
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]