[haiku-development] Re: Debugging in libroot and friends during startup

  • From: kallisti5 <kallisti5@xxxxxxxxxxx>
  • To: haiku-development@xxxxxxxxxxxxx
  • Date: Fri, 09 Dec 2016 00:41:24 -0600

On 2016-12-09 00:32, Jessica Hamilton wrote:

Hi,

How does one get debug output during startup from things like libroot?
Particularly with launch_daemon.

I tried using dprintf(), but I'm getting undefined references, so
that's probably not usable? And using syslog(), it appears to hang.
And I don't get output when using printf().

Files I want to be able to get printf-style debugging output from are:
  src/kits/app/Roster.cpp: BRoster::_LaunchApp
  src/system/libroot/os/image.cpp: load_image

With UEFI, I'm finding that the page faults are happening in
load_image. This seems to be related to the __gRuntimeLoader pointer,
but I'd like to be able to do things like print out the address of
__gRuntimeLoader, etc.

I can't use the userland debugger, as it's still too early during startup.

Is there a way to LD_PRELOAD libroot_debug.so that early in the boot process? Maybe just flat out replace libroot.so with libroot_debug?

If you get lucky you might get some illegal memory access from libroot_debug you didn't get otherwise.


Another option might be finding a UEFI machine with a serial UART built in.

My MinnowBoard Max has a 16550 HS UART built-in and fancy UEFI only bios... maybe I could pull something extra if you send me a test image?

 -- Alex

Other related posts: