This is an archive of the discontinued LLVM Phabricator instance.

[NativeSession] Implement NativeSession::findSymbolByAddress.
ClosedPublic

Authored by akhuang on May 1 2020, 2:59 PM.

Details

Summary

This implements searching for function symbols and public symbols by address.

More specifically,
-Implements NativeSession::findSymbolByAddress for function symbols and public symbols. I think data symbols are also searched for, but that isn't implemented here.
-Adds classes for NativeFunctionSymbol and NativePublicSymbol
-Adds a '-use-native-pdb-reader' option to llvm-symbolizer, for testing

Diff Detail

Event Timeline

akhuang created this revision.May 1 2020, 2:59 PM
akhuang edited reviewers, added: rnk, amccarth, labath; removed: jhenderson.May 1 2020, 3:02 PM
akhuang updated this revision to Diff 261557.May 1 2020, 3:05 PM

clean up

akhuang updated this revision to Diff 261561.May 1 2020, 3:33 PM

Fix some things, update description

akhuang edited the summary of this revision. (Show Details)May 1 2020, 3:37 PM
labath added inline comments.May 4 2020, 2:36 AM
llvm/lib/DebugInfo/PDB/Native/SymbolCache.cpp
425

IntervalMap explodes if you try to insert overlapping intervals into it. How sure are you that no input will contain overlapping addresses?

I'm not sure what's the pdb position on asserting on invalid inputs, but it certainly seems like this could happen with a hand-crafted/corrupted pdbs. However, I wouldn't be surprised if that happens for "valid" pdbs too...

amccarth added inline comments.May 4 2020, 12:24 PM
llvm/include/llvm/DebugInfo/PDB/Native/SymbolCache.h
93

In the NativeSession, we have findSymbolByAddress, -ByRVA, and -BySectOffset. Here we find -ByAddress, but is seems like it should be -BySectOffset.

I realized you inherited a bunch of the API definition, but is there a technical reason for the naming inconsistency? Can we make it more consistent without breaking things?

llvm/lib/DebugInfo/PDB/Native/NativeFunctionSymbol.cpp
22

The reason for the std::move is not obvious (to me). The constructor takes the Sym parameter by value (so it's a copy) and then stashes it in member Sym. Is the goal to avoid a second copy from the argument to the member?

If it's expensive to copy, should the constructor take a const & and then copy the value (once) into the data member?

(And if you must use std::move, I think this file should include <utility>.)

llvm/lib/DebugInfo/PDB/Native/SymbolCache.cpp
310

this } would make more sense just above default:

425

Can you clarify "IntervalMap explodes"? Crashes, hangs, uses crazy amounts of memory or time, corrupts itself?

From the IntervalMap comments:

/// insert - Add a mapping of [a;b] to y, coalesce with adjacent intervals.
/// It is assumed that no key in the interval is mapped to another value, but
/// overlapping intervals already mapped to y will be coalesced.

If I understand that correctly, it's not overlapping intervals in general, but ones that give a different value for at least part of the overlap. Perhaps IntervalMap needs a way to test for a conflicting overlap.

akhuang marked an inline comment as done.May 4 2020, 5:28 PM
akhuang added inline comments.
llvm/lib/DebugInfo/PDB/Native/SymbolCache.cpp
425

Would it be reasonable to just check for overlap before adding to the map and ignore those?

Also, I hadn't run this on larger pdbs before but it seems like the IntervalMap sometimes segfaults on destruction (in map.visitNodes()).

labath added inline comments.May 5 2020, 3:50 AM
llvm/lib/DebugInfo/PDB/Native/NativeFunctionSymbol.cpp
22

This is actually the recommended way to pass objects if your function "consumes" them and you don't care about every last drop of performance. The assertion that this will always incur a copy is not true. In fact, const T & guarantees a copy. This puts the choice into the hands of the caller. If the caller calls the constructor with an lvalue, there will be 1 copy (+ 1 move). If the caller calls this with an xvalue, there will be no copies (only two moves).

llvm/lib/DebugInfo/PDB/Native/SymbolCache.cpp
425

explodes == assert if you have asserts enabled, UB otherwise

