From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 19560 invoked by alias); 27 Sep 2006 18:27:11 -0000 Received: (qmail 19552 invoked by uid 22791); 27 Sep 2006 18:27:10 -0000 X-Spam-Check-By: sourceware.org Received: from mx2.palmsource.com (HELO mx2.palmsource.com) (12.7.175.14) by sourceware.org (qpsmtpd/0.31) with ESMTP; Wed, 27 Sep 2006 18:27:08 +0000 Received: from localhost (localhost [127.0.0.1]) by localhost.domain.tld (Postfix) with ESMTP id 4545826E19; Wed, 27 Sep 2006 11:27:07 -0700 (PDT) Received: from mx2.palmsource.com ([127.0.0.1]) by localhost (mx2.palmsource.com [127.0.0.1]) (amavisd-new, port 10024) with LMTP id 18483-01-3; Wed, 27 Sep 2006 11:27:06 -0700 (PDT) Received: from ussunex01.palmsource.com (unknown [192.168.101.9]) by mx2.palmsource.com (Postfix) with ESMTP id 5A31D26DF7; Wed, 27 Sep 2006 11:27:06 -0700 (PDT) Received: from 192.168.92.59 ([192.168.92.59]) by ussunex01.palmsource.com ([192.168.101.9]) via Exchange Front-End Server owa.palmsource.com ([10.0.20.17]) with Microsoft Exchange Server HTTP-DAV ; Wed, 27 Sep 2006 18:27:06 +0000 Received: from svmsnyderlnx by owa.palmsource.com; 27 Sep 2006 11:27:05 -0700 Subject: Re: GDB stub - connection from 32 bit GDB or 64 bit GDB From: Michael Snyder To: Mitchell Fang Cc: gdb@sourceware.org In-Reply-To: References: Content-Type: text/plain Content-Transfer-Encoding: 7bit Date: Wed, 27 Sep 2006 18:27:00 -0000 Message-Id: <1159381625.9768.51.camel@localhost.localdomain> Mime-Version: 1.0 X-Mailer: Evolution 2.4.1 X-IsSubscribed: yes Mailing-List: contact gdb-help@sourceware.org; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sourceware.org X-SW-Source: 2006-09/txt/msg00169.txt.bz2 On Wed, 2006-09-27 at 10:34 -0700, Mitchell Fang wrote: > Hi, > > How can the gdb stub know if a 32 bit GDB is connecting to the stub > or a 64 bit GDB is connecting to the stub? Is it even possible? It > doesn't seem possible to me looking at the current gdb remote > commands, but hopefully I overlooked something. > I have tried different combinations with 32-bit and 64-bit GDBs and > gdbservers and it seems like a 32 bit GDB will not work with a 64 bit > gdbserver and vice versa. In general, a stub is built for a single architecture, while gdb may be built to handle several architecture variants (such as 32 bit and 64 bit versions of the same processor family). Therefore in practice, to my knowledge, it's never the stub that adapts to gdb, it's gdb that adapts to the stub. That's not to say that it's prohibited, but there's currently no provision for it in the remote protocol. However, there *is* provision for a general purpose query (get/set) request. You could use that to, say, tell your (custom) stub which version of the architecture you wanted to talk to. See the "Q"/"q" messages. Michael