/* Bison parser for Rust expressions, for GDB.
- Copyright (C) 2016-2019 Free Software Foundation, Inc.
+ Copyright (C) 2016-2020 Free Software Foundation, Inc.
This file is part of GDB.
#include "gdb_regex.h"
#include "rust-lang.h"
#include "parser-defs.h"
-#include "common/selftest.h"
+#include "gdbsupport/selftest.h"
#include "value.h"
-#include "common/vec.h"
+#include "gdbarch.h"
#define GDB_YY_REMAP_PREFIX rust
#include "yy-remap.h"
const char *
rust_parser::copy_name (const char *name, int len)
{
- return (const char *) obstack_copy0 (&obstack, name, len);
+ return obstack_strndup (&obstack, name, len);
}
/* Helper function to make an stoken from a C string. */
}
}
- value = strtoul (number.c_str () + offset, NULL, radix);
+ value = strtoulst (number.c_str () + offset, NULL, radix);
if (implicit_i32 && value >= ((uint64_t) 1) << 31)
type = get_type ("i64");
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;
/* Test that INPUT lexes as the integer VALUE. */
static void
-rust_lex_int_test (rust_parser *parser, const char *input, int value, int kind)
+rust_lex_int_test (rust_parser *parser, const char *input,
+ LONGEST value, int kind)
{
RUSTSTYPE result = rust_lex_test_one (parser, input, kind);
SELF_CHECK (result.typed_val_int.val == value);
rust_lex_int_test (&parser, "0x1_f", 0x1f, INTEGER);
rust_lex_int_test (&parser, "0b1_101011__", 0x6b, INTEGER);
rust_lex_int_test (&parser, "0o001177i64", 639, INTEGER);
+ rust_lex_int_test (&parser, "0x123456789u64", 0x123456789ull, INTEGER);
rust_lex_test_trailing_dot (&parser);