You're right that this only happens if the mapped-to value differs. I didn't mention that part, but I assume this is going to be hold if we actually end up with overlapping contribution (i.e., C.Imod is some sort of a contribution identifier). IntervalMap does have a method for testing overlaps (it's called overlaps).

As for checking for overlap, I think that is definitely better than crashing. Whether that is the "reasonable" thing to do depends on the use case, which I don't know anything about.

BTW: Instead passing End-1 you could consider instantiating the IntervalMap to use half-open intervals.

amccarth added inline comments.May 5 2020, 8:55 AM
llvm/lib/DebugInfo/PDB/Native/NativeFunctionSymbol.cpp
22

Two moves would require that Sym has a move constructor, right? It looks like Sym is a codeview::ProcSym. I suppose it might get a compiler-generated move constructor, but that class appears to be a collection of scalar types (enums, integers, and a non-owning raw pointer).

rnk added a comment.May 5 2020, 4:41 PM

Cool. :)

llvm/lib/DebugInfo/PDB/Native/SymbolCache.cpp
339

This is a VarStreamArray. I think you can skip past entire procedure regions by doing something like this:

CVSymbolArray Syms = ModS.getSymbolArray();
for (auto I = Syms.begin(), E = Syms.end(); I != E; ++I) {
  ...
  // If this is not the procsym you want
  I = Syms.at(PS.Next);
}

Something like that, maybe.

343

We discussed adjusting this condition to be a range check.

akhuang updated this revision to Diff 262270.May 5 2020, 5:34 PM
akhuang marked 2 inline comments as done.

Address comments
-check for overlap before inserting into IntervalMap and just ignore any overlapping sections
-change function names from -ByAddress to -BySectOffset

I also fixed a few other things
-changed public symbol search to search by upper bound instead of exact match
-function symbol search now searches within the address range (offset+codesize), instead
of just the starting address

labath added inline comments.May 6 2020, 1:06 AM
llvm/lib/DebugInfo/PDB/Native/NativeFunctionSymbol.cpp
22

Ah, right, sorry. In that case a const T&would be more suitable.

akhuang updated this revision to Diff 262403.May 6 2020, 9:43 AM

-implement skipping to the end of symbols while searching
-remove std::move in pdb symbol constructors

akhuang updated this revision to Diff 262432.May 6 2020, 11:41 AM
akhuang marked 2 inline comments as done.

change constructor to take a const & to SymbolRecord

akhuang marked 2 inline comments as done.May 6 2020, 12:09 PM
akhuang added inline comments.
llvm/include/llvm/DebugInfo/PDB/Native/SymbolCache.h
93

Yep, it can definitely be -BySectOffset here.

llvm/lib/DebugInfo/PDB/Native/NativeFunctionSymbol.cpp
22

thanks; I think the std::move was just there because it was in the class I copied this from, but I've changed the constructor to take a const &

llvm/lib/DebugInfo/PDB/Native/SymbolCache.cpp
343

I think I had just updated the patch to include this.

ping! I think I've addressed all the comments here

amccarth accepted this revision.May 12 2020, 1:58 PM

Looks good. Thanks for the improvements.

I saw one more opportunity to clarify -FromSectOffset rather than -FromAddress for a couple methods, just in case you want to address those before you land this.

llvm/include/llvm/DebugInfo/PDB/Native/NativeSession.h
112

Another -FromAddress versus -FromSectOffset.

This revision is now accepted and ready to land.May 12 2020, 1:58 PM
rnk accepted this revision.May 12 2020, 3:13 PM
This revision was automatically updated to reflect the committed changes.

It looks like this patch added a bunch of undefined symbols to the sanitizer symbolizer, and is causing the buildbot to fail:

http://lab.llvm.org:8011/builders/sanitizer-x86_64-linux/builds/27269/steps/build%2032-bit%20symbolizer%20for%20compiler_rt_build/logs/stdio

