From: Joel Brobecker <brobecker@adacore.com>
To: gdb-patches@sourceware.org
Subject: [commit/AIX] Fix error when loading core file
Date: Sun, 20 May 2007 00:01:00 -0000 [thread overview]
Message-ID: <20070520000154.GW3565@adacore.com> (raw)
[-- 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;
next reply other threads:[~2007-05-20 0:01 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-05-20 0:01 Joel Brobecker [this message]
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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20070520000154.GW3565@adacore.com \
--to=brobecker@adacore.com \
--cc=gdb-patches@sourceware.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox