gdb: Don't print a newline in language la_print_typedef methods
authorAndrew Burgess <andrew.burgess@embecosm.com>
Tue, 24 Sep 2019 22:01:14 +0000 (23:01 +0100)
committerAndrew Burgess <andrew.burgess@embecosm.com>
Thu, 31 Oct 2019 23:02:59 +0000 (23:02 +0000)
When calling the language la_print_typedef method, don't include a
newline at the end, instead print the newline from the users of
la_print_typedef.

This change will be useful in a later commit when the output from
la_print_typedef will be placed into an MI output field, in which case
the trailing newline is not required.

There should be no user visible changes after this commit.

gdb/ChangeLog:

* ada-typeprint.c (ada_print_typedef): Don't print newline at the
end.
* c-typeprint.c (c_print_typedef): Likewise.
* f-typeprint.c (f_print_typedef): Likewise.
* m2-typeprint.c (m2_print_typedef): Likewise.
* p-typeprint.c (pascal_print_typedef): Likewise.
* rust-lang.c (rust_print_typedef): Likewise.
* symtab.c (print_symbol_info): Print a newline after calling
typedef_print.

Change-Id: I6e697ea1ec0eadaa31aefaea959b2055188d680d

gdb/ChangeLog
gdb/ada-typeprint.c
gdb/c-typeprint.c
gdb/f-typeprint.c
gdb/m2-typeprint.c
gdb/p-typeprint.c
gdb/rust-lang.c
gdb/symtab.c

index 2bd67260dc72cfc3ed42e60dd294fd9264f9f7b9..381147b32178ed71a9f1fd13955aa4df2d522d7e 100644 (file)
@@ -1,3 +1,15 @@
+2019-10-31  Andrew Burgess  <andrew.burgess@embecosm.com>
+
+       * ada-typeprint.c (ada_print_typedef): Don't print newline at the
+       end.
+       * c-typeprint.c (c_print_typedef): Likewise.
+       * f-typeprint.c (f_print_typedef): Likewise.
+       * m2-typeprint.c (m2_print_typedef): Likewise.
+       * p-typeprint.c (pascal_print_typedef): Likewise.
+       * rust-lang.c (rust_print_typedef): Likewise.
+       * symtab.c (print_symbol_info): Print a newline after calling
+       typedef_print.
+
 2019-10-31  Andrew Burgess  <andrew.burgess@embecosm.com>
 
        * symtab.c (info_module_cmdlist): New variable.
index be379254aa1c4cb6bd2173db30d64b7ce8d24775..f89dd23ed8274e184c75311d4cd14a48c7fb4582 100644 (file)
@@ -945,5 +945,4 @@ ada_print_typedef (struct type *type, struct symbol *new_symbol,
 {
   type = ada_check_typedef (type);
   ada_print_type (type, "", stream, 0, 0, &type_print_raw_options);
-  fprintf_filtered (stream, "\n");
 }
index 1a37c4edfb8665f29bb0280ac44c8851828ffc9d..e0f1714da11591fe47a5a2dce0f3afdaa3c8aa87 100644 (file)
@@ -211,7 +211,7 @@ c_print_typedef (struct type *type,
                 SYMBOL_LINKAGE_NAME (new_symbol)) != 0
       || TYPE_CODE (SYMBOL_TYPE (new_symbol)) == TYPE_CODE_TYPEDEF)
     fprintf_filtered (stream, " %s", SYMBOL_PRINT_NAME (new_symbol));
-  fprintf_filtered (stream, ";\n");
+  fprintf_filtered (stream, ";");
 }
 
 /* If TYPE is a derived type, then print out derivation information.
index 0093aebddc2c10886729f9bac5645263e0d1fb56..027bcdde0f91254dc577afe25b082c69a502e20c 100644 (file)
@@ -54,7 +54,6 @@ f_print_typedef (struct type *type, struct symbol *new_symbol,
 {
   type = check_typedef (type);
   f_print_type (type, "", stream, 0, 0, &type_print_raw_options);
-  fprintf_filtered (stream, "\n");
 }
 
 /* LEVEL is the depth to indent lines by.  */
index 3c1a8d2aed392ca5bf06a5e8bf2afc1bd80513f1..e81a9e568886b8931fc40712cd5d9a554ddd5b1d 100644 (file)
@@ -170,7 +170,7 @@ m2_print_typedef (struct type *type, struct symbol *new_symbol,
   else
     fprintf_filtered (stream, "<builtin> = ");
   type_print (type, "", stream, 0);
-  fprintf_filtered (stream, ";\n");
+  fprintf_filtered (stream, ";");
 }
 
 /* m2_type_name - if a, type, has a name then print it.  */
index fadc44eaee87510b0f787c665ca8e6f72804e56d..da30d4a3ac2802f399e6b535d4237972cd2bdd51 100644 (file)
@@ -101,7 +101,7 @@ pascal_print_typedef (struct type *type, struct symbol *new_symbol,
   fprintf_filtered (stream, "type ");
   fprintf_filtered (stream, "%s = ", SYMBOL_PRINT_NAME (new_symbol));
   type_print (type, "", stream, 0);
-  fprintf_filtered (stream, ";\n");
+  fprintf_filtered (stream, ";");
 }
 
 /* If TYPE is a derived type, then print out derivation information.
index cef0a9cb092e58c6a012c50660d722bf5d0092a3..838d9019adfbca32ee205b88da2842ecef0f1e13 100644 (file)
@@ -831,7 +831,7 @@ rust_print_typedef (struct type *type,
   type = check_typedef (type);
   fprintf_filtered (stream, "type %s = ", SYMBOL_PRINT_NAME (new_symbol));
   type_print (type, "", stream, 0);
-  fprintf_filtered (stream, ";\n");
+  fprintf_filtered (stream, ";");
 }
 
 /* la_print_type implementation for Rust.  */
index 72a54ec1ca0a02c2b96c156bfea5ba4f44a1796b..2c934b9c22f022439086537f0593cab0d6071f55 100644 (file)
@@ -4774,10 +4774,8 @@ print_symbol_info (enum search_domain kind,
       if (TYPE_CODE (SYMBOL_TYPE (sym)) == TYPE_CODE_TYPEDEF)
        typedef_print (SYMBOL_TYPE (sym), sym, gdb_stdout);
       else
-       {
-         type_print (SYMBOL_TYPE (sym), "", gdb_stdout, -1);
-         printf_filtered ("\n");
-       }
+       type_print (SYMBOL_TYPE (sym), "", gdb_stdout, -1);
+      printf_filtered ("\n");
     }
   /* variable, func, or typedef-that-is-c++-class.  */
   else if (kind < TYPES_DOMAIN
This page took 0.032029 seconds and 4 git commands to generate.