diff options
author | Alvin Wong <alvin@alvinhc.com> | 2022-09-28 12:46:27 +0300 |
---|---|---|
committer | Martin Storsjö <martin@martin.st> | 2022-09-28 12:57:12 +0300 |
commit | 8a67a05e93349e341d1325f1a6428d1373f77177 (patch) | |
tree | 03abb0382c5236bd2aaf55c93764555667d32867 /lldb/source/Plugins/ObjectFile/PECOFF/ObjectFilePECOFF.cpp | |
parent | acf7d081198f380d6ad2a1b859930e50a9cf2dae (diff) | |
download | llvm-8a67a05e93349e341d1325f1a6428d1373f77177.zip llvm-8a67a05e93349e341d1325f1a6428d1373f77177.tar.gz llvm-8a67a05e93349e341d1325f1a6428d1373f77177.tar.bz2 |
[lldb][COFF] Map symbols without base+complex type as 'Data' type
Both LLD and GNU ld write global/static variables to the COFF symbol
table with `IMAGE_SYM_TYPE_NULL` and `IMAGE_SYM_DTYPE_NULL` type. Map
these symbols as 'Data' type in the symtab to allow these symbols to be
used in expressions and printable.
Reviewed By: labath, DavidSpickett
Differential Revision: https://reviews.llvm.org/D134585
Diffstat (limited to 'lldb/source/Plugins/ObjectFile/PECOFF/ObjectFilePECOFF.cpp')
-rw-r--r-- | lldb/source/Plugins/ObjectFile/PECOFF/ObjectFilePECOFF.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/lldb/source/Plugins/ObjectFile/PECOFF/ObjectFilePECOFF.cpp b/lldb/source/Plugins/ObjectFile/PECOFF/ObjectFilePECOFF.cpp index 6b6177f..61c9b9f 100644 --- a/lldb/source/Plugins/ObjectFile/PECOFF/ObjectFilePECOFF.cpp +++ b/lldb/source/Plugins/ObjectFile/PECOFF/ObjectFilePECOFF.cpp @@ -379,6 +379,13 @@ lldb::SymbolType ObjectFilePECOFF::MapSymbolType(uint16_t coff_symbol_type) { if (complex_type == llvm::COFF::IMAGE_SYM_DTYPE_FUNCTION) { return lldb::eSymbolTypeCode; } + const auto base_type = coff_symbol_type & 0xff; + if (base_type == llvm::COFF::IMAGE_SYM_TYPE_NULL && + complex_type == llvm::COFF::IMAGE_SYM_DTYPE_NULL) { + // Unknown type. LLD and GNU ld uses this for variables on MinGW, so + // consider these symbols to be data to enable printing. + return lldb::eSymbolTypeData; + } return lldb::eSymbolTypeInvalid; } |