Mirror of the gdb mailing list
 help / color / mirror / Atom feed
* Single stepping inside shared lib functions on ARM
@ 2007-01-24 11:04 Dheeraj V.S.
  2007-01-24 12:12 ` Daniel Jacobowitz
  0 siblings, 1 reply; 5+ messages in thread
From: Dheeraj V.S. @ 2007-01-24 11:04 UTC (permalink / raw)
  To: gdb

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
-- 




^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2007-01-24 15:59 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-01-24 11:04 Single stepping inside shared lib functions on ARM Dheeraj V.S.
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.

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox