From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 28992 invoked by alias); 29 Jul 2003 08:11:45 -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 28985 invoked from network); 29 Jul 2003 08:11:44 -0000 Received: from unknown (HELO mta06bw.bigpond.com) (144.135.24.156) by sources.redhat.com with SMTP; 29 Jul 2003 08:11:44 -0000 Received: from bubble.local ([144.135.24.84]) by mta06bw.email.bigpond.com (iPlanet Messaging Server 5.2 HotFix 1.14 (built Mar 18 2003)) with SMTP id <0HIS00EYN1DT0D@mta06bw.email.bigpond.com> for gdb@sources.redhat.com; Tue, 29 Jul 2003 18:10:42 +1000 (EST) Received: from cpe-144-136-188-60.sa.bigpond.net.au ([144.136.188.60]) by bwmam06bpa.bigpond.com(MailRouter V3.2g 53/45967044); Tue, 29 Jul 2003 18:10:42 +0000 Received: (qmail 12660 invoked by uid 179); Tue, 29 Jul 2003 08:10:41 +0000 Date: Tue, 29 Jul 2003 08:11:00 -0000 From: Alan Modra Subject: Re: fake symbols to aid debugging In-reply-to: To: Nick Clifton Cc: binutils@sources.redhat.com, gdb@sources.redhat.com Mail-followup-to: Nick Clifton , binutils@sources.redhat.com, gdb@sources.redhat.com Message-id: <20030729081041.GN27145@bubble.sa.bigpond.net.au> MIME-version: 1.0 Content-type: text/plain; charset=us-ascii Content-transfer-encoding: 7BIT Content-disposition: inline User-Agent: Mutt/1.4i References: <20030729023258.GH27145@bubble.sa.bigpond.net.au> X-SW-Source: 2003-07/txt/msg00328.txt.bz2 On Tue, Jul 29, 2003 at 07:45:30AM +0100, Nick Clifton wrote: > Hi Alan, > > > I waste enough time doing this that I figure it's worth doing something > > about it. My first idea, already implemented, was to have the linker > > emit extra symbols to identify the stubs. This works well but bloats > > the symbol table and isn't on by default. A better idea would be to > > create the stub symbols on the fly. With that in mind, I propose to > > add two new bfd functions > > > > long bfd_get_fake_symtab_upper_bound (bfd *abfd); > > long bfd_canonicalize_fake_symtab (bfd *abfd, asymbol **buf); > > > > analogous to bfd_get_symtab_upper_bound and bfd_canonicalize_symtab. > > > > Comments? > > Well a few questions actually: > > Where would these fake symbols be held ? In a new .fakesymtab > section? Or are they entirely ephemeral and never stored in the > executable ? They're ephemeral, but I discovered I needed to save some info away in order to locate stubs. For that reason, I think the idea of emitting DWARF2 info for stubs is better. Helps gdb out in tracing over stubs too. > Can the fake symbols be generated after the stubs are created ? ie > can they be created for already existing libraries/executables ? That was my aim, but short of scanning all code it's hard to locate stubs.. > Would gdb users be able to set breakpoints on these fake symbols ? I think so. It's a while since I poked around in gbd though.. -- Alan Modra IBM OzLabs - Linux Technology Centre