From: Joel Brobecker <brobecker@adacore.com>
To: gdb-patches@sourceware.org
Subject: [RFA/commit] Internal error while loading core on alpha-tru64
Date: Thu, 31 Dec 2009 07:03:00 -0000 [thread overview]
Message-ID: <20091231070224.GE548@adacore.com> (raw)
[-- Attachment #1: Type: text/plain, Size: 1884 bytes --]
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
[-- Attachment #2: corelow.diff --]
[-- Type: text/x-diff, Size: 1037 bytes --]
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);
}
next reply other threads:[~2009-12-31 7:03 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-12-31 7:03 Joel Brobecker [this message]
2009-12-31 7:51 ` Pedro Alves
2009-12-31 10:59 ` Joel Brobecker
2009-12-31 17:14 ` Pedro Alves
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=20091231070224.GE548@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