GDB on SGI Irix 6.5
Eli Zaretskii
eliz@is.elta.co.il
Wed Jun 13 01:53:00 GMT 2001
I'm forwarding this to the list per Andrew's suggestion, to give people
background when they read the followups.
---------- Forwarded message ----------
Date: Tue, 12 Jun 2001 15:43:00 +0300 (IDT)
From: Eli Zaretskii <eliz@is.elta.co.il>
To: Andrew Cagney <ac131313@cygnus.com>
Cc: David B Anderson <davea@quasar.engr.sgi.com>
Subject: Re: GDB on SGI Irix 6.5
On Thu, 17 May 2001, David B Anderson wrote:
> The 64bit dwarf2 that is read by read_initial_length is based on
> dwarf 2.1, designed in 2000. SGI 64bit dwarf2 was designed in
> the early 1990's. SGI made offsets etc 64bit in elf64
> (and offsets etc 32bits in elf32).
> (basically we could not bring ourselves to limit dwarf
> offsets to 32 bits in an elf64 file...)
>
> Anyway, to be correct for IRIX6, read_initial_length
> needs to know it is IRIX elf64 and then
> /* UNTESTED, NOT ALL THAT NEEDS TO BE DONE probably */
> cu_header->initial_length_size = 8;
> cu_header->offset_size = 8;
> at least gives the right sizes.
Andrew, I think I need your help to decide how to go about adding support
for the debugging SGI 64-bit executables, since my understanding of
multi-arch is still almost nonexistent.
First, it is not clear to me whether the issue of SGI's n32 vs 64 ABI is
at all consistent with the design of GDB's mult-arch facilities. We are
talking about two ABIs which are almost identical, including the registers'
layout, but their debug info is recorded in two different formats. Is
this something multi-arch is supposed to handle?
Note that the SGI 64-bit dwarf2 format is not one of the formats for
which there's a reader available in the GDB distribution. So basically
we are talking about an unsupported debug info format, which in principle
would require a separate *read.c module, along with coffread.c,
dwarf2read.c, etc.
Am I missing something?
Of course, since the difference in the two dwarf2 formats is not too
large, I could somehow sneak this in without writing a full-fledged debug
info reader. But would this be accepted, and if so, how, if at all, can I
use the multi-arch infrastructure to control this?
Assuming that multi-arch somehow can be tweaked into doing this, my next
question is: how do I set things up for GDB to identify the debug info
format automatically? That is, if I type "gdb myprog", how can GDB find
out that `myprog' is a 64-bit executable and automatically switch to the
64bit ABI architecture?
More generally, what facilities are there in gdbarch to identify the
architecture of the debuggee automatically? (My impression is that there
are no such facilities and that the user should do that manually from
inside GDB, but perhaps I'm missing something.)
Thanks in advance for any help.
More information about the Gdb
mailing list