diff options
author | Oxore <oxore@protonmail.com> | 2022-09-29 02:00:46 +0300 |
---|---|---|
committer | Oxore <oxore@protonmail.com> | 2022-09-29 02:00:46 +0300 |
commit | fccf528efb30e6dcbd0070a4bfd0dc6ebc180fdf (patch) | |
tree | b651a1f48e5c219ecdb53c9adffe0716c6d15fce | |
parent | d657bc185cc1ea7fff8918d96de6860204543c50 (diff) |
Disable GDB Remote trace
-rw-r--r-- | CMakeLists.txt | 2 | ||||
-rw-r--r-- | emulator.cpp | 11 |
2 files changed, 8 insertions, 5 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 7187264..0b2323c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -48,7 +48,7 @@ add_executable(emulator ${emulator_sources}) target_link_libraries(emulator musashi_m68k) target_compile_definitions(emulator PRIVATE DEBUG_TRACE_INSTRUCTIONS=0 - DEBUG_TRACE_GDB_REMOTE=1 + DEBUG_TRACE_GDB_REMOTE=0 ) ## Target for GDB Remote Debugging protocol implementation testing diff --git a/emulator.cpp b/emulator.cpp index 59c1367..95cb0df 100644 --- a/emulator.cpp +++ b/emulator.cpp @@ -355,7 +355,7 @@ void ParseAndReact( for (size_t i = 0; i < static_cast<size_t>(msg_data_len); i++) { const auto res = exchange_ctx.Consume(msg_data[i]); if (res == nullptr) continue; - if (res->packet.length() > 0) { + if (DEBUG_TRACE_GDB_REMOTE && res->packet.length() > 0) { printf("<- \"%s\"\n", exchange_ctx.GetLastPacket().c_str()); const auto packet = GDBRemote::Packet::Parse(res->packet); printf( @@ -363,7 +363,8 @@ void ParseAndReact( GDBRemote::Packet::PacketTypeToString(packet.type)); } if (res->ack.length() > 0 && !g_no_ack_mode) { - printf("-> \"%s\"\n", res->ack.c_str()); + if (DEBUG_TRACE_GDB_REMOTE) + printf("-> \"%s\"\n", res->ack.c_str()); if (send(conn_fd, &res->ack[0], res->ack.length(), 0) == -1) perror("Send failed (ack/nak)"); } @@ -371,7 +372,8 @@ void ParseAndReact( const auto packet = GDBRemote::Packet::Parse(res->packet); const auto response = exchange_ctx.WrapDataToSend(CreateResponse(m68k_debug, packet)); - printf("-> \"%s\"\n", response.c_str()); + if (DEBUG_TRACE_GDB_REMOTE) + printf("-> \"%s\"\n", response.c_str()); if (send(conn_fd, &response[0], response.length(), 0) == -1) perror("Send failed (response)"); } @@ -434,7 +436,8 @@ int emulator(M68KDebuggingControl& m68k_debug) m68k_debug.ResetPendingBreakpoint(); const auto response = exchange_ctx.WrapDataToSend("S05"); - printf("-> \"%s\"\n", response.c_str()); + if (DEBUG_TRACE_GDB_REMOTE) + printf("-> \"%s\"\n", response.c_str()); if (send(conn_fd, &response[0], response.length(), 0) == -1) perror("Send failed (response)"); } |