diff --git a/gdb/ChangeLog b/gdb/ChangeLog index c8249550b4..bfc6a0ebf2 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,8 @@ +2015-06-03 Jon Turney + + * windows-nat.c (handle_output_debug_string): Trim trailing '\n' + from OutputDebugString. + 2015-06-10 Walfred Tedeschi Mircea Gherzan diff --git a/gdb/windows-nat.c b/gdb/windows-nat.c index 701d2c52e8..851eb5192d 100644 --- a/gdb/windows-nat.c +++ b/gdb/windows-nat.c @@ -818,7 +818,13 @@ handle_output_debug_string (struct target_waitstatus *ourstatus) #ifdef __CYGWIN__ if (!startswith (s, "cYg")) #endif - warning (("%s"), s); + { + char *p = strchr (s, '\0'); + + if (p > s && *--p == '\n') + *p = '\0'; + warning (("%s"), s); + } } #ifdef __COPY_CONTEXT_SIZE else