Mail Archives: cygwin/1998/06/17/14:05:53.1
On Tue, 16 Jun 1998, Stephen Marley wrote:
> Since the process I need to debug is forked from the one started
> at the command line, I need to attach gdb to a running process
> but gdb refuses to do it.
>
> The UID's of gdb and my programm are the same so why does this
> fail?
First, you need the Win32 Pid of your process (normally the value under
the WIN32-PID if you use the ps that comes with GNU-Win32). Use this pid
with the attach command of gdb (I suppose you already know all that). I
have a look at the gdb source code (the win32-nat.c file to be precise)
and apparently, when you attach to a process the handle of the current
thread (multithread are not handled apparently) is not put into one of the
global variable that normally contain the current thread handle. So if you
do a backtrace command, you only get a stupid message.
I precise that I get the latest version of gdb (4.17) to see that. I have
done some work around to get the thread handle, but in many cases I get
several thread handle because the program I debugged has launched several
threads (for example when you hit Control-C or open a file open dialog
boxe or play some sound, you get several threads). Apparently there are
some ways to handle multithreading within gdb, but I am still
investigated. I could post my win32-nat.c file but I do not know how to
use diff and all that stuff. (and I had some other work to be done too
:-/)
Benoit.
-
For help on using this list (especially unsubscribing), send a message to
"gnu-win32-request AT cygnus DOT com" with one line of text: "help".
- Raw text -