This is the mail archive of the frysk@sources.redhat.com mailing list for the frysk 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: remote dwarf info using libunwind


On Tue, 2006-09-05 at 10:07 +0800, Wu Zhou wrote:
> ./TestRunner frysk.rt.tests.TestStackBacktrace
> Running testBacktrace(frysk.rt.tests.TestStackBacktrace) ...Frame 1
>          File: ../../frysk-clean/frysk-core/frysk/pkglibexecdir/funit-rt-looper.c
>          Func: baz
>          Line: 69
>          Col: 0
>          Addr: 134514264
> Frame 2
>          File: ../../frysk-clean/frysk-core/frysk/pkglibexecdir/funit-rt-looper.c
>          Func: bar
>          Line: 72
>          Col: 0
>          Addr: 134514286
> Frame 3
>          File: ../../frysk-clean/frysk-core/frysk/pkglibexecdir/funit-rt-looper.c
>          Func: foo
>          Line: 53
>          Col: 0
>          Addr: 134514315
> Frame 4
>          File: null
>          Func: main
>          Line: 0
>          Col: 0
>          Addr: 134514973
> Frame 5
>          File: null
>          Func:
>          Line: 0
>          Col: 0
>          Addr: 12773156
> Frame 6
>          File: null
>          Func:
>          Line: 0
>          Col: 0
>          Addr: 134514081
> PASS
> 
> Time: 0.274
> 
> OK (1 test)
> 
> Regards
> - Wu Zhou

So last night, after some investigation, Kyle Galloway and I found out
why the line numbers seemed to be off in our backtraces and why, in
particular, the line number for main () is zero with its source file
being null.

In _UPT_get_dyn_info_list_addr (), a call is made to get_list_addr () in
the same file:

#if UNW_TARGET_IA64 && defined(__linux)

static inline int
get_list_addr (unw_addr_space_t as, unw_word_t *dil_addr, void *arg,
               int *countp)
{

.
.       /* implemented */
.

}

#else

static inline int
get_list_addr (unw_addr_space_t as, unw_word_t *dil_addr, void *arg,
               int *countp)
{

# warning Implement get_list_addr(), please.
  *countp = 0;
  return 0;
}

#endif

Setting *countp to zero results in libunwind falling back to frame
pointers to determine the call stack information, which is no good for
our uses.

- Mike



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