This is the mail archive of the
archer@sourceware.org
mailing list for the Archer project.
Re: [Archer] Re: [Archer] Stop the Insanity! Linespec Rewrite
> I'm afraid I don't understand. As far as I can tell, CVS HEAD and
> archer-keiths-linespec-rewrite behave identically. The output is
> exactly the same:
The thing is that the task ID you are using needs to be valid.
So, basically, you need to use an Ada program that uses tasking,
and the task ID needs to be known at the time the breakpoint is
inserted.
My favorite little Ada program happens to be available from
gdb.ada/mi_task_arg. Using that program:
gdb -q task_switch
(gdb) b break_me
Breakpoint 1 at 0x403a5a: file /[...]/task_switch.adb, line 57.
(gdb) run
Starting program: /[...]/task_switch
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/libthread_db.so.1".
[New Thread 0x7ffff7852910 (LWP 32425)]
[New Thread 0x7ffff764e910 (LWP 32426)]
[Switching to Thread 0x7ffff764e910 (LWP 32426)]
Breakpoint 1, task_switch.break_me () at /[...]/task_switch.adb:57
57 null;
(gdb) info tasks
ID TID P-ID Pri State Name
1 645010 48 Child Activation Wait main_task
2 645d80 1 48 Accept or Select Term my_callee
* 3 649490 1 48 Runnable my_caller
(gdb) b task_switch.adb:70 task 1
Breakpoint 2 at 0x40365a: file /[...]/task_switch.adb, line 70.
The above works. But if you start using a different casing on
the "task" keyword, as below, the current GDB rejects it:
(gdb) b task_switch.adb:70 TASK 1
Junk at end of arguments.
(gdb) b task_switch.adb:70 Task 1
Junk at end of arguments.
(note: the "info tasks" command is not necessary for things to work;
GDB will automatically compute the list of tasks as needed)
--
Joel