[PATCH] D125784: [llvm-debuginfo-analyzer] 09 - CodeView Reader

Zequan Wu via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Oct 7 17:38:41 PDT 2022


zequanwu added inline comments.


================
Comment at: llvm/lib/DebugInfo/LogicalView/Readers/LVCodeViewVisitor.cpp:1193
+
+    Symbol->addLocation(Attr, 0, 0, 0, 0);
+    Symbol->addLocationOperands(LVSmall(Attr), Operand1, /*Operand2=*/0);
----------------
Why is Range set for `S_DEFRANGE_FRAMEPOINTER_REL` and `S_DEFRANGE_REGISTER_REL` but not set for `S_DEFRANGE_REGISTER`, `S_DEFRANGE_SUBFIELD_REGISTER`?


================
Comment at: llvm/lib/DebugInfo/LogicalView/Readers/LVCodeViewVisitor.cpp:1622
+    if (DemangledSymbol.find("scalar deleting dtor") != std::string::npos)
+      Function->setIsArtificial();
+  }
----------------
Clang generated global ctor and dtor names containing the substrings: `dynamic initializer for` and `dynamic atexit destructor for`: https://github.com/llvm/llvm-project/blob/main/clang/lib/CodeGen/CGDebugInfo.cpp#L2254-L2259


================
Comment at: llvm/lib/DebugInfo/LogicalView/Readers/LVCodeViewVisitor.cpp:1900
+                : getSizeInBytesForTypeIndex(TIElementType))
+      PrevSubrange->setCount(PrevSubrange->getCount() / Size);
+
----------------
Might worth checking `Size != 0`, I have seen that element size being 0, might be missing in pdb.


================
Comment at: llvm/lib/DebugInfo/LogicalView/Readers/LVCodeViewVisitor.cpp:3393
+
+Error LVLogicalVisitor::inlineSiteAnnotation(LVScope *AbstractFunction,
+                                             LVScope *InlinedFunction,
----------------
zequanwu wrote:
> It looks like it doesn't handle following case correctly. After parse line 5, it will create line starting at 0x20 with line offset being 3, which should be 2. It's from https://reviews.llvm.org/D123151#3431153. You may want to take a look on https://github.com/llvm/llvm-project/blob/main/llvm/lib/DebugInfo/PDB/Native/NativeInlineSiteSymbol.cpp#L101.
> ```
> 0602      line 1 (+1)
> 0315      code 0x15 (+0x15)
> 0B2B      code 0x20 (+0xB) line 2 (+1)
> 0602      line 3 (+1)
> 0311      code 0x31 (+0x11)
> 0B29      code 0x3A (+0x9) line 4 (+1)
> 0409      code end 0x43 (+0x9)
> ```
NVM, ignore the comment. It's correct.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D125784/new/

https://reviews.llvm.org/D125784



More information about the llvm-commits mailing list