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 breakpoint.c breakpoint.h in ...


CVSROOT:	/cvs/src
Module name:	src
Changes by:	brobecke@sourceware.org	2012-08-16 23:54:50

Modified files:
	gdb            : ChangeLog breakpoint.c breakpoint.h 
	                 inf-ttrace.c infrun.c linux-nat.c 

Log message:
	Change detach_breakpoints to take a ptid instead of a pid
	
	Before this change, detach_breakpoints would take a pid, and then
	set inferior_ptid to a ptid that it constructs using pid_to_ptid (pid).
	Unfortunately, this ptid is not necessarily valid.  Consider for
	instance the case of ia64-hpux, where ttrace refuses a register-read
	operation if the LWP is not provided.
	
	This problems shows up when GDB is trying to handle fork events.
	Assuming GDB is configured to follow the parent, GDB will try to
	detach from the child. But before doing so, it needs to remove
	all breakpoints inside that child.  On ia64, this involves reading
	inferior (the child's) memory. And on ia64-hpux, reading memory
	requires us to read the bsp and bspstore registers, in order to
	determine where that memory is relative to the value of those
	registers, and thus to determine which ttrace operation to use in
	order to fetch that memory (see ia64_hpux_xfer_memory).
	
	This patch therefore changes detach_breakpoints to take a ptid instead
	of a pid, and then updates all callers.
	
	One of the consequences of this patch is that it trips an assert
	on GNU/Linux targets.  But this assert appears to have not actual
	purpose, and is thus removed.
	
	gdb/ChangeLog:
	
	* breakpoint.h (detach_breakpoints): pid parameter is now a ptid.
	* breakpoint.c (detach_breakpoints): Change pid parameter into
	a ptid.  Adjust code accordingly.
	* infrun.c (handle_inferior_event): Delete variable child_pid.
	Update call to detach_breakpoints to pass the child ptid for
	fork events.
	* linux-nat.c (linux_nat_iterate_watchpoint_lwps): Remove
	assert that inferior_ptid's lwp is zero.
	(linux_handle_extended_wait): Update call to detach_breakpoints.
	* inf-ttrace.c (inf_ttrace_follow_fork): Update call to
	detach_breakpoints.

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gdb/ChangeLog.diff?cvsroot=src&r1=1.14596&r2=1.14597
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gdb/breakpoint.c.diff?cvsroot=src&r1=1.699&r2=1.700
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gdb/breakpoint.h.diff?cvsroot=src&r1=1.186&r2=1.187
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gdb/inf-ttrace.c.diff?cvsroot=src&r1=1.64&r2=1.65
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gdb/infrun.c.diff?cvsroot=src&r1=1.555&r2=1.556
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gdb/linux-nat.c.diff?cvsroot=src&r1=1.257&r2=1.258


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