Hi All,
I was looking in to PR14569 [http://llvm.org/bugs/show_bug.cgi?id=14569] and here are my findings.
GDB uses following attributes while printing function names, in order.
1. Linkage Name, if available, gdb demangles it and use it to print function name.
2. Name, if available, gdb uses it as it is without demangling it.
3. GDB tries to generage name of the function with other information available.
In case of clang, for compiler generated functions, [where HasDecl() is false], only Name attribute is being set in debug info.
So to fix bug on clang, we can do following.
1. Do not set both name and linkage_name attributes of just set linkage_name attribute. This makes testcase [gdb.cp/virtfunc.cpp] to pass but causes failures in 2 CodeGenCXX tests [debug-info-global-ctor-dtor.cpp and debug-info-thunk.cpp] which expect name attribute with mangled name of the function. I am also not sure, if other tools also depends on name attributes with mangled anme for compiler generated function.
2. Set both name and linkage_name attributes. This makes testcase [gdb.cp/virtfunc.cpp] to pass and does not have any side effect on existing clang/ llvm tests. But this will increase debug info size. I suggest to enable this fix if Full Debug Info option is enabled.
I have attached patch using second approach. Please let me know if this is fine.
Regards
Dinesh Dwivedi
0001-PR14569_Fix.patch
Description: Binary data
_______________________________________________ cfe-commits mailing list [email protected] http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits
