Bug 12212 - gdb.selected_thread() core dumps gdb if no inferior is running
Summary: gdb.selected_thread() core dumps gdb if no inferior is running
Status: RESOLVED FIXED
Alias: None
Product: gdb
Classification: Unclassified
Component: python (show other bugs)
Version: 7.2
: P2 normal
Target Milestone: 7.3
Assignee: Phil Muldoon
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-11-12 14:01 UTC by Mark Florisson
Modified: 2010-11-23 14:13 UTC (History)
1 user (show)

See Also:
Host:
Target:
Build:
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Mark Florisson 2010-11-12 14:01:30 UTC
$ gdb -n -q                                                                                                                                    
(gdb) python print gdb.selected_thread()
inferior.c:362: internal-error: find_inferior_pid: Assertion `pid != 0' failed.
A problem internal to GDB has been detected,
further debugging may prove unreliable.
Quit this debugging session? (y or n)
Comment 1 Phil Muldoon 2010-11-23 14:13:40 UTC
CVSROOT:	/cvs/src
Module name:	src
Changes by:	pmuldoon@sourceware.org	2010-11-23 13:33:23

Modified files:
	gdb            : ChangeLog 
	gdb/python     : py-inferior.c 
	gdb/testsuite  : ChangeLog 
	gdb/testsuite/gdb.python: python.exp 

Log message:
	2010-11-23  Phil Muldoon  <pmuldoon@redhat.com>
	
	PR python/12212
	
	* python/py-inferior.c (find_thread_object): Check if PIDGET
	returns 0.
	
	2010-11-23  Phil Muldoon  <pmuldoon@redhat.com>
	
	PR python/12212
	
	* gdb.python/python.exp: Check that selected_thread raises an
	error when no inferior is loaded.

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gdb/ChangeLog.diff?cvsroot=src&r1=1.12337&r2=1.12338
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gdb/python/py-inferior.c.diff?cvsroot=src&r1=1.2&r2=1.3
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gdb/testsuite/ChangeLog.diff?cvsroot=src&r1=1.2514&r2=1.2515
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gdb/testsuite/gdb.python/python.exp.diff?cvsroot=src&r1=1.17&r2=1.18