Debugging early bootloader code can be extremely difficult. The lack of printf and other classical black-box debugging tools means you’re limited to one of the following methods of debugging lockups:
When debugging UEFI loader for ARM (UEFI Haiku boot loader for ARM), I used UEFI text output protocol to write checkpoints like (1), (2), (2.1). Also UEFI display crash report with IP register value that can be converted to source code position by llvm-addr2line.
I used serial for ARM as well. However I found out printf was broken on ARM and in some very important info print 0 instead of the correct numerical values. So I think using both methods is important. (Turned out packages used by bootlloader was compiled with hardfloat, while UEFI in ARM arn’t allowed to use float).
I made RISC-V port without any external debuggers, only serial, screen output and disassemblers. There are no actual GDB version in HaikuPorts and I am not sure that current version will work with Qemu on Haiku host.
Good advice. And for others: remember that var-args and how arguments are passed, calculations, mmap and so on might not report the correct values when you are bringing up a new arch.