From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 19782 invoked by alias); 9 Dec 2008 02:08:28 -0000 Received: (qmail 19575 invoked by uid 22791); 9 Dec 2008 02:08:28 -0000 X-Spam-Check-By: sourceware.org Received: from NaN.false.org (HELO nan.false.org) (208.75.86.248) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 09 Dec 2008 02:07:48 +0000 Received: from nan.false.org (localhost [127.0.0.1]) by nan.false.org (Postfix) with ESMTP id 6D8C910CD7; Tue, 9 Dec 2008 02:07:46 +0000 (GMT) Received: from caradoc.them.org (209.195.188.212.nauticom.net [209.195.188.212]) by nan.false.org (Postfix) with ESMTP id 534A81053B; Tue, 9 Dec 2008 02:07:46 +0000 (GMT) Received: from drow by caradoc.them.org with local (Exim 4.69) (envelope-from ) id 1L9s0n-0002zh-3D; Mon, 08 Dec 2008 21:07:45 -0500 Date: Tue, 09 Dec 2008 02:08:00 -0000 From: Daniel Jacobowitz To: Paul Pluzhnikov Cc: gdb-patches@sourceware.org Subject: Re: [patch] Fix a glitch in debugging 32-bit process with 64-bit GDB. Message-ID: <20081209020744.GA11173@caradoc.them.org> Mail-Followup-To: Paul Pluzhnikov , gdb-patches@sourceware.org References: <20081209013252.9E1C83A6B2E@localhost> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20081209013252.9E1C83A6B2E@localhost> User-Agent: Mutt/1.5.17 (2008-05-11) X-IsSubscribed: yes Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2008-12/txt/msg00163.txt.bz2 On Mon, Dec 08, 2008 at 05:32:52PM -0800, Paul Pluzhnikov wrote: > The problem is that in findvar.c: > > case LOC_ARG: > if (frame == NULL) > return 0; > addr = get_frame_args_address (frame); > if (!addr) > return 0; > addr += SYMBOL_VALUE (var); > break; > > What happens if sizeof(addr) == 8 (64-bit gdb), len == 4 (32-bit target), > get_frame_args_address() returns 0xffffbf98 (typical stack address) > and SYMBOL_VALUE() returns -16? > > We end up with an impossible target address of 0x1ffffbf88. Conclusion doesn't follow from example, but I think I'm just confused... Do you mean that SYMBOL_VALUE is -16U or -16UL, and that's where the wrapping comes from? But SYMBOL_VALUE is a long, signed. Is SYMBOL_VALUE (long) 0xfffffff0? If that's the case then the debug reader might be to blame. -- Daniel Jacobowitz CodeSourcery