PR/2386 [0/2]: MinGW attach to process without an exec file
Fri Dec 28 01:21:00 GMT 2007
The following two patches fix PR/2386 -
"gdb doesn't load symbols after 'gdb --pid <pid>'".
There are two MinGW related problems here, both relate
to the fact that target_so_ops are now associated
with the gdbarch in effect. If we're not able to find the
exec file of the attached inferior, we'll not be able to
set_current_gdbarch_from_bfd. When we need to get at the so list
of the inferior, solib_ops will return solib_null...
1 - We currently don't set a default gdb_osabi for *-*-mingw32.
Patch 1/2 takes care of it. This fixes the cases where for
some reason gdb isn't able to open a bfd to the executable.
Having a default osabi is useful for native debuggers. For
multi-target builds, the default will probably not make sense
for any other target than the native -- so we may want to
move this default osabi somewhere else, like the target interface,
or moving the target string matching into runtime code.
2 - win32_pid_to_exec_file (target_pid_to_exec_file), is currently
an empty stub implementation for MinGW, as I mentioned on
Patch 2/2 implements support for getting at the exec file
of native win32 processes. The patch tries to cover every
version of Windows we support, and tries to work even if
psapi.dll isn't present (it isn't part of the OS).
More information about the Gdb-patches