public inbox for elfutils@sourceware.org
 help / color / mirror / Atom feed
* [PATCH] addr2line: Add explicit fflush for stdout when reading from stdin.
@ 2018-05-12 19:42 Mark Wielaard
  0 siblings, 0 replies; only message in thread
From: Mark Wielaard @ 2018-05-12 19:42 UTC (permalink / raw)
  To: elfutils-devel; +Cc: Mark Wielaard

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

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2018-05-12 19:42 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-05-12 19:42 [PATCH] addr2line: Add explicit fflush for stdout when reading from stdin Mark Wielaard

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).