This is an archive of the discontinued LLVM Phabricator instance.

[compiler-rt] Symbolizer refactoring: ExtractToken and friends
ClosedPublic

Authored by kubamracek on Feb 24 2015, 2:01 PM.

Details

Reviewers
samsonov
Summary

Part of http://reviews.llvm.org/D7827. Removes ExtractInt and only leaves ExtractUptr. Makes these functions available in the sanitizer_symbolizer.h header. Adds ExtractTokenUpToDelimiter, which is currently unused, but I plan to use it for AtosSymbolizer later, and since it's related, I included it in this patch.

Diff Detail

Event Timeline

kubamracek updated this revision to Diff 20622.Feb 24 2015, 2:01 PM
kubamracek retitled this revision from to [compiler-rt] Symbolizer refactoring: ExtractToken and friends.
kubamracek updated this object.
kubamracek edited the test plan for this revision. (Show Details)
kubamracek added subscribers: Unknown Object (MLST), zaks.anna, samsonov.
samsonov added inline comments.Feb 24 2015, 5:04 PM
lib/sanitizer_common/sanitizer_symbolizer_posix_libcdep.cc
57–58

Can these function go to sanitizer_symbolizer.cc (or sanitizer_symbolizer_libcdep.cc)? They don't seem to be linux-specific.

59

Please add some unit tests for these functions to sanitizer_common/tests

543

Please don't do this. If you want to remove ExtractInt in favor of ExtractUptr, please turn AddressInfo::line and AddressInfo::column into uptr in a separate change (and audit all cases where we use/print them). Another option is to have single ExtractNumber<T>, but then we'd need to provide definition for this function in a header, and I wouldn't like to include heavy sanitizer_allocator_internal.h in sanitizer_symbolizer.h

kubamracek updated this revision to Diff 20955.Mar 1 2015, 2:57 AM

Updating patch. Let's start with moving the functions, making them available in the header and adding tests.

samsonov accepted this revision.Mar 2 2015, 12:12 PM
samsonov added a reviewer: samsonov.

LGTM, but please address comments.

lib/sanitizer_common/sanitizer_symbolizer.h
27

Consider declaring these functions in sanitizer_symbolizer_internal.h instead (after you create it).

lib/sanitizer_common/sanitizer_symbolizer_libcdep.cc
20

Remove comments, now that you have them in a header.

lib/sanitizer_common/tests/sanitizer_symbolizer_test.cc
25

Here and below - "expected" result should go first, actual result should go second.

45

E.g. this line should be

EXPECT_EQ(123U, token);
This revision is now accepted and ready to land.Mar 2 2015, 12:12 PM
kubamracek closed this revision.Mar 2 2015, 2:17 PM

Landed in r231027.