From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 6181 invoked by alias); 1 Jan 2004 06:15:20 -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 6111 invoked from network); 1 Jan 2004 06:15:07 -0000 Received: from unknown (HELO svr44.ehostpros.com) (66.98.192.92) by sources.redhat.com with SMTP; 1 Jan 2004 06:15:07 -0000 Received: from [61.11.17.253] (port=10074 helo=askii-pc) by svr44.ehostpros.com with asmtp (Exim 4.24) id 1Abw6x-0001Tg-7Q; Wed, 31 Dec 2003 22:15:11 -0800 From: "Amit S. Kale" Organization: EmSysSoft To: Mark Kettenis , gdb@sources.redhat.com, dan@debian.org, peter@freebsd.org, obrien@freebsd.org, fvdl@netbsd.org, Jim Houston Subject: Re: [RFC] Adding %cs and %ss for AMD64 to GDB Date: Thu, 01 Jan 2004 06:15:00 -0000 User-Agent: KMail/1.5 References: <200401010051.i010p5Yg016798@elgar.kettenis.dyndns.org> In-Reply-To: <200401010051.i010p5Yg016798@elgar.kettenis.dyndns.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200401011144.29524.amitkale@emsyssoft.com> X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - svr44.ehostpros.com X-AntiAbuse: Original Domain - sources.redhat.com X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - emsyssoft.com X-SW-Source: 2004-01/txt/msg00004.txt.bz2 Mark, Linux kgdb indeed will not have much of a problem. I anyway have posted a gdb with kernel module loading feature at kgdb.sourceforge.net. It's going to stay there for till the time this feature makes it to official gdb. I can add this change also to that gdb. I guess it's time to introduce a version stamp on remote protocol. That way any further modifications to the protocol will not result in surprises from gdb-gdbserver mismatches. On Thursday 01 Jan 2004 6:21 am, Mark Kettenis wrote: > Folks, > > GDB doesn't handle %cs and %ss for AMD64 yet. I'm not sure why they > were omitted (might be because they're not particularly useful in long > mode), but there are cases where we might need them. I might add > these registers after the current last register (%mxcsr), but it just > seems so much more logical to have them close to the other segment > registers. However, since GDB's register numbering influences the > remote interface, I cannot simply do this. > > So here's my question: How bad would it be to change the remote > protocol for AMD64? > > I'm proposing to add %cs and %ss just after %eflags. This would mean > that the segment registers, the floating-point registers and the SSE > registers will shift. Using a new GDB with an old gdbserver, or an > old remote stub, will mean those registers will contain bogus values. > > I did a small survey of the Open Source projects that might make use > of GDB's remote interface to see what the impact would be: > > * Linux kgdb doesn't use anything beyond %eflags yet. Impact would be > zero. > > * FreeBSD kgdb supplies %cs and %ss in the slots that are now reserved > for %ds and %es. It provides zero for %fs and %gs (which it thinks > are %ds and %es). The impact would be positive! > > * NetBSD kgdb doesn't seem to support remote debugging for AMD64 yet. > > * Gdbserver supplies %cs and %ss in the slots that are now reserved > for %ds and %es, %ds and %es in the slots for %fs and %gs, and %fs > and %gs in the slots for %st0 and %st1. So the situation for the > segment registers would actually improve! However, for the > floating-point and SSE registers the situation would become worse, > although right now the most important floating-point registers %st0 > and %st1 might be unreliable. > > Note that the problems with gdbserver can be solved by simply > upgrading gdbserver on the remote machine, which in most cases won't > bee too difficult. I can't imagine that there are many embedded AMD64 > systems out there yet. > > From the above I conclude that it wouldn't be too bad to add the %cs > and %ss registers the way I propose. However, don't hesitate to tell > me if you think differently. > > Mark -- Amit Kale EmSysSoft (http://www.emsyssoft.com) KGDB: Linux Kernel Source Level Debugger (http://kgdb.sourceforge.net)