mirror of
https://github.com/intel/llvm.git
synced 2026-01-16 05:32:28 +08:00
Convert from the C-based LLVM Disassembler shim to the full MC Disassembler API's.
Calculate "can branch" using the MC API's rather than our hand-rolled regex'es. As extra credit, allow setting the disassembly flavor for x86 based architectures to intel or att. <rdar://problem/11319574> <rdar://problem/9329275> llvm-svn: 176392
This commit is contained in:
@@ -2249,6 +2249,12 @@ SBTarget::GetSourceManager()
|
||||
|
||||
lldb::SBInstructionList
|
||||
SBTarget::ReadInstructions (lldb::SBAddress base_addr, uint32_t count)
|
||||
{
|
||||
return ReadInstructions (base_addr, count, NULL);
|
||||
}
|
||||
|
||||
lldb::SBInstructionList
|
||||
SBTarget::ReadInstructions (lldb::SBAddress base_addr, uint32_t count, const char *flavor_string)
|
||||
{
|
||||
SBInstructionList sb_instructions;
|
||||
|
||||
@@ -2265,6 +2271,7 @@ SBTarget::ReadInstructions (lldb::SBAddress base_addr, uint32_t count)
|
||||
const size_t bytes_read = target_sp->ReadMemory(*addr_ptr, prefer_file_cache, data.GetBytes(), data.GetByteSize(), error);
|
||||
sb_instructions.SetDisassembler (Disassembler::DisassembleBytes (target_sp->GetArchitecture(),
|
||||
NULL,
|
||||
flavor_string,
|
||||
*addr_ptr,
|
||||
data.GetBytes(),
|
||||
bytes_read,
|
||||
@@ -2278,6 +2285,12 @@ SBTarget::ReadInstructions (lldb::SBAddress base_addr, uint32_t count)
|
||||
|
||||
lldb::SBInstructionList
|
||||
SBTarget::GetInstructions (lldb::SBAddress base_addr, const void *buf, size_t size)
|
||||
{
|
||||
return GetInstructionsWithFlavor (base_addr, NULL, buf, size);
|
||||
}
|
||||
|
||||
lldb::SBInstructionList
|
||||
SBTarget::GetInstructionsWithFlavor (lldb::SBAddress base_addr, const char *flavor_string, const void *buf, size_t size)
|
||||
{
|
||||
SBInstructionList sb_instructions;
|
||||
|
||||
@@ -2291,6 +2304,7 @@ SBTarget::GetInstructions (lldb::SBAddress base_addr, const void *buf, size_t si
|
||||
|
||||
sb_instructions.SetDisassembler (Disassembler::DisassembleBytes (target_sp->GetArchitecture(),
|
||||
NULL,
|
||||
flavor_string,
|
||||
addr,
|
||||
buf,
|
||||
size));
|
||||
@@ -2302,7 +2316,13 @@ SBTarget::GetInstructions (lldb::SBAddress base_addr, const void *buf, size_t si
|
||||
lldb::SBInstructionList
|
||||
SBTarget::GetInstructions (lldb::addr_t base_addr, const void *buf, size_t size)
|
||||
{
|
||||
return GetInstructions (ResolveLoadAddress(base_addr), buf, size);
|
||||
return GetInstructionsWithFlavor (ResolveLoadAddress(base_addr), NULL, buf, size);
|
||||
}
|
||||
|
||||
lldb::SBInstructionList
|
||||
SBTarget::GetInstructionsWithFlavor (lldb::addr_t base_addr, const char *flavor_string, const void *buf, size_t size)
|
||||
{
|
||||
return GetInstructionsWithFlavor (ResolveLoadAddress(base_addr), flavor_string, buf, size);
|
||||
}
|
||||
|
||||
SBError
|
||||
|
||||
Reference in New Issue
Block a user