Новая публичная версия компилятора GNAT: GNAT GPL 2006 уже доступна на
сайте
http://www.ajam.org.pl/ - gnat-GPL2006-x86-qnx6.3.tar.bz2.
Там я поместил тоже новый gdb6.4-GnatGPL2006-qnx6.3.
Он даеть возможность вести debugging задач языка ада.
И думаю очень важно что тепер компилятор gcc даеть правилную информацию
для gdb. К примеру так выглядить работа с дебаггером
==========================================================
prg4.adb
......................................
WITH Ada.Text_IO;
PROCEDURE Start_Buttons IS
------------------------------------------------------------------------
--| Show the declaration of a simple task type and three
--| variables of that type. The tasks use DELAYs to cooperate.
--| "Start button" entries are used to to control starting order.
--| Author: Michael B. Feldman, The George Washington University
--| Last Modified: December 1995
------------------------------------------------------------------------
TASK TYPE SimpleTask (Message: Character; HowMany: Positive) IS
-- This specification provides a "start button" entry.
ENTRY StartRunning;
END SimpleTask;
TASK BODY SimpleTask IS
BEGIN -- SimpleTask
-- The task will "block" at the ACCEPT, waiting for the "button"
-- to be "pushed" (called from another task, Main in this case).
ACCEPT StartRunning;
FOR Count IN 1..HowMany LOOP
Ada.Text_IO.Put(Item => "Hello from Task " & Message);
Ada.Text_IO.New_Line;
DELAY 0.1; -- lets another task have the CPU
END LOOP;
END SimpleTask;
-- Now we declare three variables of the type
Task_A: SimpleTask(Message => 'A', HowMany => 5);
Task_B: SimpleTask(Message => 'B', HowMany => 7);
Task_C: SimpleTask(Message => 'C', HowMany => 4);
BEGIN -- Start_Buttons
-- Tasks will all start executing as soon as control
-- reaches this point, but each will block on its ACCEPT
-- until the entry is called. In this way we control the starting
-- order of the tasks.
Task_B.StartRunning;
Task_A.StartRunning;
Task_C.StartRunning;
END Start_Buttons;
...........................................
#gnatmake -g prg4
#gdb prg4
GNU gdb 6.4 for GNAT Pro 2006 (20060522)
Copyright 2005 Free Software Foundation, Inc.
Ada Core Technologies version of GDB for GNAT Professional
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
This GDB was configured as "i386-pc-nto-qnx6.3.0"...
(gdb) start
Breakpoint 1 at 0x80517df: file prg4.adb, line 2.
Starting program: /src/Temp/prg4
start_buttons () at prg4.adb:2
2 PROCEDURE Start_Buttons IS
(gdb) info tasks
ID TID P-ID Pri State Name
1 808f020 0 31 Runnable main_task
(gdb) info threads
1 process 1921107 start_buttons () at prg4.adb:2
(gdb) l
2 PROCEDURE Start_Buttons IS
3 ------------------------------------------------------------------------
4 --| Show the declaration of a simple task type and three
5 --| variables of that type. The tasks use DELAYs to cooperate.
6 --| "Start button" entries are used to to control starting order.
7 --| Author: Michael B. Feldman, The George Washington University
8 --| Last Modified: December 1995
9 ------------------------------------------------------------------------
10
11 TASK TYPE SimpleTask (Message: Character; HowMany: Positive) IS
(gdb) n
11 TASK TYPE SimpleTask (Message: Character; HowMany: Positive) IS
(gdb)
18 TASK BODY SimpleTask IS
(gdb)
35 Task_A: SimpleTask(Message => 'A', HowMany => 5);
(gdb)
36 Task_B: SimpleTask(Message => 'B', HowMany => 7);
(gdb)
37 Task_C: SimpleTask(Message => 'C', HowMany => 4);
(gdb)
2 PROCEDURE Start_Buttons IS
(gdb)
46 Task_B.StartRunning;
(gdb) info threads
4 process 1921107 0xb032e9f9 in SyncCondvarWait_r ()
from /usr/qnx630/target/qnx6/x86/lib/libc.so.2
3 process 1921107 0xb032e9f9 in SyncCondvarWait_r ()
from /usr/qnx630/target/qnx6/x86/lib/libc.so.2
2 process 1921107 0xb032e9f9 in SyncCondvarWait_r ()
from /usr/qnx630/target/qnx6/x86/lib/libc.so.2
1 process 1921107 start_buttons () at prg4.adb:46
(gdb) info tasks
ID TID P-ID Pri State Name
1 808f020 0 31 Runnable main_task
2 808e6f8 1 31 Accept Statement task_a
3 808b7c0 1 31 Accept Statement task_b
4 808b0a0 1 31 Accept Statement task_c
(gdb) n
47 Task_A.StartRunning;
(gdb) info tasks
ID TID P-ID Pri State Name
1 808f020 0 31 Runnable main_task
2 808e6f8 1 31 Accept Statement task_a
3 808b7c0 1 31 Runnable task_b
4 808b0a0 1 31 Accept Statement task_c
(gdb) info hreads
4 process 1921107 0xb032e9f9 in SyncCondvarWait_r ()
from /usr/qnx630/target/qnx6/x86/lib/libc.so.2
3 process 1921107 0xb031ade2 in pthread_mutex_unlock ()
from /usr/qnx630/target/qnx6/x86/lib/libc.so.2
2 process 1921107 0xb032e9f9 in SyncCondvarWait_r ()
from /usr/qnx630/target/qnx6/x86/lib/libc.so.2
1 process 1921107 start_buttons () at prg4.adb:47
(gdb) n
48 Task_C.StartRunning;
(gdb)
50 END Start_Buttons;
(gdb)
Hello from Task A
Hello from Task C
Hello from Task B
.................
Hello from Task A
Hello from Task B
Hello from Task B
Hello from Task B
main (argc=1, argv=(system.address) 0x8047a0c, envp=(system.address) 0x8047a14)
at b~prg4.adb:199
199 Do_Finalize;
(gdb) info threads
1 process 1921107 main (argc=1, argv=(system.address) 0x8047a0c,
envp=(system.address) 0x8047a14) at b~prg4.adb:199
(gdb) info tasks
ID TID P-ID Pri State Name
1 808f020 0 31 Runnable main_task
(gdb) n
200 Finalize;
(gdb)
201 return (gnat_exit_status);
(gdb)
.................................
Program exited normally.
(gdb) q