Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* [commit/AIX] Fix error when loading core file
@ 2007-05-20  0:01 Joel Brobecker
  2007-05-20 15:12 ` Ulrich Weigand
  0 siblings, 1 reply; 12+ messages in thread
From: Joel Brobecker @ 2007-05-20  0:01 UTC (permalink / raw)
  To: gdb-patches

[-- Attachment #1: Type: text/plain, Size: 1259 bytes --]

Hello,

We noticed the following problem with gdb-6.6 when trying to load
a core file on AIX:

        (gdb) core core
        ptrace ldinfo: No such process.

This is the cause of 2 FAILS in corefile.exp.

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.

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.

2007-05-19  Joel Brobecker  <brobecker@adacore.com>

        * rs6000-nat.c (xcoff_relocate_symtab): Do nothing if debugging
        a core file. Add comment in the function description.

Tested on ppc-aix, fixes:

        gdb.base/corefile.exp: args: execfile -core=corefile
        gdb.base/corefile.exp: core-file command

Committed.

-- 
Joel

[-- Attachment #2: aix-core.diff --]
[-- Type: text/plain, Size: 856 bytes --]

Index: rs6000-nat.c
===================================================================
RCS file: /cvs/src/src/gdb/rs6000-nat.c,v
retrieving revision 1.70
diff -u -p -r1.70 rs6000-nat.c
--- rs6000-nat.c	11 May 2007 19:55:20 -0000	1.70
+++ rs6000-nat.c	18 May 2007 22:17:46 -0000
@@ -1016,7 +1016,9 @@ rs6000_create_inferior (char *exec_file,
 
 \f
 /* xcoff_relocate_symtab -      hook for symbol table relocation.
-   also reads shared libraries.  */
+   
+   This is only applicable to live processes, and is a no-op when
+   debugging a core file.  */
 
 void
 xcoff_relocate_symtab (unsigned int pid)
@@ -1028,6 +1030,9 @@ xcoff_relocate_symtab (unsigned int pid)
   int ldisize = arch64 ? sizeof (ldi->l64) : sizeof (ldi->l32);
   int size;
 
+  if (ptid_equal (inferior_ptid, null_ptid))
+    return;
+
   do
     {
       size = load_segs * ldisize;

^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2007-05-31 21:40 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-05-20  0:01 [commit/AIX] Fix error when loading core file Joel Brobecker
2007-05-20 15:12 ` Ulrich Weigand
2007-05-20 15:50   ` Pedro Alves
2007-05-20 23:22     ` Pedro Alves
2007-05-21 13:24       ` Ulrich Weigand
2007-05-21 13:32         ` Daniel Jacobowitz
2007-05-28 20:00           ` Ulrich Weigand
2007-05-28 20:52             ` Daniel Jacobowitz
2007-05-31 21:24               ` Ulrich Weigand
2007-05-31 21:43                 ` Daniel Jacobowitz
2007-05-22 18:14   ` Joel Brobecker
2007-05-22 23:19     ` Joel Brobecker

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox