[RFA/commit] Internal error while loading core on alpha-tru64

Joel Brobecker brobecker@adacore.com
Thu Dec 31 07:03:00 GMT 2009


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
-------------- next part --------------
A non-text attachment was scrubbed...
Name: corelow.diff
Type: text/x-diff
Size: 1037 bytes
Desc: not available
URL: <http://sourceware.org/pipermail/gdb-patches/attachments/20091231/d7f949ab/attachment.bin>


More information about the Gdb-patches mailing list