This is the mail archive of the gdb-patches@sources.redhat.com 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]

Re: RFA: infptrace fix


Kevin Buettner wrote:
On Feb 24, 6:31pm, J. Johnston wrote:


The following patch fixes a problem on linux regarding attached
processes.  When gdb quits, it goes to detach the process.  If the
process has already been killed, the ptrace detach call sets errno.
This causes infptrace.c: detach() to issue a perror_with_name()
call which eventually gets caught and the user is returned to the
gdb prompt.  If we try and quit again, we go through the same
sequence and so on and so on.

The patch recognizes if errno is set to ESRCH, indicating that the
process cannot be found which is ok and should not result in an
error being flagged.

Ok to install?


-- Jeff J.


2003-02-24 Jeff Johnston <jjohnstn at redhat dot com>

	* infptrace.c (detach): Do not flag error if ptrace detach fails and
	errno is set to ESRCH.


This is okay.

(For other errors during detach, I wonder if it'd make sense to just
issue a warning which decodes the errno...)


Thanks Kevin. Patch applied. I also wondered if a warning should be issued but I do not know what other errors can occur with the detach operation. I also considered moving the attached_flag reset to before the error check so at least we didn't come back to detach it again and again.

-- Jeff J.




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