This is an archive of the discontinued LLVM Phabricator instance.

[compiler-rt] Symbolizer refactoring: SymbolizerTool and better interface
ClosedPublic

Authored by kubamracek on Feb 27 2015, 5:07 AM.

Details

Reviewers
samsonov
Summary

Part of http://reviews.llvm.org/D7827. This patch transforms ExternalSymbolizerInterface into SymbolizerTool and makes it a more high-level interface that (eventually) all symbolizer tools should implement. This makes both the formatting of the input and parsing of the output be the responsibility of the individual tool. For now, we make LLVMSymbolizer, Addr2LinePool and InternalSymbolizer be the implementations of this interface (I'll do LibbacktraceSymbolizer in a next step).

Diff Detail

Event Timeline

kubamracek updated this revision to Diff 20845.Feb 27 2015, 5:07 AM
kubamracek retitled this revision from to [compiler-rt] Symbolizer refactoring: SymbolizerTool and better interface.
kubamracek updated this object.
kubamracek edited the test plan for this revision. (Show Details)
kubamracek added subscribers: Unknown Object (MLST), zaks.anna, samsonov.
samsonov accepted this revision.Feb 27 2015, 11:43 AM
samsonov added a reviewer: samsonov.

LGTM, but please address all the comments below before committing (there's a bug introduced in InteranalSymbolizer, so be careful). Keep an eye on WinSymbolizer - looks like we will be able to inherit it from SymbolizerTool as well, make our current "POSIXSymbolizer" class the only class implementing "Symbolizer" interface, and get rid of the latter.

Thanks for doing this!

lib/sanitizer_common/sanitizer_symbolizer_posix_libcdep.cc
373
if (const char *res = SendCommand(...)) {
  ParseSymbolizePCOutput(res, stack);
  return true;
}
return false;
380

same here

435

same here

498

Here you should call __sanitizer_symbolize_code

505

And here - __sanitizer_symbolize_data

577
if (SymbolizerTool *tool = GetSymbolizerTool()) {
  ...
}
601

same here

This revision is now accepted and ready to land.Feb 27 2015, 11:43 AM
kubamracek closed this revision.Feb 28 2015, 1:42 AM

Landed in r230842.

Keep an eye on WinSymbolizer - looks like we will be able to inherit it from SymbolizerTool as well, make our current "POSIXSymbolizer" class the only class implementing "Symbolizer" interface, and get rid of the latter.

Yes, that's my plan.