44#include "llvm/Support/Compiler.h"
45#include "llvm/TargetParser/Triple.h"
53#define DEFAULT_DISASM_BYTE_SIZE 32
60 const char *plugin_name) {
64 DisassemblerCreateInstance create_callback =
nullptr;
69 if (create_callback) {
70 DisassemblerSP disassembler_sp(create_callback(arch, flavor));
73 return disassembler_sp;
80 DisassemblerSP disassembler_sp(create_callback(arch, flavor));
83 return disassembler_sp;
86 return DisassemblerSP();
92 const char *plugin_name) {
93 if (flavor ==
nullptr) {
97 if (arch.
GetTriple().getArch() == llvm::Triple::x86 ||
98 arch.
GetTriple().getArch() == llvm::Triple::x86_64)
116 if (is_resolved && resolved_addr.
IsValid())
117 return resolved_addr;
123 const ArchSpec &arch,
const char *plugin_name,
const char *flavor,
131 lldb::DisassemblerSP disasm_sp =
137 const size_t bytes_disassembled = disasm_sp->ParseInstructions(
138 target, range.
GetBaseAddress(), {Limit::Bytes, range.GetByteSize()},
139 nullptr, force_live_memory);
140 if (bytes_disassembled == 0)
148 const char *flavor,
const Address &start,
149 const void *src,
size_t src_len,
150 uint32_t num_instructions,
bool data_from_file) {
154 lldb::DisassemblerSP disasm_sp =
163 (void)disasm_sp->DecodeInstructions(start, data, 0, num_instructions,
false,
169 const char *plugin_name,
const char *flavor,
172 bool mixed_source_and_assembly,
183 const bool force_live_memory =
true;
184 size_t bytes_disassembled = disasm_sp->ParseInstructions(
185 exe_ctx.
GetTargetRef(), address, limit, &strm, force_live_memory);
186 if (bytes_disassembled == 0)
189 disasm_sp->PrintInstructions(debugger, arch, exe_ctx,
190 mixed_source_and_assembly,
191 num_mixed_context_lines, options, strm);
208 if (func_decl_file != prologue_end_line.
file &&
213 decl_line.
file = func_decl_file;
214 decl_line.
line = func_decl_line;
223 std::map<
FileSpec, std::set<uint32_t>> &source_lines_seen) {
225 auto source_lines_seen_pos = source_lines_seen.find(line.
file);
226 if (source_lines_seen_pos == source_lines_seen.end()) {
227 std::set<uint32_t> lines;
228 lines.insert(line.
line);
229 source_lines_seen.emplace(line.
file, lines);
231 source_lines_seen_pos->second.insert(line.
line);
250 avoid_regex = thread_sp->GetSymbolsToAvoidRegexp();
255 OptionValueSP value_sp = target_sp->GetDebugger().GetPropertyValue(
256 &exe_ctx,
"target.process.thread.step-avoid-regexp",
false,
error);
265 if (avoid_regex && sc.
symbol !=
nullptr) {
266 const char *function_name =
269 if (function_name && avoid_regex->
Execute(function_name)) {
280 bool mixed_source_and_assembly,
286 const uint32_t max_opcode_byte_size =
291 const Address *pc_addr_ptr =
nullptr;
302 eSymbolContextLineEntry | eSymbolContextFunction | eSymbolContextSymbol;
303 const bool use_inline_block_range =
false;
312 disassembly_format = &format;
323 std::map<FileSpec, std::set<uint32_t>> source_lines_seen;
324 Symbol *previous_symbol =
nullptr;
326 size_t address_text_size = 0;
327 for (
size_t i = 0; i < num_instructions_found; ++i) {
333 const SymbolContextItem resolve_mask = eSymbolContextFunction |
334 eSymbolContextSymbol |
335 eSymbolContextLineEntry;
337 module_sp->ResolveSymbolContextForAddress(addr, resolve_mask, sc);
341 &exe_ctx, &addr, strmstr);
343 if (cur_line > address_text_size)
344 address_text_size = cur_line;
354 if (sc.
symbol != previous_symbol) {
374 previous_symbol =
nullptr;
376 for (
size_t i = 0; i < num_instructions_found; ++i) {
381 const bool inst_is_at_pc = pc_addr_ptr && addr == *pc_addr_ptr;
388 uint32_t resolved_mask = module_sp->ResolveSymbolContextForAddress(
389 addr, eSymbolContextEverything, sc);
391 if (mixed_source_and_assembly) {
396 if (previous_symbol != sc.
symbol) {
401 if (previous_symbol !=
nullptr)
404 previous_symbol = sc.
symbol;
408 prologue_end_line)) {
413 if (func_decl_file == prologue_end_line.
file ||
418 for (
uint32_t lineno = func_decl_line;
419 lineno <= prologue_end_line.
line; lineno++) {
421 this_line.
file = func_decl_file;
422 this_line.
line = lineno;
423 source_lines_to_display.
lines.push_back(this_line);
427 if (source_lines_to_display.
lines.size() > 0)
429 source_lines_to_display.
lines.size() - 1;
434 current_source_line_range);
441 current_source_line_range);
455 if (this_line != previous_line) {
457 std::vector<uint32_t> previous_lines;
459 i < num_mixed_context_lines &&
460 (this_line.
line - num_mixed_context_lines) > 0;
463 this_line.
line - num_mixed_context_lines + i;
464 auto pos = source_lines_seen.find(this_line.
file);
465 if (pos != source_lines_seen.end()) {
466 if (pos->second.count(line) == 1) {
467 previous_lines.clear();
469 previous_lines.push_back(line);
473 for (
size_t i = 0; i < previous_lines.size(); i++) {
475 previous_line.
file = this_line.
file;
476 previous_line.
line = previous_lines[i];
477 auto pos = source_lines_seen.find(previous_line.
file);
478 if (pos != source_lines_seen.end()) {
479 pos->second.insert(previous_line.
line);
481 source_lines_to_display.
lines.push_back(previous_line);
484 source_lines_to_display.
lines.push_back(this_line);
486 source_lines_to_display.
lines.size() - 1;
488 for (
uint32_t i = 0; i < num_mixed_context_lines; i++) {
491 next_line.
line = this_line.
line + i + 1;
492 auto pos = source_lines_seen.find(next_line.
file);
493 if (pos != source_lines_seen.end()) {
494 if (pos->second.count(next_line.
line) == 1)
496 pos->second.insert(next_line.
line);
498 source_lines_to_display.
lines.push_back(next_line);
501 previous_line = this_line;
511 if (source_lines_to_display.
lines.size() > 0) {
513 for (
size_t idx = 0; idx < source_lines_to_display.
lines.size();
516 const char *line_highlight =
"";
518 line_highlight =
"->";
520 line_highlight =
"**";
530 const bool show_control_flow_kind =
532 inst->
Dump(&strm, max_opcode_byte_size,
true, show_bytes,
533 show_control_flow_kind, &exe_ctx, &sc, &prev_sc,
nullptr,
561 if (limit.
value == 0)
564 return Disassemble(debugger, arch,
nullptr,
nullptr, frame,
569 : m_address(address), m_address_class(addr_class), m_opcode(),
570 m_calculated_strings(false) {}
582 switch (instruction_control_flow_kind) {
602 llvm_unreachable(
"Fully covered switch above!");
606 bool show_address,
bool show_bytes,
607 bool show_control_flow_kind,
612 size_t max_address_text_size) {
613 size_t opcode_column_width = 7;
614 const size_t operand_column_width = 25;
631 if (max_opcode_byte_size > 0)
638 if (max_opcode_byte_size > 0)
645 if (show_control_flow_kind) {
649 instruction_control_flow_kind));
667 opcode_pos + opcode_column_width + operand_column_width,
' ');
675 std::unique_ptr<EmulateInstruction> insn_emulator_up(
677 if (insn_emulator_up) {
679 return insn_emulator_up->EvaluateInstruction(0);
699 auto option_value_sp = std::make_shared<OptionValueArray>(1u << data_type);
703 if (!fgets(buffer, 1023, in_file)) {
705 "Instruction::ReadArray: Error reading file (fgets).\n");
706 option_value_sp.reset();
707 return option_value_sp;
710 std::string line(buffer);
712 size_t len = line.size();
713 if (line[len - 1] ==
'\n') {
714 line[len - 1] =
'\0';
715 line.resize(len - 1);
718 if ((line.size() == 1) && line[0] ==
']') {
726 llvm::StringRef(
"^[ \t]*([^ \t]+)[ \t]*$"));
727 llvm::SmallVector<llvm::StringRef, 2> matches;
728 if (g_reg_exp.
Execute(line, &matches))
729 value = matches[1].str();
733 OptionValueSP data_value_sp;
736 data_value_sp = std::make_shared<OptionValueUInt64>(0, 0);
737 data_value_sp->SetValueFromString(value);
741 data_value_sp = std::make_shared<OptionValueString>(value.c_str(),
"");
745 option_value_sp->GetAsArray()->InsertValue(idx, data_value_sp);
750 return option_value_sp;
757 auto option_value_sp = std::make_shared<OptionValueDictionary>();
763 if (!fgets(buffer, 1023, in_file)) {
765 "Instruction::ReadDictionary: Error reading file (fgets).\n");
766 option_value_sp.reset();
767 return option_value_sp;
771 std::string line(buffer);
773 size_t len = line.size();
774 if (line[len - 1] ==
'\n') {
775 line[len - 1] =
'\0';
776 line.resize(len - 1);
779 if ((line.size() == 1) && (line[0] ==
'}')) {
788 "^[ \t]*([a-zA-Z_][a-zA-Z0-9_]*)[ \t]*=[ \t]*(.*)[ \t]*$"));
790 llvm::SmallVector<llvm::StringRef, 3> matches;
792 bool reg_exp_success = g_reg_exp.
Execute(line, &matches);
795 if (reg_exp_success) {
796 key = matches[1].str();
797 value = matches[2].str();
799 out_stream->
Printf(
"Instruction::ReadDictionary: Failure executing "
800 "regular expression.\n");
801 option_value_sp.reset();
802 return option_value_sp;
808 lldb::OptionValueSP value_sp;
809 assert(value.empty() ==
false);
810 assert(key.empty() ==
false);
812 if (value[0] ==
'{') {
813 assert(value.size() == 1);
817 option_value_sp.reset();
818 return option_value_sp;
820 }
else if (value[0] ==
'[') {
821 assert(value.size() == 1);
823 value_sp =
ReadArray(in_file, out_stream, data_type);
825 option_value_sp.reset();
826 return option_value_sp;
831 }
else if ((value[0] ==
'0') && (value[1] ==
'x')) {
832 value_sp = std::make_shared<OptionValueUInt64>(0, 0);
833 value_sp->SetValueFromString(value);
835 size_t len = value.size();
836 if ((value[0] ==
'"') && (value[len - 1] ==
'"'))
837 value = value.substr(1, len - 2);
838 value_sp = std::make_shared<OptionValueString>(value.c_str(),
"");
841 if (const_key == encoding_key) {
846 if (strcmp(value.c_str(),
"uint32_t") == 0)
849 option_value_sp->GetAsDictionary()->SetValueForKey(const_key, value_sp,
854 return option_value_sp;
862 out_stream->
Printf(
"Instruction::TestEmulation: Missing file_name.");
868 "Instruction::TestEmulation: Attempt to open test file failed.");
873 if (!fgets(buffer, 255, test_file)) {
875 "Instruction::TestEmulation: Error reading first line of test file.\n");
880 if (strncmp(buffer,
"InstructionEmulationState={", 27) != 0) {
881 out_stream->
Printf(
"Instructin::TestEmulation: Test file does not contain "
882 "emulation state dictionary\n");
890 OptionValueSP data_dictionary_sp(
ReadDictionary(test_file, out_stream));
891 if (!data_dictionary_sp) {
893 "Instruction::TestEmulation: Error reading Dictionary Object.\n");
902 static ConstString description_key(
"assembly_string");
905 OptionValueSP value_sp = data_dictionary->
GetValueForKey(description_key);
908 out_stream->
Printf(
"Instruction::TestEmulation: Test file does not "
909 "contain description string.\n");
918 "Instruction::TestEmulation: Test file does not contain triple.\n");
923 arch.
SetTriple(llvm::Triple(value_sp->GetStringValue()));
925 bool success =
false;
926 std::unique_ptr<EmulateInstruction> insn_emulator_up(
928 if (insn_emulator_up)
930 insn_emulator_up->TestEmulation(out_stream, arch, data_dictionary);
933 out_stream->
Printf(
"Emulation test succeeded.");
935 out_stream->
Printf(
"Emulation test failed.");
946 std::unique_ptr<EmulateInstruction> insn_emulator_up(
948 if (insn_emulator_up) {
949 insn_emulator_up->SetBaton(baton);
950 insn_emulator_up->SetCallbacks(read_mem_callback, write_mem_callback,
951 read_reg_callback, write_reg_callback);
953 return insn_emulator_up->EvaluateInstruction(evaluate_options);
971 collection::const_iterator pos, end;
974 uint32_t inst_size = (*pos)->GetOpcode().GetByteSize();
975 if (max_inst_size < inst_size)
976 max_inst_size = inst_size;
978 return max_inst_size;
982 InstructionSP inst_sp;
996 bool show_control_flow_kind,
999 collection::const_iterator pos, begin, end;
1004 disassembly_format =
1008 disassembly_format = &format;
1012 pos != end; ++pos) {
1015 (*pos)->Dump(s, max_opcode_byte_size, show_address, show_bytes,
1016 show_control_flow_kind, exe_ctx,
nullptr,
nullptr,
1017 disassembly_format, 0);
1031 bool *found_calls)
const {
1037 *found_calls =
false;
1038 for (
size_t i = start; i < num_instructions; i++) {
1042 *found_calls =
true;
1057 for (
size_t i = 0; i < num_instructions; i++) {
1076 bool force_live_memory) {
1087 auto data_sp = std::make_shared<DataBufferHeap>(byte_size,
'\0');
1091 const size_t bytes_read =
1092 target.
ReadMemory(start, data_sp->GetBytes(), data_sp->GetByteSize(),
1093 error, force_live_memory, &load_addr);
1096 if (bytes_read == 0) {
1097 if (error_strm_ptr) {
1098 if (
const char *error_cstr =
error.AsCString())
1099 error_strm_ptr->
Printf(
"error: %s\n", error_cstr);
1104 if (bytes_read != data_sp->GetByteSize())
1105 data_sp->SetByteSize(bytes_read);
1111 false, data_from_file);
1118 if (flavor ==
nullptr)
1126 std::string thumb_arch_name(arch.
GetTriple().getArchName().str());
1128 if (thumb_arch_name.size() > 3) {
1129 thumb_arch_name.erase(0, 3);
1130 thumb_arch_name.insert(0,
"thumb");
1177 switch (opcode_size) {
1179 uint8_t value8 = *((uint8_t *)opcode_data);
1194 uint64_t value64 = *((uint64_t *)opcode_data);
1217 ret.
m_type = Type::Immediate;
1225 ret.
m_type = Type::Immediate;
1239 ret.
m_type = Type::Dereference;
1255 ret.
m_type = Type::Product;
1266 return (base(op) && op.m_children.size() == 2 &&
1267 ((left(op.m_children[0]) && right(op.m_children[1])) ||
1268 (left(op.m_children[1]) && right(op.m_children[0]))));
1277 return (base(op) && op.m_children.size() == 1 && child(op.m_children[0]));
1296 reg = op.m_register;
1305 ((op.m_negative && op.m_immediate == (uint64_t)-imm) ||
1306 (!op.m_negative && op.m_immediate == (uint64_t)imm)));
1316 if (op.m_negative) {
1317 imm = -((int64_t)op.m_immediate);
1319 imm = ((int64_t)op.m_immediate);
static llvm::raw_ostream & error(Stream &strm)
static Address ResolveAddress(Target &target, const Address &addr)
#define DEFAULT_DISASM_BYTE_SIZE
#define LLDB_SCOPED_TIMERF(...)
A section + offset based address range class.
Address & GetBaseAddress()
Get accessor for the base address of the range.
bool ContainsFileAddress(const Address &so_addr) const
Check if a section offset address is contained in this range.
void SetByteSize(lldb::addr_t byte_size)
Set accessor for the byte size of this range.
lldb::addr_t GetByteSize() const
Get accessor for the byte size of this range.
A section + offset based address class.
bool SetLoadAddress(lldb::addr_t load_addr, Target *target, bool allow_section_end=false)
Set the address to represent load_addr.
lldb::ModuleSP GetModule() const
Get accessor for the module for this address.
lldb::addr_t GetOffset() const
Get the section relative offset value.
bool IsValid() const
Check if the object state is valid.
bool IsSectionOffset() const
Check if an address is section offset.
AddressClass GetAddressClass() const
An architecture specification class.
uint32_t GetAddressByteSize() const
Returns the size in bytes of an address of the current architecture.
llvm::Triple & GetTriple()
Architecture triple accessor.
bool IsAlwaysThumbInstructions() const
Detect whether this architecture uses thumb code exclusively.
bool SetTriple(const llvm::Triple &triple)
Architecture triple setter.
lldb::ByteOrder GetByteOrder() const
Returns the byte order for the architecture specification.
uint32_t GetMaximumOpcodeByteSize() const
const char * GetArchitectureName() const
Returns a static string representing the current architecture.
A uniqued constant string class.
const char * GetCString() const
Get the string value as a C string.
A class to manage flag bits.
SourceManager & GetSourceManager()
static bool FormatDisassemblerAddress(const FormatEntity::Entry *format, const SymbolContext *sc, const SymbolContext *prev_sc, const ExecutionContext *exe_ctx, const Address *addr, Stream &s)
const FormatEntity::Entry * GetDisassemblyFormat() const
static lldb::DisassemblerSP DisassembleBytes(const ArchSpec &arch, const char *plugin_name, const char *flavor, const Address &start, const void *bytes, size_t length, uint32_t max_num_instructions, bool data_from_file)
size_t ParseInstructions(Target &target, Address address, Limit limit, Stream *error_strm_ptr, bool force_live_memory=false)
InstructionList m_instruction_list
void PrintInstructions(Debugger &debugger, const ArchSpec &arch, const ExecutionContext &exe_ctx, bool mixed_source_and_assembly, uint32_t num_mixed_context_lines, uint32_t options, Stream &strm)
@ eOptionMarkPCSourceLine
@ eOptionShowControlFlowKind
static void AddLineToSourceLineTables(SourceLine &line, std::map< FileSpec, std::set< uint32_t > > &source_lines_seen)
static bool ElideMixedSourceAndDisassemblyLine(const ExecutionContext &exe_ctx, const SymbolContext &sc, SourceLine &line)
Disassembler(const ArchSpec &arch, const char *flavor)
static SourceLine GetFunctionDeclLineEntry(const SymbolContext &sc)
virtual size_t DecodeInstructions(const Address &base_addr, const DataExtractor &data, lldb::offset_t data_offset, size_t num_instructions, bool append, bool data_from_file)=0
InstructionList & GetInstructionList()
static lldb::DisassemblerSP FindPlugin(const ArchSpec &arch, const char *flavor, const char *plugin_name)
static lldb::DisassemblerSP DisassembleRange(const ArchSpec &arch, const char *plugin_name, const char *flavor, Target &target, const AddressRange &disasm_range, bool force_live_memory=false)
static bool Disassemble(Debugger &debugger, const ArchSpec &arch, const char *plugin_name, const char *flavor, const ExecutionContext &exe_ctx, const Address &start, Limit limit, bool mixed_source_and_assembly, uint32_t num_mixed_context_lines, uint32_t options, Stream &strm)
static lldb::DisassemblerSP FindPluginForTarget(const Target &target, const ArchSpec &arch, const char *flavor, const char *plugin_name)
bool(* WriteRegisterCallback)(EmulateInstruction *instruction, void *baton, const Context &context, const RegisterInfo *reg_info, const RegisterValue ®_value)
size_t(* WriteMemoryCallback)(EmulateInstruction *instruction, void *baton, const Context &context, lldb::addr_t addr, const void *dst, size_t length)
size_t(* ReadMemoryCallback)(EmulateInstruction *instruction, void *baton, const Context &context, lldb::addr_t addr, void *dst, size_t length)
bool(* ReadRegisterCallback)(EmulateInstruction *instruction, void *baton, const RegisterInfo *reg_info, RegisterValue ®_value)
static EmulateInstruction * FindPlugin(const ArchSpec &arch, InstructionType supported_inst_type, const char *plugin_name)
"lldb/Target/ExecutionContext.h" A class that contains an execution context.
const lldb::TargetSP & GetTargetSP() const
Get accessor to get the target shared pointer.
StackFrame * GetFramePtr() const
Returns a pointer to the frame object.
Target * GetTargetPtr() const
Returns a pointer to the target object.
const lldb::ThreadSP & GetThreadSP() const
Get accessor to get the thread shared pointer.
bool HasTargetScope() const
Returns true the ExecutionContext object contains a valid target.
Target & GetTargetRef() const
Returns a reference to the target object.
static FileSystem & Instance()
FILE * Fopen(const char *path, const char *mode)
Wraps ::fopen in a platform-independent way.
const AddressRange & GetAddressRange()
void GetStartLineSourceInfo(FileSpec &source_file, uint32_t &line_no)
Find the file and line number of the source location of the start of the function.
void Append(lldb::InstructionSP &inst_sp)
uint32_t GetIndexOfInstructionAtAddress(const Address &addr)
lldb::InstructionSP GetInstructionAtIndex(size_t idx) const
uint32_t GetIndexOfInstructionAtLoadAddress(lldb::addr_t load_addr, Target &target)
collection m_instructions
lldb::InstructionSP GetInstructionAtAddress(const Address &addr)
Get the instruction at the given address.
void Dump(Stream *s, bool show_address, bool show_bytes, bool show_control_flow_kind, const ExecutionContext *exe_ctx)
uint32_t GetIndexOfNextBranchInstruction(uint32_t start, bool ignore_calls, bool *found_calls) const
Get the index of the next branch instruction.
uint32_t GetMaxOpcocdeByteSize() const
uint32_t GetData(DataExtractor &data)
Instruction(const Address &address, AddressClass addr_class=AddressClass::eInvalid)
virtual bool HasDelaySlot()
AddressClass m_address_class
static const char * GetNameForInstructionControlFlowKind(lldb::InstructionControlFlowKind instruction_control_flow_kind)
virtual lldb::InstructionControlFlowKind GetControlFlowKind(const ExecutionContext *exe_ctx)
void CalculateMnemonicOperandsAndCommentIfNeeded(const ExecutionContext *exe_ctx)
const Address & GetAddress() const
lldb::OptionValueSP ReadDictionary(FILE *in_file, Stream *out_stream)
lldb::OptionValueSP ReadArray(FILE *in_file, Stream *out_stream, OptionValue::Type data_type)
bool DumpEmulation(const ArchSpec &arch)
virtual bool TestEmulation(Stream *stream, const char *test_file_name)
virtual void SetDescription(llvm::StringRef)
const Opcode & GetOpcode() const
std::string m_opcode_name
AddressClass GetAddressClass()
virtual void Dump(Stream *s, uint32_t max_opcode_byte_size, bool show_address, bool show_bytes, bool show_control_flow_kind, const ExecutionContext *exe_ctx, const SymbolContext *sym_ctx, const SymbolContext *prev_sym_ctx, const FormatEntity::Entry *disassembly_addr_format, size_t max_address_text_size)
Dump the text representation of this Instruction to a Stream.
bool Emulate(const ArchSpec &arch, uint32_t evaluate_options, void *baton, EmulateInstruction::ReadMemoryCallback read_mem_callback, EmulateInstruction::WriteMemoryCallback write_mem_calback, EmulateInstruction::ReadRegisterCallback read_reg_callback, EmulateInstruction::WriteRegisterCallback write_reg_callback)
bool ResolveFileAddress(lldb::addr_t vm_addr, Address &so_addr) const
void SetOpcode16(uint16_t inst, lldb::ByteOrder order)
int Dump(Stream *s, uint32_t min_byte_width)
uint32_t GetByteSize() const
void SetOpcode64(uint64_t inst, lldb::ByteOrder order)
Opcode::Type GetType() const
void SetOpcode8(uint8_t inst, lldb::ByteOrder order)
uint32_t GetData(DataExtractor &data) const
void SetOpcode32(uint32_t inst, lldb::ByteOrder order)
lldb::OptionValueSP GetValueForKey(ConstString key) const
const RegularExpression * GetCurrentValue() const
OptionValueDictionary * GetAsDictionary()
OptionValueRegex * GetAsRegex()
static DisassemblerCreateInstance GetDisassemblerCreateCallbackForPluginName(llvm::StringRef name)
static DisassemblerCreateInstance GetDisassemblerCreateCallbackAtIndex(uint32_t idx)
std::string m_description
void SetOpcode(size_t opcode_size, void *opcode_data)
void SetDescription(llvm::StringRef description) override
bool IsAuthenticated() override
bool HasDelaySlot() override
size_t Decode(const Disassembler &disassembler, const DataExtractor &data, lldb::offset_t data_offset) override
~PseudoInstruction() override
bool DoesBranch() override
bool Execute(llvm::StringRef string, llvm::SmallVectorImpl< llvm::StringRef > *matches=nullptr) const
Execute a regular expression match using the compiled regular expression that is already in this obje...
bool ResolveLoadAddress(lldb::addr_t load_addr, Address &so_addr, bool allow_section_end=false) const
size_t DisplaySourceLinesWithLineNumbers(const FileSpec &file, uint32_t line, uint32_t column, uint32_t context_before, uint32_t context_after, const char *current_line_cstr, Stream *s, const SymbolContextList *bp_locs=nullptr)
This base class provides an interface to stack frames.
const SymbolContext & GetSymbolContext(lldb::SymbolContextItem resolve_scope)
Provide a SymbolContext for this StackFrame's current pc value.
const Address & GetFrameCodeAddress()
Get an Address for the current pc value in this StackFrame.
size_t GetSizeOfLastLine() const
llvm::StringRef GetString() const
void FillLastLineToColumn(uint32_t column, char fill_char)
A stream class that can stream formatted output to a file.
size_t Printf(const char *format,...) __attribute__((format(printf
Output printf formatted output to the stream.
size_t PutCString(llvm::StringRef cstr)
Output a C string to the stream.
size_t EOL()
Output and End of Line character to the stream.
Defines a symbol context baton that can be handed other debug core functions.
Function * function
The Function for a given query.
ConstString GetFunctionName(Mangled::NamePreference preference=Mangled::ePreferDemangled) const
Find a name of the innermost function for the symbol context.
CompileUnit * comp_unit
The CompileUnit for a given query.
void Clear(bool clear_target)
Clear the object's state.
bool GetAddressRange(uint32_t scope, uint32_t range_idx, bool use_inline_block_range, AddressRange &range) const
Get the address range contained within a symbol context.
Symbol * symbol
The Symbol for a given query.
LineEntry line_entry
The LineEntry for a given query.
bool ValueIsAddress() const
Address & GetAddressRef()
lldb::addr_t GetByteSize() const
const char * GetDisassemblyFlavor() const
SectionLoadList & GetSectionLoadList()
size_t ReadMemory(const Address &addr, void *dst, size_t dst_len, Status &error, bool force_live_memory=false, lldb::addr_t *load_addr_ptr=nullptr)
const ModuleList & GetImages() const
Get accessor for the images for this process.
#define LLDB_INVALID_ADDRESS
std::function< bool(const Instruction::Operand &)> MatchRegOp(const RegisterInfo &info)
std::function< bool(const Instruction::Operand &)> FetchRegOp(ConstString ®)
std::function< bool(const Instruction::Operand &)> MatchImmOp(int64_t imm)
std::function< bool(const Instruction::Operand &)> FetchImmOp(int64_t &imm)
std::function< bool(const Instruction::Operand &)> MatchOpType(Instruction::Operand::Type type)
std::function< bool(const Instruction::Operand &)> MatchBinaryOp(std::function< bool(const Instruction::Operand &)> base, std::function< bool(const Instruction::Operand &)> left, std::function< bool(const Instruction::Operand &)> right)
std::function< bool(const Instruction::Operand &)> MatchUnaryOp(std::function< bool(const Instruction::Operand &)> base, std::function< bool(const Instruction::Operand &)> child)
A class that represents a running process on the host machine.
InstructionControlFlowKind
Architecture-agnostic categorization of instructions for traversing the control flow of a trace.
@ eInstructionControlFlowKindReturn
The instruction is a near (function) return.
@ eInstructionControlFlowKindFarJump
The instruction is a jump-like far transfer.
@ eInstructionControlFlowKindOther
The instruction is something not listed below, i.e.
@ eInstructionControlFlowKindFarCall
The instruction is a call-like far transfer.
@ eInstructionControlFlowKindFarReturn
The instruction is a return-like far transfer.
@ eInstructionControlFlowKindUnknown
The instruction could not be classified.
@ eInstructionControlFlowKindJump
The instruction is a near unconditional jump.
@ eInstructionControlFlowKindCall
The instruction is a near (function) call.
@ eInstructionControlFlowKindCondJump
The instruction is a near conditional jump.
enum lldb_private::Disassembler::Limit::@6 kind
size_t current_source_line
std::vector< SourceLine > lines
bool print_source_context_end_eol
enum lldb_private::Instruction::Operand::Type m_type
static Operand BuildImmediate(lldb::addr_t imm, bool neg)
static Operand BuildDereference(const Operand &ref)
std::vector< Operand > m_children
static Operand BuildProduct(const Operand &lhs, const Operand &rhs)
static Operand BuildSum(const Operand &lhs, const Operand &rhs)
static Operand BuildRegister(ConstString &r)
A line table entry class.
FileSpec original_file
The original source file, from debug info.
uint16_t column
The column number of the source line, or zero if there is no column information.
bool IsValid() const
Check if a line entry object is valid.
FileSpec file
The source file, possibly mapped by the target.source-map setting.
uint32_t line
The source line number, or zero if there is no line number information.