summaryrefslogtreecommitdiff
path: root/gdb/jv-exp.y
diff options
context:
space:
mode:
authorUlrich Weigand <uweigand@de.ibm.com>2009-07-02 12:09:27 +0000
committerUlrich Weigand <uweigand@de.ibm.com>2009-07-02 12:09:27 +0000
commita05afb42b7c8c11a08a6f1f75bca25b23e948563 (patch)
tree13ef2222d38b71f47c7a75cdc1188ac99fd6eaac /gdb/jv-exp.y
parent42c472625ec6b9cb657fb91be333b34829793d91 (diff)
downloadgdb-a05afb42b7c8c11a08a6f1f75bca25b23e948563.tar.gz
* jv-lang.h (java_int_type, java_byte_type, java_short_type,
java_long_type, java_boolean_type, java_char_type, java_float_type, java_double_type, java_void_type): Remove. (struct builtin_java_type): New data type. (builtin_java_type): Add prototype. (java_primitive_type): Add GDBARCH argument. (java_primitive_type_from_name): Likewise. (type_from_class): Likewise. * jv-lang.c (java_int_type, java_byte_type, java_short_type, java_long_type, java_boolean_type, java_char_type, java_float_type, java_double_type, java_void_type): Remove. (build_java_types, builtin_java_type): New functions. (java_type_data): New static variable. (_initialize_java_language): Initialize it. No longer initialize global types. (java_language_arch_info): Use per-architecture types. (java_primitive_type): Add GDBARCH argument. Return per-architecture type instead of refering to global variable. (java_primitive_type_from_name): Add GDBARCH argument. (java_primitive_type_name): New function. (java_demangled_signature_length): Use it instead of java_primitive_type_from_name. (java_demangled_signature_copy): Likewise. (type_from_class): Add GDBARCH argument. Pass to java_link_class_type, java_primitive_type, and recursive type_from_class call. (java_link_class_type): Add GDBARCH argument. Pass to type_from_class calls. Use per-architecture types instead of global types. * jv-exp.y (parse_java_type): New define. Use per-architecture types instead of global types througout. * jv-valprint.c (java_value_print): Pass architecture to type_from_class and java_primitive_type_from_name. Use per- architecture types instead of global types.
Diffstat (limited to 'gdb/jv-exp.y')
-rw-r--r--gdb/jv-exp.y33
1 files changed, 17 insertions, 16 deletions
diff --git a/gdb/jv-exp.y b/gdb/jv-exp.y
index 89ec3e94607..f2dfa6a694e 100644
--- a/gdb/jv-exp.y
+++ b/gdb/jv-exp.y
@@ -50,6 +50,7 @@
#include "block.h"
#define parse_type builtin_type (parse_gdbarch)
+#define parse_java_type builtin_java_type (parse_gdbarch)
/* Remap normal yacc parser interface names (yyparse, yylex, yyerror, etc),
as well as gratuitiously global symbol names, so we can have multiple
@@ -249,7 +250,7 @@ Literal:
write_exp_elt_opcode (OP_DOUBLE); }
| BOOLEAN_LITERAL
{ write_exp_elt_opcode (OP_LONG);
- write_exp_elt_type (java_boolean_type);
+ write_exp_elt_type (parse_java_type->builtin_boolean);
write_exp_elt_longcst ((LONGEST)$1);
write_exp_elt_opcode (OP_LONG); }
| StringLiteral
@@ -265,7 +266,7 @@ Type:
PrimitiveType:
NumericType
| BOOLEAN
- { $$ = java_boolean_type; }
+ { $$ = parse_java_type->builtin_boolean; }
;
NumericType:
@@ -275,22 +276,22 @@ NumericType:
IntegralType:
BYTE
- { $$ = java_byte_type; }
+ { $$ = parse_java_type->builtin_byte; }
| SHORT
- { $$ = java_short_type; }
+ { $$ = parse_java_type->builtin_short; }
| INT
- { $$ = java_int_type; }
+ { $$ = parse_java_type->builtin_int; }
| LONG
- { $$ = java_long_type; }
+ { $$ = parse_java_type->builtin_long; }
| CHAR
- { $$ = java_char_type; }
+ { $$ = parse_java_type->builtin_char; }
;
FloatingPointType:
FLOAT
- { $$ = java_float_type; }
+ { $$ = parse_java_type->builtin_float; }
| DOUBLE
- { $$ = java_double_type; }
+ { $$ = parse_java_type->builtin_double; }
;
/* UNUSED:
@@ -765,12 +766,12 @@ parse_number (char *p, int len, int parsed_float, YYSTYPE *putithere)
limit = ((limit << 16) << 16) | limit;
if (c == 'l' || c == 'L')
{
- type = java_long_type;
+ type = parse_java_type->builtin_long;
len--;
}
else
{
- type = java_int_type;
+ type = parse_java_type->builtin_int;
}
limit_div_base = limit / (ULONGEST) base;
@@ -795,10 +796,10 @@ parse_number (char *p, int len, int parsed_float, YYSTYPE *putithere)
/* If the type is bigger than a 32-bit signed integer can be, implicitly
promote to long. Java does not do this, so mark it as builtin_type_uint64
- rather than java_long_type. 0x80000000 will become -0x80000000 instead
- of 0x80000000L, because we don't know the sign at this point.
- */
- if (type == java_int_type && n > (ULONGEST)0x80000000)
+ rather than parse_java_type->builtin_long. 0x80000000 will become
+ -0x80000000 instead of 0x80000000L, because we don't know the sign
+ at this point. */
+ if (type == parse_java_type->builtin_int && n > (ULONGEST)0x80000000)
type = builtin_type_uint64;
putithere->typed_val_int.val = n;
@@ -902,7 +903,7 @@ yylex (void)
error (_("Empty character constant"));
yylval.typed_val_int.val = c;
- yylval.typed_val_int.type = java_char_type;
+ yylval.typed_val_int.type = parse_java_type->builtin_char;
c = *lexptr++;
if (c != '\'')