gdb "attach" and sharing thread info between processes

Egor Duda deo@logos-m.ru
Fri Apr 30 06:39:00 GMT 1999


Hi!

CF> The recently announced gdb 4.18 should have the ability to attach to
CF> a running process and manipulate threads.

CF> You can get the sources from
CF> ftp://sourceware.cygnus.com/pub/gdb/releases/gdb-4.18.tar.bz2 .

Thanks,  it  really  works. The only drawback I encountered is that it
fails  to  load  dll  symbols  when attaching to process. According to
comments  in  win32-nat.c  that's because gdb cannot retrieve full dll
file name.
Microsoft provide special dll -- psapi.dll

http://msdn.microsoft.com/library/sdkdoc/winbase/psapi_0bjn.htm

which provides all needed functionality. Alas, this method works under
NT  only. Moreover -- this dll is nonstandard -- it's not available in
common  NT  distribution  (though it's included in ResKit). Below is a
patch for gdb-4.18 to make it use psapi.dll, if possible.

I'm   also  planning  to  make  a  patch  to winsup, which would allow
to  handle exceptions  by  starting  debugger.  i  think  it  would be
acceptable  substitution  for  core  files  functionality. What do you
think about usefulness of such patch?

Egor.            mailto:deo@logos-m.ru ICQ 5165414 FidoNet 2:5020/496.19
win32-nat.diff.gz



More information about the Cygwin-developers mailing list