Mirror of the gdb mailing list
 help / color / mirror / Atom feed
From: "Dheeraj V.S." <dheerajvs@huawei.com>
To: gdb@sourceware.org
Subject: Single stepping inside shared lib functions on ARM
Date: Wed, 24 Jan 2007 11:04:00 -0000	[thread overview]
Message-ID: <000501c73fa7$53b556f0$7b14120a@china.huawei.com> (raw)

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 <stdio.h>

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 <stdio.h>
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
-- 




             reply	other threads:[~2007-01-24 11:04 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-01-24 11:04 Dheeraj V.S. [this message]
2007-01-24 12:12 ` Daniel Jacobowitz
2007-01-24 12:56   ` Dheeraj V.S.
2007-01-24 13:07     ` Daniel Jacobowitz
2007-01-24 15:59       ` Dheeraj V.S.

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='000501c73fa7$53b556f0$7b14120a@china.huawei.com' \
    --to=dheerajvs@huawei.com \
    --cc=gdb@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox