From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 18697 invoked by alias); 1 Jan 2004 00:51:42 -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 18686 invoked from network); 1 Jan 2004 00:51:40 -0000 Received: from unknown (HELO walton.kettenis.dyndns.org) (213.93.115.144) by sources.redhat.com with SMTP; 1 Jan 2004 00:51:40 -0000 Received: from elgar.kettenis.dyndns.org (elgar.kettenis.dyndns.org [192.168.0.2]) by walton.kettenis.dyndns.org (8.12.6p3/8.12.6) with ESMTP id i010p9iu007831; Thu, 1 Jan 2004 01:51:09 +0100 (CET) (envelope-from kettenis@elgar.kettenis.dyndns.org) Received: from elgar.kettenis.dyndns.org (localhost [127.0.0.1]) by elgar.kettenis.dyndns.org (8.12.6p3/8.12.6) with ESMTP id i010p8Te016801; Thu, 1 Jan 2004 01:51:08 +0100 (CET) (envelope-from kettenis@elgar.kettenis.dyndns.org) Received: (from kettenis@localhost) by elgar.kettenis.dyndns.org (8.12.6p3/8.12.6/Submit) id i010p5Yg016798; Thu, 1 Jan 2004 01:51:05 +0100 (CET) Date: Thu, 01 Jan 2004 00:51:00 -0000 Message-Id: <200401010051.i010p5Yg016798@elgar.kettenis.dyndns.org> From: Mark Kettenis To: gdb@sources.redhat.com, dan@debian.org, amitkale@emsyssoft.com, peter@freebsd.org, obrien@freebsd.org, fvdl@netbsd.org Subject: [RFC] Adding %cs and %ss for AMD64 to GDB X-SW-Source: 2004-01/txt/msg00000.txt.bz2 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