diff --git a/lldb/source/Core/Section.cpp b/lldb/source/Core/Section.cpp index 9e98b59deb0357..0763e88d4608f4 100644 --- a/lldb/source/Core/Section.cpp +++ b/lldb/source/Core/Section.cpp @@ -275,7 +275,7 @@ bool Section::ContainsFileAddress(addr_t vm_addr) const { void Section::Dump(llvm::raw_ostream &s, unsigned indent, Target *target, uint32_t depth) const { s.indent(indent); - s << llvm::format("0x%8.8" PRIx64 " %-16s ", GetID(), GetTypeAsCString()); + s << llvm::format("0x%16.16" PRIx64 " %-22s ", GetID(), GetTypeAsCString()); bool resolved = true; addr_t addr = LLDB_INVALID_ADDRESS; @@ -642,14 +642,12 @@ void SectionList::Dump(llvm::raw_ostream &s, unsigned indent, Target *target, if (show_header && !m_sections.empty()) { s.indent(indent); s << llvm::formatv( - "SectID Type {0} Address " - " Perm File Off. File Size Flags " - " Section Name\n", + "SectID Type {0} Address " + " Perm File Off. File Size Flags Section Name\n", target_has_loaded_sections ? "Load" : "File"); s.indent(indent); - s << "---------- ---------------- " - "--------------------------------------- ---- ---------- " - "---------- " + s << "------------------ ---------------------- " + "--------------------------------------- ---- ---------- ---------- " "---------- ----------------------------\n"; } diff --git a/lldb/test/Shell/Commands/command-target-modules-dump-sections.yaml b/lldb/test/Shell/Commands/command-target-modules-dump-sections.yaml index 1fb06f651df8e9..d75a24c60123c9 100644 --- a/lldb/test/Shell/Commands/command-target-modules-dump-sections.yaml +++ b/lldb/test/Shell/Commands/command-target-modules-dump-sections.yaml @@ -3,18 +3,18 @@ # RUN: | FileCheck --match-full-lines --strict-whitespace %s # CHECK:Sections for '{{.*}}command-target-modules-dump-sections.yaml.tmp' (x86_64): -# CHECK-NEXT: SectID Type File Address Perm File Off. File Size Flags Section Name -# CHECK-NEXT: ---------- ---------------- --------------------------------------- ---- ---------- ---------- ---------- ---------------------------- -# CHECK-NEXT: 0x00000001 code [0x0000000000004000-0x0000000000005000) r-x 0x00001000 0x00001000 0x00000006 command-target-modules-dump-sections.yaml.tmp..text -# CHECK-NEXT: 0x00000002 regular [0x0000000000005000-0x0000000000005100) r-- 0x00002000 0x00000100 0x00000002 command-target-modules-dump-sections.yaml.tmp..rodata -# CHECK-NEXT: 0x00000003 eh-frame [0x0000000000006000-0x0000000000006040) r-- 0x00002100 0x00000040 0x00000002 command-target-modules-dump-sections.yaml.tmp..eh_frame +# CHECK-NEXT: SectID Type File Address Perm File Off. File Size Flags Section Name +# CHECK-NEXT: ------------------ ---------------------- --------------------------------------- ---- ---------- ---------- ---------- ---------------------------- +# CHECK-NEXT: 0x0000000000000001 code [0x0000000000004000-0x0000000000005000) r-x 0x00001000 0x00001000 0x00000006 command-target-modules-dump-sections.yaml.tmp..text +# CHECK-NEXT: 0x0000000000000002 regular [0x0000000000005000-0x0000000000005100) r-- 0x00002000 0x00000100 0x00000002 command-target-modules-dump-sections.yaml.tmp..rodata +# CHECK-NEXT: 0x0000000000000003 eh-frame [0x0000000000006000-0x0000000000006040) r-- 0x00002100 0x00000040 0x00000002 command-target-modules-dump-sections.yaml.tmp..eh_frame --- !ELF -FileHeader: +FileHeader: Class: ELFCLASS64 Data: ELFDATA2LSB Type: ET_EXEC Machine: EM_X86_64 -Sections: +Sections: - Name: .text Type: SHT_PROGBITS Flags: [ SHF_ALLOC, SHF_EXECINSTR ]