Index: gdb/f-exp.y |
diff --git a/gdb/f-exp.y b/gdb/f-exp.y |
index 33c7418caedf7509e2d6536e0cd86d042f4150c7..567cd005acb302025701b06c4dd49d60d8b8a4d0 100644 |
--- a/gdb/f-exp.y |
+++ b/gdb/f-exp.y |
@@ -1,6 +1,5 @@ |
/* YACC parser for Fortran expressions, for GDB. |
- Copyright (C) 1986, 1989-1991, 1993-1996, 2000-2012 Free Software |
- Foundation, Inc. |
+ Copyright (C) 1986-2013 Free Software Foundation, Inc. |
Contributed by Motorola. Adapted from the C parser by Farooq Butt |
(fmbutt@engage.sps.mot.com). |
@@ -43,7 +42,7 @@ |
%{ |
#include "defs.h" |
-#include "gdb_string.h" |
+#include <string.h> |
#include "expression.h" |
#include "value.h" |
#include "parser-defs.h" |
@@ -158,7 +157,7 @@ static int match_string_literal (void); |
%{ |
/* YYSTYPE gets defined by %union */ |
-static int parse_number (char *, int, int, YYSTYPE *); |
+static int parse_number (const char *, int, int, YYSTYPE *); |
%} |
%type <voidval> exp type_exp start variable |
@@ -514,12 +513,12 @@ variable: name_not_typename |
} |
else |
{ |
- struct minimal_symbol *msymbol; |
+ struct bound_minimal_symbol msymbol; |
char *arg = copy_name ($1.stoken); |
msymbol = |
- lookup_minimal_symbol (arg, NULL, NULL); |
- if (msymbol != NULL) |
+ lookup_bound_minimal_symbol (arg); |
+ if (msymbol.minsym != NULL) |
write_exp_msymbol (msymbol); |
else if (!have_full_symbols () && !have_partial_symbols ()) |
error (_("No symbol table is loaded. Use the \"file\" command.")); |
@@ -670,7 +669,7 @@ name_not_typename : NAME |
/*** Needs some error checking for the float case ***/ |
static int |
-parse_number (char *p, int len, int parsed_float, YYSTYPE *putithere) |
+parse_number (const char *p, int len, int parsed_float, YYSTYPE *putithere) |
{ |
LONGEST n = 0; |
LONGEST prevn = 0; |
@@ -921,7 +920,7 @@ growbuf_by_size (int count) |
static int |
match_string_literal (void) |
{ |
- char *tokptr = lexptr; |
+ const char *tokptr = lexptr; |
for (tempbufindex = 0, tokptr++; *tokptr != '\0'; tokptr++) |
{ |
@@ -956,7 +955,7 @@ yylex (void) |
int c; |
int namelen; |
unsigned int i,token; |
- char *tokstart; |
+ const char *tokstart; |
retry: |
@@ -1055,7 +1054,7 @@ yylex (void) |
{ |
/* It's a number. */ |
int got_dot = 0, got_e = 0, got_d = 0, toktype; |
- char *p = tokstart; |
+ const char *p = tokstart; |
int hex = input_radix > 10; |
if (c == '0' && (p[1] == 'x' || p[1] == 'X')) |
@@ -1175,9 +1174,13 @@ yylex (void) |
{ |
char *tmp = copy_name (yylval.sval); |
struct symbol *sym; |
- int is_a_field_of_this = 0; |
+ struct field_of_this_result is_a_field_of_this; |
int hextype; |
+ /* Initialize this in case we *don't* use it in this call; that |
+ way we can refer to it unconditionally below. */ |
+ memset (&is_a_field_of_this, 0, sizeof (is_a_field_of_this)); |
+ |
sym = lookup_symbol (tmp, expression_context_block, |
VAR_DOMAIN, |
parse_language->la_language == language_cplus |
@@ -1205,14 +1208,14 @@ yylex (void) |
if (hextype == INT) |
{ |
yylval.ssym.sym = sym; |
- yylval.ssym.is_a_field_of_this = is_a_field_of_this; |
+ yylval.ssym.is_a_field_of_this = is_a_field_of_this.type != NULL; |
return NAME_OR_INT; |
} |
} |
/* Any other kind of symbol */ |
yylval.ssym.sym = sym; |
- yylval.ssym.is_a_field_of_this = is_a_field_of_this; |
+ yylval.ssym.is_a_field_of_this = is_a_field_of_this.type != NULL; |
return NAME; |
} |
} |