29 "Mips-specific algorithms",
44 bool is_alternate_isa =
false;
51 is_alternate_isa =
true;
56 if ((code_addr & 2ull) || is_alternate_isa)
57 return code_addr | 1u;
69 return opcode_addr & ~(1ull);
80 if (section_load_list.
IsEmpty())
92 if (temp_addr_module_sp) {
94 SymbolContextItem resolve_scope =
95 eSymbolContextFunction | eSymbolContextSymbol;
96 temp_addr_module_sp->ResolveSymbolContextForAddress(resolved_addr,
109 current_offset = addr - function_start;
114 if (current_offset == 0)
119 if (
nullptr == insn || !insn->HasDelaySlot())
123 uint64_t breakable_addr = addr - insn->GetOpcode().GetByteSize();
125 "Target::%s Breakpoint at 0x%8.8" PRIx64
126 " is adjusted to 0x%8.8" PRIx64
" due to delay slot\n",
127 __FUNCTION__, addr, breakable_addr);
129 return breakable_addr;
135 auto loop_count = symbol_offset / 2;
141 if (loop_count > 3) {
143 if (IsMips16 | IsMicromips)
157 uint32_t inst_to_choose = 0;
161 for (uint32_t i = 1; i <= loop_count; i++) {
164 uint32_t insn_size = 0;
166 disasm_sp->ParseInstructions(target, addr,
169 uint32_t num_insns = disasm_sp->GetInstructionList().GetSize();
171 prev_insn = disasm_sp->GetInstructionList().GetInstructionAtIndex(0);
172 insn_size = prev_insn->GetOpcode().GetByteSize();
173 if (i == 1 && insn_size == 2) {
176 instruction_list.
Append(prev_insn);
181 if (num_insns == 2) {
191 else if (insn_size == 4) {
195 instruction_list.
Append(prev_insn);
218 inst_to_choose = i - 1;
225 if (inst_to_choose) {
226 if (inst_to_choose > instruction_list.
GetSize())
#define LLDB_LOGF(log,...)
#define LLDB_PLUGIN_DEFINE(PluginName)
Address & GetBaseAddress()
Get accessor for the base address of the range.
A section + offset based address class.
lldb::addr_t GetLoadAddress(Target *target) const
Get the load address.
bool Slide(int64_t offset)
lldb::ModuleSP GetModule() const
Get accessor for the module for this address.
lldb::addr_t GetFileAddress() const
Get the file address.
An architecture specification class.
bool IsMIPS() const
if MIPS architecture return true.
uint32_t GetFlags() const
lldb::addr_t GetOpcodeLoadAddress(lldb::addr_t load_addr, AddressClass addr_class) const override
Get load_addr as an opcode for this target.
Instruction * GetInstructionAtAddress(Target &target, const Address &resolved_addr, lldb::addr_t symbol_offset) const
static std::unique_ptr< Architecture > Create(const ArchSpec &arch)
lldb::addr_t GetBreakableLoadAddress(lldb::addr_t addr, Target &) const override
lldb::addr_t GetCallableLoadAddress(lldb::addr_t load_addr, AddressClass addr_class) const override
Get load_addr as a callable code load address for this target.
static lldb::DisassemblerSP FindPlugin(const ArchSpec &arch, const char *flavor, const char *plugin_name)
const AddressRange & GetAddressRange()
void Append(lldb::InstructionSP &inst_sp)
lldb::InstructionSP GetInstructionAtIndex(size_t idx) const
static bool RegisterPlugin(llvm::StringRef name, llvm::StringRef description, ABICreateInstance create_callback)
static bool UnregisterPlugin(ABICreateInstance create_callback)
Defines a symbol context baton that can be handed other debug core functions.
Function * function
The Function for a given query.
Symbol * symbol
The Symbol for a given query.
Address GetAddress() const
SectionLoadList & GetSectionLoadList()
bool ResolveFileAddress(lldb::addr_t load_addr, Address &so_addr)
bool ResolveLoadAddress(lldb::addr_t load_addr, Address &so_addr, uint32_t stop_id=SectionLoadHistory::eStopIDNow)
#define LLDB_INVALID_ADDRESS
A class that represents a running process on the host machine.
Log * GetLog(Cat mask)
Retrieve the Log object for the channel associated with the given log enum.
std::shared_ptr< lldb_private::Instruction > InstructionSP
std::shared_ptr< lldb_private::Disassembler > DisassemblerSP
std::shared_ptr< lldb_private::Module > ModuleSP