From fccf528efb30e6dcbd0070a4bfd0dc6ebc180fdf Mon Sep 17 00:00:00 2001 From: Oxore Date: Thu, 29 Sep 2022 02:00:46 +0300 Subject: Disable GDB Remote trace --- emulator.cpp | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'emulator.cpp') 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(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)"); } -- cgit v1.2.3