From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 19019 invoked by alias); 14 Sep 2010 15:14:34 -0000 Received: (qmail 19009 invoked by uid 22791); 14 Sep 2010 15:14:33 -0000 X-SWARE-Spam-Status: No, hits=-2.0 required=5.0 tests=AWL,BAYES_00 X-Spam-Check-By: sourceware.org Received: from mel.act-europe.fr (HELO mel.act-europe.fr) (212.99.106.210) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 14 Sep 2010 15:14:25 +0000 Received: from localhost (localhost [127.0.0.1]) by filtered-smtp.eu.adacore.com (Postfix) with ESMTP id 6E067CB0236; Tue, 14 Sep 2010 17:14:23 +0200 (CEST) Received: from mel.act-europe.fr ([127.0.0.1]) by localhost (smtp.eu.adacore.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id LKWJkky4yEGQ; Tue, 14 Sep 2010 17:14:23 +0200 (CEST) Received: from ulanbator.act-europe.fr (ulanbator.act-europe.fr [10.10.1.67]) (using TLSv1 with cipher AES128-SHA (128/128 bits)) (No client certificate requested) by mel.act-europe.fr (Postfix) with ESMTP id 5BA01CB01EF; Tue, 14 Sep 2010 17:14:23 +0200 (CEST) Subject: Re: [RFC] Improve stabs debugging for mingw64 executables loaded at high addresses Mime-Version: 1.0 (Apple Message framework v1081) Content-Type: text/plain; charset=us-ascii From: Tristan Gingold In-Reply-To: <000701cb541e$1160cde0$342269a0$@muller@ics-cnrs.unistra.fr> Date: Tue, 14 Sep 2010 17:32:00 -0000 Cc: Content-Transfer-Encoding: 7bit Message-Id: <282E4D5B-2863-4CC2-99EE-76A36BDE8A9F@adacore.com> References: <000701cb541e$1160cde0$342269a0$@muller@ics-cnrs.unistra.fr> To: Pierre Muller 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: 2010-09/txt/msg00267.txt.bz2 On Sep 14, 2010, at 5:04 PM, Pierre Muller wrote: > On 64-bit targets, stabs suffers from the fact that addresses > are only stored as 32-bit values. > > For mingw64, I was able to debug executables loaded > at address 0x100000000 (the default location for executables > compiled by Free Pascal Compiler) by using the simple > patch below. > > The idea of the patch is quite basic: > add the 32 high bits of text_addr as > to the offsets of all sections in read_dbx_symtab. > > I don't know if this is mingw64 (possibly 64-bit PE) specific or not... > > All those offsets seemed to be at zero at the time I added > the high 32-bit part of text_addr, but maybe other > targets do something else... If this should not be applied > for other 64-bit targets, we could of course modify > the tests before changing the offsets, restricting it to > targets for which it is relevant. > > I just tried to use gcc to compile an executable > with -Wl,--image-base,0x300000000, to force high load address, > but this lead to lots of messages: > relocation truncated to fit R_X86_64_32 against .text > Free Pascal compiler doesn't seem to generate any of those > time of relocations... > > Comments welcome, I think that some 64 bits targets have 8 bytes for the address. Tristan.