From c63f1d2151b551faeb437839a7e7903dde503dcd Mon Sep 17 00:00:00 2001 From: Samuel Thibault Date: Fri, 29 May 2020 12:49:38 +0200 Subject: Add static assembly version of mach_print, in case it may be useful --- hurd/debugging/glibc.mdwn | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/hurd/debugging/glibc.mdwn b/hurd/debugging/glibc.mdwn index 10a41503..a409f392 100644 --- a/hurd/debugging/glibc.mdwn +++ b/hurd/debugging/glibc.mdwn @@ -75,6 +75,16 @@ If your `mach_traps.h` does not have the declaration, use: extern void mach_print(const char *s); +If you can't use the libc-provided `mach_print` for some reason, you can use as last resort: + + asm("\ + my_mach_print:\n\ + mov $-30,%eax\n\ + lcall $7,$0\n\ + ret\n\ + "); + extern void my_mach_print(const char *s); + This call does not support any formatting. You can use this kind of helper to format a message before passing to gnumach: -- cgit v1.2.3