windows-nat: Trim a trailing '\n' from OutputDebugString before echoing it

For cosmetic purposes, trim a trailing '\n' from OutputDebugString before
echoing it, as warning() will add a '\n', anyhow.

gdb/ChangeLog:

2015-06-03  Jon Turney  <jon.turney@dronecode.org.uk>

	* windows-nat.c (handle_output_debug_string): Trim trailing '\n'
	from OutputDebugString.

Signed-off-by: Jon Turney <jon.turney@dronecode.org.uk>
This commit is contained in:
Jon Turney 2015-06-03 14:03:50 +01:00
parent 7d73c23c4d
commit 040ea00bb0
2 changed files with 12 additions and 1 deletions

View File

@ -1,3 +1,8 @@
2015-06-03 Jon Turney <jon.turney@dronecode.org.uk>
* windows-nat.c (handle_output_debug_string): Trim trailing '\n'
from OutputDebugString.
2015-06-10 Walfred Tedeschi <walfred.tedeschi@intel.com>
Mircea Gherzan <mircea.gherzan@intel.com>

View File

@ -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