diff options
author | Jan Kratochvil <jan.kratochvil@redhat.com> | 2015-03-26 18:44:38 +0100 |
---|---|---|
committer | Jan Kratochvil <jan.kratochvil@redhat.com> | 2015-03-26 18:44:38 +0100 |
commit | f30d5c78faa5979fb933038923e5270b7728f96f (patch) | |
tree | 0aade4272d9ce87b97cc63f85f09f03ef30377a5 /gdb/printcmd.c | |
parent | 8d89f51a70a9a3cf74562324fc0391e4872a93b1 (diff) | |
download | gdb-f30d5c78faa5979fb933038923e5270b7728f96f.zip gdb-f30d5c78faa5979fb933038923e5270b7728f96f.tar.gz gdb-f30d5c78faa5979fb933038923e5270b7728f96f.tar.bz2 |
Code cleanup: Move print_command_1 expr variable scope
gdb/ChangeLog
2015-03-26 Jan Kratochvil <jan.kratochvil@redhat.com>
Code cleanup.
* printcmd.c (print_command_1): Move expr variable scope.
Diffstat (limited to 'gdb/printcmd.c')
-rw-r--r-- | gdb/printcmd.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/gdb/printcmd.c b/gdb/printcmd.c index deb501a..a1451f8 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); |