aboutsummaryrefslogtreecommitdiff
path: root/gdb/expprint.c
diff options
context:
space:
mode:
authorTom Tromey <tom@tromey.com>2016-04-20 08:14:16 -0600
committerTom Tromey <tom@tromey.com>2016-05-17 12:01:58 -0600
commite4b8a1c839b88c345b82c37c90814a89c7f0c3c2 (patch)
tree3aff1c51a20d860792d07fe12baaad722300303a /gdb/expprint.c
parent9ab0bb2a673875ba15d6956f2c587c9c31f40357 (diff)
downloadgdb-e4b8a1c839b88c345b82c37c90814a89c7f0c3c2.zip
gdb-e4b8a1c839b88c345b82c37c90814a89c7f0c3c2.tar.gz
gdb-e4b8a1c839b88c345b82c37c90814a89c7f0c3c2.tar.bz2
Make gdb expression debugging handle OP_F90_RANGE
print_subexp_standard and dump_subexp_body_standard did not handle OP_F90_RANGE. Attempting to dump an expression using this opcode would fail. This patch adds support for this opcode to these functions. 2016-05-17 Tom Tromey <tom@tromey.com> * expprint.c: Include f-lang.h. (print_subexp_standard, dump_subexp_body_standard): Handle OP_F90_RANGE.
Diffstat (limited to 'gdb/expprint.c')
-rw-r--r--gdb/expprint.c57
1 files changed, 57 insertions, 0 deletions
diff --git a/gdb/expprint.c b/gdb/expprint.c
index b3337cd..db196a1 100644
--- a/gdb/expprint.c
+++ b/gdb/expprint.c
@@ -29,6 +29,7 @@
#include "block.h"
#include "objfiles.h"
#include "valprint.h"
+#include "f-lang.h"
#include <ctype.h>
@@ -559,6 +560,26 @@ print_subexp_standard (struct expression *exp, int *pos,
return;
}
+ case OP_F90_RANGE:
+ {
+ enum f90_range_type range_type;
+
+ range_type = (enum f90_range_type)
+ longest_to_int (exp->elts[pc + 1].longconst);
+ *pos += 2;
+
+ fputs_filtered ("RANGE(", stream);
+ if (range_type == HIGH_BOUND_DEFAULT
+ || range_type == NONE_BOUND_DEFAULT)
+ print_subexp (exp, pos, stream, PREC_ABOVE_COMMA);
+ fputs_filtered ("..", stream);
+ if (range_type == LOW_BOUND_DEFAULT
+ || range_type == NONE_BOUND_DEFAULT)
+ print_subexp (exp, pos, stream, PREC_ABOVE_COMMA);
+ fputs_filtered (")", stream);
+ return;
+ }
+
/* Default ops */
default:
@@ -1025,6 +1046,42 @@ dump_subexp_body_standard (struct expression *exp,
elt += 2;
}
break;
+ case OP_F90_RANGE:
+ {
+ enum f90_range_type range_type;
+
+ range_type = (enum f90_range_type)
+ longest_to_int (exp->elts[elt].longconst);
+ elt += 2;
+
+ switch (range_type)
+ {
+ case BOTH_BOUND_DEFAULT:
+ fputs_filtered ("Range '..'", stream);
+ break;
+ case LOW_BOUND_DEFAULT:
+ fputs_filtered ("Range '..EXP'", stream);
+ break;
+ case HIGH_BOUND_DEFAULT:
+ fputs_filtered ("Range 'EXP..'", stream);
+ break;
+ case NONE_BOUND_DEFAULT:
+ fputs_filtered ("Range 'EXP..EXP'", stream);
+ break;
+ default:
+ fputs_filtered ("Invalid Range!", stream);
+ break;
+ }
+
+ if (range_type == HIGH_BOUND_DEFAULT
+ || range_type == NONE_BOUND_DEFAULT)
+ elt = dump_subexp (exp, stream, elt);
+ if (range_type == LOW_BOUND_DEFAULT
+ || range_type == NONE_BOUND_DEFAULT)
+ elt = dump_subexp (exp, stream, elt);
+ }
+ break;
+
default:
case OP_NULL:
case MULTI_SUBSCRIPT: