+2019-12-05 Simon Marchi <simon.marchi@polymtl.ca>
+
+ * c-exp.y: Update calls to lookup_typename,
+ lookup_signed_typename and lookup_unsigned_typename.
+ * c-lang.c (evaluate_subexp_c): Likewise.
+ * cp-namespace.c (cp_lookup_symbol_imports_or_template):
+ Likewise.
+ * eval.c (binop_promote): Likewise.
+ * gdbtypes.c (lookup_typename): Remove gdbarch parameter.
+ (lookup_unsigned_typename): Likewise.
+ (lookup_signed_typename): Likewise.
+ * gdbtypes.h (lookup_unsigned_typename): Likewise.
+ (lookup_signed_typename): Likewise.
+ (lookup_typename): Likewise.
+ * guile/scm-type.c (tyscm_lookup_typename): Update calls to
+ lookup_typename, lookup_signed_typename,
+ lookup_unsigned_typename.
+ * m2-exp.y: Likewise.
+ * printcmd.c (printf_wide_c_string): Likewise.
+ (ui_printf): Likewise.
+ * python/py-type.c (typy_lookup_typename): Likewise.
+ * python/py-xmethods.c (python_xmethod_worker::invoke):
+ Likewise.
+ * rust-exp.y: Likewise.
+
2019-12-04 Christian Biesinger <cbiesinger@google.com>
* configure.nat (obsd64): Add missing files x86-nat.o and
write_exp_elt_opcode (pstate, OP_LONG);
write_exp_elt_type (pstate, lookup_signed_typename
(pstate->language (),
- pstate->gdbarch (),
"int"));
type = check_typedef (type);
{ $$ = $1.type; }
| INT_KEYWORD
{ $$ = lookup_signed_typename (pstate->language (),
- pstate->gdbarch (),
"int"); }
| LONG
{ $$ = lookup_signed_typename (pstate->language (),
- pstate->gdbarch (),
"long"); }
| SHORT
{ $$ = lookup_signed_typename (pstate->language (),
- pstate->gdbarch (),
"short"); }
| LONG INT_KEYWORD
{ $$ = lookup_signed_typename (pstate->language (),
- pstate->gdbarch (),
"long"); }
| LONG SIGNED_KEYWORD INT_KEYWORD
{ $$ = lookup_signed_typename (pstate->language (),
- pstate->gdbarch (),
"long"); }
| LONG SIGNED_KEYWORD
{ $$ = lookup_signed_typename (pstate->language (),
- pstate->gdbarch (),
"long"); }
| SIGNED_KEYWORD LONG INT_KEYWORD
{ $$ = lookup_signed_typename (pstate->language (),
- pstate->gdbarch (),
"long"); }
| UNSIGNED LONG INT_KEYWORD
{ $$ = lookup_unsigned_typename (pstate->language (),
- pstate->gdbarch (),
"long"); }
| LONG UNSIGNED INT_KEYWORD
{ $$ = lookup_unsigned_typename (pstate->language (),
- pstate->gdbarch (),
"long"); }
| LONG UNSIGNED
{ $$ = lookup_unsigned_typename (pstate->language (),
- pstate->gdbarch (),
"long"); }
| LONG LONG
{ $$ = lookup_signed_typename (pstate->language (),
- pstate->gdbarch (),
"long long"); }
| LONG LONG INT_KEYWORD
{ $$ = lookup_signed_typename (pstate->language (),
- pstate->gdbarch (),
"long long"); }
| LONG LONG SIGNED_KEYWORD INT_KEYWORD
{ $$ = lookup_signed_typename (pstate->language (),
- pstate->gdbarch (),
"long long"); }
| LONG LONG SIGNED_KEYWORD
{ $$ = lookup_signed_typename (pstate->language (),
- pstate->gdbarch (),
"long long"); }
| SIGNED_KEYWORD LONG LONG
{ $$ = lookup_signed_typename (pstate->language (),
- pstate->gdbarch (),
"long long"); }
| SIGNED_KEYWORD LONG LONG INT_KEYWORD
{ $$ = lookup_signed_typename (pstate->language (),
- pstate->gdbarch (),
"long long"); }
| UNSIGNED LONG LONG
{ $$ = lookup_unsigned_typename (pstate->language (),
- pstate->gdbarch (),
"long long"); }
| UNSIGNED LONG LONG INT_KEYWORD
{ $$ = lookup_unsigned_typename (pstate->language (),
- pstate->gdbarch (),
"long long"); }
| LONG LONG UNSIGNED
{ $$ = lookup_unsigned_typename (pstate->language (),
- pstate->gdbarch (),
"long long"); }
| LONG LONG UNSIGNED INT_KEYWORD
{ $$ = lookup_unsigned_typename (pstate->language (),
- pstate->gdbarch (),
"long long"); }
| SHORT INT_KEYWORD
{ $$ = lookup_signed_typename (pstate->language (),
- pstate->gdbarch (),
"short"); }
| SHORT SIGNED_KEYWORD INT_KEYWORD
{ $$ = lookup_signed_typename (pstate->language (),
- pstate->gdbarch (),
"short"); }
| SHORT SIGNED_KEYWORD
{ $$ = lookup_signed_typename (pstate->language (),
- pstate->gdbarch (),
"short"); }
| UNSIGNED SHORT INT_KEYWORD
{ $$ = lookup_unsigned_typename (pstate->language (),
- pstate->gdbarch (),
"short"); }
| SHORT UNSIGNED
{ $$ = lookup_unsigned_typename (pstate->language (),
- pstate->gdbarch (),
"short"); }
| SHORT UNSIGNED INT_KEYWORD
{ $$ = lookup_unsigned_typename (pstate->language (),
- pstate->gdbarch (),
"short"); }
| DOUBLE_KEYWORD
{ $$ = lookup_typename (pstate->language (),
- pstate->gdbarch (),
"double",
NULL,
0); }
| LONG DOUBLE_KEYWORD
{ $$ = lookup_typename (pstate->language (),
- pstate->gdbarch (),
"long double",
NULL,
0); }
}
| UNSIGNED type_name
{ $$ = lookup_unsigned_typename (pstate->language (),
- pstate->gdbarch (),
TYPE_NAME($2.type)); }
| UNSIGNED
{ $$ = lookup_unsigned_typename (pstate->language (),
- pstate->gdbarch (),
"int"); }
| SIGNED_KEYWORD type_name
{ $$ = lookup_signed_typename (pstate->language (),
- pstate->gdbarch (),
TYPE_NAME($2.type)); }
| SIGNED_KEYWORD
{ $$ = lookup_signed_typename (pstate->language (),
- pstate->gdbarch (),
"int"); }
/* It appears that this rule for templates is never
reduced; template recognition happens by lookahead
$$.stoken.ptr = "int";
$$.stoken.length = 3;
$$.type = lookup_signed_typename (pstate->language (),
- pstate->gdbarch (),
"int");
}
| LONG
$$.stoken.ptr = "long";
$$.stoken.length = 4;
$$.type = lookup_signed_typename (pstate->language (),
- pstate->gdbarch (),
"long");
}
| SHORT
$$.stoken.ptr = "short";
$$.stoken.length = 5;
$$.type = lookup_signed_typename (pstate->language (),
- pstate->gdbarch (),
"short");
}
;
exp->gdbarch);
break;
case C_WIDE_STRING:
- type = lookup_typename (exp->language_defn, exp->gdbarch,
- "wchar_t", NULL, 0);
+ type = lookup_typename (exp->language_defn, "wchar_t", NULL, 0);
break;
case C_STRING_16:
- type = lookup_typename (exp->language_defn, exp->gdbarch,
- "char16_t", NULL, 0);
+ type = lookup_typename (exp->language_defn, "char16_t", NULL, 0);
break;
case C_STRING_32:
- type = lookup_typename (exp->language_defn, exp->gdbarch,
- "char32_t", NULL, 0);
+ type = lookup_typename (exp->language_defn, "char32_t", NULL, 0);
break;
default:
internal_error (__FILE__, __LINE__, _("unhandled c_string_type"));
struct type *context;
std::string name_copy (function->natural_name ());
const struct language_defn *lang = language_def (language_cplus);
- struct gdbarch *arch = symbol_arch (function);
const struct block *parent = BLOCK_SUPERBLOCK (block);
struct symbol *sym;
else
{
name_copy.erase (prefix_len);
- context = lookup_typename (lang, arch,
+ context = lookup_typename (lang,
name_copy.c_str (),
parent, 1);
}
break;
case language_opencl:
if (result_len <= TYPE_LENGTH (lookup_signed_typename
- (language, gdbarch, "int")))
+ (language, "int")))
{
promoted_type =
(unsigned_operation
- ? lookup_unsigned_typename (language, gdbarch, "int")
- : lookup_signed_typename (language, gdbarch, "int"));
+ ? lookup_unsigned_typename (language, "int")
+ : lookup_signed_typename (language, "int"));
}
else if (result_len <= TYPE_LENGTH (lookup_signed_typename
- (language, gdbarch, "long")))
+ (language, "long")))
{
promoted_type =
(unsigned_operation
- ? lookup_unsigned_typename (language, gdbarch, "long")
- : lookup_signed_typename (language, gdbarch,"long"));
+ ? lookup_unsigned_typename (language, "long")
+ : lookup_signed_typename (language,"long"));
}
break;
default:
struct type *
lookup_typename (const struct language_defn *language,
- struct gdbarch *gdbarch, const char *name,
+ const char *name,
const struct block *block, int noerr)
{
struct symbol *sym;
struct type *
lookup_unsigned_typename (const struct language_defn *language,
- struct gdbarch *gdbarch, const char *name)
+ const char *name)
{
char *uns = (char *) alloca (strlen (name) + 10);
strcpy (uns, "unsigned ");
strcpy (uns + 9, name);
- return lookup_typename (language, gdbarch, uns, NULL, 0);
+ return lookup_typename (language, uns, NULL, 0);
}
struct type *
-lookup_signed_typename (const struct language_defn *language,
- struct gdbarch *gdbarch, const char *name)
+lookup_signed_typename (const struct language_defn *language, const char *name)
{
struct type *t;
char *uns = (char *) alloca (strlen (name) + 8);
strcpy (uns, "signed ");
strcpy (uns + 7, name);
- t = lookup_typename (language, gdbarch, uns, NULL, 1);
+ t = lookup_typename (language, uns, NULL, 1);
/* If we don't find "signed FOO" just try again with plain "FOO". */
if (t != NULL)
return t;
- return lookup_typename (language, gdbarch, name, NULL, 0);
+ return lookup_typename (language, name, NULL, 0);
}
/* Lookup a structure type named "struct NAME",
extern struct type *create_set_type (struct type *, struct type *);
extern struct type *lookup_unsigned_typename (const struct language_defn *,
- struct gdbarch *, const char *);
+ const char *);
extern struct type *lookup_signed_typename (const struct language_defn *,
- struct gdbarch *, const char *);
+ const char *);
extern void get_unsigned_type_max (struct type *, ULONGEST *);
extern char *gdb_mangle_name (struct type *, int, int);
extern struct type *lookup_typename (const struct language_defn *,
- struct gdbarch *, const char *,
- const struct block *, int);
+ const char *, const struct block *, int);
extern struct type *lookup_template_type (const char *, struct type *,
const struct block *);
else if (startswith (type_name, "enum "))
type = lookup_enum (type_name + 5, NULL);
else
- type = lookup_typename (current_language, get_current_arch (),
+ type = lookup_typename (current_language,
type_name, block, 0);
}
catch (const gdb_exception &except)
: TYPENAME
{ $$
= lookup_typename (pstate->language (),
- pstate->gdbarch (),
copy_name ($1).c_str (),
pstate->expression_context_block,
0);
VAR_DOMAIN, 0).symbol;
if (sym && SYMBOL_CLASS (sym) == LOC_BLOCK)
return BLOCKNAME;
- if (lookup_typename (pstate->language (), pstate->gdbarch (),
+ if (lookup_typename (pstate->language (),
tmp.c_str (), pstate->expression_context_block, 1))
return TYPENAME;
const gdb_byte *str;
size_t len;
struct gdbarch *gdbarch = get_type_arch (value_type (value));
- struct type *wctype = lookup_typename (current_language, gdbarch,
+ struct type *wctype = lookup_typename (current_language,
"wchar_t", NULL, 0);
int wcwidth = TYPE_LENGTH (wctype);
{
struct gdbarch *gdbarch
= get_type_arch (value_type (val_args[i]));
- struct type *wctype = lookup_typename (current_language, gdbarch,
+ struct type *wctype = lookup_typename (current_language,
"wchar_t", NULL, 0);
struct type *valtype;
const gdb_byte *bytes;
else if (startswith (type_name, "enum "))
type = lookup_enum (type_name + 5, NULL);
else
- type = lookup_typename (python_language, python_gdbarch,
+ type = lookup_typename (python_language,
type_name, block, 0);
}
catch (const gdb_exception &except)
}
else
{
- res = allocate_value (lookup_typename (python_language, python_gdbarch,
+ res = allocate_value (lookup_typename (python_language,
"void", NULL, 0));
}
return SYMBOL_TYPE (result.symbol);
}
- type = lookup_typename (language (), arch (), name, NULL, 1);
+ type = lookup_typename (language (), name, NULL, 1);
if (type != NULL)
return type;