llvm-project/lldb/unittests/Core
PoYao Chang 633b002944 [lldb] Fix PR52702 by fixing bool conversion of Mangled
Remove the Mangled::operator! and Mangled::operator void* where the
comments in header and implementation files disagree and replace them
with operator bool.

This fix PR52702 as https://reviews.llvm.org/D106837 used the buggy
Mangled::operator! in Symbol::SynthesizeNameIfNeeded. For example,
consider the symbol "puts" in a hello world C program:

// Inside Symbol::SynthesizeNameIfNeeded
(lldb) p m_mangled
(lldb_private::Mangled) $0 = (m_mangled = None, m_demangled = "puts")
(lldb) p !m_mangled
(bool) $1 = true          # should be false!!
This leads to Symbol::SynthesizeNameIfNeeded overwriting m_demangled
part of Mangled (in this case "puts").

In conclusion, this patch turns
callq  0x401030                  ; symbol stub for: ___lldb_unnamed_symbol36
back into
callq  0x401030                  ; symbol stub for: puts .

Differential Revision: https://reviews.llvm.org/D116217
2021-12-29 17:17:52 +08:00
..
CMakeLists.txt [lldb/Core] Add SourceLocationSpec class (NFC) 2021-05-04 16:34:45 +00:00
CommunicationTest.cpp [lldb] [Communication] Add a WriteAll() method that resumes writing 2021-10-26 12:45:45 +02:00
DumpDataExtractorTest.cpp [LLDB] Adjust DumpDataExtractorTest.Formats for Windows 2021-11-04 08:48:26 +05:00
FormatEntityTest.cpp Some FormatEntity.cpp cleanup and unit testing 2021-04-21 15:12:59 +02:00
MangledTest.cpp [lldb] Fix PR52702 by fixing bool conversion of Mangled 2021-12-29 17:17:52 +08:00
ModuleSpecTest.cpp [lldb/Module] Allow for the creation of memory-only modules 2020-07-14 08:45:44 -07:00
RichManglingContextTest.cpp [lldb][NFC] Remove unused method RichManglingContext::IsFunction 2021-08-23 11:45:55 -07:00
SourceLocationSpecTest.cpp [lldb/Core] Add SourceLocationSpec class (NFC) 2021-05-04 16:34:45 +00:00
SourceManagerTest.cpp [lldb] Fix SourceManager::SourceFileCache insertion 2020-04-20 16:25:54 +02:00
StreamCallbackTest.cpp
UniqueCStringMapTest.cpp