diff options
Diffstat (limited to 'gdbserver/remote-utils.cc')
-rw-r--r-- | gdbserver/remote-utils.cc | 55 |
1 files changed, 13 insertions, 42 deletions
diff --git a/gdbserver/remote-utils.cc b/gdbserver/remote-utils.cc index 8cd8f52..3004130 100644 --- a/gdbserver/remote-utils.cc +++ b/gdbserver/remote-utils.cc @@ -670,22 +670,15 @@ putpkt_binary_1 (char *buf, int cnt, int is_notif) if (cs.noack_mode || is_notif) { /* Don't expect an ack then. */ - if (remote_debug) - { - if (is_notif) - debug_printf ("putpkt (\"%s\"); [notif]\n", buf2); - else - debug_printf ("putpkt (\"%s\"); [noack mode]\n", buf2); - debug_flush (); - } + if (is_notif) + remote_debug_printf ("putpkt (\"%s\"); [notif]", buf2); + else + remote_debug_printf ("putpkt (\"%s\"); [noack mode]", buf2); + break; } - if (remote_debug) - { - debug_printf ("putpkt (\"%s\"); [looking for ack]\n", buf2); - debug_flush (); - } + remote_debug_printf ("putpkt (\"%s\"); [looking for ack]", buf2); cc = readchar (); @@ -695,11 +688,7 @@ putpkt_binary_1 (char *buf, int cnt, int is_notif) return -1; } - if (remote_debug) - { - debug_printf ("[received '%c' (0x%x)]\n", cc, cc); - debug_flush (); - } + remote_debug_printf ("[received '%c' (0x%x)]", cc, cc); /* Check for an input interrupt while we're here. */ if (cc == '\003' && current_thread != NULL) @@ -868,8 +857,7 @@ readchar (void) { if (readchar_bufcnt == 0) { - if (remote_debug) - debug_printf ("readchar: Got EOF\n"); + remote_debug_printf ("readchar: Got EOF"); } else perror ("readchar"); @@ -950,11 +938,8 @@ getpkt (char *buf) if (c == '$') break; - if (remote_debug) - { - debug_printf ("[getpkt: discarding char '%c']\n", c); - debug_flush (); - } + + remote_debug_printf ("[getpkt: discarding char '%c']", c); if (c < 0) return -1; @@ -997,29 +982,15 @@ getpkt (char *buf) if (!cs.noack_mode) { - if (remote_debug) - { - debug_printf ("getpkt (\"%s\"); [sending ack] \n", buf); - debug_flush (); - } + remote_debug_printf ("getpkt (\"%s\"); [sending ack]", buf); if (write_prim ("+", 1) != 1) return -1; - if (remote_debug) - { - debug_printf ("[sent ack]\n"); - debug_flush (); - } + remote_debug_printf ("[sent ack]"); } else - { - if (remote_debug) - { - debug_printf ("getpkt (\"%s\"); [no ack sent] \n", buf); - debug_flush (); - } - } + remote_debug_printf ("getpkt (\"%s\"); [no ack sent]", buf); /* The readchar above may have already read a '\003' out of the socket and moved it to the local buffer. For example, when GDB sends |