[llvm-branch-commits] [lldb] bf2f2bf - [LLDB] [COFF] Fix handling of symbols with more than one aux symbol
Hans Wennborg via llvm-branch-commits
llvm-branch-commits at lists.llvm.org
Tue Jul 21 07:05:54 PDT 2020
Author: Martin Storsjö
Date: 2020-07-21T16:05:41+02:00
New Revision: bf2f2bffee244318a86fea90a0dfaf9be8a71b8c
URL: https://github.com/llvm/llvm-project/commit/bf2f2bffee244318a86fea90a0dfaf9be8a71b8c
DIFF: https://github.com/llvm/llvm-project/commit/bf2f2bffee244318a86fea90a0dfaf9be8a71b8c.diff
LOG: [LLDB] [COFF] Fix handling of symbols with more than one aux symbol
Differential Revision: https://reviews.llvm.org/D84070
(cherry picked from commit f07ddbc9c4b66e91aa7a106042512ee903b6b3ba)
Added:
Modified:
lldb/source/Plugins/ObjectFile/PECOFF/ObjectFilePECOFF.cpp
lldb/test/Shell/ObjectFile/PECOFF/symbol.yaml
Removed:
################################################################################
diff --git a/lldb/source/Plugins/ObjectFile/PECOFF/ObjectFilePECOFF.cpp b/lldb/source/Plugins/ObjectFile/PECOFF/ObjectFilePECOFF.cpp
index d606b49130c4..dac2c496423f 100644
--- a/lldb/source/Plugins/ObjectFile/PECOFF/ObjectFilePECOFF.cpp
+++ b/lldb/source/Plugins/ObjectFile/PECOFF/ObjectFilePECOFF.cpp
@@ -698,7 +698,7 @@ Symtab *ObjectFilePECOFF::GetSymtab() {
if (symbol.naux > 0) {
i += symbol.naux;
- offset += symbol_size;
+ offset += symbol.naux * symbol_size;
}
}
}
diff --git a/lldb/test/Shell/ObjectFile/PECOFF/symbol.yaml b/lldb/test/Shell/ObjectFile/PECOFF/symbol.yaml
index 1d79e702333b..9dbc93b9b918 100644
--- a/lldb/test/Shell/ObjectFile/PECOFF/symbol.yaml
+++ b/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
@@ -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
More information about the llvm-branch-commits
mailing list