[llvm] r255596 - [llvm-readobj] s/FunctionName/LinkageName/ for codeview dumping

Reid Kleckner via llvm-commits llvm-commits at lists.llvm.org
Mon Dec 14 17:23:55 PST 2015


Author: rnk
Date: Mon Dec 14 19:23:55 2015
New Revision: 255596

URL: http://llvm.org/viewvc/llvm-project?rev=255596&view=rev
Log:
[llvm-readobj] s/FunctionName/LinkageName/ for codeview dumping

The symbol being printed in this field comes from the main symbol table,
not 0xF1 subsection. Use LinkageName to make that a lot clearer.

Modified:
    llvm/trunk/test/tools/llvm-readobj/codeview-linetables.test
    llvm/trunk/tools/llvm-readobj/COFFDumper.cpp

Modified: llvm/trunk/test/tools/llvm-readobj/codeview-linetables.test
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/tools/llvm-readobj/codeview-linetables.test?rev=255596&r1=255595&r2=255596&view=diff
==============================================================================
--- llvm/trunk/test/tools/llvm-readobj/codeview-linetables.test (original)
+++ llvm/trunk/test/tools/llvm-readobj/codeview-linetables.test Mon Dec 14 19:23:55 2015
@@ -50,7 +50,7 @@ MFUN32:        ]
 MFUN32-NEXT:   Subsection [
 MFUN32-NEXT:     Type: 0xF2
 MFUN32-NEXT:     PayloadSize: 0x30
-MFUN32:          FunctionName: _x
+MFUN32:          LinkageName: _x
 MFUN32-NEXT:   ]
 MFUN32-NEXT:   Subsection [
 MFUN32-NEXT:     Type: 0xF5
@@ -69,7 +69,7 @@ MFUN32:        ]
 MFUN32-NEXT:   Subsection [
 MFUN32-NEXT:     Type: 0xF2
 MFUN32-NEXT:     PayloadSize: 0x30
-MFUN32:          FunctionName: _y
+MFUN32:          LinkageName: _y
 MFUN32-NEXT:   ]
 MFUN32-NEXT:   Subsection [
 MFUN32-NEXT:     Type: 0xF5
@@ -88,7 +88,7 @@ MFUN32:        ]
 MFUN32-NEXT:   Subsection [
 MFUN32-NEXT:     Type: 0xF2
 MFUN32-NEXT:     PayloadSize: 0x40
-MFUN32:          FunctionName: _f
+MFUN32:          LinkageName: _f
 MFUN32-NEXT:   ]
 MFUN32-NEXT:   Subsection [
 MFUN32-NEXT:     Type: 0xF4
@@ -103,7 +103,7 @@ MFUN32-NEXT:     Type: 0xF1
 MFUN32-NEXT:     PayloadSize: 0x8
 MFUN32:        ]
 MFUN32-NEXT:   FunctionLineTable [
-MFUN32-NEXT:     FunctionName: _x
+MFUN32-NEXT:     LinkageName: _x
 MFUN32-NEXT:     Flags: 0x0
 MFUN32-NEXT:     CodeSize: 0xA
 MFUN32-NEXT:     FilenameSegment [
@@ -114,7 +114,7 @@ MFUN32-NEXT:       +0x8: 5
 MFUN32-NEXT:     ]
 MFUN32-NEXT:   ]
 MFUN32-NEXT:   FunctionLineTable [
-MFUN32-NEXT:     FunctionName: _y
+MFUN32-NEXT:     LinkageName: _y
 MFUN32-NEXT:     Flags: 0x0
 MFUN32-NEXT:     CodeSize: 0xA
 MFUN32-NEXT:     FilenameSegment [
@@ -125,7 +125,7 @@ MFUN32-NEXT:       +0x8: 9
 MFUN32-NEXT:     ]
 MFUN32-NEXT:   ]
 MFUN32-NEXT:   FunctionLineTable [
-MFUN32-NEXT:     FunctionName: _f
+MFUN32-NEXT:     LinkageName: _f
 MFUN32-NEXT:     Flags: 0x0
 MFUN32-NEXT:     CodeSize: 0x14
 MFUN32-NEXT:     FilenameSegment [
@@ -158,7 +158,7 @@ MFUN64:        ]
 MFUN64-NEXT:   Subsection [
 MFUN64-NEXT:     Type: 0xF2
 MFUN64-NEXT:     PayloadSize: 0x30
-MFUN64:          FunctionName: x
+MFUN64:          LinkageName: x
 MFUN64-NEXT:   ]
 MFUN64-NEXT:   Subsection [
 MFUN64-NEXT:     Type: 0xF1
@@ -173,7 +173,7 @@ MFUN64:        ]
 MFUN64-NEXT:   Subsection [
 MFUN64-NEXT:     Type: 0xF2
 MFUN64-NEXT:     PayloadSize: 0x30
-MFUN64:          FunctionName: y
+MFUN64:          LinkageName: y
 MFUN64-NEXT:   ]
 MFUN64-NEXT:   Subsection [
 MFUN64-NEXT:     Type: 0xF1
@@ -188,7 +188,7 @@ MFUN64:        ]
 MFUN64-NEXT:   Subsection [
 MFUN64-NEXT:     Type: 0xF2
 MFUN64-NEXT:     PayloadSize: 0x40
-MFUN64:          FunctionName: f
+MFUN64:          LinkageName: f
 MFUN64-NEXT:   ]
 MFUN64-NEXT:   Subsection [
 MFUN64-NEXT:     Type: 0xF4
@@ -203,7 +203,7 @@ MFUN64-NEXT:     Type: 0xF1
 MFUN64-NEXT:     PayloadSize: 0x8
 MFUN64:        ]
 MFUN64-NEXT:   FunctionLineTable [
-MFUN64-NEXT:     FunctionName: x
+MFUN64-NEXT:     LinkageName: x
 MFUN64-NEXT:     Flags: 0x0
 MFUN64-NEXT:     CodeSize: 0xE
 MFUN64-NEXT:     FilenameSegment [
@@ -214,7 +214,7 @@ MFUN64-NEXT:       +0x9: 5
 MFUN64-NEXT:     ]
 MFUN64-NEXT:   ]
 MFUN64-NEXT:   FunctionLineTable [
-MFUN64-NEXT:     FunctionName: y
+MFUN64-NEXT:     LinkageName: y
 MFUN64-NEXT:     Flags: 0x0
 MFUN64-NEXT:     CodeSize: 0xE
 MFUN64-NEXT:     FilenameSegment [
@@ -225,7 +225,7 @@ MFUN64-NEXT:       +0x9: 9
 MFUN64-NEXT:     ]
 MFUN64-NEXT:   ]
 MFUN64-NEXT:   FunctionLineTable [
-MFUN64-NEXT:     FunctionName: f
+MFUN64-NEXT:     LinkageName: f
 MFUN64-NEXT:     Flags: 0x0
 MFUN64-NEXT:     CodeSize: 0x18
 MFUN64-NEXT:     FilenameSegment [
@@ -286,7 +286,7 @@ MFILE32:        ]
 MFILE32-NEXT:   Subsection [
 MFILE32-NEXT:     Type: 0xF2
 MFILE32-NEXT:     PayloadSize: 0x64
-MFILE32:          FunctionName: _f
+MFILE32:          LinkageName: _f
 MFILE32-NEXT:   ]
 MFILE32-NEXT:   Subsection [
 MFILE32-NEXT:     Type: 0xF4
@@ -301,7 +301,7 @@ MFILE32-NEXT:     Type: 0xF1
 MFILE32-NEXT:     PayloadSize: 0x8
 MFILE32:        ]
 MFILE32-NEXT:   FunctionLineTable [
-MFILE32-NEXT:     FunctionName: _f
+MFILE32-NEXT:     LinkageName: _f
 MFILE32-NEXT:     Flags: 0x0
 MFILE32-NEXT:     CodeSize: 0x14
 MFILE32-NEXT:     FilenameSegment [
@@ -343,7 +343,7 @@ MFILE64:        ]
 MFILE64-NEXT:   Subsection [
 MFILE64-NEXT:     Type: 0xF2
 MFILE64-NEXT:     PayloadSize: 0x64
-MFILE64:          FunctionName: f
+MFILE64:          LinkageName: f
 MFILE64-NEXT:   ]
 MFILE64-NEXT:   Subsection [
 MFILE64-NEXT:     Type: 0xF4
@@ -358,7 +358,7 @@ MFILE64-NEXT:     Type: 0xF1
 MFILE64-NEXT:     PayloadSize: 0x8
 MFILE64:        ]
 MFILE64-NEXT:   FunctionLineTable [
-MFILE64-NEXT:     FunctionName: f
+MFILE64-NEXT:     LinkageName: f
 MFILE64-NEXT:     Flags: 0x0
 MFILE64-NEXT:     CodeSize: 0x18
 MFILE64-NEXT:     FilenameSegment [
@@ -406,7 +406,7 @@ MCOMDAT-NEXT:   Section: ?f@@YAHXZ
 MCOMDAT-NEXT:   CodeSize: 0x7
 MCOMDAT-NEXT: }
 MCOMDAT:      FunctionLineTable [
-MCOMDAT-NEXT:   FunctionName: ?f@@YAHXZ
+MCOMDAT-NEXT:   LinkageName: ?f@@YAHXZ
 MCOMDAT-NEXT:   Flags: 0x0
 MCOMDAT-NEXT:   CodeSize: 0x7
 MCOMDAT-NEXT:   FilenameSegment [
@@ -422,7 +422,7 @@ MCOMDAT-NEXT:   Section: ?g@@YAHXZ
 MCOMDAT-NEXT:   CodeSize: 0x7
 MCOMDAT-NEXT: }
 MCOMDAT:      FunctionLineTable [
-MCOMDAT-NEXT:   FunctionName: ?g@@YAHXZ
+MCOMDAT-NEXT:   LinkageName: ?g@@YAHXZ
 MCOMDAT-NEXT:   Flags: 0x0
 MCOMDAT-NEXT:   CodeSize: 0x7
 MCOMDAT-NEXT:   FilenameSegment [

Modified: llvm/trunk/tools/llvm-readobj/COFFDumper.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvm-readobj/COFFDumper.cpp?rev=255596&r1=255595&r2=255596&view=diff
==============================================================================
--- llvm/trunk/tools/llvm-readobj/COFFDumper.cpp (original)
+++ llvm/trunk/tools/llvm-readobj/COFFDumper.cpp Mon Dec 14 19:23:55 2015
@@ -531,18 +531,18 @@ void COFFDumper::printCodeViewDebugInfo(
           return;
         }
 
-        StringRef FunctionName;
+        StringRef LinkageName;
         error(resolveSymbolName(Obj->getCOFFSection(Section), Offset,
-                                FunctionName));
-        W.printString("FunctionName", FunctionName);
-        if (FunctionLineTables.count(FunctionName) != 0) {
+                                LinkageName));
+        W.printString("LinkageName", LinkageName);
+        if (FunctionLineTables.count(LinkageName) != 0) {
           // Saw debug info for this function already?
           error(object_error::parse_failed);
           return;
         }
 
-        FunctionLineTables[FunctionName] = Contents;
-        FunctionNames.push_back(FunctionName);
+        FunctionLineTables[LinkageName] = Contents;
+        FunctionNames.push_back(LinkageName);
         break;
       }
       case COFF::DEBUG_STRING_TABLE_SUBSECTION:
@@ -579,7 +579,7 @@ void COFFDumper::printCodeViewDebugInfo(
   for (unsigned I = 0, E = FunctionNames.size(); I != E; ++I) {
     StringRef Name = FunctionNames[I];
     ListScope S(W, "FunctionLineTable");
-    W.printString("FunctionName", Name);
+    W.printString("LinkageName", Name);
 
     DataExtractor DE(FunctionLineTables[Name], true, 4);
     uint32_t Offset = 6;  // Skip relocations.




More information about the llvm-commits mailing list