This change makes it possible to use OPAL console as a GDB debug port.
Similar to uart and uart_phyp debug ports, it has to be enabled by
setting the hw.uart.dbgport variable to the serial console node
of the device tree.
Differential D22649
[PPC64] Enable opal console use as a GDB DBGPORT luporl on Dec 3 2019, 8:41 PM. Authored by Tags Referenced Files
Details
This change makes it possible to use OPAL console as a GDB debug port. Similar to uart and uart_phyp debug ports, it has to be enabled by This was tested using the console provided by IPMI over LAN. The test goal is to be able to perform basic remote debugging, using 2 machines with the same FreeBSD version. Note: for now, this was tested only with ELFv1 systems and with /usr/libexec/kgdb, as recent gdb/kgdb versions fail to attach to a remote FreeBSD target. Below are the steps needed to establish a debug connection between the 2 machines:
Next, execute the ipmitool command needed to activate a console to the debuggee machine, redirecting its I/O to the pty.
When Petitboot is reached, start FreeBSD in debug mode and specify the debug port path.
Ex: kgdb kernel then target remote /dev/cuau0. After the final step, the debug connection should (finally) be established, allowing debug commands to be executed. While this is not fixed, a temporary workaround is to manually reload the symbols, specifying the actual load addresses of the sections.
Diff Detail
Event TimelineComment Actions Overall looks fine.
Comment Actions Yes, at least use the existing environment variable that others already use. That keeps it more uniform. uart_cpu_getdev() looks a bit clunky in its implementation, I'd love it if we could eventually make it support the OPAL console without needing even more cases. |