aboutsummaryrefslogtreecommitdiff
path: root/gdb/p-exp.y
diff options
context:
space:
mode:
authorPierre Muller <muller@sourceware.org>2002-04-25 14:51:29 +0000
committerPierre Muller <muller@sourceware.org>2002-04-25 14:51:29 +0000
commit24467a8686c09546ee59303b30ca12589b6b9bd6 (patch)
tree798aee7eb688cb097eb9b085c62126d33952e90b /gdb/p-exp.y
parent6c95717af00ff1764a1636af5472768712a9cddb (diff)
downloadgdb-24467a8686c09546ee59303b30ca12589b6b9bd6.zip
gdb-24467a8686c09546ee59303b30ca12589b6b9bd6.tar.gz
gdb-24467a8686c09546ee59303b30ca12589b6b9bd6.tar.bz2
2002-04-25 Pierre Muller <muller@ics.u-strasbg.fr>
* p-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.
Diffstat (limited to 'gdb/p-exp.y')
-rw-r--r--gdb/p-exp.y5
1 files changed, 5 insertions, 0 deletions
diff --git a/gdb/p-exp.y b/gdb/p-exp.y
index b130e97..8efb450 100644
--- a/gdb/p-exp.y
+++ b/gdb/p-exp.y
@@ -947,6 +947,8 @@ yylex ()
retry:
+ prev_lexptr = lexptr;
+
tokstart = lexptr;
explen = strlen (lexptr);
/* See if it is a special token of length 3. */
@@ -1481,5 +1483,8 @@ void
yyerror (msg)
char *msg;
{
+ if (prev_lexptr)
+ lexptr = prev_lexptr;
+
error ("A %s in expression, near `%s'.", (msg ? msg : "error"), lexptr);
}