summaryrefslogtreecommitdiff
path: root/gdb/p-exp.y
diff options
context:
space:
mode:
authorPierre Muller <muller@ics.u-strasbg.fr>2002-04-25 14:51:29 +0000
committerPierre Muller <muller@ics.u-strasbg.fr>2002-04-25 14:51:29 +0000
commit623bcf543319be5010968003e804d2768a991f99 (patch)
tree2564b2854dc0e052962f443a1b0fec1c53d7864e /gdb/p-exp.y
parent9cddf4c586e92b83b7185ad1611594751adf347f (diff)
downloadgdb-623bcf543319be5010968003e804d2768a991f99.tar.gz
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 b130e970e4b..8efb45019f4 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);
}