This is the mail archive of the
gdb@sources.redhat.com
mailing list for the GDB project.
Re: Asynchronous GDB
- To: gdb at sourceware dot cygnus dot com
- Subject: Re: Asynchronous GDB
- From: James Cownie <jcownie at etnus dot com>
- Date: Fri, 05 Jan 2001 10:28:53 +0000
- cc: Jamie Guinan <guinan at bluebutton dot com>
- Reply-To: James Cownie <jcownie at etnus dot com>
Jamie Guinan wrote :
> I'm interested in GDB's ability to run asynchronously, like being able to
> examine and modify values without stopping the debugged program.
Depending on the operating system this may not be possible no matter
how gdb works. On systems which use the ptrace interface for debugging
(e.g. Linux, AIX) the ptrace system call itself _requires_ that the
target process be stopped before allowing the debugger to delve around
inside it.
Taking linux/x86 as a "for instance", here's the relevant code for the
sys_ptrace in arch/i386/kernel/ptrace.c
...
if (child->state != TASK_STOPPED) {
if (request != PTRACE_KILL)
goto out;
}
...
In other words the only thing you can do via ptrace to an unstopped
process is kill it.
-- Jim
James Cownie <jcownie@etnus.com>
Etnus, LLC. +44 117 9071438
http://www.etnus.com