From cc704ebecf3fd0ca95eadf7a89c6dfd4446e5c26 Mon Sep 17 00:00:00 2001 From: Tom Tromey Date: Fri, 12 Dec 2008 16:58:46 +0000 Subject: [PATCH] * macrocmd.c (macro_define_command): Skip whitespace after macro name. (print_one_macro): Print space after macro name. --- gdb/ChangeLog | 6 ++++++ gdb/macrocmd.c | 10 ++++++---- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 9e8f9a5a7b7..9a1956911ed 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,9 @@ +2008-12-11 Tom Tromey + + * macrocmd.c (macro_define_command): Skip whitespace after + macro name. + (print_one_macro): Print space after macro name. + 2008-12-12 Pedro Alves * infrun.c (handle_inferior_event): Correctly tag non-executing diff --git a/gdb/macrocmd.c b/gdb/macrocmd.c index 56e9a48ff22..fa639d1e60d 100644 --- a/gdb/macrocmd.c +++ b/gdb/macrocmd.c @@ -315,13 +315,17 @@ macro_define_command (char *exp, int from_tty) } /* Skip the closing paren. */ ++exp; + skip_ws (&exp); macro_define_function (macro_main (macro_user_macros), -1, name, new_macro.argc, (const char **) new_macro.argv, exp); } else - macro_define_object (macro_main (macro_user_macros), -1, name, exp); + { + skip_ws (&exp); + macro_define_object (macro_main (macro_user_macros), -1, name, exp); + } do_cleanups (cleanup_chain); } @@ -358,9 +362,7 @@ print_one_macro (const char *name, const struct macro_definition *macro, macro->argv[i]); fprintf_filtered (gdb_stdout, ")"); } - /* Note that we don't need a leading space here -- "macro define" - provided it. */ - fprintf_filtered (gdb_stdout, "%s\n", macro->replacement); + fprintf_filtered (gdb_stdout, " %s\n", macro->replacement); } -- 2.30.2