From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 6413 invoked by alias); 15 Mar 2006 06:19:06 -0000 Received: (qmail 6404 invoked by uid 22791); 15 Mar 2006 06:19:05 -0000 X-Spam-Check-By: sourceware.org Received: from mail02.loop.com.tw (HELO loop.com.tw) (211.23.53.221) by sourceware.org (qpsmtpd/0.31) with ESMTP; Wed, 15 Mar 2006 06:19:04 +0000 Received: from denniswin2000 ([10.0.2.1]) by loop.com.tw (8.11.6+Sun/8.11.6) with SMTP id k2F68hv02507; Wed, 15 Mar 2006 14:08:43 +0800 (CST) Message-ID: <064501c647f8$39e135c0$0102000a@loop.com.tw> From: "Nai-Hsien" To: "Daniel Jacobowitz" Cc: References: <063201c647e2$b2c39160$0102000a@loop.com.tw> <20060315034555.GA1813@nevyn.them.org> Subject: Re: Debugging a shared library through gdbserver Date: Wed, 15 Mar 2006 12:25:00 -0000 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Mailing-List: contact gdb-help@sourceware.org; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sourceware.org X-SW-Source: 2006-03/txt/msg00073.txt.bz2 > > Why are you doing any of this? Please tell us where you saw > suggestions to use add-symbol-file in this way, so that we can correct > them. > > Please take a look at "set solib-absolute-prefix". Use that, and > the "file" command, before connecting to gdbserver and everything > should work automatically. > > -- > Daniel Jacobowitz > CodeSourcery > > Hi Daniel Nobody told me to do this. I just learned add-symbol-file from u-boot document to relocate program base. I tried some commands in gdb user's manual then I think this command has result most close to my expectation. Anyway, this is totally my fault. I tried to follow your hint, shown as blow. Now, I can set a breakpoint in the shared library and make the program stop there. However, I still can not see the source code. (I am using DDD with gdb.) Am I still doing something wrong? Thank you Dennis # my shared library is in lib/ (gdb) set solib-absolute-prefix lib (gdb) file console (gdb) target remote 10.0.2.3:2001 0x0fd39fac in ?? () warning: Unable to find dynamic linker breakpoint function. GDB will be unable to debug shared library initializers and track explicitly loaded dynamic code. (gdb) b user_str_to_id Breakpoint 1 at 0x10040040 (gdb) c Breakpoint 1, 0x10040040 in ?? () # the program stop here without displaying source code on screen. (gdb)