Fix regression in Ada ptype
authorTom Tromey <tromey@adacore.com>
Mon, 15 Mar 2021 12:23:12 +0000 (06:23 -0600)
committerTom Tromey <tromey@adacore.com>
Mon, 15 Mar 2021 12:23:13 +0000 (06:23 -0600)
This fixes PR ada/27545, which points out that a test in
gdb.ada/tagged.exp started failing due to the expression rewrite.  I
didn't notice this failure because my system gcc-gnat debuginfo was
out of date, and so the test was already failing in the baseline.

Previously, the OP_VAR_VALUE case in ada_evaluate_subexp ended up
doing a recursive call:

    arg1 = evaluate_subexp (nullptr, exp, pos, EVAL_NORMAL);

However, during the rewrite I missed this fact and had the new code
call the superclass implementation.

This patch fixes the bug by changing this code to use a recursive call
instead.

gdb/ChangeLog
2021-03-15  Tom Tromey  <tromey@adacore.com>

PR ada/27545:
* ada-lang.c (ada_var_value_operation::evaluate): Use recursive
call for tagged type.

gdb/ChangeLog
gdb/ada-lang.c

index ed4da7aae9314d92c7392ac3bfed432c66ae9a65..3033d11387dc6b63f1426ac980ff734fd6e57c74 100644 (file)
@@ -1,3 +1,9 @@
+2021-03-15  Tom Tromey  <tromey@adacore.com>
+
+       PR ada/27545:
+       * ada-lang.c (ada_var_value_operation::evaluate): Use recursive
+       call for tagged type.
+
 2021-03-15  Tom Tromey  <tromey@adacore.com>
 
        * ada-exp.y (exp1): Handle resolution of the right hand side of an
index ea43a259f5139ccfa9785405f0605276ad97778c..07958e7934e153634f56304c563cd48ad7f62fc6 100644 (file)
@@ -10320,8 +10320,7 @@ ada_var_value_operation::evaluate (struct type *expect_type,
             a fixed type would result in the loss of that type name,
             thus preventing us from printing the name of the ancestor
             type in the type description.  */
-         value *arg1 = var_value_operation::evaluate (nullptr, exp,
-                                                      EVAL_NORMAL);
+         value *arg1 = evaluate (nullptr, exp, EVAL_NORMAL);
 
          if (type->code () != TYPE_CODE_REF)
            {
This page took 0.032342 seconds and 4 git commands to generate.