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


CVSROOT:	/cvs/src
Module name:	src
Changes by:	brobecke@sourceware.org	2010-03-16 18:47:15

Modified files:
	gdb            : ChangeLog ada-tasks.c 

Log message:
	Avoid switch to invalid ptid during Ada task switch.
	
	This is to prevent an internal error during an Ada task switch. A task
	switch is simply a thread switch under the hood. What we do is collect
	the info from the Ada Task Control Block, deduce the associated thread
	ptid, and then switch to that thread.  If the thread ptid computation
	routine has not been implemented for the target, of if there is a bug,
	then we end up computing a bogus ptid which GDB does not know about,
	which eventually leads to an assertion failure:
	
	(gdb) task 1
	[New Thread 5715]
	/[...]/gdb/thread.c:595: internal-error: is_thread_state:
	Assertion `tp' failed.
	A problem internal to GDB has been detected,
	further debugging may prove unreliable.
	Quit this debugging session? (y or n)
	
	When this happens, it's just nicer for the user to print an error
	message, and cancel the task switch. After this patch is applied,
	this is what we get:
	
	(gdb) task 1
	[New Thread 10250]
	Unable to compute thread ID for task 1.
	Cannot switch to this task.
	
	gdb/ChangeLog:
	
	* ada-tasks.c (task_command_1): Check that the task ptid is valid
	before doing the associated thread switch.

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gdb/ChangeLog.diff?cvsroot=src&r1=1.11490&r2=1.11491
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gdb/ada-tasks.c.diff?cvsroot=src&r1=1.28&r2=1.29


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