|
From: Josef W. <Jos...@gm...> - 2006-03-14 21:02:10
|
Hi, With the (to be) 3.2.0/3.1.1 the demangler replaces __libc_start_main with "(below main)". I am not sure this is a good thing in general, especially for tools where symbol names in the output are expected to be as precise as possible (like eg. callgrind :-). I just wondered where this symbols is coming from when looking at a profile, and did some research... Can this be done either at another level or only when a flag is given? Or am I missing something here? It looks like this replacement is unconditional. Josef |
|
From: Nicholas N. <nj...@cs...> - 2006-03-14 22:48:59
|
On Tue, 14 Mar 2006, Josef Weidendorfer wrote: > With the (to be) 3.2.0/3.1.1 the demangler replaces __libc_start_main with > "(below main)". I am not sure this is a good thing in general, > especially for tools where symbol names in the output are expected > to be as precise as possible (like eg. callgrind :-). > > I just wondered where this symbols is coming from when looking at a profile, > and did some research... > > Can this be done either at another level or only when a flag is given? > Or am I missing something here? It looks like this replacement is > unconditional. There already is the --show-below-main flag, looks like the code in VG_(demangle)() should be made conditional on it. And Callgrind could then set --show-below-main=no at startup. Julian, do you agree? The comparison against __libc_start_main and generic_start_main is also done in m_stacktrace.c:VG_(apply_StackTrace)() -- looks like it should be factored out from those two places into a separate function. Nick |
|
From: Josef W. <Jos...@gm...> - 2006-03-15 09:44:13
|
On Tuesday 14 March 2006 23:48, Nicholas Nethercote wrote: > On Tue, 14 Mar 2006, Josef Weidendorfer wrote: > > > With the (to be) 3.2.0/3.1.1 the demangler replaces __libc_start_main with > > "(below main)". I am not sure this is a good thing in general, > > especially for tools where symbol names in the output are expected > > to be as precise as possible (like eg. callgrind :-). > > There already is the --show-below-main flag, looks like the code in > VG_(demangle)() should be made conditional on it. I thought that --show-below-main=no does stop printing a backtrace at main, ie. this never would show this "(below main)" symbol, so no need to bother changing the symbol name at the first place? > And Callgrind could then > set --show-below-main=no at startup. Julian, do you agree? This option is about changing the behavior of stack backtraces in error messages, and AFAICS the "(below main)" hack is about the same thing (backtraces), but done at a way too low level (at demangling time), which means that tools never will be able to see symbols like "__libc_start_main" for there own special handling. Also, tools now have to expect that symbols can start with a parenthesis. Why not simply do this "(below main)" thing when printing out the backtraces (and before matching any suppresions), possibly in an additional function VG_(mangle_for_backtrace_output)() ? > The comparison against __libc_start_main and generic_start_main is also done > in m_stacktrace.c:VG_(apply_StackTrace)() -- looks like it should be > factored out from those two places into a separate function. Yes. Josef > > Nick > > |