This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
[RFA/commit] Internal error while loading core on alpha-tru64
- From: Joel Brobecker <brobecker at adacore dot com>
- To: gdb-patches at sourceware dot org
- Date: Thu, 31 Dec 2009 11:02:24 +0400
- Subject: [RFA/commit] Internal error while loading core on alpha-tru64
Hello,
There is an internal-error due to GDB not being able to find
the inferior address space when trying to load a core file on
alpha-tru64.
The core file is for a program that does not use threads. The name
of the section where the registers is saved is .reg. core_open
prefers .reg/NN rather than .reg, and has some special code to
handle the case where no .reg/NN section was found.
/* Either we found no .reg/NN section, and hence we have a
non-threaded core (single-threaded, from gdb's perspective),
or for some reason add_to_thread_list couldn't determine
which was the "main" thread. The latter case shouldn't
usually happen, but we're dealing with input here, which can
always be broken in different ways. */
struct thread_info *thread = first_thread_of_process (-1);
if (thread == NULL)
{
add_inferior_silent (CORELOW_PID);
inferior_ptid = pid_to_ptid (CORELOW_PID);
add_thread_silent (inferior_ptid);
}
The problem is that the code above is it is using add_inferior_silent.
As a result, we end up with a second inferior in our list (which I do
not think is expected), and also this new inferior has no program or
address space.
The fix I applied was to replace the call to add_inferior_silent
by a call to inferior_appeared... I think that this was the right
thing to do.
2009-12-31 Joel Brobecker <brobecker@adacore.com>
Internal error while loading core on alpha-tru64.
* corelow.c (core_open): Delete unused local variables.
Use inferior_appeared instead of add_inferior_silent.
Tested on alpha-tru64 with the AdaCore gdb-testsuite (I can no longer
run the dejagnu testsuite on this platform). This is the only platform
where I observed this issue.
Will commit in a few days unless there are any objections.
--
Joel
commit da99585b71b9646f9468e1f6aff00c9fcd18202b
Author: brobecke <brobecke@f8352e7e-cb20-0410-8ce7-b5d9e71c585c>
Date: Thu Dec 31 06:25:05 2009 +0000
Internal error while loading core on alpha-tru64.
* corelow.c (core_open): Delete unused local variables.
Use inferior_appeared instead of add_inferior_silent.
diff --git a/gdb/corelow.c b/gdb/corelow.c
index d0eada6..15ecd2d 100644
--- a/gdb/corelow.c
+++ b/gdb/corelow.c
@@ -302,8 +302,6 @@ core_open (char *filename, int from_tty)
bfd *temp_bfd;
int scratch_chan;
int flags;
- int corelow_pid = CORELOW_PID;
- struct inferior *inf;
target_preopen (from_tty);
if (!filename)
@@ -423,7 +421,7 @@ core_open (char *filename, int from_tty)
struct thread_info *thread = first_thread_of_process (-1);
if (thread == NULL)
{
- add_inferior_silent (CORELOW_PID);
+ inferior_appeared (current_inferior (), CORELOW_PID);
inferior_ptid = pid_to_ptid (CORELOW_PID);
add_thread_silent (inferior_ptid);
}