public inbox for gdb@sourceware.org
 help / color / mirror / Atom feed
[parent not found: <200106131650.JAA27856@quasar.engr.sgi.com>]
[parent not found: <Pine.SUN.3.91.1010612152328.3699B-100000@is>]
* Re: GDB on SGI Irix 6.5
@ 2001-06-13  1:53 Eli Zaretskii
  0 siblings, 0 replies; 30+ messages in thread
From: Eli Zaretskii @ 2001-06-13  1:53 UTC (permalink / raw)
  To: gdb

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.

^ permalink raw reply	[flat|nested] 30+ messages in thread
* Re: GDB on SGI Irix 6.5
@ 2001-05-17 10:15 David B Anderson
  2001-05-17 11:40 ` Eli Zaretskii
  0 siblings, 1 reply; 30+ messages in thread
From: David B Anderson @ 2001-05-17 10:15 UTC (permalink / raw)
  To: Eli Zaretskii, Daniel Berlin; +Cc: gdb, jkingdon, ac131313, davea

Daniel Berlin wrote:
|On Thu, 17 May 2001, Eli Zaretskii wrote:
|
|>
|> On Thu, 17 May 2001, Daniel Berlin wrote:
|>
|> > We should support 64 bit dwarf2 already, for the most part.
|>
|> Since when?
|Well, since about august of last year or something.
|
|The main difference between 64 bit dwarf2, and 32 bit dwarf2, is, of
|course, the offset sizes.
|
|The DWARF2.1 standard says that the cu header's initial length will tell
|us whether we are dealing with 4 byte offsets or 8 byte offsets.
|
|If you look at dwarf2read.c, you'll notice it handles offset sizes of both
|4 and 8.
|read_initial_length takes care of figuring out which offset size we have.
|
|
|> It's possible that I have an outdated tree, in which case I'm sorry for
|> the line noise.


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.

Ben Gamsa's patch on my website is a crude version of the above
(not suitable for inclusion in gdb, but at least it has the
key changes IRIX6 elf64 dwarf2 requires, for an older gdb).
(patch is not multi-arch.)
See the end of the page
	http://reality.sgi.com/davea/objectinfo.html
(which Eli already noticed).

I'm on vacation all week, but I'll apply Eli's patches
and try out gdb asap.  Hopefully tonight or tomorrow night.
Been kind of behind in email due to vacation.

Regards,
David B. Anderson davea@sgi.com danderson@acm.org http://reality.sgi.com/davea/

^ permalink raw reply	[flat|nested] 30+ messages in thread
* Re: GDB on SGI Irix 6.5
@ 2001-04-19 18:06 David B Anderson
  2001-04-21 11:12 ` Eli Zaretskii
  2001-04-21 13:09 ` David B Anderson
  0 siblings, 2 replies; 30+ messages in thread
From: David B Anderson @ 2001-04-19 18:06 UTC (permalink / raw)
  To: gdb; +Cc: jkingdon, ac131313, eliz

>  - Should I make the change in tm-irix5.h, or should I leave it alone
>    and create irix6x.h?  The issue here is that perhaps Irix 5 did
>    work like tm-irix5.h says, and I won't want to break that.

I suggest creating tm-irix6.h
IMO it's misleading to keep using the irix5 designation for irix6
and will lead to difficulty. But I'm far far from being an expert
on gdb, so take this with  a grain of salt.

>  - What should I do about the different ABIs?  At least 3 come to
>    mind: O32, N32, and N64.  They have subtly different layouts of
>    registers, so if I need to set things up for more than a single
>    ABI, I'll need to know what's the current say-so about how this
>    should be done (e.g., does gdbarch has some functionality for
>    dynamically computing the registers array?).

The register layouts for n32 and 64 are the same.
Pointer and int are different sizes, but the registers
themselves are the same and designated the same.

The register set for o32 is different, and should be the same as for
irix5.

Recall that o32 uses the mdebug/third-eye format for debug info
while n32/64 uses dwarf2 exlusively for debug info
(should be irrelevant as far as registers go though).

I am not much help in determining the 'right way to do things' for
gdb, but if there is any way I can help with building or
testing or anything on IRIX6.5, let me know.

Regards,
David B. Anderson davea@sgi.com danderson@acm.org http://reality.sgi.com/davea/

^ permalink raw reply	[flat|nested] 30+ messages in thread
* GDB on SGI Irix 6.5
@ 2001-04-09  0:08 Eli Zaretskii
  2001-04-09  6:53 ` Daniel Berlin
  2001-04-17 10:38 ` Andrew Cagney
  0 siblings, 2 replies; 30+ messages in thread
From: Eli Zaretskii @ 2001-04-09  0:08 UTC (permalink / raw)
  To: gdb

Did someone successfully build the current CVS version on Irix 6.5?  If 
so, are there any special tricks one need to be aware of to do that?

I built GDB with "./configure; make" with the native C compiler and a 
native Make.  While it built okay, the resulting binary aborts at runtime 
like this:

  (src)gdb ./emacs
  GNU gdb 20010402
  Copyright 2001 Free Software Foundation, Inc.
  GDB is free software, covered by the GNU General Public License, and you are
  welcome to change it and/or distribute copies of it under certain  conditions.
  Type "show copying" to see the conditions.
  There is absolutely no warranty for GDB.  Type "show warranty" for details.
  This GDB was configured as "mips-sgi-irix6.5"...
  Environment variable "DISPLAY" not defined.
  TERM = vt220
  Breakpoint 1 at 0x100ff7d0: file emacs.c, line 384.
  Breakpoint 2 at 0x100d8e18: file xterm.c, line 11714.
  (gdb) b main
  Breakpoint 3 at 0x100ffe48: file emacs.c, line 736.
  (gdb) r -q
  Starting program: /gnu/emacs-21/emacs-21.0.101/src/./emacs -q
  regcache.c:282: gdb-internal-error: Assertion `regnum >= 0 && regnum < (NUM_REGS + NUM_PSEUDO_REGS)' failed.
  An internal GDB error was detected.  This may make further
  debugging unreliable.  Continue this debugging session? (y or n)

