[commit] Fix "break *EXP thread/task NUM" for Ada (was: "Re: RFC: Fix "break *EXP thread NUM"")

Joel Brobecker
2010-01-01T06:31:56Z

[-- Attachment #1: Type: text/plain, Size: 652 bytes --]

I finally took the time to fix this for Ada as well. Initially,
I just fixed it for "task", until I realized that I should have
fixed it for both "thread" and "task". Hence two patches instead
of just one.

2010-01-01 Joel Brobecker <brobecker@adacore.com>

Fix break *FUN'address task NUM.
* ada-lex.l (task): New rule.
* ada-lang.c (valid_task_id): Make sure the Ada task list has
been built before using it.

2010-01-01 Joel Brobecker <brobecker@adacore.com>

Fix break *FUN'address thread NUM.
* ada-lex.l (task): Expand rule to also match the thread keyword.

Tested on x86_64-linux.

--
Joel

[-- Attachment #2: task-bp-at-addr.diff --]
[-- Type: text/x-diff, Size: 1020 bytes --]

commit 366b0ad634564fcc3ee6242510d91fab52d994db
Author: brobecke <brobecke@f8352e7e-cb20-0410-8ce7-b5d9e71c585c>
Date: Fri Jan 1 05:18:51 2010 +0000

Fix break *FUN'address task NUM.

* ada-lex.l (task): New rule.
* ada-lang.c (valid_task_id): Make sure the Ada task list has
been built before using it.

diff --git a/gdb/ada-lex.l b/gdb/ada-lex.l
index 745ed64..9505c2d 100644
--- a/gdb/ada-lex.l
+++ b/gdb/ada-lex.l
@@ -160,6 +160,13 @@ if {
return 0;
}

+task {
+ while (*lexptr != 't' && *lexptr != 'T')
+ lexptr--;
+ yyrestart(NULL);
+ return 0;
+ }
+
/* ADA KEYWORDS */

abs { return ABS; }
diff --git a/gdb/ada-tasks.c b/gdb/ada-tasks.c
index 806548a..af80877 100644
--- a/gdb/ada-tasks.c
+++ b/gdb/ada-tasks.c
@@ -198,6 +198,7 @@ get_task_number_from_id (CORE_ADDR task_id)
int
valid_task_id (int task_num)
{
+ ada_build_task_list (0);
return (task_num > 0
&& task_num <= VEC_length (ada_task_info_s, task_list));
}

[-- Attachment #3: thread-bp-at-addr.diff --]
[-- Type: text/x-diff, Size: 691 bytes --]

commit 7d7cd745c3f76445eb0f92a76e347de999d938ff
Author: Joel Brobecker <brobecker@adacore.com>
Date: Fri Jan 1 10:22:11 2010 +0400

Fix break *FUN'address thread NUM.

* ada-lex.l (task): Expand rule to also match the thread keyword.
Related to J101-001.

diff --git a/gdb/ada-lex.l b/gdb/ada-lex.l
index 9505c2d..8c47418 100644
--- a/gdb/ada-lex.l
+++ b/gdb/ada-lex.l
@@ -160,7 +160,9 @@ if {
return 0;
}

-task {
+(task|thread) {
+ /* This keyword signals the end of the expression and
+ will be processed separately. */
while (*lexptr != 't' && *lexptr != 'T')
lexptr--;
yyrestart(NULL);