GDB 5.1/Core files and ptids
Takis Psarogiannakopoulos
takis@XFree86.Org
Thu Jan 17 08:08:00 GMT 2002
Hi Kevin,
On Wed, 16 Jan 2002, Kevin Buettner wrote:
> The context here is that we're trying to fetch the appropriate
> .reg (.reg2, etc) section from bfd, right?
That is correct. We are trying to get a section with name "name".
> > Especially when, even in the new gdb-5.1/bfd we find:
> >
> > ======
> > static int
> > elfcore_make_pid (abfd)
> > bfd *abfd;
> > {
> > return ((elf_tdata (abfd)->core_lwpid << 16)
> > + (elf_tdata (abfd)->core_pid));
> > }
> > =======
>
> This will need to change. It is incorrect to attempt to represent
> both the pid and lwp as a single integer whose size isn't large
> enough to hold all of the bits.
>
I have no problem with the ptid especially when it is less confusing
from the old mixed pid's!
My problem is that a core DG/UX file has lot of info sections that
I would like to read and wasnt sure if gdb would be able now taking
in account that elfcore_make_pid had the above form.
> So, to fetch a .reg section in a multithreaded core dump where
> the pid is 14 and the lwp is 42, GDB would need to ask BFD for
> the .reg/14+42 (pseudo) section.
>
> else if (TIDGET (inferior_ptid))
> sprintf (section_name, "%s/%d+%d", name, PIDGET (inferior_ptid),
> TIDGET (inferior_ptid));
> else if (PIDGET (inferior_ptid))
> sprintf (section_name, "%s/%d", name, PIDGET (inferior_ptid));
> else
> strcpy (section_name, name);
>
OK. That is indeed a solution to what I was saying about reading sections
using ptid's. Thanks Kevin.
Regards,
Takis
More information about the Binutils
mailing list