aboutsummaryrefslogtreecommitdiff
path: root/gdb
diff options
context:
space:
mode:
authorJoel Brobecker <brobecker@adacore.com>2014-03-18 10:52:08 -0700
committerJoel Brobecker <brobecker@adacore.com>2014-04-28 15:38:19 -0400
commit528653254b46ccd95d7ffbef73acbcc1242eaee6 (patch)
tree6b57f65c417c2ebf3e01f856b0b0bde00e0e7de0 /gdb
parentf01c1a090e6629be280efb3c596d818f1f74ae2a (diff)
downloadgdb-528653254b46ccd95d7ffbef73acbcc1242eaee6.zip
gdb-528653254b46ccd95d7ffbef73acbcc1242eaee6.tar.gz
gdb-528653254b46ccd95d7ffbef73acbcc1242eaee6.tar.bz2
remove unnecessary second call to static_unwrap_type in ada_evaluate_subexp
In ada-lang.c::ada_evaluate_subexp, case OP_VAR_VALUE, when noside is EVAL_AVOID_SIDE_EFFECTS, the first thing we do is set type as follow: type = static_unwrap_type (SYMBOL_TYPE (exp->elts[pc + 2].symbol)); Later on in the same block, we make the same call: return value_zero (to_static_fixed_type (static_unwrap_type (SYMBOL_TYPE (exp->elts[pc + 2].symbol))), not_lval); This patch removes the second call, since it should result in the same type being returned, so no point in making that call again. gdb/ChangeLog: * ada-lang.c (ada_evaluate_subexp) <OP_VAR_VALUE>: Remove unnecessary second call to static_unwrap_type.
Diffstat (limited to 'gdb')
-rw-r--r--gdb/ChangeLog5
-rw-r--r--gdb/ada-lang.c5
2 files changed, 6 insertions, 4 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index e1093cf..cd43f6e 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,8 @@
+2014-04-28 Joel Brobecker <brobecker@adacore.com>
+
+ * ada-lang.c (ada_evaluate_subexp) <OP_VAR_VALUE>: Remove
+ unnecessary second call to static_unwrap_type.
+
2014-04-27 Hui Zhu <hui@codesourcery.com>
* stack.c (print_frame_info): Call do_gdb_disassembly with
diff --git a/gdb/ada-lang.c b/gdb/ada-lang.c
index da304ab..0acc1b5 100644
--- a/gdb/ada-lang.c
+++ b/gdb/ada-lang.c
@@ -10205,10 +10205,7 @@ ada_evaluate_subexp (struct type *expect_type, struct expression *exp,
}
*pos += 4;
- return value_zero
- (to_static_fixed_type
- (static_unwrap_type (SYMBOL_TYPE (exp->elts[pc + 2].symbol))),
- not_lval);
+ return value_zero (to_static_fixed_type (type), not_lval);
}
else
{