summaryrefslogtreecommitdiff
path: root/gdb/go-exp.y
diff options
context:
space:
mode:
Diffstat (limited to 'gdb/go-exp.y')
-rw-r--r--gdb/go-exp.y18
1 files changed, 8 insertions, 10 deletions
diff --git a/gdb/go-exp.y b/gdb/go-exp.y
index 359af226056..1b9b6ea7e90 100644
--- a/gdb/go-exp.y
+++ b/gdb/go-exp.y
@@ -545,7 +545,7 @@ variable: name_not_typename ENTRY
{ struct symbol *sym = $1.sym.symbol;
if (sym == NULL
- || !SYMBOL_IS_ARGUMENT (sym)
+ || !sym->is_argument ()
|| !symbol_read_needs_frame (sym))
error (_("@entry can be used only for function "
"parameters, not for \"%s\""),
@@ -647,10 +647,8 @@ static int
parse_number (struct parser_state *par_state,
const char *p, int len, int parsed_float, YYSTYPE *putithere)
{
- /* FIXME: Shouldn't these be unsigned? We don't deal with negative values
- here, and we do kind of silly things like cast to unsigned. */
- LONGEST n = 0;
- LONGEST prevn = 0;
+ ULONGEST n = 0;
+ ULONGEST prevn = 0;
ULONGEST un;
int i = 0;
@@ -702,7 +700,7 @@ parse_number (struct parser_state *par_state,
}
/* Handle base-switching prefixes 0x, 0t, 0d, 0. */
- if (p[0] == '0')
+ if (p[0] == '0' && len > 1)
switch (p[1])
{
case 'x':
@@ -790,7 +788,7 @@ parse_number (struct parser_state *par_state,
on 0x123456789 when LONGEST is 32 bits. */
if (c != 'l' && c != 'u' && n != 0)
{
- if ((unsigned_p && (ULONGEST) prevn >= (ULONGEST) n))
+ if ((unsigned_p && prevn >= n))
error (_("Numeric constant too large."));
}
prevn = n;
@@ -808,7 +806,7 @@ parse_number (struct parser_state *par_state,
the case where it is we just always shift the value more than
once, with fewer bits each time. */
- un = (ULONGEST)n >> 2;
+ un = n >> 2;
if (long_p == 0
&& (un >> (gdbarch_int_bit (par_state->gdbarch ()) - 2)) == 0)
{
@@ -1338,8 +1336,8 @@ package_name_p (const char *name, const struct block *block)
sym = lookup_symbol (name, block, STRUCT_DOMAIN, &is_a_field_of_this).symbol;
if (sym
- && SYMBOL_CLASS (sym) == LOC_TYPEDEF
- && SYMBOL_TYPE (sym)->code () == TYPE_CODE_MODULE)
+ && sym->aclass () == LOC_TYPEDEF
+ && sym->type ()->code () == TYPE_CODE_MODULE)
return 1;
return 0;