From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 22353 invoked by alias); 2 Jun 2009 17:26:44 -0000 Received: (qmail 22342 invoked by uid 22791); 2 Jun 2009 17:26:43 -0000 X-SWARE-Spam-Status: No, hits=-1.5 required=5.0 tests=AWL,BAYES_00,J_CHICKENPOX_33,SARE_MSGID_LONG40,SPF_PASS X-Spam-Check-By: sourceware.org Received: from smtp-out.google.com (HELO smtp-out.google.com) (216.239.33.17) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 02 Jun 2009 17:26:34 +0000 Received: from wpaz33.hot.corp.google.com (wpaz33.hot.corp.google.com [172.24.198.97]) by smtp-out.google.com with ESMTP id n52HQU3Y031502 for ; Tue, 2 Jun 2009 18:26:31 +0100 Received: from gxk2 (gxk2.prod.google.com [10.202.11.2]) by wpaz33.hot.corp.google.com with ESMTP id n52HPhmH010203 for ; Tue, 2 Jun 2009 10:26:29 -0700 Received: by gxk2 with SMTP id 2so3719989gxk.3 for ; Tue, 02 Jun 2009 10:26:29 -0700 (PDT) MIME-Version: 1.0 Received: by 10.90.49.8 with SMTP id w8mr6470778agw.103.1243963588973; Tue, 02 Jun 2009 10:26:28 -0700 (PDT) In-Reply-To: <20090602170414.GL3029@adacore.com> References: <20090602162718.GA21116@adacore.com> <8ac60eac0906020947w4c413b39t3fb38bd04eeb0c41@mail.gmail.com> <20090602170414.GL3029@adacore.com> Date: Tue, 02 Jun 2009 17:26:00 -0000 Message-ID: Subject: Re: add-symbol-file/load and scripts From: Doug Evans To: Jerome Guitton Cc: Paul Pluzhnikov , gdb@sourceware.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-System-Of-Record: true X-IsSubscribed: yes 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: 2009-06/txt/msg00012.txt.bz2 On Tue, Jun 2, 2009 at 10:04 AM, Jerome Guitton wrote: > Paul Pluzhnikov (ppluzhnikov@google.com): > >> On Tue, Jun 2, 2009 at 9:27 AM, Jerome Guitton wrote: >> >> > the text's address, as initialized >> > in the symbol file itself, would be the appropriate defaut. >> >> AFAIU, on any UNIX system it would be appropriate default *only* for ET_EXEC. >> For non-prelinked ET_DYN, one needs to add the base load address. > > Thank you for pointing this out! This definitely rules out the first > solution. > > So, what about the second possibility? (That is to say: when it is > possible, setting a convenience variable to the start address after > load). With a better scripting language with better tools for access to elf files (a small subset of all of the various kinds of things one would like to be able to script better), one could pass the .elf file to a function and it would return the desired value. add-symbol-file foo.elf $elf.load_address ("foo.elf") # [just winging syntax here, it's subordinate to the main point]