From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 28467 invoked by alias); 30 Aug 2002 01:05:43 -0000 Mailing-List: contact gdb-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sources.redhat.com Received: (qmail 28456 invoked from network); 30 Aug 2002 01:05:42 -0000 Received: from unknown (HELO redhat.com) (66.30.22.225) by sources.redhat.com with SMTP; 30 Aug 2002 01:05:42 -0000 Received: by redhat.com (Postfix, from userid 201) id BF6FB1B887; Thu, 29 Aug 2002 21:05:39 -0400 (EDT) Date: Thu, 29 Aug 2002 18:05:00 -0000 From: Christopher Faylor To: gdb@sources.redhat.com Subject: Re: SEGV on display /i $pc with i386 target Message-ID: <20020830010539.GA28337@redhat.com> Mail-Followup-To: gdb@sources.redhat.com References: <20020829055103.GA26149@redhat.com> <86k7m9p9v9.fsf@elgar.kettenis.dyndns.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <86k7m9p9v9.fsf@elgar.kettenis.dyndns.org> User-Agent: Mutt/1.3.23.1i X-SW-Source: 2002-08/txt/msg00408.txt.bz2 On Fri, Aug 30, 2002 at 12:40:10AM +0200, Mark Kettenis wrote: >Christopher Faylor writes: >>I just noticed a SEGV whenever I do a 'display /i $pc' on cygwin. >> >>I tried building a gdb for linux to see what was going wrong on cygwin >>but it isn't much better: >> >>(top-gdb) display /i $pc >>1: x/i $(null) 0x8072f42 : push $0x6 >> >>The problem comes from the fact that, while gdb understands that $pc == >>$eip, it doesn't seem to know how to rename $pc to $eip when it is >>outputting the register name. You can get the same behavior by doing >>something like 'display /i $ps', too (even if that doesn't make sense >>it shouldn't SEGV). > >Hmm, this defenitely used to work in the past. Does anybody have an >idea what broke it? I tested cygwin releases that I generated all the way back to April and saw that, while there were no SEGVs on cygwin, I was getting bogus output where I saw something like $xmmi used rather than $eib in the display. Maybe Andrew's 2002-08-13 change to i386_register_name may have stopped that from occuring and, essentially, stopped masking some broken behavior. >>The simplest way to fix this is to extend the i386_register_names array >>to include builtin register names, however, maybe the right way to fix >>this is to add something to builtin-reg.c. > >I suspect this problem isn't i386-specific, so extending >i386_register_names seems to be the wrong approach to me. I agree. >> I noticed that i386_register_names seems to have 41 elements while >> the sum of NUM_REGS + NUM_PSEUDO_REGS == 40. Is that intentional? > >Sort of. In the current situation, Depending on whether your target >supports the SSE registers NUM_REGS will be either 32 or 41. Since >NUM_PSEUDO_REGS is 6, and 32 + 6 = 40. > >Perhaps this is a good moment to warn you about an implication of >multi-arching the i386 for Cygwin: the Cygwin targets don't support >SSE anymor, since we use the "Unknown" OS/ABI for Cygwin right now. I >doubt whether this is what you want. You probably want to introduce >some sort of Cygwin or Win32 OS/ABI that includes those registers. I noticed that while I was poking at this. I'll put this on my long todo list. cgf