From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 18923 invoked by alias); 9 Nov 2006 21:49:31 -0000 Received: (qmail 18914 invoked by uid 22791); 9 Nov 2006 21:49:30 -0000 X-Spam-Check-By: sourceware.org Received: from nevyn.them.org (HELO nevyn.them.org) (66.93.172.17) by sourceware.org (qpsmtpd/0.31.1) with ESMTP; Thu, 09 Nov 2006 21:49:26 +0000 Received: from drow by nevyn.them.org with local (Exim 4.54) id 1GiHm0-0005cj-3d for gdb-patches@sourceware.org; Thu, 09 Nov 2006 16:49:24 -0500 Date: Thu, 09 Nov 2006 21:49:00 -0000 From: Daniel Jacobowitz To: gdb-patches@sourceware.org Subject: Re: [rfc] Autoselect x86_64 or i386 based on the remote g packet size Message-ID: <20061109214924.GA21448@nevyn.them.org> Mail-Followup-To: gdb-patches@sourceware.org References: <20061109205755.GA18755@nevyn.them.org> <20030.82.92.89.47.1163108189.squirrel@webmail.xs4all.nl> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20030.82.92.89.47.1163108189.squirrel@webmail.xs4all.nl> User-Agent: Mutt/1.5.13 (2006-08-11) X-IsSubscribed: yes Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2006-11/txt/msg00063.txt.bz2 On Thu, Nov 09, 2006 at 10:36:29PM +0100, Mark Kettenis wrote: > Hi Daniel, > > I can't say I'm very enthousiastic about this patch. It feels like a > kludge to avoid adding proper support to the remote protocol that allows > gdb to interrogate the target about this. A very clever kludge, but still > a kludge. True. I'm not avoiding it, though; that interrogation happens to be mentioned here: http://sourceware.org/ml/gdb-patches/2006-11/msg00055.html Something I haven't implemented yet, but probably will before posting the XML bits: this is enough to implement a remote target which can tell you its architecture! Pretty neat, though a little tricky to get right. What we ought to do at that point is validate that the remote target and the selected executable have sufficiently compatible architectures. Then GDB will be able to warn me when I connect a MIPS cross GDB to an i386 gdbserver by accident (which I do probably once a week). Honestly, this clever auto-detection is much more useful for MIPS than it is for i386/AMD64; for MIPS, an executable file doesn't necessarily contain the answer to the question, but for i386 it always does. I implemented the AMD64 bits after I had it working for MIPS, as a demo when Jan K. posted an even kludgier patch to warn about this case a couple of weeks ago. If you don't like this bit, I'd be happy to drop it, and make gdbserver report the architecture manually when I advance to the XML stage of these target descriptions. I won't mourn the i386 parts of this patch. Would you rather I did that? (I'd like to hold on to the MIPS bits, because they're solving a slightly different problem, and because I know they're useful with existing non-gdbserver stubs that would be harder to fix.) -- Daniel Jacobowitz CodeSourcery