From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 8933 invoked by alias); 24 Jan 2007 11:04:17 -0000 Received: (qmail 8915 invoked by uid 22791); 24 Jan 2007 11:04:15 -0000 X-Spam-Check-By: sourceware.org Received: from szxga03-in.huawei.com (HELO szxga03-in.huawei.com) (61.144.161.55) by sourceware.org (qpsmtpd/0.31) with ESMTP; Wed, 24 Jan 2007 11:04:10 +0000 Received: from huawei.com (szxga04-in [172.24.2.12]) by szxga04-in.huawei.com (iPlanet Messaging Server 5.2 HotFix 1.25 (built Mar 3 2004)) with ESMTP id <0JCD004VSDEI7V@szxga04-in.huawei.com> for gdb@sourceware.org; Wed, 24 Jan 2007 19:03:55 +0800 (CST) Received: from huawei.com ([172.24.1.18]) by szxga04-in.huawei.com (iPlanet Messaging Server 5.2 HotFix 1.25 (built Mar 3 2004)) with ESMTP id <0JCD00IURDEISQ@szxga04-in.huawei.com> for gdb@sourceware.org; Wed, 24 Jan 2007 19:03:54 +0800 (CST) Received: from DHEERAJ3666 ([10.18.20.123]) by szxml03-in.huawei.com (iPlanet Messaging Server 5.2 HotFix 1.25 (built Mar 3 2004)) with ESMTPA id <0JCD00KV1DECT5@szxml03-in.huawei.com> for gdb@sourceware.org; Wed, 24 Jan 2007 19:03:54 +0800 (CST) Date: Wed, 24 Jan 2007 11:04:00 -0000 From: "Dheeraj V.S." Subject: Single stepping inside shared lib functions on ARM To: gdb@sourceware.org Reply-to: dheerajvs@huawei.com Message-id: <000501c73fa7$53b556f0$7b14120a@china.huawei.com> MIME-version: 1.0 X-Mailer: Microsoft Office Outlook 11 Content-type: text/plain; charset=us-ascii 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: 2007-01/txt/msg00304.txt.bz2 I'm remote debugging on an ARM target using gdb 6.5. I'm unable to step into functions that are defined inside shared libraries although the identical .so file is accessible both by the host and target. These are the test programs used (both compiled using gcc version 3.4.4 with -g option): linux:/home/dheeraj # cat gdb_test.c #include void function () { printf ("In function\n"); } extern void function_in_lib(); int main () { printf ("In main\n"); function(); function_in_lib(); printf ("Quitting\n"); return 0; } linux:/home/dheeraj # cat gdb_test_lib.c #include void function_in_lib () { printf ("In function_in_lib\n"); } The following is the output of gdb 6.5: Note the lines with the arrows (<----) linux:/home/dheeraj # arm-unknown-linux-gnu-gdb GNU gdb 6.5 This GDB was configured as "--host=i686-pc-linux-gnu --target=arm-unknown-linux-gnu". (gdb) set solib-absolute-prefix /home/dheeraj (gdb) set solib-search-path /home/dheeraj (gdb) file gdb_test Reading symbols from /home/dheeraj/gdb_test...done. (gdb) b main Breakpoint 1 at 0x8630: file gdb_test.c, line 12. (gdb) target remote 10.18.21.35:3456 Remote debugging using 10.18.21.35:3456 0x40000ba0 in ?? () (gdb) c Continuing. Breakpoint 1, main () at gdb_test.c:12 12 printf ("In main\n"); (gdb) n Cannot access memory at address 0x0 <---- Problem?? 13 function(); (gdb) s function () at gdb_test.c:5 <---- Stepping inside the same file is OK. 5 printf ("In function\n"); (gdb) n 6 } (gdb) n Cannot access memory at address 0x0 main () at gdb_test.c:14 14 function_in_lib(); (gdb) s 0x40015060 in ?? () <---- Cannot step into a function in shared lib! (gdb) n Cannot find bounds of current function <---- Problem?? (gdb) c Continuing. I tried the same using gdb 5.3. This time, I don't get the errors like "Cannot access memory at address 0x0" and "Cannot find bounds of current function", but I'm still unable to step into the shared lib function. In gdb 5.3, the "step" command is treated as a "next" command for the shared lib function. Similar problems were reported in some list archives, but I've not found a solution that works. Any help is appreciated. Dheeraj --