From: Pierre Muller Date: Fri, 3 May 2002 08:23:12 +0000 (+0000) Subject: 2002-05-03 Pierre Muller X-Git-Tag: binutils-2_13-branchpoint~1113 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=065432a84e9b80968838004a1d784708fff3f295;p=platform%2Fupstream%2Fbinutils.git 2002-05-03 Pierre Muller * f-exp.y: Also use new prev_lexptr variable to improve error reporting. Based on Michael Snyder 2002-04-24 dated patch to c-exp.y. * jv-exp.y: Likewise. * m2-exp.y: Likewise. --- diff --git a/gdb/ChangeLog b/gdb/ChangeLog index e267bff..459dfb9 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,11 @@ +2002-05-03 Pierre Muller + + * f-exp.y: Also use new prev_lexptr variable + to improve error reporting. Based on Michael Snyder + 2002-04-24 dated patch to c-exp.y. + * jv-exp.y: Likewise. + * m2-exp.y: Likewise. + 2002-05-02 Elena Zannoni * valops.c (value_arg_coerce): Don't coerce arrays to pointers if diff --git a/gdb/f-exp.y b/gdb/f-exp.y index 7cbfd5a..e1168772 100644 --- a/gdb/f-exp.y +++ b/gdb/f-exp.y @@ -924,7 +924,9 @@ yylex () char *tokstart; retry: - + + prev_lexptr = lexptr; + tokstart = lexptr; /* First of all, let us make sure we are not dealing with the @@ -1171,5 +1173,8 @@ void yyerror (msg) char *msg; { + if (prev_lexptr) + lexptr = prev_lexptr; + error ("A %s in expression, near `%s'.", (msg ? msg : "error"), lexptr); } diff --git a/gdb/jv-exp.y b/gdb/jv-exp.y index 1b80ab4..495bf3e 100644 --- a/gdb/jv-exp.y +++ b/gdb/jv-exp.y @@ -862,6 +862,8 @@ yylex () retry: + prev_lexptr = lexptr; + tokstart = lexptr; /* See if it is a special token of length 3. */ for (i = 0; i < sizeof tokentab3 / sizeof tokentab3[0]; i++) @@ -1207,6 +1209,9 @@ void yyerror (msg) char *msg; { + if (prev_lexptr) + lexptr = prev_lexptr; + error ("A %s in expression, near `%s'.", (msg ? msg : "error"), lexptr); } diff --git a/gdb/m2-exp.y b/gdb/m2-exp.y index eaaad5a..772c6b7 100644 --- a/gdb/m2-exp.y +++ b/gdb/m2-exp.y @@ -821,6 +821,8 @@ yylex () retry: + prev_lexptr = lexptr; + tokstart = lexptr; @@ -1090,5 +1092,8 @@ void yyerror (msg) char *msg; { + if (prev_lexptr) + lexptr = prev_lexptr; + error ("A %s in expression, near `%s'.", (msg ? msg : "error"), lexptr); }