gdb_monitor does not work

Alexander Senier senier at componolit.com
Thu Aug 9 16:08:17 CEST 2018


Hi all,

I'm debugging an application on base-nova and trying to get remote gdb
set up for that. Using gdb on base-linux is not an option right now, as
the application exposes a different issue there.

To verify that gdb works, I adapted the simple run/log example (see the
attached delta). I'm using current master (f4ea50c6). When starting the
run file, I see:

[snip]
Genode 18.05-203-gf4ea50c6f <local changes>
469 MiB RAM and 63253 caps assigned to init
[init -> uart_drv] --- UART driver started ---
[init -> gdb_monitor] using the pipe libc plugin
[init -> gdb_monitor] Warning: sigaction: sigaction not implemented
[init -> gdb_monitor] Process target created; pid = 1
[init -> gdb_monitor] Warning: unsupported ioctl (request=0x40047477)
[init -> gdb_monitor] Warning: unsupported ioctl (request=0x80047476)
[init -> uart_drv] open IRQ 3
[init -> uart_drv]
[init -> gdb_monitor] Remote debugging using /dev/terminal
[init -> gdb_monitor] Warning: fcntl(): command 4 args 66 not supported
- terminal
[init -> gdb_monitor] Warning: fcntl(): command 6 args 4294967295 not
supported - terminal

Then, I start gdb on the host from within the debug directory of the build:

$ ln -s ld-nova.lib.so ld.lib.so
$ genode-x86-gdb test-log
GNU gdb (GDB) 7.3.1
Copyright (C) 2011 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later
<http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "--host=x86_64-unknown-linux-gnu
--target=x86_64-pc-elf".
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>...
Reading symbols from
/home/alex/Documents/Componolit_GmbH/Devel/src/genode-master/build/x86_64/debug/test-log...done.
(gdb) target remote localhost:5555
Remote debugging using localhost:5555
Reading symbols from ld.lib.so...done.
Loaded symbols for ld.lib.so
warning: Unable to find dynamic linker breakpoint function.
GDB will be unable to debug shared library initializers
and track explicitly loaded dynamic code.
_start () at
/home/alex/Documents/Componolit_GmbH/Devel/src/genode-master/repos/base/src/lib/startup/spec/x86_64/crt0.s:43
43              leaq _GLOBAL_OFFSET_TABLE_(%rip), %r15
(gdb)

The Genode log says:

[init -> gdb_monitor] Warning: ptrace(PTRACE_GETREGSET (0x4204)) called
- not implemented!
[init -> gdb_monitor] Warning: read: no memory at address 0x1005d08
[init -> gdb_monitor] Warning: read: no memory at address 0x1005d08
[init -> gdb_monitor] Warning: read: no memory at address 0x1005d08

GDB does not seem to work correctly:

(gdb) bt
#0  _start () at
/home/alex/Documents/Componolit_GmbH/Devel/src/genode-master/repos/base/src/lib/startup/spec/x86_64/crt0.s:43
Cannot access memory at address 0x0

[init -> gdb_monitor] Warning: read: no memory at address 0x0


Any ideas what's wrong here?

Cheers,
Alex

-- 
Componolit GmbH · Königsbrücker Straße 124 · 01099 Dresden · Germany
Amtsgericht Dresden · HRB 36670 · Sitz Dresden
Geschäftsführer: Alexander Senier · USt-IdNr. (EU VATIN): DE312113634

http://componolit.com · @Componolit
-------------- next part --------------
A non-text attachment was scrubbed...
Name: run_log_gdb.diff
Type: text/x-patch
Size: 2014 bytes
Desc: not available
URL: <http://lists.genode.org/pipermail/users/attachments/20180809/960b213a/attachment.bin>


More information about the users mailing list