From 2db0203317876af3cde41a6a56876d6e92403869 Mon Sep 17 00:00:00 2001 From: Jarek Syrylak Date: Thu, 12 Jul 2018 21:18:09 +0100 Subject: [PATCH] Tidy up as requested in PR feedback --- src/core/gdbstub/gdbstub.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/core/gdbstub/gdbstub.cpp b/src/core/gdbstub/gdbstub.cpp index b78d8c0076..5fba669e40 100644 --- a/src/core/gdbstub/gdbstub.cpp +++ b/src/core/gdbstub/gdbstub.cpp @@ -565,7 +565,7 @@ static void HandleQuery() { } else if (strncmp(query, "Supported", strlen("Supported")) == 0) { // PacketSize needs to be large enough for target xml std::string buffer = "PacketSize=2000;qXfer:features:read+;qXfer:threads:read+"; - if (modules.size()) { + if (!modules.empty()) { buffer += ";qXfer:libraries:read+"; } SendReply(buffer.c_str()); @@ -776,7 +776,6 @@ static void ReadRegister() { } else if (id == FPSCR_REGISTER) { LongToGdbHex(reply, RegRead(998, current_thread)); } else { - // return SendReply("E01"); LongToGdbHex(reply, RegRead(997, current_thread)); } @@ -839,10 +838,10 @@ static void WriteRegister() { } else if (id == FPSCR_REGISTER) { RegWrite(998, GdbHexToLong(buffer_ptr), current_thread); } else { - // return SendReply("E01"); RegWrite(997, GdbHexToLong(buffer_ptr), current_thread); } + // Update Unicorn context skipping scheduler, no running threads at this point Core::System::GetInstance().ArmInterface(current_core).LoadContext(current_thread->context); SendReply("OK"); @@ -871,6 +870,7 @@ static void WriteRegisters() { } } + // Update Unicorn context skipping scheduler, no running threads at this point Core::System::GetInstance().ArmInterface(current_core).LoadContext(current_thread->context); SendReply("OK"); @@ -941,6 +941,7 @@ void Break(bool is_memory_break) { static void Step() { if (command_length > 1) { RegWrite(PC_REGISTER, GdbHexToLong(command_buffer + 1), current_thread); + // Update Unicorn context skipping scheduler, no running threads at this point Core::System::GetInstance().ArmInterface(current_core).LoadContext(current_thread->context); } step_loop = true;