From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 13408 invoked by alias); 19 Sep 2003 19:41:01 -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 13401 invoked from network); 19 Sep 2003 19:41:00 -0000 Received: from unknown (HELO localhost.redhat.com) (207.219.125.105) by sources.redhat.com with SMTP; 19 Sep 2003 19:41:00 -0000 Received: from redhat.com (localhost [127.0.0.1]) by localhost.redhat.com (Postfix) with ESMTP id CC5562B89 for ; Fri, 19 Sep 2003 15:40:58 -0400 (EDT) Message-ID: <3F6B5BCA.1040504@redhat.com> Date: Fri, 19 Sep 2003 19:41:00 -0000 From: Andrew Cagney User-Agent: Mozilla/5.0 (X11; U; NetBSD macppc; en-US; rv:1.0.2) Gecko/20030820 X-Accept-Language: en-us, en MIME-Version: 1.0 To: gdb-patches@sources.redhat.com Subject: [ppc64 help] Convert breakpoint's into addresses Content-Type: multipart/mixed; boundary="------------090409060706070403000304" X-SW-Source: 2003-09/txt/msg00415.txt.bz2 This is a multi-part message in MIME format. --------------090409060706070403000304 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Content-length: 981 Hello, 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!! 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! Andrew --------------090409060706070403000304 Content-Type: text/plain; name="diffs" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="diffs" Content-length: 1112 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. Index: breakpoint.c =================================================================== RCS file: /cvs/src/src/gdb/breakpoint.c,v retrieving revision 1.129 diff -u -r1.129 breakpoint.c --- breakpoint.c 14 Sep 2003 16:32:12 -0000 1.129 +++ breakpoint.c 19 Sep 2003 15:43:52 -0000 @@ -3866,7 +3866,7 @@ b = (struct breakpoint *) xmalloc (sizeof (struct breakpoint)); memset (b, 0, sizeof (*b)); - b->address = sal.pc; + b->address = CONVERT_FROM_FUNC_PTR_ADDR (sal.pc); if (sal.symtab == NULL) b->source_file = NULL; else @@ -6838,7 +6838,7 @@ savestring (sals.sals[i].symtab->filename, strlen (sals.sals[i].symtab->filename)); b->line_number = sals.sals[i].line; - b->address = sals.sals[i].pc; + b->address = CONVERT_FROM_FUNC_PTR_ADDR (sals.sals[i].pc); /* Used to check for duplicates here, but that can cause trouble, as it doesn't check for disabled --------------090409060706070403000304--