From: "Maciej W. Rozycki" <macro@mips.com>
To: gdb-patches@sources.redhat.com
Subject: Support for "break *ADDRESS thread THREADNO"
Date: Tue, 12 Apr 2005 15:54:00 -0000 [thread overview]
Message-ID: <Pine.LNX.4.61.0504121544140.13777@perivale.mips.com> (raw)
Hello,
The current version of gdb does not accept the "thread THREADNO" clause
for breakpoints at an address. I'm not sure if that's a bug or feature as
the info pages carefully avoid documenting what should happen in this
case, referring to source lines instead.
Anyway I've found the inability to set up such breakpoints an obstacle,
so I've implemented the missing bits for it to work. Here's the result.
I've run-time tested the C language bit only (i.e. c-exp.y), but the other
.y changes are essentially the same, so they should work as well.
Unfortunately I haven't found a way of testing the Ada part which is
significantly different; I hope it's OK.
2005-04-12 Maciej W. Rozycki <macro@mips.com>
* ada-lex.l: Support the "thread THREADNO" clause with breakpoints
at an address.
* c-exp.y (yylex): Likewise.
* f-exp.y (yylex): Likewise.
* jv-exp.y (yylex): Likewise.
* m2-exp.y (yylex): Likewise.
* objc-exp.y (yylex): Likewise.
* p-exp.y (yylex): Likewise.
This has been verified for the HEAD version with the test suite for the
i386-linux-gnu system natively with no regressions. Please consider.
Maciej
gdb-6.2.1-20050412-break-addr-thread-0.patch
Index: src/gdb/ada-lex.l
===================================================================
RCS file: /cvsroot/gcc/src-cvs/src/gdb/ada-lex.l,v
retrieving revision 1.2.1000.2
diff -u -p -r1.2.1000.2 ada-lex.l
--- src/gdb/ada-lex.l 5 Aug 2004 14:41:08 -0000 1.2.1000.2
+++ src/gdb/ada-lex.l 12 Apr 2005 14:25:15 -0000
@@ -191,8 +191,9 @@ static int find_dot_all (const char *);
tempbuf_len += yyleng-4;
}
-if {
- while (*lexptr != 'i' && *lexptr != 'I')
+if|thread {
+ while (*lexptr != 'i' && *lexptr != 'I'
+ && *lexptr != 't' && *lexptr != 'T')
lexptr -= 1;
yyrestart(NULL);
return 0;
Index: src/gdb/c-exp.y
===================================================================
RCS file: /cvsroot/gcc/src-cvs/src/gdb/c-exp.y,v
retrieving revision 1.23.1000.5
diff -u -p -r1.23.1000.5 c-exp.y
--- src/gdb/c-exp.y 26 Aug 2004 16:38:01 -0000 1.23.1000.5
+++ src/gdb/c-exp.y 12 Apr 2005 14:25:15 -0000
@@ -1620,12 +1620,11 @@ yylex ()
c = tokstart[++namelen];
}
- /* The token "if" terminates the expression and is NOT removed from
- the input stream. It doesn't count if it appears in the
- expansion of a macro. */
- if (namelen == 2
- && tokstart[0] == 'i'
- && tokstart[1] == 'f'
+ /* The tokens "if" and "thread" terminate the expression and are NOT
+ removed from the input stream. It doesn't count if it appears in
+ the expansion of a macro. */
+ if (((namelen == 2 && tokstart[0] == 'i' && tokstart[1] == 'f')
+ || (namelen == 6 && strncmp (tokstart, "thread", 6) == 0))
&& ! scanning_macro_expansion ())
{
return 0;
Index: src/gdb/f-exp.y
===================================================================
RCS file: /cvsroot/gcc/src-cvs/src/gdb/f-exp.y,v
retrieving revision 1.13.1000.2
diff -u -p -r1.13.1000.2 f-exp.y
--- src/gdb/f-exp.y 5 Aug 2004 14:41:15 -0000 1.13.1000.2
+++ src/gdb/f-exp.y 12 Apr 2005 14:25:15 -0000
@@ -1103,10 +1103,11 @@ yylex ()
|| (c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z'));
c = tokstart[++namelen]);
- /* The token "if" terminates the expression and is NOT
- removed from the input stream. */
-
- if (namelen == 2 && tokstart[0] == 'i' && tokstart[1] == 'f')
+ /* The tokens "if" and "thread" terminate the expression and are NOT
+ removed from the input stream. It doesn't count if it appears in
+ the expansion of a macro. */
+ if ((namelen == 2 && tokstart[0] == 'i' && tokstart[1] == 'f')
+ || (namelen == 6 && strncmp (tokstart, "thread", 6) == 0))
return 0;
lexptr += namelen;
Index: src/gdb/jv-exp.y
===================================================================
RCS file: /cvsroot/gcc/src-cvs/src/gdb/jv-exp.y,v
retrieving revision 1.16.1000.1
diff -u -p -r1.16.1000.1 jv-exp.y
--- src/gdb/jv-exp.y 10 Dec 2003 19:29:42 -0000 1.16.1000.1
+++ src/gdb/jv-exp.y 12 Apr 2005 14:25:15 -0000
@@ -1118,9 +1118,11 @@ yylex ()
c = tokstart[++namelen];
}
- /* The token "if" terminates the expression and is NOT
- removed from the input stream. */
- if (namelen == 2 && tokstart[0] == 'i' && tokstart[1] == 'f')
+ /* The tokens "if" and "thread" terminate the expression and are NOT
+ removed from the input stream. It doesn't count if it appears in
+ the expansion of a macro. */
+ if ((namelen == 2 && tokstart[0] == 'i' && tokstart[1] == 'f')
+ || (namelen == 6 && strncmp (tokstart, "thread", 6) == 0))
{
return 0;
}
Index: src/gdb/m2-exp.y
===================================================================
RCS file: /cvsroot/gcc/src-cvs/src/gdb/m2-exp.y,v
retrieving revision 1.11.1000.1
diff -u -p -r1.11.1000.1 m2-exp.y
--- src/gdb/m2-exp.y 10 Dec 2003 19:29:42 -0000 1.11.1000.1
+++ src/gdb/m2-exp.y 12 Apr 2005 14:25:15 -0000
@@ -981,9 +981,11 @@ yylex ()
c = tokstart[++namelen])
;
- /* The token "if" terminates the expression and is NOT
- removed from the input stream. */
- if (namelen == 2 && tokstart[0] == 'i' && tokstart[1] == 'f')
+ /* The tokens "if" and "thread" terminate the expression and are NOT
+ removed from the input stream. It doesn't count if it appears in
+ the expansion of a macro. */
+ if ((namelen == 2 && tokstart[0] == 'i' && tokstart[1] == 'f')
+ || (namelen == 6 && strncmp (tokstart, "thread", 6) == 0))
{
return 0;
}
Index: src/gdb/objc-exp.y
===================================================================
RCS file: /cvsroot/gcc/src-cvs/src/gdb/objc-exp.y,v
retrieving revision 1.14.1000.2
diff -u -p -r1.14.1000.2 objc-exp.y
--- src/gdb/objc-exp.y 5 Aug 2004 14:41:19 -0000 1.14.1000.2
+++ src/gdb/objc-exp.y 12 Apr 2005 14:25:15 -0000
@@ -1574,9 +1574,11 @@ yylex ()
c = tokstart[++namelen];
}
- /* The token "if" terminates the expression and is NOT
- removed from the input stream. */
- if (namelen == 2 && tokstart[0] == 'i' && tokstart[1] == 'f')
+ /* The tokens "if" and "thread" terminate the expression and are NOT
+ removed from the input stream. It doesn't count if it appears in
+ the expansion of a macro. */
+ if ((namelen == 2 && tokstart[0] == 'i' && tokstart[1] == 'f')
+ || (namelen == 6 && strncmp (tokstart, "thread", 6) == 0))
{
return 0;
}
Index: src/gdb/p-exp.y
===================================================================
RCS file: /cvsroot/gcc/src-cvs/src/gdb/p-exp.y,v
retrieving revision 1.25.1000.2
diff -u -p -r1.25.1000.2 p-exp.y
--- src/gdb/p-exp.y 5 Aug 2004 14:41:19 -0000 1.25.1000.2
+++ src/gdb/p-exp.y 12 Apr 2005 14:25:15 -0000
@@ -1354,9 +1354,11 @@ yylex ()
uptokstart = uptok(tokstart,namelen);
- /* The token "if" terminates the expression and is NOT
- removed from the input stream. */
- if (namelen == 2 && uptokstart[0] == 'I' && uptokstart[1] == 'F')
+ /* The tokens "if" and "thread" terminate the expression and are NOT
+ removed from the input stream. It doesn't count if it appears in
+ the expansion of a macro. */
+ if ((namelen == 2 && uptokstart[0] == 'I' && uptokstart[1] == 'F')
+ || (namelen == 6 && strncmp (uptokstart, "THREAD", 6) == 0))
{
return 0;
}
next reply other threads:[~2005-04-12 15:54 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-04-12 15:54 Maciej W. Rozycki [this message]
2005-04-12 18:13 ` Daniel Jacobowitz
2005-04-12 18:24 ` Maciej W. Rozycki
2005-04-12 18:51 ` Eli Zaretskii
2005-04-12 18:55 ` Daniel Jacobowitz
2005-04-12 19:05 ` Eli Zaretskii
2005-04-12 19:17 ` Stan Shebs
2005-04-12 19:21 ` Daniel Jacobowitz
2005-04-12 19:22 ` Daniel Jacobowitz
2005-04-13 10:36 ` Maciej W. Rozycki
2005-04-13 12:09 ` Daniel Jacobowitz
2005-04-13 16:05 ` Maciej W. Rozycki
2005-04-13 17:37 ` Eli Zaretskii
2005-04-13 17:41 ` Daniel Jacobowitz
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=Pine.LNX.4.61.0504121544140.13777@perivale.mips.com \
--to=macro@mips.com \
--cc=gdb-patches@sources.redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox