From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 2852 invoked by alias); 5 Feb 2010 12:29:20 -0000 Received: (qmail 2838 invoked by uid 22791); 5 Feb 2010 12:29:19 -0000 X-SWARE-Spam-Status: No, hits=-1.9 required=5.0 tests=AWL,BAYES_00 X-Spam-Check-By: sourceware.org Received: from david.siemens.de (HELO david.siemens.de) (192.35.17.14) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 05 Feb 2010 12:29:13 +0000 Received: from mail1.siemens.de (localhost [127.0.0.1]) by david.siemens.de (8.12.11.20060308/8.12.11) with ESMTP id o15CT9Do024974; Fri, 5 Feb 2010 13:29:09 +0100 Received: from [139.25.109.167] (mchn012c.ww002.siemens.net [139.25.109.167] (may be forged)) by mail1.siemens.de (8.12.11.20060308/8.12.11) with ESMTP id o15CT9ok009314; Fri, 5 Feb 2010 13:29:09 +0100 Message-ID: <4B6C0F15.4030006@siemens.com> Date: Fri, 05 Feb 2010 12:29:00 -0000 From: Jan Kiszka User-Agent: Mozilla/5.0 (X11; U; Linux i686 (x86_64); de; rv:1.8.1.12) Gecko/20080226 SUSE/2.0.0.12-1.1 Thunderbird/2.0.0.12 Mnenhy/0.7.5.666 MIME-Version: 1.0 To: Hui Zhu CC: Robert Barnes , gdb@sourceware.org Subject: Re: Switching architectures from a remote target References: <23c0f921002041138k1d989b9cs8423911108499331@mail.gmail.com> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Mailing-List: contact gdb-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sourceware.org X-SW-Source: 2010-02/txt/msg00028.txt.bz2 Hui Zhu wrote: > Try "set architecture" > But I don't have a inferior that can change bit when it's debug. I > don't sure if it works or not. qemu's gdbstub is an example for such a scenario. It currently switches the arch dynamically when the guest moves from 32 to 64 bit mode and vice versa. Not nice, but the best we can do until someone (us included) finds the time to fix x86 gdb. Jan > > On Fri, Feb 5, 2010 at 03:38, Robert Barnes wrote: >> I am using GDB to interface with a remote target over serial. The >> target architecture changes during execution (e.g. 32-bit to 64-bit). >> When the architecture changes I need gdb to change its internal >> representation of the remote architecture at the same time. The >> primary problem is the remote 'g' command, it's return packet size is >> determined by the initial call. When the architecture changes, the >> size and number of registers may change, thus the size of the 'g' >> packet changes. Yet gdb is still expecting the old size. >> >> This problem is addressed in section 7 of "Multi-arching Insights and >> GDB" by Andrew Cagney >> (http://www.gnu.org/software/gdb/papers/multi-arch/real-multi-arch/). >> As far as I can tell the recommendations haven't been implemented. >> >> Are there any workarounds or solutions to the general problem of >> handling changing architectures on a remote target? >> >> Thanks! >> >> -Rob >> > -- Siemens AG, Corporate Technology, CT T DE IT 1 Corporate Competence Center Embedded Linux