Skip to content

Commit

Permalink
[LLDB] [COFF] Fix handling of symbols with more than one aux symbol
Browse files Browse the repository at this point in the history
Differential Revision: https://reviews.llvm.org/D84070
  • Loading branch information
mstorsjo committed Jul 20, 2020
1 parent 8b16e45 commit f07ddbc
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
2 changes: 1 addition & 1 deletion lldb/source/Plugins/ObjectFile/PECOFF/ObjectFilePECOFF.cpp
Expand Up @@ -686,7 +686,7 @@ Symtab *ObjectFilePECOFF::GetSymtab() {

if (symbol.naux > 0) {
i += symbol.naux;
offset += symbol_size;
offset += symbol.naux * symbol_size;
}
}
}
Expand Down
10 changes: 10 additions & 0 deletions lldb/test/Shell/ObjectFile/PECOFF/symbol.yaml
@@ -1,6 +1,9 @@
# RUN: yaml2obj %s > %t
# RUN: lldb-test symbols %t | FileCheck %s

## The .file symbol isn't checked, but is included to test that the symbol
## table iteration handles cases with a symbol with more than one aux symbol.

# CHECK: Type File Address/Value {{.*}} Size Flags Name
# CHECK: Code 0x0000000040001000 0x{{[0-9a-f]+}} 0x{{[0-9a-f]+}} entry
# CHECK: 0x0000000040002000 0x{{[0-9a-f]+}} 0x{{[0-9a-f]+}} variable
Expand Down Expand Up @@ -101,6 +104,13 @@ symbols:
SimpleType: IMAGE_SYM_TYPE_NULL
ComplexType: IMAGE_SYM_DTYPE_NULL
StorageClass: IMAGE_SYM_CLASS_STATIC
- Name: .file
Value: 0
SectionNumber: -2
SimpleType: IMAGE_SYM_TYPE_NULL
ComplexType: IMAGE_SYM_DTYPE_NULL
StorageClass: IMAGE_SYM_CLASS_FILE
File: longfilenameusingtwoauxsymbols
- Name: entry
Value: 0
SectionNumber: 1
Expand Down

0 comments on commit f07ddbc

Please sign in to comment.