Skip to content

Commit 1be0960

Browse files
committed
Add a test.
The binary is as minimal as possible and it contains 1 segment named "__DWARF" with 3 sections: FILE OFF INDEX ADDRESS SIZE OFFSET ALIGN RELOFF NRELOC FLAGS RESERVED1 RESERVED2 RESERVED3 NAME =========== ===== ------------------ ------------------ ---------- ---------- ---------- ---------- ---------- ---------- ---------- ---------- ---------------------- 0x00000068: [ 1] 0x00000000fffffff0 0x0000000000000020 0xfffffff0 0x00000002 0x00000000 0x00000000 0x00000001 0x00000000 0x00000000 0x00000000 __DWARF.__debug_abbrev 0x000000b8: [ 2] 0x0000000100000010 0x0000000200000000 0x00000010 0x00000002 0x00000000 0x00000000 0x00000001 0x00000000 0x00000000 0x00000000 __DWARF.__debug_info 0x00000108: [ 3] 0x0000000300000010 0x0000000000000020 0x00000010 0x00000002 0x00000000 0x00000000 0x00000001 0x00000000 0x00000000 0x00000000 __DWARF.__debug_line The file offsets should be parsed correctly by LLDB as: __debug_abbrev file_offset=0x00000000fffffff0 __debug_info file_offset=0x0000000100000010 __debug_line file_offset=0x0000000300000010
1 parent 01fda39 commit 1be0960

File tree

2 files changed

+13
-0
lines changed

2 files changed

+13
-0
lines changed
344 Bytes
Binary file not shown.
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
RUN: %lldb -b %p/Inputs/section-overflow-binary \
2+
RUN: -o 'script dwarf = lldb.target.module[0].sections[0]' \
3+
RUN: -o 'script section = dwarf.GetSubSectionAtIndex(0)' \
4+
RUN: -o "script print(f'{section.GetName()} file_offset=0x{section.GetFileOffset():016x}')" \
5+
RUN: -o 'script section = dwarf.GetSubSectionAtIndex(1)' \
6+
RUN: -o "script print(f'{section.GetName()} file_offset=0x{section.GetFileOffset():016x}')" \
7+
RUN: -o 'script section = dwarf.GetSubSectionAtIndex(2)' \
8+
RUN: -o "script print(f'{section.GetName()} file_offset=0x{section.GetFileOffset():016x}')" \
9+
RUN: | FileCheck %s
10+
11+
CHECK: __debug_abbrev file_offset=0x00000000fffffff0
12+
CHECK: __debug_info file_offset=0x0000000100000010
13+
CHECK: __debug_line file_offset=0x0000000300000010

0 commit comments

Comments
 (0)