Tidy up as requested in PR feedback

This commit is contained in:
Jarek Syrylak
2018-07-12 21:18:09 +01:00
parent 7b4cd8f895
commit 2db0203317

View File

@@ -565,7 +565,7 @@ static void HandleQuery() {
} else if (strncmp(query, "Supported", strlen("Supported")) == 0) { } else if (strncmp(query, "Supported", strlen("Supported")) == 0) {
// PacketSize needs to be large enough for target xml // PacketSize needs to be large enough for target xml
std::string buffer = "PacketSize=2000;qXfer:features:read+;qXfer:threads:read+"; std::string buffer = "PacketSize=2000;qXfer:features:read+;qXfer:threads:read+";
if (modules.size()) { if (!modules.empty()) {
buffer += ";qXfer:libraries:read+"; buffer += ";qXfer:libraries:read+";
} }
SendReply(buffer.c_str()); SendReply(buffer.c_str());
@@ -776,7 +776,6 @@ static void ReadRegister() {
} else if (id == FPSCR_REGISTER) { } else if (id == FPSCR_REGISTER) {
LongToGdbHex(reply, RegRead(998, current_thread)); LongToGdbHex(reply, RegRead(998, current_thread));
} else { } else {
// return SendReply("E01");
LongToGdbHex(reply, RegRead(997, current_thread)); LongToGdbHex(reply, RegRead(997, current_thread));
} }
@@ -839,10 +838,10 @@ static void WriteRegister() {
} else if (id == FPSCR_REGISTER) { } else if (id == FPSCR_REGISTER) {
RegWrite(998, GdbHexToLong(buffer_ptr), current_thread); RegWrite(998, GdbHexToLong(buffer_ptr), current_thread);
} else { } else {
// return SendReply("E01");
RegWrite(997, GdbHexToLong(buffer_ptr), current_thread); 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); Core::System::GetInstance().ArmInterface(current_core).LoadContext(current_thread->context);
SendReply("OK"); 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); Core::System::GetInstance().ArmInterface(current_core).LoadContext(current_thread->context);
SendReply("OK"); SendReply("OK");
@@ -941,6 +941,7 @@ void Break(bool is_memory_break) {
static void Step() { static void Step() {
if (command_length > 1) { if (command_length > 1) {
RegWrite(PC_REGISTER, GdbHexToLong(command_buffer + 1), current_thread); 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); Core::System::GetInstance().ArmInterface(current_core).LoadContext(current_thread->context);
} }
step_loop = true; step_loop = true;