GDB monitor

Joscha Benz jbenz at ...415...
Tue Mar 15 15:13:34 CET 2016


Hi,

im currently working with Genode on Zynq-7000 based HW and i was trying
to port GDB Monitor to
that platform. So far i implemented

    * ports/src/lib/gdbserver_platform/spec/hw_zynq/low.cc
    * ports/lib/mk/spec/hw_zynq/gdbserver_platform.mk

I then tried running a modified version "make
run/gdb_monitor_interactive". I'm using tcp_terminal as
terminal session. My first problem is that running the above command
times out while the run-script is waiting for GDB monitor to start. I
guess when using tcp_terminal "/dev/terminal" is only created
after making a connection to it?
I am able to connect to GDB monitormanually and i can read/set
registers, print backtrace and set breakpoints. But actually running
specific parts of the code being debugged does not work. Jumping to
function func1 after setting a breakpoint at func2 for example yields
the following:

Assertion failed: _state == AWAITS_RESUME || _state == ACTIVE
  File: repos/base-hw/src/core/kernel/thread.cc:134
  Function: void Kernel::Thread::_pause()

Typing "run" the gdb complains:

The "remote" target does not support "run".  Try "help target" or
"continue".

I dont really know what the problem is at this point. Do i have to
implement additional files to get a full
working port of GDB monitor for hw_zynq? Or am i just doing something wrong?

I also tried using GDB monitor with foc_x86_32 and nova_x86_32. I ran
"make run/gdb_monitor" but i get
the following result for both platforms:

GDB monitor is up, starting GDB
spawn /usr/local/genode-gcc/bin/genode-x86-gdb bin/test-gdb_monitor -n
-batch -ex target remote localhost:5555 -ex set interactive-mode off -ex
symbol-file bin/ld.lib.so -ex b Linker::Binary::call_entry_point -ex c
-ex delete 1 -ex symbol-file bin/test-gdb_monitor -ex b main -ex set
solib-search-path bin -ex sharedlibrary -ex c -ex delete 2 -ex b puts
-ex c -ex bt -ex print test_var -ex set var test_var=2 -ex print
test_var -ex b Test_thread::entry() -ex c -ex info threads -ex step -ex
c -ex thread 1 -ex bt -ex q 2&>1
[init -> gdb_monitor] fcntl(): command 4 args 66 not supported - terminal
[init -> gdb_monitor] fcntl(): command 6 args -1 not supported - terminal
int main(): --- init created, waiting for exit condition ---
Don't know how to attach.  Try "help target".
GDB can't read core files on this machine.
Ignoring packet error, continuing...
warning: unrecognized item "timeout" in "qSupported" response
Ignoring packet error, continuing...
Ignoring packet error, continuing...
Ignoring packet error, continuing...
Ignoring packet error, continuing...
Remote communication error.  Target disconnected.: Die Verbindung wurde
vom Kommunikationspartner zurückgesetzt.
Breakpoint 1 at 0xaab20: file repos/base/src/lib/ldso/main.cc, line 364.
The program is not being run.
Breakpoint 2 at 0x1000a05: file repos/base/include/base/thread.h, line 583.
The program is not being run.
Breakpoint 3 at 0x1007720
The program is not being run.
No stack.
$1 = 1
Cannot access memory at address 0x1008cac
$2 = 1
Breakpoint 4 at 0x1005ae0: file
repos/ports/src/test/gdb_monitor/main.cc, line 44.
The program is not being run.
No threads.
The program is not being run.
The program is not being run.
Thread ID 1 not known.
No stack.
Error: Breakpoint in main() did not trigger
Makefile:246: die Regel für Ziel „run/gdb_monitor“ scheiterte
make: *** [run/gdb_monitor] Fehler 255

I can see that the problem seems to be related to the terminal session.
Is this supposed to work out of the box?

Any hint/advice would be much appreciated. All changes i made may be
found here:

https://github.com/ValiValpas/genode/tree/zynq_gdb_monitor

Regards,

Joscha




More information about the users mailing list