mirror of
https://github.com/espressif/binutils-gdb.git
synced 2025-09-27 17:37:36 +08:00
Turn parse_gdbarch into a method
This changes parse_gdbarch into a method of parser_state. This patch was written by a script. gdb/ChangeLog 2019-04-04 Tom Tromey <tom@tromey.com> * rust-exp.y: Replace "parse_gdbarch" with method call. * parse.c (write_dollar_variable, insert_type_address_space): Replace "parse_gdbarch" with method call. * p-exp.y (parse_type, yylex): Replace "parse_gdbarch" with method call. * objc-lang.c (end_msglist): Replace "parse_gdbarch" with method call. * m2-exp.y (parse_type, parse_m2_type, yylex): Replace "parse_gdbarch" with method call. * go-exp.y (parse_type, classify_name): Replace "parse_gdbarch" with method call. * f-exp.y (parse_type, parse_f_type, yylex): Replace "parse_gdbarch" with method call. * d-exp.y (parse_type, parse_d_type, lex_one_token): Replace "parse_gdbarch" with method call. * c-exp.y (parse_type, parse_number, classify_name): Replace "parse_gdbarch" with method call. * ada-lex.l: Replace "parse_gdbarch" with method call. * ada-exp.y (parse_type, find_primitive_type, type_char) (type_system_address): Replace "parse_gdbarch" with method call.
This commit is contained in:
@ -1,3 +1,26 @@
|
|||||||
|
2019-04-04 Tom Tromey <tom@tromey.com>
|
||||||
|
|
||||||
|
* rust-exp.y: Replace "parse_gdbarch" with method call.
|
||||||
|
* parse.c (write_dollar_variable, insert_type_address_space):
|
||||||
|
Replace "parse_gdbarch" with method call.
|
||||||
|
* p-exp.y (parse_type, yylex): Replace "parse_gdbarch" with method
|
||||||
|
call.
|
||||||
|
* objc-lang.c (end_msglist): Replace "parse_gdbarch" with method
|
||||||
|
call.
|
||||||
|
* m2-exp.y (parse_type, parse_m2_type, yylex): Replace
|
||||||
|
"parse_gdbarch" with method call.
|
||||||
|
* go-exp.y (parse_type, classify_name): Replace "parse_gdbarch"
|
||||||
|
with method call.
|
||||||
|
* f-exp.y (parse_type, parse_f_type, yylex): Replace
|
||||||
|
"parse_gdbarch" with method call.
|
||||||
|
* d-exp.y (parse_type, parse_d_type, lex_one_token): Replace
|
||||||
|
"parse_gdbarch" with method call.
|
||||||
|
* c-exp.y (parse_type, parse_number, classify_name): Replace
|
||||||
|
"parse_gdbarch" with method call.
|
||||||
|
* ada-lex.l: Replace "parse_gdbarch" with method call.
|
||||||
|
* ada-exp.y (parse_type, find_primitive_type, type_char)
|
||||||
|
(type_system_address): Replace "parse_gdbarch" with method call.
|
||||||
|
|
||||||
2019-04-04 Tom Tromey <tom@tromey.com>
|
2019-04-04 Tom Tromey <tom@tromey.com>
|
||||||
|
|
||||||
* dtrace-probe.c (dtrace_probe::build_arg_exprs): Update.
|
* dtrace-probe.c (dtrace_probe::build_arg_exprs): Update.
|
||||||
|
@ -48,7 +48,7 @@
|
|||||||
#include "frame.h"
|
#include "frame.h"
|
||||||
#include "block.h"
|
#include "block.h"
|
||||||
|
|
||||||
#define parse_type(ps) builtin_type (parse_gdbarch (ps))
|
#define parse_type(ps) builtin_type (ps->gdbarch ())
|
||||||
|
|
||||||
/* Remap normal yacc parser interface names (yyparse, yylex, yyerror,
|
/* Remap normal yacc parser interface names (yyparse, yylex, yyerror,
|
||||||
etc). */
|
etc). */
|
||||||
@ -1028,7 +1028,7 @@ find_primitive_type (struct parser_state *par_state, char *name)
|
|||||||
{
|
{
|
||||||
struct type *type;
|
struct type *type;
|
||||||
type = language_lookup_primitive_type (parse_language (par_state),
|
type = language_lookup_primitive_type (parse_language (par_state),
|
||||||
parse_gdbarch (par_state),
|
par_state->gdbarch (),
|
||||||
name);
|
name);
|
||||||
if (type == NULL && strcmp ("system__address", name) == 0)
|
if (type == NULL && strcmp ("system__address", name) == 0)
|
||||||
type = type_system_address (par_state);
|
type = type_system_address (par_state);
|
||||||
@ -1443,7 +1443,7 @@ static struct type *
|
|||||||
type_char (struct parser_state *par_state)
|
type_char (struct parser_state *par_state)
|
||||||
{
|
{
|
||||||
return language_string_char_type (parse_language (par_state),
|
return language_string_char_type (parse_language (par_state),
|
||||||
parse_gdbarch (par_state));
|
par_state->gdbarch ());
|
||||||
}
|
}
|
||||||
|
|
||||||
static struct type *
|
static struct type *
|
||||||
@ -1457,7 +1457,7 @@ type_system_address (struct parser_state *par_state)
|
|||||||
{
|
{
|
||||||
struct type *type
|
struct type *type
|
||||||
= language_lookup_primitive_type (parse_language (par_state),
|
= language_lookup_primitive_type (parse_language (par_state),
|
||||||
parse_gdbarch (par_state),
|
par_state->gdbarch (),
|
||||||
"system__address");
|
"system__address");
|
||||||
return type != NULL ? type : parse_type (par_state)->builtin_data_ptr;
|
return type != NULL ? type : parse_type (par_state)->builtin_data_ptr;
|
||||||
}
|
}
|
||||||
|
@ -370,11 +370,11 @@ processInt (struct parser_state *par_state, const char *base0,
|
|||||||
exp -= 1;
|
exp -= 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((result >> (gdbarch_int_bit (parse_gdbarch (par_state))-1)) == 0)
|
if ((result >> (gdbarch_int_bit (par_state->gdbarch ())-1)) == 0)
|
||||||
yylval.typed_val.type = type_int (par_state);
|
yylval.typed_val.type = type_int (par_state);
|
||||||
else if ((result >> (gdbarch_long_bit (parse_gdbarch (par_state))-1)) == 0)
|
else if ((result >> (gdbarch_long_bit (par_state->gdbarch ())-1)) == 0)
|
||||||
yylval.typed_val.type = type_long (par_state);
|
yylval.typed_val.type = type_long (par_state);
|
||||||
else if (((result >> (gdbarch_long_bit (parse_gdbarch (par_state))-1)) >> 1) == 0)
|
else if (((result >> (gdbarch_long_bit (par_state->gdbarch ())-1)) >> 1) == 0)
|
||||||
{
|
{
|
||||||
/* We have a number representable as an unsigned integer quantity.
|
/* We have a number representable as an unsigned integer quantity.
|
||||||
For consistency with the C treatment, we will treat it as an
|
For consistency with the C treatment, we will treat it as an
|
||||||
@ -384,7 +384,7 @@ processInt (struct parser_state *par_state, const char *base0,
|
|||||||
assignment does the trick (no, it doesn't; read the reference manual).
|
assignment does the trick (no, it doesn't; read the reference manual).
|
||||||
*/
|
*/
|
||||||
yylval.typed_val.type
|
yylval.typed_val.type
|
||||||
= builtin_type (parse_gdbarch (par_state))->builtin_unsigned_long;
|
= builtin_type (par_state->gdbarch ())->builtin_unsigned_long;
|
||||||
if (result & LONGEST_SIGN)
|
if (result & LONGEST_SIGN)
|
||||||
yylval.typed_val.val =
|
yylval.typed_val.val =
|
||||||
(LONGEST) (result & ~LONGEST_SIGN)
|
(LONGEST) (result & ~LONGEST_SIGN)
|
||||||
|
90
gdb/c-exp.y
90
gdb/c-exp.y
@ -54,7 +54,7 @@
|
|||||||
#include "typeprint.h"
|
#include "typeprint.h"
|
||||||
#include "cp-abi.h"
|
#include "cp-abi.h"
|
||||||
|
|
||||||
#define parse_type(ps) builtin_type (parse_gdbarch (ps))
|
#define parse_type(ps) builtin_type (ps->gdbarch ())
|
||||||
|
|
||||||
/* Remap normal yacc parser interface names (yyparse, yylex, yyerror,
|
/* Remap normal yacc parser interface names (yyparse, yylex, yyerror,
|
||||||
etc). */
|
etc). */
|
||||||
@ -470,7 +470,7 @@ exp : OBJC_LBRAC TYPENAME
|
|||||||
{
|
{
|
||||||
CORE_ADDR theclass;
|
CORE_ADDR theclass;
|
||||||
|
|
||||||
theclass = lookup_objc_class (parse_gdbarch (pstate),
|
theclass = lookup_objc_class (pstate->gdbarch (),
|
||||||
copy_name ($2.stoken));
|
copy_name ($2.stoken));
|
||||||
if (theclass == 0)
|
if (theclass == 0)
|
||||||
error (_("%s is not an ObjC Class"),
|
error (_("%s is not an ObjC Class"),
|
||||||
@ -816,7 +816,7 @@ exp : SIZEOF '(' type ')' %prec UNARY
|
|||||||
write_exp_elt_opcode (pstate, OP_LONG);
|
write_exp_elt_opcode (pstate, OP_LONG);
|
||||||
write_exp_elt_type (pstate, lookup_signed_typename
|
write_exp_elt_type (pstate, lookup_signed_typename
|
||||||
(parse_language (pstate),
|
(parse_language (pstate),
|
||||||
parse_gdbarch (pstate),
|
pstate->gdbarch (),
|
||||||
"int"));
|
"int"));
|
||||||
type = check_typedef (type);
|
type = check_typedef (type);
|
||||||
|
|
||||||
@ -1285,117 +1285,117 @@ typebase
|
|||||||
{ $$ = $1.type; }
|
{ $$ = $1.type; }
|
||||||
| INT_KEYWORD
|
| INT_KEYWORD
|
||||||
{ $$ = lookup_signed_typename (parse_language (pstate),
|
{ $$ = lookup_signed_typename (parse_language (pstate),
|
||||||
parse_gdbarch (pstate),
|
pstate->gdbarch (),
|
||||||
"int"); }
|
"int"); }
|
||||||
| LONG
|
| LONG
|
||||||
{ $$ = lookup_signed_typename (parse_language (pstate),
|
{ $$ = lookup_signed_typename (parse_language (pstate),
|
||||||
parse_gdbarch (pstate),
|
pstate->gdbarch (),
|
||||||
"long"); }
|
"long"); }
|
||||||
| SHORT
|
| SHORT
|
||||||
{ $$ = lookup_signed_typename (parse_language (pstate),
|
{ $$ = lookup_signed_typename (parse_language (pstate),
|
||||||
parse_gdbarch (pstate),
|
pstate->gdbarch (),
|
||||||
"short"); }
|
"short"); }
|
||||||
| LONG INT_KEYWORD
|
| LONG INT_KEYWORD
|
||||||
{ $$ = lookup_signed_typename (parse_language (pstate),
|
{ $$ = lookup_signed_typename (parse_language (pstate),
|
||||||
parse_gdbarch (pstate),
|
pstate->gdbarch (),
|
||||||
"long"); }
|
"long"); }
|
||||||
| LONG SIGNED_KEYWORD INT_KEYWORD
|
| LONG SIGNED_KEYWORD INT_KEYWORD
|
||||||
{ $$ = lookup_signed_typename (parse_language (pstate),
|
{ $$ = lookup_signed_typename (parse_language (pstate),
|
||||||
parse_gdbarch (pstate),
|
pstate->gdbarch (),
|
||||||
"long"); }
|
"long"); }
|
||||||
| LONG SIGNED_KEYWORD
|
| LONG SIGNED_KEYWORD
|
||||||
{ $$ = lookup_signed_typename (parse_language (pstate),
|
{ $$ = lookup_signed_typename (parse_language (pstate),
|
||||||
parse_gdbarch (pstate),
|
pstate->gdbarch (),
|
||||||
"long"); }
|
"long"); }
|
||||||
| SIGNED_KEYWORD LONG INT_KEYWORD
|
| SIGNED_KEYWORD LONG INT_KEYWORD
|
||||||
{ $$ = lookup_signed_typename (parse_language (pstate),
|
{ $$ = lookup_signed_typename (parse_language (pstate),
|
||||||
parse_gdbarch (pstate),
|
pstate->gdbarch (),
|
||||||
"long"); }
|
"long"); }
|
||||||
| UNSIGNED LONG INT_KEYWORD
|
| UNSIGNED LONG INT_KEYWORD
|
||||||
{ $$ = lookup_unsigned_typename (parse_language (pstate),
|
{ $$ = lookup_unsigned_typename (parse_language (pstate),
|
||||||
parse_gdbarch (pstate),
|
pstate->gdbarch (),
|
||||||
"long"); }
|
"long"); }
|
||||||
| LONG UNSIGNED INT_KEYWORD
|
| LONG UNSIGNED INT_KEYWORD
|
||||||
{ $$ = lookup_unsigned_typename (parse_language (pstate),
|
{ $$ = lookup_unsigned_typename (parse_language (pstate),
|
||||||
parse_gdbarch (pstate),
|
pstate->gdbarch (),
|
||||||
"long"); }
|
"long"); }
|
||||||
| LONG UNSIGNED
|
| LONG UNSIGNED
|
||||||
{ $$ = lookup_unsigned_typename (parse_language (pstate),
|
{ $$ = lookup_unsigned_typename (parse_language (pstate),
|
||||||
parse_gdbarch (pstate),
|
pstate->gdbarch (),
|
||||||
"long"); }
|
"long"); }
|
||||||
| LONG LONG
|
| LONG LONG
|
||||||
{ $$ = lookup_signed_typename (parse_language (pstate),
|
{ $$ = lookup_signed_typename (parse_language (pstate),
|
||||||
parse_gdbarch (pstate),
|
pstate->gdbarch (),
|
||||||
"long long"); }
|
"long long"); }
|
||||||
| LONG LONG INT_KEYWORD
|
| LONG LONG INT_KEYWORD
|
||||||
{ $$ = lookup_signed_typename (parse_language (pstate),
|
{ $$ = lookup_signed_typename (parse_language (pstate),
|
||||||
parse_gdbarch (pstate),
|
pstate->gdbarch (),
|
||||||
"long long"); }
|
"long long"); }
|
||||||
| LONG LONG SIGNED_KEYWORD INT_KEYWORD
|
| LONG LONG SIGNED_KEYWORD INT_KEYWORD
|
||||||
{ $$ = lookup_signed_typename (parse_language (pstate),
|
{ $$ = lookup_signed_typename (parse_language (pstate),
|
||||||
parse_gdbarch (pstate),
|
pstate->gdbarch (),
|
||||||
"long long"); }
|
"long long"); }
|
||||||
| LONG LONG SIGNED_KEYWORD
|
| LONG LONG SIGNED_KEYWORD
|
||||||
{ $$ = lookup_signed_typename (parse_language (pstate),
|
{ $$ = lookup_signed_typename (parse_language (pstate),
|
||||||
parse_gdbarch (pstate),
|
pstate->gdbarch (),
|
||||||
"long long"); }
|
"long long"); }
|
||||||
| SIGNED_KEYWORD LONG LONG
|
| SIGNED_KEYWORD LONG LONG
|
||||||
{ $$ = lookup_signed_typename (parse_language (pstate),
|
{ $$ = lookup_signed_typename (parse_language (pstate),
|
||||||
parse_gdbarch (pstate),
|
pstate->gdbarch (),
|
||||||
"long long"); }
|
"long long"); }
|
||||||
| SIGNED_KEYWORD LONG LONG INT_KEYWORD
|
| SIGNED_KEYWORD LONG LONG INT_KEYWORD
|
||||||
{ $$ = lookup_signed_typename (parse_language (pstate),
|
{ $$ = lookup_signed_typename (parse_language (pstate),
|
||||||
parse_gdbarch (pstate),
|
pstate->gdbarch (),
|
||||||
"long long"); }
|
"long long"); }
|
||||||
| UNSIGNED LONG LONG
|
| UNSIGNED LONG LONG
|
||||||
{ $$ = lookup_unsigned_typename (parse_language (pstate),
|
{ $$ = lookup_unsigned_typename (parse_language (pstate),
|
||||||
parse_gdbarch (pstate),
|
pstate->gdbarch (),
|
||||||
"long long"); }
|
"long long"); }
|
||||||
| UNSIGNED LONG LONG INT_KEYWORD
|
| UNSIGNED LONG LONG INT_KEYWORD
|
||||||
{ $$ = lookup_unsigned_typename (parse_language (pstate),
|
{ $$ = lookup_unsigned_typename (parse_language (pstate),
|
||||||
parse_gdbarch (pstate),
|
pstate->gdbarch (),
|
||||||
"long long"); }
|
"long long"); }
|
||||||
| LONG LONG UNSIGNED
|
| LONG LONG UNSIGNED
|
||||||
{ $$ = lookup_unsigned_typename (parse_language (pstate),
|
{ $$ = lookup_unsigned_typename (parse_language (pstate),
|
||||||
parse_gdbarch (pstate),
|
pstate->gdbarch (),
|
||||||
"long long"); }
|
"long long"); }
|
||||||
| LONG LONG UNSIGNED INT_KEYWORD
|
| LONG LONG UNSIGNED INT_KEYWORD
|
||||||
{ $$ = lookup_unsigned_typename (parse_language (pstate),
|
{ $$ = lookup_unsigned_typename (parse_language (pstate),
|
||||||
parse_gdbarch (pstate),
|
pstate->gdbarch (),
|
||||||
"long long"); }
|
"long long"); }
|
||||||
| SHORT INT_KEYWORD
|
| SHORT INT_KEYWORD
|
||||||
{ $$ = lookup_signed_typename (parse_language (pstate),
|
{ $$ = lookup_signed_typename (parse_language (pstate),
|
||||||
parse_gdbarch (pstate),
|
pstate->gdbarch (),
|
||||||
"short"); }
|
"short"); }
|
||||||
| SHORT SIGNED_KEYWORD INT_KEYWORD
|
| SHORT SIGNED_KEYWORD INT_KEYWORD
|
||||||
{ $$ = lookup_signed_typename (parse_language (pstate),
|
{ $$ = lookup_signed_typename (parse_language (pstate),
|
||||||
parse_gdbarch (pstate),
|
pstate->gdbarch (),
|
||||||
"short"); }
|
"short"); }
|
||||||
| SHORT SIGNED_KEYWORD
|
| SHORT SIGNED_KEYWORD
|
||||||
{ $$ = lookup_signed_typename (parse_language (pstate),
|
{ $$ = lookup_signed_typename (parse_language (pstate),
|
||||||
parse_gdbarch (pstate),
|
pstate->gdbarch (),
|
||||||
"short"); }
|
"short"); }
|
||||||
| UNSIGNED SHORT INT_KEYWORD
|
| UNSIGNED SHORT INT_KEYWORD
|
||||||
{ $$ = lookup_unsigned_typename (parse_language (pstate),
|
{ $$ = lookup_unsigned_typename (parse_language (pstate),
|
||||||
parse_gdbarch (pstate),
|
pstate->gdbarch (),
|
||||||
"short"); }
|
"short"); }
|
||||||
| SHORT UNSIGNED
|
| SHORT UNSIGNED
|
||||||
{ $$ = lookup_unsigned_typename (parse_language (pstate),
|
{ $$ = lookup_unsigned_typename (parse_language (pstate),
|
||||||
parse_gdbarch (pstate),
|
pstate->gdbarch (),
|
||||||
"short"); }
|
"short"); }
|
||||||
| SHORT UNSIGNED INT_KEYWORD
|
| SHORT UNSIGNED INT_KEYWORD
|
||||||
{ $$ = lookup_unsigned_typename (parse_language (pstate),
|
{ $$ = lookup_unsigned_typename (parse_language (pstate),
|
||||||
parse_gdbarch (pstate),
|
pstate->gdbarch (),
|
||||||
"short"); }
|
"short"); }
|
||||||
| DOUBLE_KEYWORD
|
| DOUBLE_KEYWORD
|
||||||
{ $$ = lookup_typename (parse_language (pstate),
|
{ $$ = lookup_typename (parse_language (pstate),
|
||||||
parse_gdbarch (pstate),
|
pstate->gdbarch (),
|
||||||
"double",
|
"double",
|
||||||
NULL,
|
NULL,
|
||||||
0); }
|
0); }
|
||||||
| LONG DOUBLE_KEYWORD
|
| LONG DOUBLE_KEYWORD
|
||||||
{ $$ = lookup_typename (parse_language (pstate),
|
{ $$ = lookup_typename (parse_language (pstate),
|
||||||
parse_gdbarch (pstate),
|
pstate->gdbarch (),
|
||||||
"long double",
|
"long double",
|
||||||
NULL,
|
NULL,
|
||||||
0); }
|
0); }
|
||||||
@ -1457,19 +1457,19 @@ typebase
|
|||||||
}
|
}
|
||||||
| UNSIGNED type_name
|
| UNSIGNED type_name
|
||||||
{ $$ = lookup_unsigned_typename (parse_language (pstate),
|
{ $$ = lookup_unsigned_typename (parse_language (pstate),
|
||||||
parse_gdbarch (pstate),
|
pstate->gdbarch (),
|
||||||
TYPE_NAME($2.type)); }
|
TYPE_NAME($2.type)); }
|
||||||
| UNSIGNED
|
| UNSIGNED
|
||||||
{ $$ = lookup_unsigned_typename (parse_language (pstate),
|
{ $$ = lookup_unsigned_typename (parse_language (pstate),
|
||||||
parse_gdbarch (pstate),
|
pstate->gdbarch (),
|
||||||
"int"); }
|
"int"); }
|
||||||
| SIGNED_KEYWORD type_name
|
| SIGNED_KEYWORD type_name
|
||||||
{ $$ = lookup_signed_typename (parse_language (pstate),
|
{ $$ = lookup_signed_typename (parse_language (pstate),
|
||||||
parse_gdbarch (pstate),
|
pstate->gdbarch (),
|
||||||
TYPE_NAME($2.type)); }
|
TYPE_NAME($2.type)); }
|
||||||
| SIGNED_KEYWORD
|
| SIGNED_KEYWORD
|
||||||
{ $$ = lookup_signed_typename (parse_language (pstate),
|
{ $$ = lookup_signed_typename (parse_language (pstate),
|
||||||
parse_gdbarch (pstate),
|
pstate->gdbarch (),
|
||||||
"int"); }
|
"int"); }
|
||||||
/* It appears that this rule for templates is never
|
/* It appears that this rule for templates is never
|
||||||
reduced; template recognition happens by lookahead
|
reduced; template recognition happens by lookahead
|
||||||
@ -1490,7 +1490,7 @@ type_name: TYPENAME
|
|||||||
$$.stoken.ptr = "int";
|
$$.stoken.ptr = "int";
|
||||||
$$.stoken.length = 3;
|
$$.stoken.length = 3;
|
||||||
$$.type = lookup_signed_typename (parse_language (pstate),
|
$$.type = lookup_signed_typename (parse_language (pstate),
|
||||||
parse_gdbarch (pstate),
|
pstate->gdbarch (),
|
||||||
"int");
|
"int");
|
||||||
}
|
}
|
||||||
| LONG
|
| LONG
|
||||||
@ -1498,7 +1498,7 @@ type_name: TYPENAME
|
|||||||
$$.stoken.ptr = "long";
|
$$.stoken.ptr = "long";
|
||||||
$$.stoken.length = 4;
|
$$.stoken.length = 4;
|
||||||
$$.type = lookup_signed_typename (parse_language (pstate),
|
$$.type = lookup_signed_typename (parse_language (pstate),
|
||||||
parse_gdbarch (pstate),
|
pstate->gdbarch (),
|
||||||
"long");
|
"long");
|
||||||
}
|
}
|
||||||
| SHORT
|
| SHORT
|
||||||
@ -1506,7 +1506,7 @@ type_name: TYPENAME
|
|||||||
$$.stoken.ptr = "short";
|
$$.stoken.ptr = "short";
|
||||||
$$.stoken.length = 5;
|
$$.stoken.length = 5;
|
||||||
$$.type = lookup_signed_typename (parse_language (pstate),
|
$$.type = lookup_signed_typename (parse_language (pstate),
|
||||||
parse_gdbarch (pstate),
|
pstate->gdbarch (),
|
||||||
"short");
|
"short");
|
||||||
}
|
}
|
||||||
;
|
;
|
||||||
@ -2021,10 +2021,10 @@ parse_number (struct parser_state *par_state,
|
|||||||
|
|
||||||
un = n >> 2;
|
un = n >> 2;
|
||||||
if (long_p == 0
|
if (long_p == 0
|
||||||
&& (un >> (gdbarch_int_bit (parse_gdbarch (par_state)) - 2)) == 0)
|
&& (un >> (gdbarch_int_bit (par_state->gdbarch ()) - 2)) == 0)
|
||||||
{
|
{
|
||||||
high_bit
|
high_bit
|
||||||
= ((ULONGEST)1) << (gdbarch_int_bit (parse_gdbarch (par_state)) - 1);
|
= ((ULONGEST)1) << (gdbarch_int_bit (par_state->gdbarch ()) - 1);
|
||||||
|
|
||||||
/* A large decimal (not hex or octal) constant (between INT_MAX
|
/* A large decimal (not hex or octal) constant (between INT_MAX
|
||||||
and UINT_MAX) is a long or unsigned long, according to ANSI,
|
and UINT_MAX) is a long or unsigned long, according to ANSI,
|
||||||
@ -2036,10 +2036,10 @@ parse_number (struct parser_state *par_state,
|
|||||||
signed_type = parse_type (par_state)->builtin_int;
|
signed_type = parse_type (par_state)->builtin_int;
|
||||||
}
|
}
|
||||||
else if (long_p <= 1
|
else if (long_p <= 1
|
||||||
&& (un >> (gdbarch_long_bit (parse_gdbarch (par_state)) - 2)) == 0)
|
&& (un >> (gdbarch_long_bit (par_state->gdbarch ()) - 2)) == 0)
|
||||||
{
|
{
|
||||||
high_bit
|
high_bit
|
||||||
= ((ULONGEST)1) << (gdbarch_long_bit (parse_gdbarch (par_state)) - 1);
|
= ((ULONGEST)1) << (gdbarch_long_bit (par_state->gdbarch ()) - 1);
|
||||||
unsigned_type = parse_type (par_state)->builtin_unsigned_long;
|
unsigned_type = parse_type (par_state)->builtin_unsigned_long;
|
||||||
signed_type = parse_type (par_state)->builtin_long;
|
signed_type = parse_type (par_state)->builtin_long;
|
||||||
}
|
}
|
||||||
@ -2047,11 +2047,11 @@ parse_number (struct parser_state *par_state,
|
|||||||
{
|
{
|
||||||
int shift;
|
int shift;
|
||||||
if (sizeof (ULONGEST) * HOST_CHAR_BIT
|
if (sizeof (ULONGEST) * HOST_CHAR_BIT
|
||||||
< gdbarch_long_long_bit (parse_gdbarch (par_state)))
|
< gdbarch_long_long_bit (par_state->gdbarch ()))
|
||||||
/* A long long does not fit in a LONGEST. */
|
/* A long long does not fit in a LONGEST. */
|
||||||
shift = (sizeof (ULONGEST) * HOST_CHAR_BIT - 1);
|
shift = (sizeof (ULONGEST) * HOST_CHAR_BIT - 1);
|
||||||
else
|
else
|
||||||
shift = (gdbarch_long_long_bit (parse_gdbarch (par_state)) - 1);
|
shift = (gdbarch_long_long_bit (par_state->gdbarch ()) - 1);
|
||||||
high_bit = (ULONGEST) 1 << shift;
|
high_bit = (ULONGEST) 1 << shift;
|
||||||
unsigned_type = parse_type (par_state)->builtin_unsigned_long_long;
|
unsigned_type = parse_type (par_state)->builtin_unsigned_long_long;
|
||||||
signed_type = parse_type (par_state)->builtin_long_long;
|
signed_type = parse_type (par_state)->builtin_long_long;
|
||||||
@ -3001,7 +3001,7 @@ classify_name (struct parser_state *par_state, const struct block *block,
|
|||||||
/* See if it's an ObjC classname. */
|
/* See if it's an ObjC classname. */
|
||||||
if (parse_language (par_state)->la_language == language_objc && !bsym.symbol)
|
if (parse_language (par_state)->la_language == language_objc && !bsym.symbol)
|
||||||
{
|
{
|
||||||
CORE_ADDR Class = lookup_objc_class (parse_gdbarch (par_state), copy);
|
CORE_ADDR Class = lookup_objc_class (par_state->gdbarch (), copy);
|
||||||
if (Class)
|
if (Class)
|
||||||
{
|
{
|
||||||
struct symbol *sym;
|
struct symbol *sym;
|
||||||
|
@ -52,8 +52,8 @@
|
|||||||
#include "charset.h"
|
#include "charset.h"
|
||||||
#include "block.h"
|
#include "block.h"
|
||||||
|
|
||||||
#define parse_type(ps) builtin_type (parse_gdbarch (ps))
|
#define parse_type(ps) builtin_type (ps->gdbarch ())
|
||||||
#define parse_d_type(ps) builtin_d_type (parse_gdbarch (ps))
|
#define parse_d_type(ps) builtin_d_type (ps->gdbarch ())
|
||||||
|
|
||||||
/* Remap normal yacc parser interface names (yyparse, yylex, yyerror,
|
/* Remap normal yacc parser interface names (yyparse, yylex, yyerror,
|
||||||
etc). */
|
etc). */
|
||||||
@ -1289,7 +1289,7 @@ lex_one_token (struct parser_state *par_state)
|
|||||||
|
|
||||||
yylval.tsym.type
|
yylval.tsym.type
|
||||||
= language_lookup_primitive_type (parse_language (par_state),
|
= language_lookup_primitive_type (parse_language (par_state),
|
||||||
parse_gdbarch (par_state), copy);
|
par_state->gdbarch (), copy);
|
||||||
if (yylval.tsym.type != NULL)
|
if (yylval.tsym.type != NULL)
|
||||||
return TYPENAME;
|
return TYPENAME;
|
||||||
|
|
||||||
|
16
gdb/f-exp.y
16
gdb/f-exp.y
@ -55,8 +55,8 @@
|
|||||||
#include <ctype.h>
|
#include <ctype.h>
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
|
|
||||||
#define parse_type(ps) builtin_type (parse_gdbarch (ps))
|
#define parse_type(ps) builtin_type (ps->gdbarch ())
|
||||||
#define parse_f_type(ps) builtin_f_type (parse_gdbarch (ps))
|
#define parse_f_type(ps) builtin_f_type (ps->gdbarch ())
|
||||||
|
|
||||||
/* Remap normal yacc parser interface names (yyparse, yylex, yyerror,
|
/* Remap normal yacc parser interface names (yyparse, yylex, yyerror,
|
||||||
etc). */
|
etc). */
|
||||||
@ -763,22 +763,22 @@ parse_number (struct parser_state *par_state,
|
|||||||
are the same size. So we shift it twice, with fewer bits
|
are the same size. So we shift it twice, with fewer bits
|
||||||
each time, for the same result. */
|
each time, for the same result. */
|
||||||
|
|
||||||
if ((gdbarch_int_bit (parse_gdbarch (par_state))
|
if ((gdbarch_int_bit (par_state->gdbarch ())
|
||||||
!= gdbarch_long_bit (parse_gdbarch (par_state))
|
!= gdbarch_long_bit (par_state->gdbarch ())
|
||||||
&& ((n >> 2)
|
&& ((n >> 2)
|
||||||
>> (gdbarch_int_bit (parse_gdbarch (par_state))-2))) /* Avoid
|
>> (gdbarch_int_bit (par_state->gdbarch ())-2))) /* Avoid
|
||||||
shift warning */
|
shift warning */
|
||||||
|| long_p)
|
|| long_p)
|
||||||
{
|
{
|
||||||
high_bit = ((ULONGEST)1)
|
high_bit = ((ULONGEST)1)
|
||||||
<< (gdbarch_long_bit (parse_gdbarch (par_state))-1);
|
<< (gdbarch_long_bit (par_state->gdbarch ())-1);
|
||||||
unsigned_type = parse_type (par_state)->builtin_unsigned_long;
|
unsigned_type = parse_type (par_state)->builtin_unsigned_long;
|
||||||
signed_type = parse_type (par_state)->builtin_long;
|
signed_type = parse_type (par_state)->builtin_long;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
high_bit =
|
high_bit =
|
||||||
((ULONGEST)1) << (gdbarch_int_bit (parse_gdbarch (par_state)) - 1);
|
((ULONGEST)1) << (gdbarch_int_bit (par_state->gdbarch ()) - 1);
|
||||||
unsigned_type = parse_type (par_state)->builtin_unsigned_int;
|
unsigned_type = parse_type (par_state)->builtin_unsigned_int;
|
||||||
signed_type = parse_type (par_state)->builtin_int;
|
signed_type = parse_type (par_state)->builtin_int;
|
||||||
}
|
}
|
||||||
@ -1291,7 +1291,7 @@ yylex (void)
|
|||||||
|
|
||||||
yylval.tsym.type
|
yylval.tsym.type
|
||||||
= language_lookup_primitive_type (parse_language (pstate),
|
= language_lookup_primitive_type (parse_language (pstate),
|
||||||
parse_gdbarch (pstate), tmp);
|
pstate->gdbarch (), tmp);
|
||||||
if (yylval.tsym.type != NULL)
|
if (yylval.tsym.type != NULL)
|
||||||
return TYPENAME;
|
return TYPENAME;
|
||||||
|
|
||||||
|
20
gdb/go-exp.y
20
gdb/go-exp.y
@ -65,7 +65,7 @@
|
|||||||
#include "charset.h"
|
#include "charset.h"
|
||||||
#include "block.h"
|
#include "block.h"
|
||||||
|
|
||||||
#define parse_type(ps) builtin_type (parse_gdbarch (ps))
|
#define parse_type(ps) builtin_type (ps->gdbarch ())
|
||||||
|
|
||||||
/* Remap normal yacc parser interface names (yyparse, yylex, yyerror,
|
/* Remap normal yacc parser interface names (yyparse, yylex, yyerror,
|
||||||
etc). */
|
etc). */
|
||||||
@ -603,7 +603,7 @@ type /* Implements (approximately): [*] type-specifier */
|
|||||||
expression_context_block); }
|
expression_context_block); }
|
||||||
*/
|
*/
|
||||||
| BYTE_KEYWORD
|
| BYTE_KEYWORD
|
||||||
{ $$ = builtin_go_type (parse_gdbarch (pstate))
|
{ $$ = builtin_go_type (pstate->gdbarch ())
|
||||||
->builtin_uint8; }
|
->builtin_uint8; }
|
||||||
;
|
;
|
||||||
|
|
||||||
@ -664,7 +664,7 @@ parse_number (struct parser_state *par_state,
|
|||||||
if (parsed_float)
|
if (parsed_float)
|
||||||
{
|
{
|
||||||
const struct builtin_go_type *builtin_go_types
|
const struct builtin_go_type *builtin_go_types
|
||||||
= builtin_go_type (parse_gdbarch (par_state));
|
= builtin_go_type (par_state->gdbarch ());
|
||||||
|
|
||||||
/* Handle suffixes: 'f' for float32, 'l' for long double.
|
/* Handle suffixes: 'f' for float32, 'l' for long double.
|
||||||
FIXME: This appears to be an extension -- do we want this? */
|
FIXME: This appears to be an extension -- do we want this? */
|
||||||
@ -803,10 +803,10 @@ parse_number (struct parser_state *par_state,
|
|||||||
|
|
||||||
un = (ULONGEST)n >> 2;
|
un = (ULONGEST)n >> 2;
|
||||||
if (long_p == 0
|
if (long_p == 0
|
||||||
&& (un >> (gdbarch_int_bit (parse_gdbarch (par_state)) - 2)) == 0)
|
&& (un >> (gdbarch_int_bit (par_state->gdbarch ()) - 2)) == 0)
|
||||||
{
|
{
|
||||||
high_bit
|
high_bit
|
||||||
= ((ULONGEST)1) << (gdbarch_int_bit (parse_gdbarch (par_state)) - 1);
|
= ((ULONGEST)1) << (gdbarch_int_bit (par_state->gdbarch ()) - 1);
|
||||||
|
|
||||||
/* A large decimal (not hex or octal) constant (between INT_MAX
|
/* A large decimal (not hex or octal) constant (between INT_MAX
|
||||||
and UINT_MAX) is a long or unsigned long, according to ANSI,
|
and UINT_MAX) is a long or unsigned long, according to ANSI,
|
||||||
@ -818,10 +818,10 @@ parse_number (struct parser_state *par_state,
|
|||||||
signed_type = parse_type (par_state)->builtin_int;
|
signed_type = parse_type (par_state)->builtin_int;
|
||||||
}
|
}
|
||||||
else if (long_p <= 1
|
else if (long_p <= 1
|
||||||
&& (un >> (gdbarch_long_bit (parse_gdbarch (par_state)) - 2)) == 0)
|
&& (un >> (gdbarch_long_bit (par_state->gdbarch ()) - 2)) == 0)
|
||||||
{
|
{
|
||||||
high_bit
|
high_bit
|
||||||
= ((ULONGEST)1) << (gdbarch_long_bit (parse_gdbarch (par_state)) - 1);
|
= ((ULONGEST)1) << (gdbarch_long_bit (par_state->gdbarch ()) - 1);
|
||||||
unsigned_type = parse_type (par_state)->builtin_unsigned_long;
|
unsigned_type = parse_type (par_state)->builtin_unsigned_long;
|
||||||
signed_type = parse_type (par_state)->builtin_long;
|
signed_type = parse_type (par_state)->builtin_long;
|
||||||
}
|
}
|
||||||
@ -829,11 +829,11 @@ parse_number (struct parser_state *par_state,
|
|||||||
{
|
{
|
||||||
int shift;
|
int shift;
|
||||||
if (sizeof (ULONGEST) * HOST_CHAR_BIT
|
if (sizeof (ULONGEST) * HOST_CHAR_BIT
|
||||||
< gdbarch_long_long_bit (parse_gdbarch (par_state)))
|
< gdbarch_long_long_bit (par_state->gdbarch ()))
|
||||||
/* A long long does not fit in a LONGEST. */
|
/* A long long does not fit in a LONGEST. */
|
||||||
shift = (sizeof (ULONGEST) * HOST_CHAR_BIT - 1);
|
shift = (sizeof (ULONGEST) * HOST_CHAR_BIT - 1);
|
||||||
else
|
else
|
||||||
shift = (gdbarch_long_long_bit (parse_gdbarch (par_state)) - 1);
|
shift = (gdbarch_long_long_bit (par_state->gdbarch ()) - 1);
|
||||||
high_bit = (ULONGEST) 1 << shift;
|
high_bit = (ULONGEST) 1 << shift;
|
||||||
unsigned_type = parse_type (par_state)->builtin_unsigned_long_long;
|
unsigned_type = parse_type (par_state)->builtin_unsigned_long_long;
|
||||||
signed_type = parse_type (par_state)->builtin_long_long;
|
signed_type = parse_type (par_state)->builtin_long_long;
|
||||||
@ -1401,7 +1401,7 @@ classify_name (struct parser_state *par_state, const struct block *block)
|
|||||||
|
|
||||||
/* Try primitive types first so they win over bad/weird debug info. */
|
/* Try primitive types first so they win over bad/weird debug info. */
|
||||||
type = language_lookup_primitive_type (parse_language (par_state),
|
type = language_lookup_primitive_type (parse_language (par_state),
|
||||||
parse_gdbarch (par_state),
|
par_state->gdbarch (),
|
||||||
copy);
|
copy);
|
||||||
if (type != NULL)
|
if (type != NULL)
|
||||||
{
|
{
|
||||||
|
@ -48,8 +48,8 @@
|
|||||||
#include "objfiles.h" /* For have_full_symbols and have_partial_symbols */
|
#include "objfiles.h" /* For have_full_symbols and have_partial_symbols */
|
||||||
#include "block.h"
|
#include "block.h"
|
||||||
|
|
||||||
#define parse_type(ps) builtin_type (parse_gdbarch (ps))
|
#define parse_type(ps) builtin_type (ps->gdbarch ())
|
||||||
#define parse_m2_type(ps) builtin_m2_type (parse_gdbarch (ps))
|
#define parse_m2_type(ps) builtin_m2_type (ps->gdbarch ())
|
||||||
|
|
||||||
/* Remap normal yacc parser interface names (yyparse, yylex, yyerror,
|
/* Remap normal yacc parser interface names (yyparse, yylex, yyerror,
|
||||||
etc). */
|
etc). */
|
||||||
@ -597,7 +597,7 @@ variable: NAME
|
|||||||
type
|
type
|
||||||
: TYPENAME
|
: TYPENAME
|
||||||
{ $$ = lookup_typename (parse_language (pstate),
|
{ $$ = lookup_typename (parse_language (pstate),
|
||||||
parse_gdbarch (pstate),
|
pstate->gdbarch (),
|
||||||
copy_name ($1),
|
copy_name ($1),
|
||||||
expression_context_block, 0); }
|
expression_context_block, 0); }
|
||||||
|
|
||||||
@ -968,7 +968,7 @@ yylex (void)
|
|||||||
sym = lookup_symbol (tmp, expression_context_block, VAR_DOMAIN, 0).symbol;
|
sym = lookup_symbol (tmp, expression_context_block, VAR_DOMAIN, 0).symbol;
|
||||||
if (sym && SYMBOL_CLASS (sym) == LOC_BLOCK)
|
if (sym && SYMBOL_CLASS (sym) == LOC_BLOCK)
|
||||||
return BLOCKNAME;
|
return BLOCKNAME;
|
||||||
if (lookup_typename (parse_language (pstate), parse_gdbarch (pstate),
|
if (lookup_typename (parse_language (pstate), pstate->gdbarch (),
|
||||||
copy_name (yylval.sval),
|
copy_name (yylval.sval),
|
||||||
expression_context_block, 1))
|
expression_context_block, 1))
|
||||||
return TYPENAME;
|
return TYPENAME;
|
||||||
|
@ -491,7 +491,7 @@ end_msglist (struct parser_state *ps)
|
|||||||
selname_chain = sel->next;
|
selname_chain = sel->next;
|
||||||
msglist_len = sel->msglist_len;
|
msglist_len = sel->msglist_len;
|
||||||
msglist_sel = sel->msglist_sel;
|
msglist_sel = sel->msglist_sel;
|
||||||
selid = lookup_child_selector (parse_gdbarch (ps), p);
|
selid = lookup_child_selector (ps->gdbarch (), p);
|
||||||
if (!selid)
|
if (!selid)
|
||||||
error (_("Can't find selector \"%s\""), p);
|
error (_("Can't find selector \"%s\""), p);
|
||||||
write_exp_elt_longcst (ps, selid);
|
write_exp_elt_longcst (ps, selid);
|
||||||
|
22
gdb/p-exp.y
22
gdb/p-exp.y
@ -56,7 +56,7 @@
|
|||||||
#include "block.h"
|
#include "block.h"
|
||||||
#include "completer.h"
|
#include "completer.h"
|
||||||
|
|
||||||
#define parse_type(ps) builtin_type (parse_gdbarch (ps))
|
#define parse_type(ps) builtin_type (ps->gdbarch ())
|
||||||
|
|
||||||
/* Remap normal yacc parser interface names (yyparse, yylex, yyerror,
|
/* Remap normal yacc parser interface names (yyparse, yylex, yyerror,
|
||||||
etc). */
|
etc). */
|
||||||
@ -528,7 +528,7 @@ exp : DOLLAR_VARIABLE
|
|||||||
struct value * val, * mark;
|
struct value * val, * mark;
|
||||||
|
|
||||||
mark = value_mark ();
|
mark = value_mark ();
|
||||||
val = value_of_internalvar (parse_gdbarch (pstate),
|
val = value_of_internalvar (pstate->gdbarch (),
|
||||||
intvar);
|
intvar);
|
||||||
current_type = value_type (val);
|
current_type = value_type (val);
|
||||||
value_release_to_mark (mark);
|
value_release_to_mark (mark);
|
||||||
@ -973,10 +973,10 @@ parse_number (struct parser_state *par_state,
|
|||||||
|
|
||||||
un = (ULONGEST)n >> 2;
|
un = (ULONGEST)n >> 2;
|
||||||
if (long_p == 0
|
if (long_p == 0
|
||||||
&& (un >> (gdbarch_int_bit (parse_gdbarch (par_state)) - 2)) == 0)
|
&& (un >> (gdbarch_int_bit (par_state->gdbarch ()) - 2)) == 0)
|
||||||
{
|
{
|
||||||
high_bit
|
high_bit
|
||||||
= ((ULONGEST)1) << (gdbarch_int_bit (parse_gdbarch (par_state)) - 1);
|
= ((ULONGEST)1) << (gdbarch_int_bit (par_state->gdbarch ()) - 1);
|
||||||
|
|
||||||
/* A large decimal (not hex or octal) constant (between INT_MAX
|
/* A large decimal (not hex or octal) constant (between INT_MAX
|
||||||
and UINT_MAX) is a long or unsigned long, according to ANSI,
|
and UINT_MAX) is a long or unsigned long, according to ANSI,
|
||||||
@ -988,10 +988,10 @@ parse_number (struct parser_state *par_state,
|
|||||||
signed_type = parse_type (par_state)->builtin_int;
|
signed_type = parse_type (par_state)->builtin_int;
|
||||||
}
|
}
|
||||||
else if (long_p <= 1
|
else if (long_p <= 1
|
||||||
&& (un >> (gdbarch_long_bit (parse_gdbarch (par_state)) - 2)) == 0)
|
&& (un >> (gdbarch_long_bit (par_state->gdbarch ()) - 2)) == 0)
|
||||||
{
|
{
|
||||||
high_bit
|
high_bit
|
||||||
= ((ULONGEST)1) << (gdbarch_long_bit (parse_gdbarch (par_state)) - 1);
|
= ((ULONGEST)1) << (gdbarch_long_bit (par_state->gdbarch ()) - 1);
|
||||||
unsigned_type = parse_type (par_state)->builtin_unsigned_long;
|
unsigned_type = parse_type (par_state)->builtin_unsigned_long;
|
||||||
signed_type = parse_type (par_state)->builtin_long;
|
signed_type = parse_type (par_state)->builtin_long;
|
||||||
}
|
}
|
||||||
@ -999,11 +999,11 @@ parse_number (struct parser_state *par_state,
|
|||||||
{
|
{
|
||||||
int shift;
|
int shift;
|
||||||
if (sizeof (ULONGEST) * HOST_CHAR_BIT
|
if (sizeof (ULONGEST) * HOST_CHAR_BIT
|
||||||
< gdbarch_long_long_bit (parse_gdbarch (par_state)))
|
< gdbarch_long_long_bit (par_state->gdbarch ()))
|
||||||
/* A long long does not fit in a LONGEST. */
|
/* A long long does not fit in a LONGEST. */
|
||||||
shift = (sizeof (ULONGEST) * HOST_CHAR_BIT - 1);
|
shift = (sizeof (ULONGEST) * HOST_CHAR_BIT - 1);
|
||||||
else
|
else
|
||||||
shift = (gdbarch_long_long_bit (parse_gdbarch (par_state)) - 1);
|
shift = (gdbarch_long_long_bit (par_state->gdbarch ()) - 1);
|
||||||
high_bit = (ULONGEST) 1 << shift;
|
high_bit = (ULONGEST) 1 << shift;
|
||||||
unsigned_type = parse_type (par_state)->builtin_unsigned_long_long;
|
unsigned_type = parse_type (par_state)->builtin_unsigned_long_long;
|
||||||
signed_type = parse_type (par_state)->builtin_long_long;
|
signed_type = parse_type (par_state)->builtin_long_long;
|
||||||
@ -1173,7 +1173,7 @@ yylex (void)
|
|||||||
lexptr++;
|
lexptr++;
|
||||||
c = *lexptr++;
|
c = *lexptr++;
|
||||||
if (c == '\\')
|
if (c == '\\')
|
||||||
c = parse_escape (parse_gdbarch (pstate), &lexptr);
|
c = parse_escape (pstate->gdbarch (), &lexptr);
|
||||||
else if (c == '\'')
|
else if (c == '\'')
|
||||||
error (_("Empty character constant."));
|
error (_("Empty character constant."));
|
||||||
|
|
||||||
@ -1343,7 +1343,7 @@ yylex (void)
|
|||||||
break;
|
break;
|
||||||
case '\\':
|
case '\\':
|
||||||
++tokptr;
|
++tokptr;
|
||||||
c = parse_escape (parse_gdbarch (pstate), &tokptr);
|
c = parse_escape (pstate->gdbarch (), &tokptr);
|
||||||
if (c == -1)
|
if (c == -1)
|
||||||
{
|
{
|
||||||
continue;
|
continue;
|
||||||
@ -1676,7 +1676,7 @@ yylex (void)
|
|||||||
}
|
}
|
||||||
yylval.tsym.type
|
yylval.tsym.type
|
||||||
= language_lookup_primitive_type (parse_language (pstate),
|
= language_lookup_primitive_type (parse_language (pstate),
|
||||||
parse_gdbarch (pstate), tmp);
|
pstate->gdbarch (), tmp);
|
||||||
if (yylval.tsym.type != NULL)
|
if (yylval.tsym.type != NULL)
|
||||||
{
|
{
|
||||||
free (uptokstart);
|
free (uptokstart);
|
||||||
|
@ -631,7 +631,7 @@ write_dollar_variable (struct parser_state *ps, struct stoken str)
|
|||||||
|
|
||||||
/* Handle tokens that refer to machine registers:
|
/* Handle tokens that refer to machine registers:
|
||||||
$ followed by a register name. */
|
$ followed by a register name. */
|
||||||
i = user_reg_map_name_to_regnum (parse_gdbarch (ps),
|
i = user_reg_map_name_to_regnum (ps->gdbarch (),
|
||||||
str.ptr + 1, str.length - 1);
|
str.ptr + 1, str.length - 1);
|
||||||
if (i >= 0)
|
if (i >= 0)
|
||||||
goto handle_register;
|
goto handle_register;
|
||||||
@ -1420,7 +1420,7 @@ insert_type_address_space (struct parser_state *pstate, char *string)
|
|||||||
|
|
||||||
element.piece = tp_space_identifier;
|
element.piece = tp_space_identifier;
|
||||||
insert_into_type_stack (slot, element);
|
insert_into_type_stack (slot, element);
|
||||||
element.int_val = address_space_name_to_int (parse_gdbarch (pstate),
|
element.int_val = address_space_name_to_int (pstate->gdbarch (),
|
||||||
string);
|
string);
|
||||||
insert_into_type_stack (slot, element);
|
insert_into_type_stack (slot, element);
|
||||||
}
|
}
|
||||||
|
@ -32,7 +32,6 @@ struct internalvar;
|
|||||||
|
|
||||||
extern int parser_debug;
|
extern int parser_debug;
|
||||||
|
|
||||||
#define parse_gdbarch(ps) ((ps)->expout->gdbarch)
|
|
||||||
#define parse_language(ps) ((ps)->expout->language_defn)
|
#define parse_language(ps) ((ps)->expout->language_defn)
|
||||||
|
|
||||||
struct parser_state
|
struct parser_state
|
||||||
@ -49,6 +48,13 @@ struct parser_state
|
|||||||
it as an expression_up -- passing ownership to the caller. */
|
it as an expression_up -- passing ownership to the caller. */
|
||||||
ATTRIBUTE_UNUSED_RESULT expression_up release ();
|
ATTRIBUTE_UNUSED_RESULT expression_up release ();
|
||||||
|
|
||||||
|
/* Return the gdbarch that was passed to the constructor. */
|
||||||
|
|
||||||
|
struct gdbarch *gdbarch ()
|
||||||
|
{
|
||||||
|
return expout->gdbarch;
|
||||||
|
}
|
||||||
|
|
||||||
/* The size of the expression above. */
|
/* The size of the expression above. */
|
||||||
|
|
||||||
size_t expout_size;
|
size_t expout_size;
|
||||||
|
@ -211,7 +211,7 @@ struct rust_parser
|
|||||||
/* Return the parser's gdbarch. */
|
/* Return the parser's gdbarch. */
|
||||||
struct gdbarch *arch () const
|
struct gdbarch *arch () const
|
||||||
{
|
{
|
||||||
return parse_gdbarch (pstate);
|
return pstate->gdbarch ();
|
||||||
}
|
}
|
||||||
|
|
||||||
/* A helper to look up a Rust type, or fail. This only works for
|
/* A helper to look up a Rust type, or fail. This only works for
|
||||||
@ -2281,7 +2281,7 @@ rust_parser::convert_ast_to_expression (const struct rust_op *operation,
|
|||||||
struct type *type;
|
struct type *type;
|
||||||
|
|
||||||
type = language_lookup_primitive_type (parse_language (pstate),
|
type = language_lookup_primitive_type (parse_language (pstate),
|
||||||
parse_gdbarch (pstate),
|
pstate->gdbarch (),
|
||||||
"()");
|
"()");
|
||||||
|
|
||||||
write_exp_elt_opcode (pstate, OP_LONG);
|
write_exp_elt_opcode (pstate, OP_LONG);
|
||||||
|
Reference in New Issue
Block a user