From: Mark Wielaard <mark@klomp.org>
To: elfutils-devel@sourceware.org
Cc: Mark Wielaard <mark@klomp.org>
Subject: [PATCH] addr2line: Add explicit fflush for stdout when reading from stdin.
Date: Sat, 12 May 2018 19:42:00 -0000 [thread overview]
Message-ID: <20180512194245.21447-1-mark@klomp.org> (raw)
To make it possible to use eu-addr2line interactively through a pipe we
need to explicitly flush stdout after handling each line from stdin.
https://sourceware.org/bugzilla/show_bug.cgi?id=23173
Signed-off-by: Mark Wielaard <mark@klomp.org>
---
src/ChangeLog | 5 +++++
src/addr2line.c | 1 +
2 files changed, 6 insertions(+)
diff --git a/src/ChangeLog b/src/ChangeLog
index 0a8b86c8..24504077 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,8 @@
+2018-05-12 Mark Wielaard <mark@klomp.org>
+
+ * addr2line.c (main): Add fflush (stdout) after handle_address ()
+ when reading from stdin.
+
2018-04-24 Mark Wielaard <mark@klomp.org>
* readelf.c (print_debug_aranges_section): Try elf_rawdata if no
diff --git a/src/addr2line.c b/src/addr2line.c
index 444ee52c..5acafa00 100644
--- a/src/addr2line.c
+++ b/src/addr2line.c
@@ -187,6 +187,7 @@ main (int argc, char *argv[])
buf[chars - 1] = '\0';
result = handle_address (buf, dwfl);
+ fflush (stdout);
}
free (buf);
--
2.17.0
reply other threads:[~2018-05-12 19:42 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=20180512194245.21447-1-mark@klomp.org \
--to=mark@klomp.org \
--cc=elfutils-devel@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).