From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 7234 invoked by alias); 18 Jul 2005 16:54:53 -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 7222 invoked by uid 22791); 18 Jul 2005 16:54:48 -0000 Received: from ybbsmtp13.mail.mci.yahoo.co.jp (HELO ybbsmtp13.mail.mci.yahoo.co.jp) (210.80.241.187) by sourceware.org (qpsmtpd/0.30-dev) with SMTP; Mon, 18 Jul 2005 16:54:48 +0000 Received: from unknown (HELO ?192.168.1.14?) (quiver2k@219.179.232.15 with plain) by ybbsmtp13.mail.mci.yahoo.co.jp with SMTP; 18 Jul 2005 16:54:43 -0000 X-Apparently-From: Message-ID: <42DBE026.7060409@ybb.ne.jp> Date: Mon, 18 Jul 2005 16:54:00 -0000 From: Yasuhiro Endoh User-Agent: Mozilla Thunderbird 1.0.2-1.3.3 (X11/20050513) MIME-Version: 1.0 To: gdb@sources.redhat.com Subject: Step into shared-library code of attached process Content-Type: multipart/mixed; boundary="------------010901040805040706090101" X-SW-Source: 2005-07/txt/msg00191.txt.bz2 This is a multi-part message in MIME format. --------------010901040805040706090101 Content-Type: text/plain; charset=ISO-2022-JP Content-Transfer-Encoding: 7bit Content-length: 1450 Hello, I'm trying to step into shared-library code of attached process. I can't step into library-function at the first call. But I can step in the function at the second call. Can I step into library-function at the first the? My Environments are: CPU: Intel(R) Celeron(R) CPU 2.40GHz OS: Fedora core 3 Kernel: 2.6.12 (kernel-2.6.12-1.1372_FC3) gdb: 6.3 The followings are sample code: void foo() { printf("foo\n"); } int main(int argc, char *argv[]) { char buf[128]; printf("attach me(pid=%d)> ", getpid()); fgets(buf, sizeof(buf), stdin); foo(); bar(); /* can't step-in */ bar(); bar(); return 0; } Here, function bar() is defined in the shared library libbar.so. To step into bar, I took the followings: 1. This program prompts "attach me(pid=18130)>". 2. I attached the process with id 18130 3. I set a break point at "foo();" in main 4. I typed "info sharedlibrary" (gdb) info sharedlibrary >From To Syms Read Shared Object Library 0xb7f6644c 0xb7f66564 Yes /home/yendoh/link/libbar.so 0x0088cc00 0x0097ccd0 Yes /lib/tls/libc.so.6 0x008197a0 0x0082b58f Yes /lib/ld-linux.so.2 5. continued 6. The process was breakd at "foo():", I could step-in foo(). 7. I tried to step into "bar();" , but I couldn't step-in. 8. I could step-in the second and third call of bar(). I attached my-program. To run the program: 1. make 2. make run Thanks, Endoh --------------010901040805040706090101 Content-Type: text/plain; name="Makefile" Content-Transfer-Encoding: base64 Content-Disposition: inline; filename="Makefile" Content-length: 326 YWxsOiBsaWJiYXIuc28gc2FtcGxlCgpsaWJiYXIuc286IGJhci5jIGJhci5o CglnY2MgLW8gbGliYmFyLnNvIC1nIC1XYWxsIC1zaGFyZWQgLWZwaWMgYmFy LmMKCnNhbXBsZTogbWFpbi5jIGJhci5oIGxpYmJhci5zbwoJZ2NjIC1vIHNh bXBsZSAtZyAtV2FsbCBtYWluLmMgLUwuIC1sYmFyCgpjbGVhbjoKCXJtIC1m IHNhbXBsZSBsaWJiYXIuc28KCnJ1bjoKCWVudiBMRF9MSUJSQVJZX1BBVEg9 YHB3ZGAgLi9zYW1wbGUK --------------010901040805040706090101 Content-Type: text/x-csrc; name="bar.c" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="bar.c" Content-length: 57 #include void bar() { printf("bar\n"); } --------------010901040805040706090101 Content-Type: text/x-chdr; name="bar.h" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="bar.h" Content-length: 13 void bar(); --------------010901040805040706090101 Content-Type: text/x-csrc; name="main.c" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="main.c" Content-length: 313 #include #include #include "bar.h" void foo() { printf("foo\n"); } int main(int argc, char *argv[]) { char buf[128]; printf("attach me(pid=%d)> ", getpid()); fgets(buf, sizeof(buf), stdin); foo(); bar(); /* can't step-in */ bar(); bar(); return 0; } --------------010901040805040706090101--