From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 21997 invoked by alias); 23 Nov 2004 21:21:40 -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 21433 invoked from network); 23 Nov 2004 21:21:27 -0000 Received: from unknown (HELO pippin.tausq.org) (64.81.244.94) by sourceware.org with SMTP; 23 Nov 2004 21:21:27 -0000 Received: by pippin.tausq.org (Postfix, from userid 1000) id 69424CD846; Tue, 23 Nov 2004 13:21:26 -0800 (PST) Date: Tue, 23 Nov 2004 21:43:00 -0000 From: Randolph Chung To: gdb@sources.redhat.com Cc: dave@hiauly1.hia.nrc.ca Subject: pc_requires_run_before_use Message-ID: <20041123212126.GR9148@tausq.org> Reply-To: Randolph Chung Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline X-GPG: for GPG key, see http://www.tausq.org/gpg.txt User-Agent: Mutt/1.5.5.1+cvs20040105i X-SW-Source: 2004-11/txt/msg00229.txt.bz2 Does anybody understand what this comment means or what this code is supposed to do? hppa_pc_requires_run_before_use() in hppa-tdep.a says: /* Sometimes we may pluck out a minimal symbol that has a negative address. An example of this occurs when an a.out is linked against a foo.sl. The foo.sl defines a global bar(), and the a.out declares a signature for bar(). However, the a.out doesn't directly call bar(), but passes its address in another call. If you have this scenario and attempt to "break bar" before running, gdb will find a minimal symbol for bar() in the a.out. But that symbol's address will be negative. What this appears to denote is an index backwards from the base of the procedure linkage table (PLT) into the data linkage table (DLT), the end of which is contiguous with the start of the PLT. This is clearly not a valid address for us to set a breakpoint on. [...] */ what is the case that this code is trying to catch? i tried to duplicate the problem described above using this test program: #include #include static int foo(size_t (*func)(const char *), const char *arg) { printf("func = %p\n", (void *)func); return func(arg); } int main(int argc, char **argv) { return foo(strlen, argv[0]); } and putting a breakpoint on "strlen" before starting to run the program. on hppa-linux and hppa1.1-hp-hpux11.11, we do not trigger the check above, and breakpoints work fine. on hppa64-hp-hpux11.11, we are not able to put a proper breakpoint on a shared lib function before starting the executable: (gdb) b strlen Breakpoint 1 at 0x800000010000bc80 (gdb) run Starting program: /home/tausq/foo Warning: Cannot insert breakpoint 1. Error accessing memory address 0x800000010000bc80: I/O error. in either case we are not getting the problem that this hook is trying to catch... randolph -- Randolph Chung Debian GNU/Linux Developer, hppa/ia64 ports http://www.tausq.org/