Page MenuHomePhabricator

[Sanitizer] Introduce generic stack frame rendering machinery
ClosedPublic

Authored by samsonov on Nov 5 2014, 12:31 PM.

Details

Summary

This commit introduces function __sanitizer::RenderFrame()
that allows to render the contents of AddressInfo (essentially, symbolized stack frame)
using the custom format string. This function can be used to
implement stack frame formatting for both ThreadSanitizer and
generic StackTrace::Print(), used in another places. This paves the
way towards allowing user to control the format of stack frames,
obtaining them in any format he desires, and/or enforcing the consistent
output from all sanitizers.

Diff Detail

Event Timeline

samsonov updated this revision to Diff 15825.Nov 5 2014, 12:31 PM
samsonov retitled this revision from to [Sanitizer] Introduce generic stack frame rendering machinery.
samsonov updated this object.
samsonov edited the test plan for this revision. (Show Details)
samsonov added a reviewer: kcc.
samsonov added a subscriber: Unknown Object (MLST).
kcc edited edge metadata.Nov 5 2014, 12:45 PM

LGTM++ with a couple nits.

lib/sanitizer_common/sanitizer_stacktrace_printer.cc
27

static

32

why not nullptr?

lib/sanitizer_common/sanitizer_stacktrace_printer.h
11

..., and other sanitizers

samsonov updated this revision to Diff 15832.Nov 5 2014, 2:35 PM
samsonov edited edge metadata.

Fix comments in file headers, add "static" to file-local variable.

lib/sanitizer_common/sanitizer_stacktrace_printer.cc
27

Done

32

Do you mean nullptr value for "format" string? Well, in future it will be a runtime flag, specified by the user, so I thought it would be nice to make this special case have more meaningful representation.

lib/sanitizer_common/sanitizer_stacktrace_printer.h
11

Done

kcc accepted this revision.Nov 5 2014, 2:43 PM
kcc edited edge metadata.

LGTM

This revision is now accepted and ready to land.Nov 5 2014, 2:43 PM
samsonov closed this revision.Nov 5 2014, 2:55 PM