From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 30825 invoked by alias); 26 Sep 2003 17:40:19 -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 30816 invoked from network); 26 Sep 2003 17:40:18 -0000 Received: from unknown (HELO alageremail1.agere.com) (192.19.192.106) by sources.redhat.com with SMTP; 26 Sep 2003 17:40:18 -0000 Received: from alerelay.agere.com (alerelay.agere.com [135.14.190.33]) by alageremail1.agere.com (8.11.7+Sun/8.10.2) with ESMTP id h8QHeIB02821 for ; Fri, 26 Sep 2003 13:40:18 -0400 (EDT) Received: from ottmail.agere.com (ottmail.agere.com [135.149.43.31]) by alerelay.agere.com (8.11.6+Sun/8.11.6) with ESMTP id h8QHeHW19115 for ; Fri, 26 Sep 2003 13:40:17 -0400 (EDT) Received: from agere.com by ottmail.agere.com (8.11.7+Sun/AGR-1.0 Solaris) id h8QHeHc04419; Fri, 26 Sep 2003 13:40:17 -0400 (EDT) Message-ID: <3F747A00.3090302@agere.com> Date: Fri, 26 Sep 2003 17:46:00 -0000 From: Andrew Greenlaw User-Agent: Mozilla/5.0 (X11; U; SunOS sun4u; en-US; rv:1.0.1) Gecko/20020920 Netscape/7.0 X-Accept-Language: en-us, en MIME-Version: 1.0 To: gdb@sources.redhat.com Subject: "Cannot access memory at address 0x175f80" Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-SW-Source: 2003-09/txt/msg00322.txt.bz2 Hi. I'm debugging a C++ tool (called apple) that's loaded as a dynamic library into a C - or C++ program (called orange) . Apple is compiled with g++ 3.3.1, binutils 2.14, and debugging symbols are enabled. Orange is a big unknown (meaning: I don't know how it was compiled) and it has no debugging symbols. The gdb version is 5.3 Here are the flags used to compile Apple: # -gdwarf-2 -g3 used to enable stepping through macro execution under gdb 5.3 The explanation's under gdb 5.3 release notes. Compile:g++ -std=c++98 -Wall -DLINUX -gdwarf-2 -g3 -D__USE_GNU -D_GNU_SOURCE -fPIC file_name.cpp Link: g++ -shared $(LIBS) $(OBJSCHEF) $(PLIOBJSVCS_PLI) InterfaceObjectVCS_PLI.o -o $@ -lc gdwarf-2 -g3 -fPIC g++ -MD -std=c++98 -shared -lc -gdwarf-2 -g3 -fPIC -o libapple.so When I go to debug apple, I run "gdb ", then use the "add-symbol-file -readnow" gdb comman to load the symbols from apple. From there, I can set breakpoints in C++ class methods, no problem. But, there is 1 function (so, non-OO code), where if I try to set a breakpoint, I get the following: (gdb) break nc_signal_raised Cannot access memory at address 0x175f80 If I do an "nm" on the library, I get: 00175f80 T nc_signal_raised Indicating that the address read by gdb is correct. On a related, but less important note, when use ddd to debug & go to a source file, I always get: "" is at address 0x10f5f0 but contains no code. And yet I can set breakpoints or step through the code. What's going on? Any help you can offer will be appreciated. I've been working on this for 2 weeks, read every posting or piece of documentation I can find. I'm at my wits' end! -- Andrew Greenlaw ****