From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 19231 invoked by alias); 21 Apr 2003 15:44:04 -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 19223 invoked from network); 21 Apr 2003 15:44:03 -0000 Received: from unknown (HELO hotel.solipsys.com) (209.117.190.86) by sources.redhat.com with SMTP; 21 Apr 2003 15:44:03 -0000 Received: from EVADNE (evadne.solipsys.com [10.0.2.104]) by hotel.solipsys.com (8.12.9/8.12.1) with ESMTP id h3LFi3dG026964 for ; Mon, 21 Apr 2003 11:44:03 -0400 (EDT) From: "Tony Wetmore" To: Subject: problem debugging on solaris x86 with gdb-5.3 Date: Mon, 21 Apr 2003 15:44:00 -0000 Message-ID: <003301c3081c$9b01d180$6802000a@solipsys.com> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="----=_NextPart_000_0034_01C307FB.13F33EC0" X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1106 Importance: Normal X-SW-Source: 2003-04/txt/msg00228.txt.bz2 This is a multi-part message in MIME format. ------=_NextPart_000_0034_01C307FB.13F33EC0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Content-length: 2174 Hi, I am running into a bit of a problem debugging an application on Solaris x86 using GDB version 5.3. I do not appear to be able to set breakpoints in shared library code within my application. Unfortunately, if I build a very simple test application, this problem does not occur. The heart of the problem appears to be that GDB cannot correctly determine the address of class member functions in my application. For example, I have a class called "NominalData" whose code is part of a shared library "libproject.so". When I ask GDB for the address of that method, the address output by GDB is not valid. For example, here is part of the output from "info shared" showing the library in question... (gdb) info shared From To Syms Read Shared Object Library 0xdf904b00 0xdfa2904e Yes /home/username/work/project/lib/libproject.so Now here is the output from the "info address" command, as well as my attempt to put a breakpoint on a method within that class: (gdb) info address NominalData::deserializeXML Symbol "NominalData::deserializeXML(SerialStr&)" is a function at address 0x4225df. (gdb) b NominalData::deserializeXML Cannot access memory at address 0x4225df Shouldn't the address of that method be in the range of addresses allocated to the shared library in which the method resides? I suspect that address 0x4225df is in a region of memory that is "off limits" to me, which is why the breakpoint cannot be set there. The method is a normal C++ class method, not inline or anything. It is implemented in a file called "NominalData.C" which is linked into the "libproject.so" shared library. Has anyone ever seen this strange behavior? Is there anything I can try to help isolate the problem? In case it has other usefulness, I have attached the debugger session script where I started up GDB, stopped at main, dumped out the shared libraries loaded then tried to set the breakpoint. I am using GCC version 3.2.1 to build this application, along with the native Solaris x86 assembler and linker. Thanks! --- Tony Wetmore Solipsys Corporation mailto:tony.wetmore@solipsys.com http://www.solipsys.com ------=_NextPart_000_0034_01C307FB.13F33EC0 Content-Type: application/octet-stream; name="session.gdb-5.3" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="session.gdb-5.3" Content-length: 3098 Script started on Mon Apr 21 11:03:32 2003=0A= [username@hostname:~/rmt] $ gdb-5.3 `which program`=0A= GNU gdb 5.3=0A= Copyright 2002 Free Software Foundation, Inc.=0A= GDB is free software, covered by the GNU General Public License, and you ar= e=0A= welcome to change it and/or distribute copies of it under certain condition= s.=0A= Type "show copying" to see the conditions.=0A= There is absolutely no warranty for GDB. Type "show warranty" for details.= =0A= This GDB was configured as "i386-pc-solaris2.8"...=0A= (gdb) b main=0A= Breakpoint 1 at 0x80532f4: file program.C, line 202.=0A= (gdb) run=0A= Starting program: /home/username/work/project/bin/program=20=0A= [New LWP 1]=0A= [New LWP 2]=0A= [New LWP 3]=0A= [New LWP 4]=0A= =0A= Breakpoint 1, main () at program.C:202=0A= 202 Timer::startScenarioClock( Timer::getCurrentTime( Time::Real ) );=0A= (gdb) info shared=0A= >From To Syms Read Shared Object Library=0A= 0xdf904b00 0xdfa2904e Yes /home/username/work/project/lib/libproj= ect.so=0A= 0xdf6f43a4 0xdf727dfa Yes /home/username/work/project/lib/libproj= ect2.so=0A= 0xde4b0e90 0xde613552 Yes /home/username/work/subsystemA/lib/libs= ubsystemA.so=0A= 0xdf5c4e08 0xdf5fecbe Yes /home/otheruser/work/subsystemB/lib/lib= subsystemB.so=0A= 0xdf54d2ac 0xdf5525ba Yes /home/username/work/project/lib/libproj= ect3.so=0A= 0xdd97536c 0xdd9befd6 Yes /home/username/work/subsystemC/lib/libs= ubsystemC.so=0A= 0xdf3afc50 0xdf48ff9e Yes /home/otheruser/work/subsystemD/lib/lib= subsystemD.so=0A= 0xdf2e7e00 0xdf2ec72e Yes /home/otheruser/work/subsystemE/lib/lib= subsystemE.so=0A= 0xdc532900 0xdc6d75fa Yes /home/username/work/subsystemF/lib/libs= ubsystemF.so=0A= 0xddecf2c0 0xddf494ca Yes /home/username/work/subsystemG/lib/libs= ubsystemG.so=0A= 0xdde13c9c 0xdde141bc Yes /usr/lib/libpthread.so.1=0A= 0xddde26e4 0xddde5172 Yes /usr/lib/librt.so.1=0A= 0xdd797ee8 0xdd7985c2 Yes /usr/local/gcc-3.2.1/lib/libstdc++.so.5= =0A= 0xdddc190c 0xdddc8e38 Yes /usr/lib/libm.so.1=0A= 0xddda1020 0xddda52de Yes /usr/local/gcc-3.2.1/lib/libgcc_s.so.1= =0A= 0xdd6e8908 0xdd746d8d Yes /usr/lib/libc.so.1=0A= 0xdd63ed84 0xdd695713 Yes /usr/lib/libnsl.so.1=0A= 0xddd737ac 0xddd791c8 Yes /usr/lib/libsocket.so.1=0A= 0xdd5ea540 0xdd601dfc Yes /usr/lib/libcurses.so.1=0A= 0xdd5c1d04 0xdd5c62f6 Yes /usr/lib/libaio.so.1=0A= 0xdfbb0734 0xdfbb0775 Yes /usr/lib/libdl.so.1=0A= 0xdd580ba4 0xdd5825c8 Yes /usr/lib/libmp.so.2=0A= 0xdbfc74c4 0xdbfd85d1 Yes /usr/lib/libthread.so.1=0A= (gdb) info address NominalData::deserializeXML=0A= Symbol "NominalData::deserializeXML(SerialStr&)" is a function at address 0= x4225df.=0A= (gdb) b NominalData::deserializeXML=0A= Cannot access memory at address 0x4225df=0A= (gdb) kill=0A= Kill the program being debugged? (y or n) y=0A= (gdb)=0A= [username@hostname:~/rmt] $ exit=0A= =0A= script done on Mon Apr 21 11:05:13 2003=0A= ------=_NextPart_000_0034_01C307FB.13F33EC0--