I've verified that this happens because legacy_read_register_gen is 
called with regnum = 72, while it doesn't expect any register to have a 
number greater than 71.

Any clues?

^ permalink raw reply	[flat|nested] 30+ messages in thread

end of thread, other threads:[~2001-06-14 15:54 UTC | newest]

Thread overview: 30+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <npae3c16ia.fsf@zwingli.cygnus.com>
2001-06-14  0:52 ` GDB on SGI Irix 6.5 Eli Zaretskii
2001-06-14 10:05   ` Daniel Berlin
2001-06-14 15:54   ` Jim Blandy
     [not found] <200106131650.JAA27856@quasar.engr.sgi.com>
2001-06-13 11:40 ` Eli Zaretskii
2001-06-13 13:05   ` Andrew Cagney
     [not found] <Pine.SUN.3.91.1010612152328.3699B-100000@is>
     [not found] ` <3B266F35.50007@cygnus.com>
     [not found]   ` <15142.30117.72465.686304@kwikemart.cygnus.com>
2001-06-13  1:55     ` Eli Zaretskii
2001-06-13 13:35     ` David B Anderson
2001-06-13 21:19       ` Daniel Berlin
2001-06-13  1:53 Eli Zaretskii
  -- strict thread matches above, loose matches on Subject: below --
2001-05-17 10:15 David B Anderson
2001-05-17 11:40 ` Eli Zaretskii
2001-04-19 18:06 David B Anderson
2001-04-21 11:12 ` Eli Zaretskii
2001-04-21 12:09   ` Paul Hilfinger
2001-04-21 13:09 ` David B Anderson
2001-04-21 13:19   ` Eli Zaretskii
2001-05-17  8:58   ` Eli Zaretskii
2001-05-17  9:15     ` Eli Zaretskii
2001-05-17  9:26       ` Daniel Berlin
2001-05-17  9:28         ` Eli Zaretskii
2001-05-17  9:41           ` Daniel Berlin
2001-05-17 11:33             ` Eli Zaretskii
2001-05-17 11:47               ` Daniel Berlin
2001-04-09  0:08 Eli Zaretskii
2001-04-09  6:53 ` Daniel Berlin
2001-04-17 10:38 ` Andrew Cagney
2001-04-18  9:29   ` Eli Zaretskii
2001-04-19  6:08     ` Eli Zaretskii
2001-04-30 10:01       ` Andrew Cagney
2001-04-30 11:28         ` Eli Zaretskii

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).