From 58cda66eeb172461c8b9361b20311448a6384983 Mon Sep 17 00:00:00 2001 From: Per Bothner Date: Wed, 30 Mar 1994 06:59:16 +0000 Subject: [PATCH] * ch-exp.y: Implement SIZE(mode_name) and SIZE(expression). --- gdb/ChangeLog | 2 ++ gdb/ch-exp.y | 17 ++++++++--------- 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index b4fbf953bd4..fa579700351 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,5 +1,7 @@ Tue Mar 29 21:14:04 1994 Per Bothner (bothner@kalessin.cygnus.com) + * ch-exp.y: Implement SIZE(mode_name) and SIZE(expression). + * ch-lang.c (chill_is_varying_struct): Magic string is was "" is now "__var_length" (more portable). diff --git a/gdb/ch-exp.y b/gdb/ch-exp.y index e8188038394..cb6aa1824be 100644 --- a/gdb/ch-exp.y +++ b/gdb/ch-exp.y @@ -295,7 +295,7 @@ yyerror PARAMS ((char *)); %type lower_element %type upper_element %type first_element -%type mode_argument +%type mode_argument %type upper_lower_argument %type length_argument %type array_mode_name @@ -903,14 +903,13 @@ chill_value_built_in_routine_call : { $$ = 0; /* FIXME */ } - | SIZE '(' location ')' - { - $$ = 0; /* FIXME */ - } + | SIZE '(' expression ')' + { write_exp_elt_opcode (UNOP_SIZEOF); } | SIZE '(' mode_argument ')' - { - $$ = 0; /* FIXME */ - } + { write_exp_elt_opcode (OP_LONG); + write_exp_elt_type (builtin_type_int); + write_exp_elt_longcst ((LONGEST) TYPE_LENGTH ($3)); + write_exp_elt_opcode (OP_LONG); } | UPPER '(' upper_lower_argument ')' { $$ = 0; /* FIXME */ @@ -927,7 +926,7 @@ chill_value_built_in_routine_call : mode_argument : mode_name { - $$ = 0; /* FIXME */ + $$ = $1.type; } | array_mode_name '(' expression ')' { -- 2.30.2