This is the mail archive of the gdb-cvs@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

src/gdb ChangeLog ada-tasks.c testsuite/Change ...


CVSROOT:	/cvs/src
Module name:	src
Changes by:	brobecke@sourceware.org	2011-09-16 19:09:58

Modified files:
	gdb            : ChangeLog ada-tasks.c 
	gdb/testsuite  : ChangeLog 
	gdb/testsuite/gdb.ada: tasks.exp 

Log message:
	[Ada] Re-implement `info tasks' command using ui-out
	
	This is in preparation for providing a GDB/MI equivalent of
	the `info tasks' command.  The previous implementation was using
	various printf commands to generate the command output, which
	does not work at all if we want to use that same code to generate
	the result for that new GDB/MI command.
	
	This patch thus re-implements the `info tasks' command (with no
	arguments) in a way that makes it GDB/MI friendly.
	
	There is an additional hicup, which is the fact that the `info tasks'
	command displays a completely different type of output when a task
	ID is given. For instance:
	
	(gdb) info task 2
	Ada Task: 0x644d20
	Name: my_callee
	Thread: 0
	LWP: 0x5809
	Parent: 1 (main_task)
	Base Priority: 48
	State: Blocked in accept or select with terminate
	
	The above output is better when in CLI mode, but really not
	what we want when in GDB/MI mode. In GDB/MI mode, we want to
	follow what the `-thread-info' command does when a task-id
	is given as an argument, which is to produce the same table,
	but with only one element/task in it.
	
	For compatibility as well as practical reasons, we do not want
	to change the output of the `info task TASKNO' command when in
	CLI mode.  But it's easy to preserve this behavior while providing
	the desirable output when in GDB/MI mode.  For this, the function
	used to generated the `info tasks' output has been enhanced to take
	an argument interpreted as a string. The CLI command knows to never
	provide that argument, while the GDB/MI command will pass one if
	provided by the user.
	
	gdb/ChangeLog:
	
	* ada-tasks.c (print_ada_task_info): New function, merging
	short_task_info and info_tasks together.  Reimplement using
	ui-out instead of printing to stdout directly.  Move the code
	building and checking the task list here, instead of leaving it
	in info_tasks_command.
	(info_task): Move the code building and checking the task
	list here, instead of leaving it in info_tasks_command.
	(info_tasks_command): Delete code building and checking
	the task list - moved elsewhere.  Update calls to info_tasks
	and info_task.
	
	One of the minor changes the switch caused is the introduction
	of a space between the "current" column, and the task "ID"
	column, which wasn't there before.  This matches what we do
	in the "info threads" command, so I kept that change.  This
	required an adjustment in the testsuite, however...
	
	gdb/testsuite/ChangeLog:
	
	* gdb.ada/tasks.exp: Make the expected output for
	the `info tasks' tests more resilient to spacing
	changes.

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gdb/ChangeLog.diff?cvsroot=src&r1=1.13346&r2=1.13347
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gdb/ada-tasks.c.diff?cvsroot=src&r1=1.45&r2=1.46
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gdb/testsuite/ChangeLog.diff?cvsroot=src&r1=1.2855&r2=1.2856
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gdb/testsuite/gdb.ada/tasks.exp.diff?cvsroot=src&r1=1.6&r2=1.7


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]