[PATCH] D157036: Emit a .debug_str_offsets section with dsymutil to support DW_FORM_strx in dsymutil.

Shubham Sandeep Rastogi via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Aug 10 16:58:19 PDT 2023


rastogishubham added inline comments.


================
Comment at: llvm/lib/DWARFLinker/DWARFLinker.cpp:2024
 
+static void patchStrOffsetsBase(DIE &Die, DIEInteger Offset) {
+  for (auto &V : Die.values())
----------------
avl wrote:
> It looks patchStrOffsetsBase is not removed still.
Apologies, I forgot to remove the code, but I did add the proper code to cloneScalarAttribute


================
Comment at: llvm/lib/DWARFLinker/DWARFStreamer.cpp:268
+    return;
+
+  Asm->OutStreamer->switchSection(MOFI->getDwarfStrOffSection());
----------------
avl wrote:
> should not we check here for empty StringOffsets and return?
> 
> 
> ```
> if (StringOffsets.empty())
>   return;
> ```
My thought was that if there is a DWARF5 cu, then there has to be a debug_str_offset section, but I am wrong, what if the CU doesn't have any strings?


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

https://reviews.llvm.org/D157036



More information about the llvm-commits mailing list