From: Jan Kratochvil Date: Thu, 26 Mar 2015 17:44:38 +0000 (+0100) Subject: Code cleanup: Move print_command_1 expr variable scope X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=f30d5c78faa5979fb933038923e5270b7728f96f;p=binutils-gdb.git Code cleanup: Move print_command_1 expr variable scope gdb/ChangeLog 2015-03-26 Jan Kratochvil Code cleanup. * printcmd.c (print_command_1): Move expr variable scope. --- diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 55a83830e44..94ef5c8c1f9 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,8 @@ +2015-03-26 Jan Kratochvil + + Code cleanup. + * printcmd.c (print_command_1): Move expr variable scope. + 2015-03-26 Jan Kratochvil Code cleanup. diff --git a/gdb/printcmd.c b/gdb/printcmd.c index deb501ae7cf..a1451f8ab2f 100644 --- a/gdb/printcmd.c +++ b/gdb/printcmd.c @@ -946,7 +946,6 @@ validate_format (struct format_data fmt, const char *cmdname) static void print_command_1 (const char *exp, int voidprint) { - struct expression *expr; struct cleanup *old_chain = make_cleanup (null_cleanup, NULL); char format = 0; struct value *val; @@ -969,6 +968,8 @@ print_command_1 (const char *exp, int voidprint) if (exp && *exp) { + struct expression *expr; + expr = parse_expression (exp); make_cleanup (free_current_contents, &expr); val = evaluate_expression (expr);