From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 5759 invoked by alias); 22 Sep 2003 22:17:03 -0000 Mailing-List: contact gdb-patches-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sources.redhat.com Received: (qmail 5748 invoked from network); 22 Sep 2003 22:17:03 -0000 Received: from unknown (HELO mx1.redhat.com) (66.187.233.31) by sources.redhat.com with SMTP; 22 Sep 2003 22:17:03 -0000 Received: from int-mx1.corp.redhat.com (int-mx1.corp.redhat.com [172.16.52.254]) by mx1.redhat.com (8.11.6/8.11.6) with ESMTP id h8MMH1130563 for ; Mon, 22 Sep 2003 18:17:02 -0400 Received: from pobox.corp.redhat.com (pobox.corp.redhat.com [172.16.52.156]) by int-mx1.corp.redhat.com (8.11.6/8.11.6) with ESMTP id h8MMH1c18235 for ; Mon, 22 Sep 2003 18:17:01 -0400 Received: from localhost.localdomain (vpn50-12.rdu.redhat.com [172.16.50.12]) by pobox.corp.redhat.com (8.12.8/8.12.8) with ESMTP id h8MMH0VG003938; Mon, 22 Sep 2003 18:17:00 -0400 Received: (from kev@localhost) by localhost.localdomain (8.11.6/8.11.6) id h8MMGsx29843; Mon, 22 Sep 2003 15:16:54 -0700 Date: Mon, 22 Sep 2003 22:17:00 -0000 From: Kevin Buettner Message-Id: <1030922221654.ZM29842@localhost.localdomain> In-Reply-To: Andrew Cagney "[ppc64 help] Convert breakpoint's into addresses" (Sep 19, 3:40pm) References: <3F6B5BCA.1040504@redhat.com> To: Andrew Cagney , gdb-patches@sources.redhat.com Subject: Re: [ppc64 help] Convert breakpoint's into addresses MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-SW-Source: 2003-09/txt/msg00486.txt.bz2 On Sep 19, 3:40pm, Andrew Cagney wrote: > I think the ppc64 ELF ABI is officially wierd. > > For "main" the minimal symbol table contains two symbols vis: > > main: points at descriptor in .opd sectoin > .main: points at main's code entry point > > Consequently, given only a minimal symbol table, GDB, when given: > > (gdb) break main > > will try to insert the breakpoint in the descriptor, and not the > function. Trying to enter: > > (gdb) break .main > > gets you no where (syntax error :-/) > > Adding to the fun, GCC's debug info contains the symbol "main" which > points at the code address (and not the descriptor) and consequently > debugging with symbols works. Yes, this means that "main" has two > different values, arrrghghgh!! Yuck. Is gcc simply broken or is there a good reason to do things this way? > Attatched is a hack to breakpoint.c that applies "convert from func ptr > addr" to any address. This causing the breakpoint code to convert > "main" into ".main" and hence work. > > I don't know if its a right fix, good fix, or of any other alternative > fix. However it does work ... > help! > > 2003-09-17 Andrew Cagney > > * breakpoint.c (set_raw_breakpoint): Apply > CONVERT_FROM_FUNC_PTR_ADDR to the breakpoint address. > (breakpoint_re_set_one): Ditto. I can't think of anything better. If this goes in, I suggest adding a nice fat comment explaining what's going on... Kevin