From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 16886 invoked by alias); 12 Mar 2003 18:28:07 -0000 Mailing-List: contact gdb-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sources.redhat.com Received: (qmail 16879 invoked from network); 12 Mar 2003 18:28:07 -0000 Received: from unknown (HELO crack.them.org) (65.125.64.184) by 172.16.49.205 with SMTP; 12 Mar 2003 18:28:07 -0000 Received: from nevyn.them.org ([66.93.61.169] ident=mail) by crack.them.org with asmtp (Exim 3.12 #1 (Debian)) id 18tCqp-0005SF-00; Wed, 12 Mar 2003 14:29:23 -0600 Received: from drow by nevyn.them.org with local (Exim 3.36 #1 (Debian)) id 18tAxQ-0006tt-00; Wed, 12 Mar 2003 13:28:04 -0500 Date: Wed, 12 Mar 2003 18:28:00 -0000 From: Daniel Jacobowitz To: Bruce Ashfield Cc: gdb@sources.redhat.com Subject: Re: Accessing variables in .sdata Message-ID: <20030312182804.GA26459@nevyn.them.org> Mail-Followup-To: Bruce Ashfield , gdb@sources.redhat.com References: <20030312175317.GA2464@seawaynetworks.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20030312175317.GA2464@seawaynetworks.com> User-Agent: Mutt/1.5.1i X-SW-Source: 2003-03/txt/msg00187.txt.bz2 On Wed, Mar 12, 2003 at 12:53:17PM -0500, Bruce Ashfield wrote: > Hi all, > > I've been trying to characterize the types of variables I > can't access when using a linker script during the construction > of our bootable image. The linker script in question is a > slightly modified one from ppcboot and I can't see any > fundamental problems with the script. > > I've been dumping the map file during the link and comparing > the one that the linker internally generates to the one that > results from our supplied linker map. I'm seeing a different > location for the .text,.bss,.data segments and some other > ordering differences, but again nothing fundamentally wrong. > > But my problem persists. If I use a linker script and try to > print the value of a variable in a .sdata I'm presented with > the gdb error "Cannot access memory at address 0x...". Where > address 0xABCD.. is no where near where the map file says > that section and variable should be found. It's like gdb is > missing the offset of the sections. > > I've also tried using add-symbol-file to force gdb to recognize > the start address for the various sections, but at best I see > the error address moving around. > > I've been told from people around the office that if they load > the symbol file multiple times the error address changes and > they can breakpoint functions, but not usually inside a > function. This sounds like the sdata offset is uninitialized for some reason. I don't know why it would affect breakpoints, though. Did you try valgrind? Do you have a smaller testcase working yet based on this new insight? -- Daniel Jacobowitz MontaVista Software Debian GNU/Linux Developer