mirror of
https://github.com/RGBCube/serenity
synced 2025-05-14 07:54:58 +00:00

Turns out we can use abi::__cxa_demangle() for this, and all we need to provide is sprintf(), realloc() and free(), so this patch exposes them. We now have fully demangled C++ backtraces :^)
20 lines
374 B
C
20 lines
374 B
C
#pragma once
|
|
|
|
#include <AK/Types.h>
|
|
|
|
extern "C" {
|
|
int dbgprintf(const char* fmt, ...);
|
|
int dbgputstr(const char*, int);
|
|
int kprintf(const char* fmt, ...);
|
|
int sprintf(char* buf, const char* fmt, ...);
|
|
void set_serial_debug(bool on_or_off);
|
|
int get_serial_debug();
|
|
}
|
|
|
|
#ifndef USERLAND
|
|
# define printf dbgprintf
|
|
#endif
|
|
|
|
#ifndef __serenity__
|
|
#define dbgprintf printf
|
|
#endif
|