[Ada] Fix number of lines in -ada-task-info output
authorJoel Brobecker <brobecker@gnat.com>
Fri, 21 Oct 2011 18:46:06 +0000 (18:46 +0000)
committerJoel Brobecker <brobecker@gnat.com>
Fri, 21 Oct 2011 18:46:06 +0000 (18:46 +0000)
commit6cda5a20820e95cf01d510f2478cd4b992cf416b
tree1f86f3e9188b87abc598192682cc9c4d394c1e9f
parent5ed9db04f86f3eb360956052f6beea3aefd585aa
[Ada] Fix number of lines in -ada-task-info output

When using the new -ada-task-info command with an argument,
the output would say that there are N entries in the returned
table, (where N is the total number of tasks present in the inferior).
But, in fact, the table would only contain at most 1 entry.

This patch fixes this by properly computing the number of
tasks being displayed before giving it to the uiout.

gdb/ChangeLog:

        * ada-tasks.c (print_ada_task_info): Fix computation of
        number of tasks displayed in command output.

gdb/testsuite/ChangeLog:

        * gdb.ada/mi_task_info/task_switch.adb: New file.
        * gdb.ada/mi_task_info.exp: New file.
gdb/ChangeLog
gdb/ada-tasks.c
gdb/testsuite/ChangeLog
gdb/testsuite/gdb.ada/mi_task_info.exp [new file with mode: 0644]
gdb/testsuite/gdb.ada/mi_task_info/task_switch.adb [new file with mode: 0644]