This is the mail archive of the gdb-cvs@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[binutils-gdb] Avoid string_file in tui_make_status_line


https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=e2a678a557b52816a7aa45902a6519bc1cae918e

commit e2a678a557b52816a7aa45902a6519bc1cae918e
Author: Tom Tromey <tom@tromey.com>
Date:   Sat Jul 6 13:52:08 2019 -0600

    Avoid string_file in tui_make_status_line
    
    tui_make_status_line uses string_file where a simple std::string
    constructor would do.  This makes this change.
    
    gdb/ChangeLog
    2019-08-15  Tom Tromey  <tom@tromey.com>
    
    	* tui/tui-stack.c (tui_make_status_line): Use string constructor.

Diff:
---
 gdb/ChangeLog       | 4 ++++
 gdb/tui/tui-stack.c | 8 +++-----
 2 files changed, 7 insertions(+), 5 deletions(-)

diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 129d85d..58fa44d 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,5 +1,9 @@
 2019-08-15  Tom Tromey  <tom@tromey.com>
 
+	* tui/tui-stack.c (tui_make_status_line): Use string constructor.
+
+2019-08-15  Tom Tromey  <tom@tromey.com>
+
 	* tui/tui-wingeneral.c: Include tui-stack.h.
 	* tui/tui-stack.h (MAX_LOCATOR_ELEMENT_LEN)
 	(struct tui_locator_window): Move from tui-data.h.
diff --git a/gdb/tui/tui-stack.c b/gdb/tui/tui-stack.c
index c67ac1b..1d7491d 100644
--- a/gdb/tui/tui-stack.c
+++ b/gdb/tui/tui-stack.c
@@ -128,11 +128,9 @@ tui_make_status_line (struct tui_locator_window *loc)
     line_width = MIN_LINE_WIDTH;
 
   /* Translate PC address.  */
-  string_file pc_out;
-
-  fputs_filtered (loc->gdbarch? paddress (loc->gdbarch, loc->addr) : "??",
-		  &pc_out);
-
+  std::string pc_out (loc->gdbarch
+		      ? paddress (loc->gdbarch, loc->addr)
+		      : "??");
   const char *pc_buf = pc_out.c_str ();
   int pc_width = pc_out.size ();


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]