[PATCH] D105985: Support GSYM in llvm-symbolizer.

Simon Giesecke via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jul 15 02:31:12 PDT 2021


simon.giesecke added inline comments.


================
Comment at: llvm/lib/DebugInfo/GSYM/GsymDIContext.cpp:25
+                                     DILineInfo &LineInfo) {
+  LineInfo.FunctionName = static_cast<std::string>(Location.Name);
+
----------------
simon.giesecke wrote:
> clayborg wrote:
> > If Specifier.FNKind is set to DINameKind::ShortName, we want to demangle the name into LineInfo.FunctionName. If it is set to DINameKind::LinkageName or DINameKind::None, set to to the current name. Demangling can be tricky, as there are many name manglings. Not sure if there is a one stop shop to demangle all sorts of names in LLVM.
> Hm, what do you suggest to do here then? I think I am not knowledgeable enough to implement the demangling without further guidance.
> 
> Can we leave that to future work? In that case, should we fail here or fall back to not demangling, for now?
> 
> FWIW, I found that `PDBContext` returns the empty string in case of `DINameKind::None`.
DWARFDie also returns an empty string in case of `DINameKind::None`, so I guess we should do the same here.


================
Comment at: llvm/lib/DebugInfo/GSYM/GsymDIContext.cpp:58
+
+  // TODO can we do something for the requested Specifier.FNKind?
+
----------------
clayborg wrote:
> We can. If it is set to DINameKind::ShortName, we want to demangle the name into LineInfo.FunctionName. If it is set to DINameKind::LinkageName or DINameKind::None, set to to the current name.
Marking this as done, as this is the same discussion as above, I also moved the code comment up.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D105985/new/

https://reviews.llvm.org/D105985



More information about the llvm-commits mailing list