serial --speed=115200 --unit=0
serial --speed=115200 --port=0x3f8
Once serial is set run following command in grub console (so DUT side):
On host side run gdb -b 115200 and then assuming host side connects to DUT via ttyUSB0
gdb -b 115200
(gdb) target remote /dev/ttyUSB0
Remote debugging using /dev/ttyUSB0
warning: No executable has been specified and target does not support
determining executable automatically. Try using the "file" command.
0xbf96d3d5 in ?? ()
From that point (gdb) c 1 will resume execution on DUT, and ~breakpoint can be also set from script via gdbstub_break.
(gdb) c 1
To completely exit/stop gdbstub run gdbstub_stop on DUT
...to be continued...
While grub_dprintf() is controlled via debug variable (would be nice to use RTC NVRAM here instead), only a terminal_output exists and not error/log one. It would be great to introduce something like debug_output or log_output, being configured similarly to the existing one.
To not conflict with gdbstub perhaps different port can be used eg. terminal_output serial_port2f8