[PATCH] D24706: [ELF] - Partial support of --gdb-index command line option (Part 1).
Rui Ueyama via llvm-commits
llvm-commits at lists.llvm.org
Mon Oct 17 16:38:37 PDT 2016
ruiu added inline comments.
================
Comment at: ELF/CMakeLists.txt:21
ScriptParser.cpp
+ GdbIndex.cpp
Strings.cpp
----------------
Sort
================
Comment at: ELF/Config.h:101-102
bool FatalWarnings;
+ bool GdbIndex;
bool GcSections;
bool GnuHash = false;
----------------
Sort
================
Comment at: ELF/GdbIndex.cpp:12
+//
+// If that option is used, linker should emit a .gdb_index section that allows
+// debugger to locate and read .dwo files, containing neccessary debug
----------------
This long comment doesn't match with what you do in this patch. You want to add this later.
================
Comment at: ELF/GdbIndex.h:22
+
+template <class ELFT> class GdbIndexBuilder {
+ typedef typename ELFT::uint uintX_t;
----------------
You can remove this class and replace a non-member function `readCuList(InputSection<ELFT> *)`.
================
Comment at: ELF/OutputSections.cpp:90
+template <class ELFT> void GdbIndexSection<ELFT>::writeTo(uint8_t *Buf) {
+ write32le(Buf, 7); // Write version.
+ write32le(Buf + 4, CuListOffset); // CU list offset.
----------------
ruiu wrote:
> Remove `.` from comments because they are not sentences.
`Write version` -> `Version` for consistency.
================
Comment at: ELF/OutputSections.cpp:90-95
+ write32le(Buf, 7); // Write version.
+ write32le(Buf + 4, CuListOffset); // CU list offset.
+ write32le(Buf + 8, CuTypesOffset); // Types CU list offset.
+ write32le(Buf + 12, CuTypesOffset); // Address area offset.
+ write32le(Buf + 16, CuTypesOffset); // Symbol table offset.
+ write32le(Buf + 20, CuTypesOffset); // Constant pool offset.
----------------
Remove `.` from comments because they are not sentences.
================
Comment at: ELF/Writer.cpp:777
Out<ELFT>::FiniArray = findSection(".fini_array");
+ if (Out<ELFT>::GdbIndex)
----------------
I think you want to do the same as the other sections here and remove `DebugInfoSec`.
Out<ELFT>::DebugInfo = findSection(".debug_info");
https://reviews.llvm.org/D24706
More information about the llvm-commits
mailing list