From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 27346 invoked by alias); 9 Mar 2004 05:55: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 27336 invoked from network); 9 Mar 2004 05:55:39 -0000 Received: from unknown (HELO e34.co.us.ibm.com) (32.97.110.132) by sources.redhat.com with SMTP; 9 Mar 2004 05:55:39 -0000 Received: from westrelay02.boulder.ibm.com (westrelay02.boulder.ibm.com [9.17.195.11]) by e34.co.us.ibm.com (8.12.10/8.12.2) with ESMTP id i295tcrj381890 for ; Tue, 9 Mar 2004 00:55:38 -0500 Received: from austin.ibm.com (d03av02.boulder.ibm.com [9.17.193.82]) by westrelay02.boulder.ibm.com (8.12.10/NCO/VER6.6) with ESMTP id i295tbKr380700 for ; Mon, 8 Mar 2004 22:55:38 -0700 Received: from lazy.austin.ibm.com (lazy.austin.ibm.com [9.53.94.97]) by austin.ibm.com (8.12.10/8.12.10) with ESMTP id i295tbvE045178 for ; Mon, 8 Mar 2004 23:55:37 -0600 Date: Tue, 09 Mar 2004 05:55:00 -0000 From: Manoj Iyer X-X-Sender: manjo@lazy To: gdb@sources.redhat.com Subject: (PPC64) 64 bit GDB unable to set br in 32bit app Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-SW-Source: 2004-03/txt/msg00063.txt.bz2 Andrew, I am trying to debug a 32 bit app using a 64 bit GDB on a PowerPC64 bit machine, I am not able to set a breakpoint in the 32 bit app. I get the following error. Warning: Cannot insert breakpoint -1. Error accessing memory address 0xffffc4f4: Input/output error. (gdb) To recreate the problem, you need a PowerPC64 machine, build GDB (GDB 6.0) as a 64bit binary, and use any 32bit app and try to debug this app. Set a break point in main() and use the gdb command run. I did some amount of debugging and I found that read_pc() is not returning the value of PC correctly instead returns 0. So the base address of the dynamic linker is miscalculated. File:regcache.c read_pc_pid(): raw_val = 0 File:regcache.c read_pc_pid(): pc_val = 0 read_pc() calls legacy_read_register_gen() function which calls register_buffer() which is used to read the contents of the structure (struct regcache *regcache) and returns a pointer to the register buffer cache. I think this is where the problem is. The contents of the memory location that this pointer points to are all 0x0's and that shouldint be the case. legacy_read_register_gen() does a memcpy() from this location to a variable myaddr ultimately used in the calculations to find the base address of the dynamic linker. So since the base address of the dynamic linker (ld.so), GDB is unable to set default break points in _dl_debug_state. And GDB fails in the init stage itself. I dont have a good understanding of the structures regcache and regcache_dscr to do more debugging. Am I on the right track? Please help. Thanks Manoj Iyer