From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 13153 invoked by alias); 15 Mar 2006 03:44:14 -0000 Received: (qmail 13143 invoked by uid 22791); 15 Mar 2006 03:44:13 -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 03:44:12 +0000 Received: from denniswin2000 ([10.0.2.1]) by loop.com.tw (8.11.6+Sun/8.11.6) with SMTP id k2F3Ybv29078 for ; Wed, 15 Mar 2006 11:34:37 +0800 (CST) Message-ID: <063201c647e2$b2c39160$0102000a@loop.com.tw> From: "Nai-Hsien" To: Subject: Debugging a shared library through gdbserver Date: Wed, 15 Mar 2006 03:44:00 -0000 MIME-Version: 1.0 Content-Type: text/plain; charset="big5" 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/msg00068.txt.bz2 I am debugging a shared library made by myself through gdbserver. After searching the mail list, I think the gdb can be used to debug a shared library. However, when I debug my shared library by following steps, I got error to step through the source code (user_str_to_id()) in my shared library. Could anybody instruct me to do it? Thank you very much Dennis # load my executable file (gdb) add-symbol-file console add symbol table from file "console" at # load my shared library (gdb) add-symbol-file lib/libmylib.so.1.0.1 add symbol table from file "lib/libmylib.so.1.0.1" at (gdb) b clih_login Breakpoint 1 at 0x10016238: file sysui.c, line 289. (gdb) c Breakpoint 1, clih_login (handle=268700768, argc=2, argv=0x10041840) at sysui.c:289 (gdb) next # set a breakpoint in my shared library (gdb) b user_str_to_id Breakpoint 2 at 0xb05c: file utility.c, line 418. # then I got trouble here!!! (gdb) step Warning: Cannot insert breakpoint 2. Error accessing memory address 0xb05c: Input/output error. (gdb)