From 24467a8686c09546ee59303b30ca12589b6b9bd6 Mon Sep 17 00:00:00 2001 From: Pierre Muller Date: Thu, 25 Apr 2002 14:51:29 +0000 Subject: [PATCH] 2002-04-25 Pierre Muller * 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. --- gdb/ChangeLog | 6 ++++++ gdb/p-exp.y | 5 +++++ 2 files changed, 11 insertions(+) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 7454f519cc..1ae21c44ee 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,9 @@ +2002-04-25 Pierre Muller + + * 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. + 2002-04-25 Jason Thorpe * alpha-tdep.c (alpha_breakpoint_from_pc): New function. diff --git a/gdb/p-exp.y b/gdb/p-exp.y index b130e970e4..8efb45019f 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); }