This is the mail archive of the gdb-patches@sourceware.org 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: [commit/AIX] Fix error when loading core file


Ulrich Weigand wrote:
Joel Brobecker wrote:

I think the problem started when we introduced post_create_inferior.
This causes us to call the SOLIB_CREATE_INFERIOR_HOOK, which in our
case is defined as a call to xcoff_relocate_symtab. I haven't really
checked with older versions of GDB because rebuilding GDB on AIX is
mighty slow, but it very much looks like this function was not called
in the case of core files before. This function is assuming a live process,
not a core file. So what I did was do an early return when debugging
a core file.

Yes, if you look at the SOLIB_ADD definition:


#define SOLIB_ADD(a, b, c, d)   \
  if (PIDGET (inferior_ptid))   \
    /* Attach to process.  */  \
    xcoff_relocate_symtab (PIDGET (inferior_ptid)); \
  else          \
    /* Core file.  */ \
    xcoff_relocate_core (c);

it is clear that the _symtab version is intended to be called only
in the case of live process.

It looks like something changed to get SOLIB_CREATE_INFERIOR_HOOK
now invoked as well ...


What this made me realize, however, is that we should really be
converting the AIX port to using the target_so_ops. I'll try to do
that soon. In the meantime, the attached patch should be good enough.

Yes, I noticed that as well. I had already started to do that, but got side-tracked by other stuff in the meantime. One problem is that the ldinfo ptrace call that is required to get at the list of loaded shared libraries is really a native-only call.

I'd thought of defining a TARGET_OBJECT_LDINFO xfer_partial object
that reflects the contents of the ldinfo, and use this in the
implementation of a (platform-independent) solib-aix.c file.
The rs6000 native target and the core file support would need to
be extended to supply that object.


If AIX needs to use native calls to get at the shared libraries list,
perhaps you could also look if the solib-target.c Daniel is pushing
for remote dll support, and see if it would be a good fit for AIX too.
As a quick look it seems so. You would move aix_current_sos
to the target_ops, and perhaps needs a few other tweaks (aix_in_dynsym_resolve_code, and aix_solib_create_inferior_hook).
Although he presented it as remote support, it also makes sense
for native win32 debugging, so it may also make sense as native
AIX debugging.


You would need these applied:
http://sourceware.org/ml/gdb-patches/2007-05/msg00140.html
http://sourceware.org/ml/gdb-patches/2007-05/msg00145.html

Cheers,
Pedro Alves


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