From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Eli Zaretskii" To: gdb@sources.redhat.com Cc: ac131313@cygnus.com Subject: Re: GDB on SGI Irix 6.5 Date: Thu, 19 Apr 2001 06:08:00 -0000 Message-id: <3405-Thu19Apr2001160546+0300-eliz@is.elta.co.il> References: X-SW-Source: 2001-04/msg00140.html > Date: Wed, 18 Apr 2001 19:31:42 +0300 (IDT) > From: Eli Zaretskii > > On Tue, 17 Apr 2001, Andrew Cagney wrote: > > > Hmm, I've this sinking feeling that, prior to me adding the assert() it > > was falling off the end of the regcache and just blatting memory :-/ > > > > 72, I've this feeling that it is the ``FP'': > > > > ac131313@localhost$ grep 72 config/mips/tm-* > > config/mips/tm-mips.h:#define FP_REGNUM 72 /* Pseudo > > register that contains true address of executing stack frame */ > > > > As a quick hack, pump up NUM_PSEUDO_REGS to make space for this (and > > possibly a few more). > > Thanks for the hint. > > However, this doesn't work: it again bumps into internal_error because > there's no gdbarch method for fetching pseudo registers. How would such > a method look for a target that doesn't have a frame pointer? > > Also, strangely enough, tm-irix3.h does define a place for FP in the > registers array (at index 30). So why doesn't it define FP_REGNUM > accordingly? I think I've got it: tm-irix3.h is simply wrong for either Irix 6.5 or the N32 ABI and the MIPS CPUs that support it (or both). Not only should FP_REGNUM be set to 30, but the enumeration and the total number of registers defined on tm-irix3.h is incorrect for the SGI machine I have here. tm-mips.h, which defines FP_REGNUM to 72, is also wrong for Irix, at least for Irix 6.5 with N32 executables. I have no idea how could this possibly work for anyone in the past. I have a provisional patch which seems to DTRT for me. But to clean it up (so that I can submit it without blushing ;-), I need help in making several decisions, since I have no prior experience with, or knowledge about, the different CPUs and ABIs supported by SGI Irix. Questions: - 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. - 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?). Thanks in advance for any help.