From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 18031 invoked by alias); 10 May 2005 20:38:14 -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 18016 invoked from network); 10 May 2005 20:38:11 -0000 Received: from unknown (HELO e34.co.us.ibm.com) (32.97.110.132) by sourceware.org with SMTP; 10 May 2005 20:38:11 -0000 Received: from d03relay04.boulder.ibm.com (d03relay04.boulder.ibm.com [9.17.195.106]) by e34.co.us.ibm.com (8.12.10/8.12.9) with ESMTP id j4AKcAIX511962 for ; Tue, 10 May 2005 16:38:10 -0400 Received: from d03av02.boulder.ibm.com (d03av02.boulder.ibm.com [9.17.195.168]) by d03relay04.boulder.ibm.com (8.12.10/NCO/VER6.6) with ESMTP id j4AKcA6d246992 for ; Tue, 10 May 2005 14:38:10 -0600 Received: from d03av02.boulder.ibm.com (loopback [127.0.0.1]) by d03av02.boulder.ibm.com (8.12.11/8.13.3) with ESMTP id j4AKcArw028529 for ; Tue, 10 May 2005 14:38:10 -0600 Received: from dyn9047022123-009047022128.beaverton.ibm.com (dyn9047022123-009047022128.beaverton.ibm.com [9.47.22.128]) by d03av02.boulder.ibm.com (8.12.11/8.12.11) with ESMTP id j4AKc9DK028510 for ; Tue, 10 May 2005 14:38:10 -0600 From: Paul Gilliam Reply-To: pgilliam@us.ibm.com To: gdb@sources.redhat.com Subject: looking for ppc64 breakpoint address details Date: Tue, 10 May 2005 20:38:00 -0000 User-Agent: KMail/1.6.2 MIME-Version: 1.0 Content-Disposition: inline Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Message-Id: <200505101343.28903.pgilliam@us.ibm.com> X-SW-Source: 2005-05/txt/msg00140.txt.bz2 GDB gets it right, but ltrace gets it wrong. After attaching to a process, ltrace sets breakpoints at the beginning of library funcitons. It finds the address of where to stick a breakpoint as follows: * Using /proc, find executable for the process. * From the plt relocations, find the address of plt's. * If the runtime loader has not initialized the plt, it's first word is 0. * If it has, then the first word is the address of the function. This seems to work most of the time, but a user came up with a situation where it doesn't. The user wants to use ltrace to track all the 'memcpy' calls. When he attaches to his process with ltrace, he sees lots of library calls, but not memcpy. When he attaches to the process with GDB and sets a breakpoint at memcpy, the breakpoint is hit. Here's the problem: ltrace came up with one address for memcpy and GDB came up with a different address. How does GDB get the address to set the breakpoint at? I have been going through the source for GDB, starting with elfread.c, ppc-linux-nat.c and others. Any help would be appreciated. -=# Paul #=-