llvm-readobj: Print referred symbol name for CLR token definition

llvm-svn: 204024
This commit is contained in:
Nico Rieck 2014-03-17 01:46:52 +00:00
parent effcd4ba7a
commit 8678acd5ed
2 changed files with 11 additions and 2 deletions

View File

@ -36,7 +36,7 @@ CHECK-NEXT: AuxSymbolCount: 1
CHECK-NEXT: AuxCLRToken {
CHECK-NEXT: AuxType: 1
CHECK-NEXT: Reserved: 0
CHECK-NEXT: SymbolTableIndex: 19
CHECK-NEXT: SymbolTableIndex: ?PerAppDomain@@$$Q3HA (19)
CHECK-NEXT: Unused: (00 00 00 00 00 00 00 00 00 00 00 00)
CHECK-NEXT: }
CHECK-NEXT: }

View File

@ -1058,10 +1058,19 @@ void COFFDumper::printSymbol(symbol_iterator SymI) {
if (error(getSymbolAuxData(Obj, Symbol + I, Aux)))
break;
const coff_symbol *ReferredSym;
StringRef ReferredName;
error_code EC;
if ((EC = Obj->getSymbol(Aux->SymbolTableIndex, ReferredSym)) ||
(EC = Obj->getSymbolName(ReferredSym, ReferredName))) {
ReferredName = "";
error(EC);
}
DictScope AS(W, "AuxCLRToken");
W.printNumber("AuxType", Aux->AuxType);
W.printNumber("Reserved", Aux->Reserved);
W.printNumber("SymbolTableIndex", Aux->SymbolTableIndex);
W.printNumber("SymbolTableIndex", ReferredName, Aux->SymbolTableIndex);
W.printBinary("Unused", Aux->Unused);
} else {