From 844781a1bed001865515739fc576c268af2127d6 Mon Sep 17 00:00:00 2001 From: Gaius Mulley Date: Tue, 16 Oct 2007 17:36:51 +0000 Subject: * doc/gdb.texinfo: Add TSIZE definition, removed statement about unbounded arrays being unimplemented. * m2-valprint.c (m2_print_array_contents): New function. (m2_print_unbounded_array): New function. (m2_print_array_contents): New function. * m2-typeprint.c (m2_unbounded_array): New function. (m2_is_unbounded_array): New function. (m2_print_type): Test for unbounded array when walking across structs. * m2-lang.h: Added extern m2_is_unbounded_array. * m2-lang.c (evaluate_subexp_modula2): New function. (exp_descriptor_modula2): New structure. (m2_language_defn): Use exp_descriptor_modula2. * m2-exp.y: Added TSIZE and binary subscript. --- gdb/m2-exp.y | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'gdb/m2-exp.y') diff --git a/gdb/m2-exp.y b/gdb/m2-exp.y index 201ba82..7bcde3b 100644 --- a/gdb/m2-exp.y +++ b/gdb/m2-exp.y @@ -174,6 +174,7 @@ static struct block *modblock=0; %token TYPENAME %token SIZE CAP ORD HIGH ABS MIN_FUNC MAX_FUNC FLOAT_FUNC VAL CHR ODD TRUNC +%token TSIZE %token INC DEC INCL EXCL /* The GDB scope operator */ @@ -288,6 +289,10 @@ exp : TRUNC '(' exp ')' { write_exp_elt_opcode (UNOP_TRUNC); } ; +exp : TSIZE '(' exp ')' + { write_exp_elt_opcode (UNOP_SIZEOF); } + ; + exp : SIZE exp %prec UNARY { write_exp_elt_opcode (UNOP_SIZEOF); } ; @@ -353,6 +358,10 @@ exp : exp '[' write_exp_elt_opcode (MULTI_SUBSCRIPT); } ; +exp : exp '[' exp ']' + { write_exp_elt_opcode (BINOP_SUBSCRIPT); } + ; + exp : exp '(' /* This is to save the value of arglist_len being accumulated by an outer function call. */ @@ -809,6 +818,7 @@ static struct keyword keytab[] = {"SIZE", SIZE }, {"FLOAT", FLOAT_FUNC }, {"TRUNC", TRUNC }, + {"TSIZE", SIZE }, }; -- cgit v1.1