From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 26454 invoked by alias); 16 Sep 2007 19:36:07 -0000 Received: (qmail 26435 invoked by uid 22791); 16 Sep 2007 19:36:06 -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.31) with ESMTP; Sun, 16 Sep 2007 19:36:01 +0000 Received: from nan.false.org (localhost [127.0.0.1]) by nan.false.org (Postfix) with ESMTP id 2A3AC9810A; Sun, 16 Sep 2007 19:36:00 +0000 (GMT) Received: from caradoc.them.org (22.svnf5.xdsl.nauticom.net [209.195.183.55]) by nan.false.org (Postfix) with ESMTP id 56B6B98109; Sun, 16 Sep 2007 19:35:59 +0000 (GMT) Received: from drow by caradoc.them.org with local (Exim 4.67) (envelope-from ) id 1IWzuQ-00076a-A2; Sun, 16 Sep 2007 15:35:58 -0400 Date: Sun, 16 Sep 2007 19:36:00 -0000 From: Daniel Jacobowitz To: Joel Brobecker Cc: gdb-patches@sourceware.org Subject: Re: [RFA/solib-svr4] use AT_BASE auxiliary entry to compute load base address Message-ID: <20070916193558.GA27177@caradoc.them.org> Mail-Followup-To: Joel Brobecker , gdb-patches@sourceware.org References: <20070912211805.GF10540@adacore.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20070912211805.GF10540@adacore.com> User-Agent: Mutt/1.5.15 (2007-04-09) 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: 2007-09/txt/msg00206.txt.bz2 On Wed, Sep 12, 2007 at 02:18:05PM -0700, Joel Brobecker wrote: > Hello, > > I came across an unexpected issue on sparc-solaris 2.9, where I tried > to attach to an Ada program. When I later did a "continue", the debugger > error'ed out saying: > > (gdb) c > Continuing. > Warning: > Cannot insert breakpoint -1. > Error accessing memory address 0xff36159c: I/O error. So, it has attached to the program and decided that it's at the start address. That means we tried this: /* On a running target, we can get the dynamic linker's base address from the shared library table. */ solib_add (NULL, 0, ¤t_target, auto_solib_add); so = master_so_list (); while (so) ... and did not find any loaded libraries or else did not find the interpreter in the list. That's strange and almost certainly indicates a bug that we should fix. The loader should have been in the list at that point. Maybe it has a different filename in the list than in .interp? If you have time, I would recommend looking into this more. > I think that the problem is that we're computing the wrong base load > address in solib-svr4.c. As it turned out, there was a "TODO" hint > added by Daniel that suggested using the AT_BASE auxiliary entry. > The attached patch attempts to do that. > > 2007-09-12 Joel Brobecker > > * solib-svr4.c: Add include of "auxv.h". > (enable_break): Use the AT_BASE auxiliary entry if available. > * Makefile.in (solib-svr4.o): Update dependencies. This patch, independently, is a good idea and I'm glad you did it. It's OK. -- Daniel Jacobowitz CodeSourcery