Skip to content

Commit f07ddbc

Browse files
committed
[LLDB] [COFF] Fix handling of symbols with more than one aux symbol
Differential Revision: https://reviews.llvm.org/D84070
1 parent 8b16e45 commit f07ddbc

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

lldb/source/Plugins/ObjectFile/PECOFF/ObjectFilePECOFF.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -686,7 +686,7 @@ Symtab *ObjectFilePECOFF::GetSymtab() {
686686

687687
if (symbol.naux > 0) {
688688
i += symbol.naux;
689-
offset += symbol_size;
689+
offset += symbol.naux * symbol_size;
690690
}
691691
}
692692
}

lldb/test/Shell/ObjectFile/PECOFF/symbol.yaml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
# RUN: yaml2obj %s > %t
22
# RUN: lldb-test symbols %t | FileCheck %s
33

4+
## The .file symbol isn't checked, but is included to test that the symbol
5+
## table iteration handles cases with a symbol with more than one aux symbol.
6+
47
# CHECK: Type File Address/Value {{.*}} Size Flags Name
58
# CHECK: Code 0x0000000040001000 0x{{[0-9a-f]+}} 0x{{[0-9a-f]+}} entry
69
# CHECK: 0x0000000040002000 0x{{[0-9a-f]+}} 0x{{[0-9a-f]+}} variable
@@ -101,6 +104,13 @@ symbols:
101104
SimpleType: IMAGE_SYM_TYPE_NULL
102105
ComplexType: IMAGE_SYM_DTYPE_NULL
103106
StorageClass: IMAGE_SYM_CLASS_STATIC
107+
- Name: .file
108+
Value: 0
109+
SectionNumber: -2
110+
SimpleType: IMAGE_SYM_TYPE_NULL
111+
ComplexType: IMAGE_SYM_DTYPE_NULL
112+
StorageClass: IMAGE_SYM_CLASS_FILE
113+
File: longfilenameusingtwoauxsymbols
104114
- Name: entry
105115
Value: 0
106116
SectionNumber: 1

0 commit comments

Comments
 (0)