Disable ARMDisassembler.framework support which was used for software single stepping.

llvm-svn: 147886
This commit is contained in:
Greg Clayton 2012-01-10 22:33:56 +00:00
parent 20f1dd5faf
commit 8ffc4f11ce
3 changed files with 25 additions and 10 deletions

View File

@ -557,8 +557,6 @@
"OTHER_LDFLAGS[sdk=iphoneos*][arch=*]" = (
"-framework",
SpringBoardServices,
"-framework",
ARMDisassembler,
"-llockdown",
);
OTHER_MIGFLAGS = "-I$(DERIVED_FILE_DIR)";
@ -600,8 +598,6 @@
"OTHER_LDFLAGS[sdk=iphoneos*][arch=*]" = (
"-framework",
SpringBoardServices,
"-framework",
ARMDisassembler,
"-llockdown",
);
OTHER_MIGFLAGS = "-I$(DERIVED_FILE_DIR)";
@ -643,8 +639,6 @@
"OTHER_LDFLAGS[sdk=iphoneos*][arch=*]" = (
"-framework",
SpringBoardServices,
"-framework",
ARMDisassembler,
"-llockdown",
);
OTHER_MIGFLAGS = "-I$(DERIVED_FILE_DIR)";

View File

@ -423,10 +423,13 @@ DNBArchMachARM::ThreadDidStop()
}
m_sw_single_step_itblock_break_count = 0;
#if defined (USE_ARM_DISASSEMBLER_FRAMEWORK)
// Decode instructions up to the current PC to ensure the internal decoder state is valid for the IT block
// The decoder has to decode each instruction in the IT block even if it is not executed so that
// the fields are correctly updated
DecodeITBlockInstructions(m_state.context.gpr.__pc);
#endif
}
}
@ -466,6 +469,8 @@ DNBArchMachARM::StepNotComplete ()
}
#if defined (USE_ARM_DISASSEMBLER_FRAMEWORK)
void
DNBArchMachARM::DecodeITBlockInstructions(nub_addr_t curr_pc)
@ -520,7 +525,7 @@ DNBArchMachARM::DecodeITBlockInstructions(nub_addr_t curr_pc)
DNBLogThreadedIf(LOG_STEP | LOG_VERBOSE, "%s: next_pc_in_itblock=0x%8.8x", __FUNCTION__, next_pc_in_itblock);
}
}
#endif
// Set the single step bit in the processor status register.
kern_return_t
@ -685,6 +690,8 @@ DNBArchMachARM::ConditionPassed(uint8_t condition, uint32_t cpsr)
return false;
}
#if defined (USE_ARM_DISASSEMBLER_FRAMEWORK)
bool
DNBArchMachARM::ComputeNextPC(nub_addr_t currentPC, arm_decoded_instruction_t decodedInstruction, bool currentPCIsThumb, nub_addr_t *targetPC)
{
@ -1830,6 +1837,8 @@ DNBArchMachARM::DecodeInstructionUsingDisassembler(nub_addr_t curr_pc, uint32_t
return decodeReturnCode;
}
#endif
nub_bool_t
DNBArchMachARM::BreakpointHit (nub_process_t pid, nub_thread_t tid, nub_break_t breakID, void *baton)
{
@ -1847,6 +1856,8 @@ kern_return_t
DNBArchMachARM::SetSingleStepSoftwareBreakpoints()
{
DNBError err;
#if defined (USE_ARM_DISASSEMBLER_FRAMEWORK)
err = GetGPRState(false);
if (err.Fail())
@ -2043,7 +2054,9 @@ DNBArchMachARM::SetSingleStepSoftwareBreakpoints()
}
#endif
}
#else
err.LogThreaded("%s: ARMDisassembler.framework support is disabled", __FUNCTION__);
#endif
return err.Error();
}

View File

@ -17,7 +17,9 @@
#if defined (__arm__)
#include "DNBArch.h"
#if defined (USE_ARM_DISASSEMBLER_FRAMEWORK)
#include <ARMDisassembler/ARMDisassembler.h>
#endif
class MachThread;
@ -36,7 +38,9 @@ public:
m_last_decode_pc(INVALID_NUB_ADDRESS)
{
memset(&m_dbg_save, 0, sizeof(m_dbg_save));
#if defined (USE_ARM_DISASSEMBLER_FRAMEWORK)
ThumbStaticsInit(&m_last_decode_thumb);
#endif
for (int i = 0; i < kMaxNumThumbITBreakpoints; i++)
m_sw_single_step_itblock_break_id[i] = INVALID_NUB_BREAK_ID;
}
@ -85,10 +89,12 @@ protected:
kern_return_t SetSingleStepSoftwareBreakpoints ();
bool ConditionPassed(uint8_t condition, uint32_t cpsr);
#if defined (USE_ARM_DISASSEMBLER_FRAMEWORK)
bool ComputeNextPC(nub_addr_t currentPC, arm_decoded_instruction_t decodedInstruction, bool currentPCIsThumb, nub_addr_t *targetPC);
void EvaluateNextInstructionForSoftwareBreakpointSetup(nub_addr_t currentPC, uint32_t cpsr, bool currentPCIsThumb, nub_addr_t *nextPC, bool *nextPCIsThumb);
void DecodeITBlockInstructions(nub_addr_t curr_pc);
arm_error_t DecodeInstructionUsingDisassembler(nub_addr_t curr_pc, uint32_t curr_cpsr, arm_decoded_instruction_t *decodedInstruction, thumb_static_data_t *thumbStaticData, nub_addr_t *next_pc);
void DecodeITBlockInstructions(nub_addr_t curr_pc);
#endif
void EvaluateNextInstructionForSoftwareBreakpointSetup(nub_addr_t currentPC, uint32_t cpsr, bool currentPCIsThumb, nub_addr_t *nextPC, bool *nextPCIsThumb);
static nub_bool_t BreakpointHit (nub_process_t pid, nub_thread_t tid, nub_break_t breakID, void *baton);
typedef enum RegisterSetTag
@ -233,8 +239,10 @@ protected:
nub_break_t m_sw_single_step_itblock_break_id[kMaxNumThumbITBreakpoints];
nub_addr_t m_sw_single_step_itblock_break_count;
// Disassembler state
#if defined (USE_ARM_DISASSEMBLER_FRAMEWORK)
thumb_static_data_t m_last_decode_thumb;
arm_decoded_instruction_t m_last_decode_arm;
#endif
nub_addr_t m_last_decode_pc;
};