|
From: Alexander P. <gl...@go...> - 2009-08-17 14:19:35
Attachments:
demangle.patch
|
Hello everybody, It turns out that all the demangling functions available in coregrind/m_debuginfo/debuginfo.c exploit VG_(demangle) to do the actual demangling. However, the behavior of VG_(demangle) depends on the value of VG(clo_demangle), so it's impossible to turn on C++ names demangling for a single call to VG_(demangle), if the tool is ran with the --demangle=no command line option. I suggest to pass the VG_(clo_demangle) value to VG_(demangle) using the helpers that call VG_(get_sym_name). This can allow to override VG_(clo_demangle) value in a single call to VG_(demangle) or VG_(get_sym_name). The attached patch contains a possible implementation of this feature. AFAIU this should not break anything in the trunk, because nobody uses VG_(demangle) and VG_(get_sym_name) directly. I've also added VG_(get_fnname_force_cxx_demangle) and moved VG_(get_fnname_no_cxx_demangle) to include/pub_tool_debuginfo.h Please let me know if you've got any questions. Trivia: ThreadSanitizer (http://code.google.com/p/data-race-test/) uses demangling in two places: when it prints the error reports and when it checks that an error has happened in some object's destruction. If one wants to turn off demangling in the error reports using --demangle=no, the tool can't tell if a function name is a destructor because VG_(demangle) stops working for C++ symbols. That's a possible use case of the suggested feature. -- Alexander Potapenko Software Engineer Google Moscow |
|
From: Nicholas N. <n.n...@gm...> - 2009-08-17 22:09:17
|
On Tue, Aug 18, 2009 at 12:19 AM, Alexander Potapenko<gl...@go...> wrote: > Hello everybody, > > I suggest to pass the VG_(clo_demangle) value to VG_(demangle) using > the helpers that call VG_(get_sym_name). This can allow to override > VG_(clo_demangle) value in a single call to VG_(demangle) or > VG_(get_sym_name). The attached patch contains a possible > implementation of this feature. AFAIU this should not break anything > in the trunk, because nobody uses VG_(demangle) and VG_(get_sym_name) > directly. > I've also added VG_(get_fnname_force_cxx_demangle) and moved > VG_(get_fnname_no_cxx_demangle) to include/pub_tool_debuginfo.h Alexander, can you please open a bug report for this so it doesn't get lost? Thanks. Nick |
|
From: Alexander P. <gl...@go...> - 2009-08-18 09:03:26
|
Done, see https://bugs.kde.org/show_bug.cgi?id=204252 On Tue, Aug 18, 2009 at 2:09 AM, Nicholas Nethercote<n.n...@gm...> wrote: > On Tue, Aug 18, 2009 at 12:19 AM, Alexander Potapenko<gl...@go...> wrote: >> Hello everybody, >> >> I suggest to pass the VG_(clo_demangle) value to VG_(demangle) using >> the helpers that call VG_(get_sym_name). This can allow to override >> VG_(clo_demangle) value in a single call to VG_(demangle) or >> VG_(get_sym_name). The attached patch contains a possible >> implementation of this feature. AFAIU this should not break anything >> in the trunk, because nobody uses VG_(demangle) and VG_(get_sym_name) >> directly. >> I've also added VG_(get_fnname_force_cxx_demangle) and moved >> VG_(get_fnname_no_cxx_demangle) to include/pub_tool_debuginfo.h > > Alexander, can you please open a bug report for this so it doesn't get lost? > > Thanks. > > Nick > -- Alexander Potapenko Software Engineer Google Moscow |