gdb/testsuite/tui: Always dump_screen when asked
[deliverable/binutils-gdb.git] / gdb / macrocmd.c
index beb9b78b3441ebd044900a0cd30cee321597a328..70b95b107ea0c70453197aa53d02c7b294254ec4 100644 (file)
@@ -1,5 +1,5 @@
 /* C preprocessor macro expansion commands for GDB.
-   Copyright (C) 2002-2019 Free Software Foundation, Inc.
+   Copyright (C) 2002-2020 Free Software Foundation, Inc.
    Contributed by Red Hat, Inc.
 
    This file is part of GDB.
@@ -22,6 +22,7 @@
 #include "macrotab.h"
 #include "macroexp.h"
 #include "macroscope.h"
+#include "cli/cli-style.h"
 #include "cli/cli-utils.h"
 #include "command.h"
 #include "gdbcmd.h"
@@ -118,18 +119,18 @@ show_pp_source_pos (struct ui_file *stream,
                     struct macro_source_file *file,
                     int line)
 {
-  char *fullname;
-
-  fullname = macro_source_fullname (file);
-  fprintf_filtered (stream, "%s:%d\n", fullname, line);
-  xfree (fullname);
+  std::string fullname = macro_source_fullname (file);
+  fprintf_filtered (stream, "%ps:%d\n",
+                   styled_string (file_name_style.style (),
+                                  fullname.c_str ()),
+                   line);
 
   while (file->included_by)
     {
       fullname = macro_source_fullname (file->included_by);
-      fprintf_filtered (gdb_stdout, "  included at %s:%d\n", fullname,
-                        file->included_at_line);
-      xfree (fullname);
+      fputs_filtered (_("  included at "), stream);
+      fputs_styled (fullname.c_str (), file_name_style.style (), stream);
+      fprintf_filtered (stream, ":%d\n", file->included_at_line);
       file = file->included_by;
     }
 }
This page took 0.024909 seconds and 4 git commands to generate.