From b6199126eec56a19b3d4cd365abe3ec29d4911b9 Mon Sep 17 00:00:00 2001 From: Daniel Jacobowitz Date: Wed, 25 Nov 2009 20:43:29 +0000 Subject: PR gdb/8704 * breakpoint.c (find_condition_and_thread): Correct task error message. * c-exp.y (yylex): Stop before "thread N", "task N", or abbreviations of those. doc/ * gdb.texinfo (Thread-Specific Breakpoints): Thread specifiers are allowed after the breakpoint condition. testsuite/ * gdb.base/condbreak.exp: Test combinations of "break *EXP", "if", and "thread". Correct matching in the previous test. --- gdb/c-exp.y | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'gdb/c-exp.y') diff --git a/gdb/c-exp.y b/gdb/c-exp.y index 8ee323e..d657c92 100644 --- a/gdb/c-exp.y +++ b/gdb/c-exp.y @@ -2250,6 +2250,24 @@ yylex (void) return 0; } + /* For the same reason (breakpoint conditions), "thread N" + terminates the expression. "thread" could be an identifier, but + an identifier is never followed by a number without intervening + punctuation. "task" is similar. Handle abbreviations of these, + similarly to breakpoint.c:find_condition_and_thread. */ + if (namelen >= 1 + && (strncmp (tokstart, "thread", namelen) == 0 + || strncmp (tokstart, "task", namelen) == 0) + && (tokstart[namelen] == ' ' || tokstart[namelen] == '\t') + && ! scanning_macro_expansion ()) + { + char *p = tokstart + namelen + 1; + while (*p == ' ' || *p == '\t') + p++; + if (*p >= '0' && *p <= '9') + return 0; + } + lexptr += namelen; tryname: -- cgit v1.1