20#include "llvm/ADT/bit.h"
27 const lldb_private::RegisterInfo ®_info,
37 value = reg_info.flags_type->ReverseFieldOrder(value);
42 value = llvm::byteswap(value);
53 return varname.GetLength();
57 vobj_sp->Dump(strm, dump_options);
61 const RegisterInfo ®_info,
62 bool prefix_with_name,
63 bool prefix_with_alt_name,
Format format,
65 ExecutionContextScope *exe_scope,
66 bool print_flags, TargetSP target_sp) {
68 if (!reg_val.GetData(data))
71 bool name_printed =
false;
77 StreamString format_string;
78 if (reg_name_right_align_at && (prefix_with_name ^ prefix_with_alt_name))
79 format_string.Printf(
"%%%us", reg_name_right_align_at);
81 format_string.Printf(
"%%s");
82 std::string fmt = std::string(format_string.GetString());
83 if (prefix_with_name) {
85 s.Printf(fmt.c_str(), reg_info.name);
87 }
else if (reg_info.alt_name) {
88 s.Printf(fmt.c_str(), reg_info.alt_name);
89 prefix_with_alt_name =
false;
93 if (prefix_with_alt_name) {
96 if (reg_info.alt_name) {
97 s.Printf(fmt.c_str(), reg_info.alt_name);
99 }
else if (!name_printed) {
102 s.Printf(fmt.c_str(), reg_info.name);
110 format = reg_info.format;
123 if (!print_flags || !reg_info.flags_type || !exe_scope || !target_sp ||
124 (reg_info.byte_size != 4 && reg_info.byte_size != 8))
127 CompilerType fields_type = target_sp->GetRegisterType(
128 reg_info.name, *reg_info.flags_type, reg_info.byte_size);
131 StreamString fields_stream;
133 if (reg_info.byte_size == 4) {
134 dump_type_value(fields_type, reg_val.GetAsUInt32(), exe_scope, reg_info,
137 dump_type_value(fields_type, reg_val.GetAsUInt64(), exe_scope, reg_info,
148 llvm::StringRef fields_str = fields_stream.GetString().drop_back();
155 while (fields_str.size()) {
156 std::pair<llvm::StringRef, llvm::StringRef> split = fields_str.split(
'\n');
157 fields_str = split.second;
159 s.Printf(fmt.c_str(),
"");
170 if (fields_str.size())
static void dump_type_value(lldb_private::CompilerType &fields_type, T value, lldb_private::ExecutionContextScope *exe_scope, const lldb_private::RegisterInfo ®_info, lldb_private::Stream &strm)
Generic representation of a type in a programming language.
A uniqued constant string class.
DumpValueObjectOptions & SetHideRootType(bool hide_root_type=false)
std::function< bool(ConstString)> ChildPrintingDecider
DumpValueObjectOptions & SetChildPrintingDecider(ChildPrintingDecider decider)
"lldb/Target/ExecutionContextScope.h" Inherit from this if your object can reconstruct its execution ...
virtual lldb::ProcessSP CalculateProcess()=0
A stream class that can stream formatted output to a file.
static lldb::ValueObjectSP Create(ExecutionContextScope *exe_scope, lldb::ByteOrder byte_order, uint32_t addr_byte_size, lldb::addr_t address=LLDB_INVALID_ADDRESS)
#define LLDB_INVALID_ADDRESS
lldb::ByteOrder InlHostByteOrder()
lldb::offset_t DumpDataExtractor(const DataExtractor &DE, Stream *s, lldb::offset_t offset, lldb::Format item_format, size_t item_byte_size, size_t item_count, size_t num_per_line, uint64_t base_addr, uint32_t item_bit_size, uint32_t item_bit_offset, ExecutionContextScope *exe_scope=nullptr, bool show_memory_tags=false)
Dumps item_count objects into the stream s.
void DumpRegisterValue(const RegisterValue ®_val, Stream &s, const RegisterInfo ®_info, bool prefix_with_name, bool prefix_with_alt_name, lldb::Format format, uint32_t reg_name_right_align_at=0, ExecutionContextScope *exe_scope=nullptr, bool print_flags=false, lldb::TargetSP target_sp=nullptr)
Format
Display format definitions.
ByteOrder
Byte ordering definitions.