aboutsummaryrefslogtreecommitdiff
path: root/gdb/c-exp.y
diff options
context:
space:
mode:
authorFred Fish <fnf@specifix.com>1993-01-19 23:00:19 +0000
committerFred Fish <fnf@specifix.com>1993-01-19 23:00:19 +0000
commitec16f7015b91a7324011b41f6a13dfab0fd5d21a (patch)
treee7f4babdb56207372200a6e11c3f46b4bbcacb97 /gdb/c-exp.y
parentfa2b89f1032989451742a5a75bcdec34736f903a (diff)
downloadgdb-ec16f7015b91a7324011b41f6a13dfab0fd5d21a.zip
gdb-ec16f7015b91a7324011b41f6a13dfab0fd5d21a.tar.gz
gdb-ec16f7015b91a7324011b41f6a13dfab0fd5d21a.tar.bz2
* c-exp.y (exp): Add production to support direct creation
of array constants using the obvious syntax. * c-valprint.c (c_val_print): Set printed string length. * dwarfread.c (read_tag_string_type): New prototype and function that handles TAG_string_type DIEs. * dwarfread.c (process_dies): Add case for TAG_string_type that calls new read_tag_string_type function. * expprint.c (print_subexp): Add support for OP_ARRAY. * gdbtypes.c (create_range_type, create_array_type): Inherit objfile from the index type. **** start-sanitize-chill **** * ch-typeprint.c (chill_print_type): Add case for TYPE_CODE_STRING. * ch-valprint.c (chill_val_print): Fix case for TYPE_CODE_STRING. **** end-sanitize-chill ****
Diffstat (limited to 'gdb/c-exp.y')
-rw-r--r--gdb/c-exp.y11
1 files changed, 11 insertions, 0 deletions
diff --git a/gdb/c-exp.y b/gdb/c-exp.y
index bca3d6d..a7f7320 100644
--- a/gdb/c-exp.y
+++ b/gdb/c-exp.y
@@ -318,6 +318,17 @@ arglist : arglist ',' exp %prec ABOVE_COMMA
{ arglist_len++; }
;
+exp : '{'
+ /* This is to save the value of arglist_len
+ being accumulated by an outer function call. */
+ { start_arglist (); }
+ arglist '}' %prec ARROW
+ { write_exp_elt_opcode (OP_ARRAY);
+ write_exp_elt_longcst ((LONGEST) 0);
+ write_exp_elt_longcst ((LONGEST) end_arglist () - 1);
+ write_exp_elt_opcode (OP_ARRAY); }
+ ;
+
exp : '{' type '}' exp %prec UNARY
{ write_exp_elt_opcode (UNOP_MEMVAL);
write_exp_elt_type ($2);