From: Jon Turney <jon.turney@dronecode.org.uk>
To: gdb-patches@sourceware.org
Cc: Jon Turney <jon.turney@dronecode.org.uk>
Subject: [PATCH 1/4] windows-nat: Trim a trailing '\n's from OutputDebugString before echoing it
Date: Wed, 03 Jun 2015 17:30:00 -0000 [thread overview]
Message-ID: <1433352592-9728-3-git-send-email-jon.turney@dronecode.org.uk> (raw)
In-Reply-To: <1433352592-9728-1-git-send-email-jon.turney@dronecode.org.uk>
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>
---
gdb/ChangeLog | 5 +++++
gdb/windows-nat.c | 7 ++++++-
2 files changed, 11 insertions(+), 1 deletion(-)
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 37d619b..ee9f1df 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -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-02 Simon Marchi <simon.marchi@ericsson.com>
PR gdb/15564
diff --git a/gdb/windows-nat.c b/gdb/windows-nat.c
index 701d2c5..b56b916 100644
--- a/gdb/windows-nat.c
+++ b/gdb/windows-nat.c
@@ -818,7 +818,12 @@ 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
--
2.1.4
next prev parent reply other threads:[~2015-06-03 17:30 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-06-03 17:30 [PATCH 0/4] Various Cygwin patches Jon Turney
2015-06-03 17:30 ` [PATCH 3/4] windows-nat: Consistently use numeric get_context parameter to thread_rec() Jon Turney
2015-06-09 19:14 ` Joel Brobecker
2015-06-10 13:13 ` Jon TURNEY
2015-06-03 17:30 ` Jon Turney [this message]
2015-06-03 17:30 ` [PATCH 4/4] windows-nat: Also ignore ERROR_INVALID_HANDLE from SuspendThread() Jon Turney
2015-06-09 19:17 ` Joel Brobecker
2015-06-03 17:30 ` [PATCH 1/4] windows-nat: Trim a trailing '\n' from OutputDebugString before echoing it Jon Turney
2015-06-09 18:49 ` Joel Brobecker
2015-06-03 17:30 ` [PATCH 2/4] windows-nat: Replace __COPY_CONTEXT_SIZE conditional with __CYGWIN__ Jon Turney
2015-06-09 18:55 ` Joel Brobecker
2015-06-10 13:14 ` Jon TURNEY
2015-06-12 12:56 ` Joel Brobecker
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1433352592-9728-3-git-send-email-jon.turney@dronecode.org.uk \
--to=jon.turney@dronecode.org.uk \
--cc=gdb-patches@sourceware.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).