More fixes as per PR feedback.

This commit is contained in:
Jarek Syrylak 2018-08-16 19:44:31 +01:00
parent a6ecb3c913
commit 039fb95f80
3 changed files with 16 additions and 14 deletions

View file

@ -147,7 +147,7 @@ void ARM_DynCom::ExecuteInstructions(u64 num_instructions) {
state->NumInstrsToExecute = num_instructions; state->NumInstrsToExecute = num_instructions;
unsigned ticks_executed = InterpreterMainLoop(state.get()); unsigned ticks_executed = InterpreterMainLoop(state.get());
CoreTiming::AddTicks(ticks_executed); CoreTiming::AddTicks(ticks_executed);
state.get()->ServeBreak(); state->ServeBreak();
} }
std::unique_ptr<ARM_Interface::ThreadContext> ARM_DynCom::NewContext() const { std::unique_ptr<ARM_Interface::ThreadContext> ARM_DynCom::NewContext() const {

View file

@ -597,7 +597,10 @@ void ARMul_State::WriteCP15Register(u32 value, u32 crn, u32 opcode_1, u32 crm, u
} }
void ARMul_State::ServeBreak() { void ARMul_State::ServeBreak() {
if (GDBStub::IsServerEnabled()) { if (!GDBStub::IsServerEnabled()) {
return;
}
if (last_bkpt_hit) { if (last_bkpt_hit) {
Reg[15] = last_bkpt.address; Reg[15] = last_bkpt.address;
} }
@ -608,5 +611,4 @@ void ARMul_State::ServeBreak() {
GDBStub::Break(); GDBStub::Break();
GDBStub::SendTrap(thread, 5); GDBStub::SendTrap(thread, 5);
} }
}
} }

View file

@ -215,8 +215,8 @@ static void FpuWrite(std::size_t id, u64 val, Kernel::Thread* thread = nullptr)
} }
if (id >= D0_REGISTER && id < FPSCR_REGISTER) { if (id >= D0_REGISTER && id < FPSCR_REGISTER) {
thread->context->SetFpuRegister(2 * (id - D0_REGISTER), (u32)val); thread->context->SetFpuRegister(2 * (id - D0_REGISTER), static_cast<u32>(val));
thread->context->SetFpuRegister(2 * (id - D0_REGISTER) + 1, val >> 32); thread->context->SetFpuRegister(2 * (id - D0_REGISTER) + 1, static_cast<u32>(val >> 32));
} else if (id == FPSCR_REGISTER) { } else if (id == FPSCR_REGISTER) {
return thread->context->SetFpscr(static_cast<u32>(val)); return thread->context->SetFpscr(static_cast<u32>(val));
} }