mailing list of musl libc
 help / color / mirror / code / Atom feed
* [musl] [QUESTION] how to gdb dynamic linker for musl?
@ 2020-12-07 13:37 Chen Wang
  2020-12-07 16:46 ` Rich Felker
  0 siblings, 1 reply; 4+ messages in thread
From: Chen Wang @ 2020-12-07 13:37 UTC (permalink / raw)
  To: musl; +Cc: unicorn_wang

[-- Attachment #1: Type: text/plain, Size: 1692 bytes --]

Hello,
I confugure and make musl with following:

CFLAGS=-g CROSS_COMPILE=riscv64-unknown-linux-gnu- ./configure --prefix=/home/u/ws/musl/install --exec-prefix=/home/u/ws/musl/install --syslibdir=/home/u/ws/musl/install

create the executable with: ./install/bin/musl-gcc -g test.c

Then I tried to debug:
$ qemu-riscv64 -g 1234 ./a.out
then launch gdb:
$ riscv64-unknown-linux-gnu-gdb a.out

but after I tried to target remote, gdb oops and tell me:
```
gdb) target remote:1234
Remote debugging using :1234
warning: Unable to find dynamic linker breakpoint function.
GDB will be unable to debug shared library initializers
and track explicitly loaded dynamic code.
0x0000004000850ae2 in ?? ()
```

I tried to set sysroot but does NOT take effect:
```
(gdb) set sysroot /home/u/ws/musl/install/
warning: Unable to find dynamic linker breakpoint function.
GDB will be unable to debug shared library initializers
and track explicitly loaded dynamic code.
(gdb) set sysroot /home/u/ws/musl/install/lib
warning: Unable to find dynamic linker breakpoint function.
GDB will be unable to debug shared library initializers
and track explicitly loaded dynamic code.
```
I checked the a.out
```
$ riscv64-unknown-linux-gnu-readelf -l a.out
......
  INTERP         0x00000000000001c8 0x00000000000101c8 0x00000000000101c8
                 0x000000000000002d 0x000000000000002d  R      0x1
      [Requesting program interpreter: /home/u/ws/musl/install/ld-musl-riscv64.so.1]
......
```
And I can run with qemu directly: $ qemu-riscv64 ./a.out, this works, but why I can not debug with gdb? Who can help me out? Thanks in adv.




Best Regards

Wang Chen

[-- Attachment #2: Type: text/html, Size: 2828 bytes --]

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

end of thread, other threads:[~2020-12-08  2:34 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-12-07 13:37 [musl] [QUESTION] how to gdb dynamic linker for musl? Chen Wang
2020-12-07 16:46 ` Rich Felker
2020-12-08  0:55   ` Chen Wang
2020-12-08  2:34   ` Chen Wang

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/musl/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).