From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 3683 invoked by alias); 25 Jun 2010 12:47:59 -0000 Received: (qmail 3672 invoked by uid 22791); 25 Jun 2010 12:47:57 -0000 X-SWARE-Spam-Status: No, hits=-1.7 required=5.0 tests=AWL,BAYES_00,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from cam-admin0.cambridge.arm.com (HELO cam-admin0.cambridge.arm.com) (217.140.96.50) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 25 Jun 2010 12:47:53 +0000 Received: from cam-owa2.Emea.Arm.com (cam-owa2.emea.arm.com [10.1.105.18]) by cam-admin0.cambridge.arm.com (8.12.6/8.12.6) with ESMTP id o5PClneI004540; Fri, 25 Jun 2010 13:47:49 +0100 (BST) Received: from [10.1.77.63] ([10.1.255.212]) by cam-owa2.Emea.Arm.com with Microsoft SMTPSVC(6.0.3790.3959); Fri, 25 Jun 2010 13:47:49 +0100 Subject: Re: [ARM] dlopen and remote debugging From: Matthew Gretton-Dann To: "karthikeyan.s" Cc: gdb@sourceware.org In-Reply-To: References: Content-Type: text/plain; charset="ISO-8859-1" Date: Fri, 25 Jun 2010 12:47:00 -0000 Message-ID: <1277470068.10416.4.camel@e102319-lin.cambridge.arm.com> Mime-Version: 1.0 Content-Transfer-Encoding: 7bit X-IsSubscribed: yes Mailing-List: contact gdb-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sourceware.org X-SW-Source: 2010-06/txt/msg00123.txt.bz2 Karthik, On Thu, 2010-06-24 at 23:42 +0530, karthikeyan.s wrote: > Hi, > We recently encountered an issue with gdb wherein it does not get the > symbols from a shared library when loaded with dlopen. The following > steps does not give us the shared library's symbols. The binary is > Xorg. > > 1) > gdbserver :10000 /usr/bin/X -ac > set sysroot > target remote 10.0.0.3:10000 > continue > cntrl-C > We do not get the library's symbols here. But with cat > /proc/{x_pid}/maps we can see the library is loaded in memory. > > 2) But with the following steps, the libraries get loaded > /usr/bin/X -ac & > gdbserver :10000 --attach > set sysroot > target remote 10.0.0.3:10000 > > We can see the library's symbols and hit breakpoint, debug etc. etc. > Section 20.3.2 of the gdb manual says that you need to load the symbols for your application using the file command before you connect (see http://sourceware.org/gdb/download/onlinedocs/gdb/Server.html#Server). Can you try this, and report back if you are still having problems? I would imagine the commands to your host gdb would be something like: (gdb) set sysroot (gdb) file (gdb) target remote 10.0.0.3:10000 (gdb) continue Thanks, Matt -- Matthew Gretton-Dann Principal Engineer - PDSW Tools ARM Ltd