+ cd /b/sanitizer-x86_64-linux/build/symbolizer_build32/symbolizer
+ rm -rf /b/sanitizer-x86_64-linux/build/symbolizer_build32/symbolizer/symbolizer
+ mkdir /b/sanitizer-x86_64-linux/build/symbolizer_build32/symbolizer/symbolizer
+ cd /b/sanitizer-x86_64-linux/build/symbolizer_build32/symbolizer/symbolizer
+ echo Compiling...
+ SYMBOLIZER_FLAGS='-m32 -fPIC -flto -Os -g0 -DNDEBUG -fno-rtti -fno-exceptions -nostdinc++ -I/b/sanitizer-x86_64-linux/build/symbolizer_build32/symbolizer/zlib -I/b/sanitizer-x86_64-linux/build/symbolizer_build32/symbolizer/libcxx/include/c++/v1 -I/b/sanitizer-x86_64-linux/build/llvm-project/llvm/include -I/b/sanitizer-x86_64-linux/build/symbolizer_build32/symbolizer/llvm/include -std=c++14'
+ /b/sanitizer-x86_64-linux/build/llvm_build64/bin/clang++ -m32 -fPIC -flto -Os -g0 -DNDEBUG -fno-rtti -fno-exceptions -nostdinc++ -I/b/sanitizer-x86_64-linux/build/symbolizer_build32/symbolizer/zlib -I/b/sanitizer-x86_64-linux/build/symbolizer_build32/symbolizer/libcxx/include/c++/v1 -I/b/sanitizer-x86_64-linux/build/llvm-project/llvm/include -I/b/sanitizer-x86_64-linux/build/symbolizer_build32/symbolizer/llvm/include -std=c++14 /b/sanitizer-x86_64-linux/build/llvm-project/compiler-rt/lib/sanitizer_common/symbolizer/sanitizer_symbolize.cpp /b/sanitizer-x86_64-linux/build/llvm-project/compiler-rt/lib/sanitizer_common/symbolizer/sanitizer_wrappers.cpp -c
Compiling...
+ /b/sanitizer-x86_64-linux/build/llvm_build64/bin/llvm-ar rc symbolizer.a sanitizer_symbolize.o sanitizer_wrappers.o
+ SYMBOLIZER_API_LIST=__sanitizer_symbolize_code,__sanitizer_symbolize_data,__sanitizer_symbolize_flush,__sanitizer_symbolize_demangle
+ /b/sanitizer-x86_64-linux/build/llvm-project/compiler-rt/lib/sanitizer_common/symbolizer/scripts/ar_to_bc.sh /b/sanitizer-x86_64-linux/build/symbolizer_build32/symbolizer/libcxx/lib/libc++.a /b/sanitizer-x86_64-linux/build/symbolizer_build32/symbolizer/libcxx/lib/libc++abi.a /b/sanitizer-x86_64-linux/build/symbolizer_build32/symbolizer/llvm/lib/libLLVMSymbolize.a /b/sanitizer-x86_64-linux/build/symbolizer_build32/symbolizer/llvm/lib/libLLVMObject.a /b/sanitizer-x86_64-linux/build/symbolizer_build32/symbolizer/llvm/lib/libLLVMBinaryFormat.a /b/sanitizer-x86_64-linux/build/symbolizer_build32/symbolizer/llvm/lib/libLLVMDebugInfoDWARF.a /b/sanitizer-x86_64-linux/build/symbolizer_build32/symbolizer/llvm/lib/libLLVMSupport.a /b/sanitizer-x86_64-linux/build/symbolizer_build32/symbolizer/llvm/lib/libLLVMDebugInfoPDB.a /b/sanitizer-x86_64-linux/build/symbolizer_build32/symbolizer/llvm/lib/libLLVMDemangle.a /b/sanitizer-x86_64-linux/build/symbolizer_build32/symbolizer/llvm/lib/libLLVMMC.a /b/sanitizer-x86_64-linux/build/symbolizer_build32/symbolizer/llvm/lib/libLLVMTextAPI.a /b/sanitizer-x86_64-linux/build/symbolizer_build32/symbolizer/zlib/libz.a symbolizer.a all.bc
Inputs: /b/sanitizer-x86_64-linux/build/symbolizer_build32/symbolizer/libcxx/lib/libc++.a /b/sanitizer-x86_64-linux/build/symbolizer_build32/symbolizer/libcxx/lib/libc++abi.a /b/sanitizer-x86_64-linux/build/symbolizer_build32/symbolizer/llvm/lib/libLLVMSymbolize.a /b/sanitizer-x86_64-linux/build/symbolizer_build32/symbolizer/llvm/lib/libLLVMObject.a /b/sanitizer-x86_64-linux/build/symbolizer_build32/symbolizer/llvm/lib/libLLVMBinaryFormat.a /b/sanitizer-x86_64-linux/build/symbolizer_build32/symbolizer/llvm/lib/libLLVMDebugInfoDWARF.a /b/sanitizer-x86_64-linux/build/symbolizer_build32/symbolizer/llvm/lib/libLLVMSupport.a /b/sanitizer-x86_64-linux/build/symbolizer_build32/symbolizer/llvm/lib/libLLVMDebugInfoPDB.a /b/sanitizer-x86_64-linux/build/symbolizer_build32/symbolizer/llvm/lib/libLLVMDemangle.a /b/sanitizer-x86_64-linux/build/symbolizer_build32/symbolizer/llvm/lib/libLLVMMC.a /b/sanitizer-x86_64-linux/build/symbolizer_build32/symbolizer/llvm/lib/libLLVMTextAPI.a /b/sanitizer-x86_64-linux/build/symbolizer_build32/symbolizer/zlib/libz.a /b/sanitizer-x86_64-linux/build/symbolizer_build32/symbolizer/symbolizer/symbolizer.a
Output: /b/sanitizer-x86_64-linux/build/symbolizer_build32/symbolizer/symbolizer/all.bc
/tmp/tmp.ffguFzwEJO /b/sanitizer-x86_64-linux/build/symbolizer_build32/symbolizer/symbolizer
+ echo Optimizing...
+ /b/sanitizer-x86_64-linux/build/llvm_build64/bin/opt -internalize -internalize-public-api-list=__sanitizer_symbolize_code,__sanitizer_symbolize_data,__sanitizer_symbolize_flush,__sanitizer_symbolize_demangle all.bc -o opt.bc
Optimizing...
+ /b/sanitizer-x86_64-linux/build/llvm_build64/bin/clang -m32 -fPIC -flto -Os -g0 -DNDEBUG -fno-rtti -fno-exceptions -fno-lto -c opt.bc -o symbolizer.o
+ echo 'Checking undefined symbols...'
Checking undefined symbols...
+ nm -f posix -g symbolizer.o
+ cut -f 1,2 -d ' '
+ LC_COLLATE=C
+ sort -u
+ diff -u /b/sanitizer-x86_64-linux/build/llvm-project/compiler-rt/lib/sanitizer_common/symbolizer/scripts/global_symbols.txt undefined.new
+ grep -E '^\+[^+]'
+_ZN4llvm3msf17MappedBlockStream15createFpmStreamERKNS0_9MSFLayoutENS_15BinaryStreamRefERNS_20BumpPtrAllocatorImplINS_15MallocAllocatorELj4096ELj4096ELj128EEE U
+_ZN4llvm3msf17MappedBlockStream19createIndexedStreamERKNS0_9MSFLayoutENS_15BinaryStreamRefEjRNS_20BumpPtrAllocatorImplINS_15MallocAllocatorELj4096ELj4096ELj128EEE U
+_ZN4llvm3msf17MappedBlockStream21createDirectoryStreamERKNS0_9MSFLayoutENS_15BinaryStreamRefERNS_20BumpPtrAllocatorImplINS_15MallocAllocatorELj4096ELj4096ELj128EEE U
+_ZN4llvm3msf18validateSuperBlockERKNS0_10SuperBlockE U
+_ZN4llvm8codeview13CodeViewError2IDE U
+_ZN4llvm8codeview15CVErrorCategoryEv U
+_ZN4llvm8codeview15getModifiedTypeERKNS0_8CVRecordINS0_12TypeLeafKindEEE U
+_ZN4llvm8codeview15isUdtForwardRefENS0_8CVRecordINS0_12TypeLeafKindEEE U
+_ZN4llvm8codeview17TypeRecordMapping12visitTypeEndERNS0_8CVRecordINS0_12TypeLeafKindEEE U
+_ZN4llvm8codeview17TypeRecordMapping14visitTypeBeginERNS0_8CVRecordINS0_12TypeLeafKindEEE U
+_ZN4llvm8codeview17TypeRecordMapping16visitKnownRecordERNS0_8CVRecordINS0_12TypeLeafKindEEERNS0_10EnumRecordE U
+_ZN4llvm8codeview17TypeRecordMapping16visitKnownRecordERNS0_8CVRecordINS0_12TypeLeafKindEEERNS0_11ArrayRecordE U
+_ZN4llvm8codeview17TypeRecordMapping16visitKnownRecordERNS0_8CVRecordINS0_12TypeLeafKindEEERNS0_11ClassRecordE U
+_ZN4llvm8codeview17TypeRecordMapping16visitKnownRecordERNS0_8CVRecordINS0_12TypeLeafKindEEERNS0_11UnionRecordE U
+_ZN4llvm8codeview17TypeRecordMapping16visitKnownRecordERNS0_8CVRecordINS0_12TypeLeafKindEEERNS0_13ArgListRecordE U
+_ZN4llvm8codeview17TypeRecordMapping16visitKnownRecordERNS0_8CVRecordINS0_12TypeLeafKindEEERNS0_13PointerRecordE U
+_ZN4llvm8codeview17TypeRecordMapping16visitKnownRecordERNS0_8CVRecordINS0_12TypeLeafKindEEERNS0_14ModifierRecordE U
+_ZN4llvm8codeview17TypeRecordMapping16visitKnownRecordERNS0_8CVRecordINS0_12TypeLeafKindEEERNS0_15ProcedureRecordE U
+_ZN4llvm8codeview17TypeRecordMapping16visitKnownRecordERNS0_8CVRecordINS0_12TypeLeafKindEEERNS0_18VFTableShapeRecordE U
+_ZN4llvm8codeview17TypeRecordMapping16visitKnownRecordERNS0_8CVRecordINS0_12TypeLeafKindEEERNS0_20MemberFunctionRecordE U
+_ZN4llvm8codeview18DebugSubsectionRefD2Ev U
+_ZN4llvm8codeview19SymbolRecordMapping14visitSymbolEndERNS0_8CVRecordINS0_10SymbolKindEEE U
+_ZN4llvm8codeview19SymbolRecordMapping16visitKnownRecordERNS0_8CVRecordINS0_10SymbolKindEEERNS0_10ObjNameSymE U
+_ZN4llvm8codeview19SymbolRecordMapping16visitKnownRecordERNS0_8CVRecordINS0_10SymbolKindEEERNS0_10ProcRefSymE U
+_ZN4llvm8codeview19SymbolRecordMapping16visitKnownRecordERNS0_8CVRecordINS0_10SymbolKindEEERNS0_10SectionSymE U
+_ZN4llvm8codeview19SymbolRecordMapping16visitKnownRecordERNS0_8CVRecordINS0_10SymbolKindEEERNS0_10Thunk32SymE U
+_ZN4llvm8codeview19SymbolRecordMapping16visitKnownRecordERNS0_8CVRecordINS0_10SymbolKindEEERNS0_11Compile2SymE U
+_ZN4llvm8codeview19SymbolRecordMapping16visitKnownRecordERNS0_8CVRecordINS0_10SymbolKindEEERNS0_11Compile3SymE U
+_ZN4llvm8codeview19SymbolRecordMapping16visitKnownRecordERNS0_8CVRecordINS0_10SymbolKindEEERNS0_11ConstantSymE U
+_ZN4llvm8codeview19SymbolRecordMapping16visitKnownRecordERNS0_8CVRecordINS0_10SymbolKindEEERNS0_11DefRangeSymE U
+_ZN4llvm8codeview19SymbolRecordMapping16visitKnownRecordERNS0_8CVRecordINS0_10SymbolKindEEERNS0_11EnvBlockSymE U
+_ZN4llvm8codeview19SymbolRecordMapping16visitKnownRecordERNS0_8CVRecordINS0_10SymbolKindEEERNS0_11PublicSym32E U
+_ZN4llvm8codeview19SymbolRecordMapping16visitKnownRecordERNS0_8CVRecordINS0_10SymbolKindEEERNS0_11RegisterSymE U
+_ZN4llvm8codeview19SymbolRecordMapping16visitKnownRecordERNS0_8CVRecordINS0_10SymbolKindEEERNS0_11ScopeEndSymE U
+_ZN4llvm8codeview19SymbolRecordMapping16visitKnownRecordERNS0_8CVRecordINS0_10SymbolKindEEERNS0_12BuildInfoSymE U
+_ZN4llvm8codeview19SymbolRecordMapping16visitKnownRecordERNS0_8CVRecordINS0_10SymbolKindEEERNS0_12CoffGroupSymE U
+_ZN4llvm8codeview19SymbolRecordMapping16visitKnownRecordERNS0_8CVRecordINS0_10SymbolKindEEERNS0_12FrameProcSymE U
+_ZN4llvm8codeview19SymbolRecordMapping16visitKnownRecordERNS0_8CVRecordINS0_10SymbolKindEEERNS0_13AnnotationSymE U
+_ZN4llvm8codeview19SymbolRecordMapping16visitKnownRecordERNS0_8CVRecordINS0_10SymbolKindEEERNS0_13BPRelativeSymE U
+_ZN4llvm8codeview19SymbolRecordMapping16visitKnownRecordERNS0_8CVRecordINS0_10SymbolKindEEERNS0_13FileStaticSymE U
+_ZN4llvm8codeview19SymbolRecordMapping16visitKnownRecordERNS0_8CVRecordINS0_10SymbolKindEEERNS0_13InlineSiteSymE U
+_ZN4llvm8codeview19SymbolRecordMapping16visitKnownRecordERNS0_8CVRecordINS0_10SymbolKindEEERNS0_13TrampolineSymE U
+_ZN4llvm8codeview19SymbolRecordMapping16visitKnownRecordERNS0_8CVRecordINS0_10SymbolKindEEERNS0_14FrameCookieSymE U
+_ZN4llvm8codeview19SymbolRecordMapping16visitKnownRecordERNS0_8CVRecordINS0_10SymbolKindEEERNS0_14RegRelativeSymE U
+_ZN4llvm8codeview19SymbolRecordMapping16visitKnownRecordERNS0_8CVRecordINS0_10SymbolKindEEERNS0_15CallSiteInfoSymE U
+_ZN4llvm8codeview19SymbolRecordMapping16visitKnownRecordERNS0_8CVRecordINS0_10SymbolKindEEERNS0_17UsingNamespaceSymE U
+_ZN4llvm8codeview19SymbolRecordMapping16visitKnownRecordERNS0_8CVRecordINS0_10SymbolKindEEERNS0_18ThreadLocalDataSymE U
+_ZN4llvm8codeview19SymbolRecordMapping16visitKnownRecordERNS0_8CVRecordINS0_10SymbolKindEEERNS0_19DefRangeRegisterSymE U
+_ZN4llvm8codeview19SymbolRecordMapping16visitKnownRecordERNS0_8CVRecordINS0_10SymbolKindEEERNS0_19DefRangeSubfieldSymE U
+_ZN4llvm8codeview19SymbolRecordMapping16visitKnownRecordERNS0_8CVRecordINS0_10SymbolKindEEERNS0_21HeapAllocationSiteSymE U
+_ZN4llvm8codeview19SymbolRecordMapping16visitKnownRecordERNS0_8CVRecordINS0_10SymbolKindEEERNS0_22DefRangeRegisterRelSymE U
+_ZN4llvm8codeview19SymbolRecordMapping16visitKnownRecordERNS0_8CVRecordINS0_10SymbolKindEEERNS0_26DefRangeFramePointerRelSymE U
+_ZN4llvm8codeview19SymbolRecordMapping16visitKnownRecordERNS0_8CVRecordINS0_10SymbolKindEEERNS0_27DefRangeSubfieldRegisterSymE U
+_ZN4llvm8codeview19SymbolRecordMapping16visitKnownRecordERNS0_8CVRecordINS0_10SymbolKindEEERNS0_35DefRangeFramePointerRelFullScopeSymE U
+_ZN4llvm8codeview19SymbolRecordMapping16visitKnownRecordERNS0_8CVRecordINS0_10SymbolKindEEERNS0_6UDTSymE U
+_ZN4llvm8codeview19SymbolRecordMapping16visitKnownRecordERNS0_8CVRecordINS0_10SymbolKindEEERNS0_7DataSymE U
+_ZN4llvm8codeview19SymbolRecordMapping16visitKnownRecordERNS0_8CVRecordINS0_10SymbolKindEEERNS0_7ProcSymE U
+_ZN4llvm8codeview19SymbolRecordMapping16visitKnownRecordERNS0_8CVRecordINS0_10SymbolKindEEERNS0_8BlockSymE U
+_ZN4llvm8codeview19SymbolRecordMapping16visitKnownRecordERNS0_8CVRecordINS0_10SymbolKindEEERNS0_8LabelSymE U
+_ZN4llvm8codeview19SymbolRecordMapping16visitKnownRecordERNS0_8CVRecordINS0_10SymbolKindEEERNS0_8LocalSymE U
+_ZN4llvm8codeview19SymbolRecordMapping16visitKnownRecordERNS0_8CVRecordINS0_10SymbolKindEEERNS0_9CallerSymE U
+_ZN4llvm8codeview19SymbolRecordMapping16visitKnownRecordERNS0_8CVRecordINS0_10SymbolKindEEERNS0_9ExportSymE U
+_ZN4llvm8codeview19SymbolRecordMapping16visitSymbolBeginERNS0_8CVRecordINS0_10SymbolKindEEE U
+_ZN4llvm8codeview20readSymbolFromStreamENS_15BinaryStreamRefEj U
+_ZN4llvm8codeview23visitMemberRecordStreamENS_8ArrayRefIhEERNS0_20TypeVisitorCallbacksE U
+_ZN4llvm8codeview24LazyRandomTypeCollectionC1ERKNS_14VarStreamArrayINS0_8CVRecordINS0_12TypeLeafKindEEENS_23VarStreamArrayExtractorIS5_EEEEjNS_16FixedStreamArrayINS0_15TypeIndexOffsetEEE U
+_ZN4llvm8codeview27DebugFrameDataSubsectionRef10initializeENS_15BinaryStreamRefE U
+_ZN4llvm8codeview29DebugStringTableSubsectionRef10initializeENS_15BinaryStreamRefE U
+_ZN4llvm8codeview29DebugStringTableSubsectionRefC1Ev U
+_ZNK4llvm8codeview29DebugStringTableSubsectionRef9getStringEj U
+_ZTVN4llvm8codeview17TypeRecordMappingE U
+_ZTVN4llvm8codeview19SymbolRecordMappingE U
+__isinf U
+ echo 'Failed: unexpected symbols'
+ exit 1
Failed: unexpected symbols

Could you please take a look?

I'll look into it, thanks for letting me know!

@morehouse Do you happen to know what would cause undefined symbols to be added? I reproduced it and it seems like it started from implementing loadDataForEXE (in https://reviews.llvm.org/D78128)

@morehouse Do you happen to know what would cause undefined symbols to be added? I reproduced it and it seems like it started from implementing loadDataForEXE (in https://reviews.llvm.org/D78128)

Does either patch introduce new dependencies for the symbolizer? Maybe we need to add another library here.

Looks like it also needs libLLVMDebugInfoCodeView.a and libLLVMDebugInfoMSF.a; I just added them to the script.

rnk added a comment.May 20 2020, 11:56 AM

I would like to register a small complaint that this script even exists in the first place. LLVM uses CMake. It's not OK for contributors to add their own ad-hoc shell script build systems and then impose the costs of maintaining them on other contributors. However, on the other hand, I understand what this script is trying to do, and do not have concrete suggestions on how to replace it. My only request is that the team that maintains it remains proactive about finding and fixing these problems.