diff options
author | Pavel Labath <pavel@labath.sk> | 2021-11-03 13:43:33 +0100 |
---|---|---|
committer | Pavel Labath <pavel@labath.sk> | 2021-11-18 14:45:17 +0100 |
commit | 4c56f734b35dd3e16b75da46c023cd4b92f83f8c (patch) | |
tree | ad236d4b602ceb74d4391d6f18b77672b41e3866 /lldb/source/Plugins/Language/CPlusPlus/LibStdcpp.cpp | |
parent | 3950e1be8d6ec602fda525ea20340fd3f8e2e919 (diff) | |
download | llvm-4c56f734b35dd3e16b75da46c023cd4b92f83f8c.zip llvm-4c56f734b35dd3e16b75da46c023cd4b92f83f8c.tar.gz llvm-4c56f734b35dd3e16b75da46c023cd4b92f83f8c.tar.bz2 |
[lldb] (Partially) enable formatting of utf strings before the program is started
The StringPrinter class was using a Process instance to read memory.
This automatically prevented it from working before starting the
program.
This patch changes the class to use the Target object for reading
memory, as targets are always available. This required moving
ReadStringFromMemory from Process to Target.
This is sufficient to make frame/target variable work, but further
changes are necessary for the expression evaluator. Preliminary analysis
indicates the failures are due to the expression result ValueObjects
failing to provide an address, presumably because we're operating on
file addresses before starting. I haven't looked into what would it take
to make that work.
Differential Revision: https://reviews.llvm.org/D113098
Diffstat (limited to 'lldb/source/Plugins/Language/CPlusPlus/LibStdcpp.cpp')
-rw-r--r-- | lldb/source/Plugins/Language/CPlusPlus/LibStdcpp.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lldb/source/Plugins/Language/CPlusPlus/LibStdcpp.cpp b/lldb/source/Plugins/Language/CPlusPlus/LibStdcpp.cpp index b4af67e..9e248d1 100644 --- a/lldb/source/Plugins/Language/CPlusPlus/LibStdcpp.cpp +++ b/lldb/source/Plugins/Language/CPlusPlus/LibStdcpp.cpp @@ -250,7 +250,7 @@ bool lldb_private::formatters::LibStdcppStringSummaryProvider( addr_of_data == LLDB_INVALID_ADDRESS) return false; options.SetLocation(addr_of_data); - options.SetProcessSP(process_sp); + options.SetTargetSP(valobj.GetTargetSP()); options.SetStream(&stream); options.SetNeedsZeroTermination(false); options.SetBinaryZeroIsTerminator(true); @@ -311,7 +311,7 @@ bool lldb_private::formatters::LibStdcppWStringSummaryProvider( addr_of_data == LLDB_INVALID_ADDRESS) return false; options.SetLocation(addr_of_data); - options.SetProcessSP(process_sp); + options.SetTargetSP(valobj.GetTargetSP()); options.SetStream(&stream); options.SetNeedsZeroTermination(false); options.SetBinaryZeroIsTerminator(false); |