llvm-project/lldb/source/Core
Jaroslav Sevcik 177dd63c8d Data formatters: fix detection of C strings
Summary:
Detection of C strings does not work well for pointers. If the value object holding a (char*) pointer does not have an address (e.g., if it is a temp), the value is not considered a C string and its formatting is left to DumpDataExtractor rather than the special handling in  ValueObject::DumpPrintableRepresentation. This leads to inconsistent outputs, e.g., in escaping non-ASCII characters. See the test for an example; the second test expectation is not met (without this patch). With this patch, the C string detection only insists that the pointer value is valid. The patch makes the code consistent with how the pointer is obtained in ValueObject::ReadPointedString.

Reviewers: teemperor

Reviewed By: teemperor

Subscribers: lldb-commits

Tags: #lldb

Differential Revision: https://reviews.llvm.org/D76650
2020-03-24 14:25:59 +01:00
..
Address.cpp [lldb][NFC] Fix all formatting errors in .cpp file headers 2020-01-24 08:52:55 +01:00
AddressRange.cpp [lldb][NFC] Fix all formatting errors in .cpp file headers 2020-01-24 08:52:55 +01:00
AddressResolver.cpp [lldb][NFC] Fix all formatting errors in .cpp file headers 2020-01-24 08:52:55 +01:00
AddressResolverFileLine.cpp [lldb][NFC] Fix all formatting errors in .cpp file headers 2020-01-24 08:52:55 +01:00
AddressResolverName.cpp [lldb][NFC] Make all CompilerDeclContext parameters references instead of pointers 2020-02-18 08:58:36 +01:00
CMakeLists.txt [lldb] Increase LINK_INTERFACE_MULTIPLICITY for Debug builds 2020-02-04 14:30:27 +01:00
Communication.cpp [lldb][NFC] Fix all formatting errors in .cpp file headers 2020-01-24 08:52:55 +01:00
CoreProperties.td [lldb] Color the line marker 2020-02-24 15:40:31 -08:00
Debugger.cpp [lldb] Color the line marker 2020-02-24 15:40:31 -08:00
Disassembler.cpp [lldb] Reduce duplication in the Disassembler class 2020-03-09 13:41:43 +01:00
DumpDataExtractor.cpp [lldb][NFC] Fix all formatting errors in .cpp file headers 2020-01-24 08:52:55 +01:00
DumpRegisterValue.cpp Make llvm::StringRef to std::string conversions explicit. 2020-01-28 23:25:25 +01:00
DynamicLoader.cpp [lldb][NFC] Remove several inefficient ConstString -> const char * -> StringRef conversions 2020-02-11 09:14:41 +01:00
EmulateInstruction.cpp [lldb][NFC] Fix all formatting errors in .cpp file headers 2020-01-24 08:52:55 +01:00
FileLineResolver.cpp [lldb][NFC] Fix all formatting errors in .cpp file headers 2020-01-24 08:52:55 +01:00
FileSpecList.cpp [lldb][NFC] Fix all formatting errors in .cpp file headers 2020-01-24 08:52:55 +01:00
FormatEntity.cpp [lldb] Delete the SharingPtr class 2020-02-11 13:23:18 +01:00
Highlighter.cpp [lldb][NFC] Fix all formatting errors in .cpp file headers 2020-01-24 08:52:55 +01:00
IOHandler.cpp [lldb] Make sure we don't drop asynchronous output when sourcing files 2020-03-03 11:18:41 +01:00
IOHandlerCursesGUI.cpp [lldb][NFC] Fix all formatting errors in .cpp file headers 2020-01-24 08:52:55 +01:00
Mangled.cpp [lldb][NFC] Remove several inefficient ConstString -> const char * -> StringRef conversions 2020-02-11 09:14:41 +01:00
Module.cpp [LLDB] Fix AddressSanitizer failure in MemoryCache 2020-02-27 11:17:10 -08:00
ModuleChild.cpp [lldb][NFC] Fix all formatting errors in .cpp file headers 2020-01-24 08:52:55 +01:00
ModuleList.cpp [lldb][NFC] Make all CompilerDeclContext parameters references instead of pointers 2020-02-18 08:58:36 +01:00
Opcode.cpp [lldb][NFC] Fix all formatting errors in .cpp file headers 2020-01-24 08:52:55 +01:00
PluginManager.cpp [lldb/Core] Remove locking in the PluginManager 2020-02-19 10:04:05 -08:00
RichManglingContext.cpp [lldb][NFC] Fix all formatting errors in .cpp file headers 2020-01-24 08:52:55 +01:00
SearchFilter.cpp [lldb][NFC] Remove unused parameter 2020-02-18 13:49:08 +03:00
Section.cpp [lldb] Remove some #ifdef LLDB_CONFIGURATION_DEBUG around asserts 2020-03-06 11:21:00 -08:00
SourceManager.cpp [lldb] Color the line marker 2020-02-24 15:40:31 -08:00
StreamAsynchronousIO.cpp [lldb][NFC] Fix all formatting errors in .cpp file headers 2020-01-24 08:52:55 +01:00
StreamFile.cpp [lldb][NFC] Fix all formatting errors in .cpp file headers 2020-01-24 08:52:55 +01:00
UserSettingsController.cpp [lldb][NFC] Fix all formatting errors in .cpp file headers 2020-01-24 08:52:55 +01:00
Value.cpp [lldb][NFC] Fix all formatting errors in .cpp file headers 2020-01-24 08:52:55 +01:00
ValueObject.cpp Data formatters: fix detection of C strings 2020-03-24 14:25:59 +01:00
ValueObjectCast.cpp [lldb] Delete commented-out code 2020-02-04 15:33:06 -08:00
ValueObjectChild.cpp [lldb][NFC] Remove GetConstTypeName and GetConstQualifiedTypeName from CompilerType 2020-02-12 09:49:39 +01:00
ValueObjectConstResult.cpp [lldb][NFC] Remove GetConstTypeName and GetConstQualifiedTypeName from CompilerType 2020-02-12 09:49:39 +01:00
ValueObjectConstResultCast.cpp [lldb][NFC] Fix all formatting errors in .cpp file headers 2020-01-24 08:52:55 +01:00
ValueObjectConstResultChild.cpp [lldb][NFC] Fix all formatting errors in .cpp file headers 2020-01-24 08:52:55 +01:00
ValueObjectConstResultImpl.cpp [lldb] Delete the SharingPtr class 2020-02-11 13:23:18 +01:00
ValueObjectDynamicValue.cpp [lldb] Remove DataExtractor::GetPointer 2020-02-18 10:38:41 +01:00
ValueObjectList.cpp [lldb] Delete the SharingPtr class 2020-02-11 13:23:18 +01:00
ValueObjectMemory.cpp [lldb][NFC] Remove GetConstTypeName and GetConstQualifiedTypeName from CompilerType 2020-02-12 09:49:39 +01:00
ValueObjectRegister.cpp [lldb][NFC] Remove GetConstTypeName and GetConstQualifiedTypeName from CompilerType 2020-02-12 09:49:39 +01:00
ValueObjectSyntheticFilter.cpp [lldb] Delete the SharingPtr class 2020-02-11 13:23:18 +01:00
ValueObjectVariable.cpp [lldb] Delete the SharingPtr class 2020-02-11 13:23:18 +01:00