Changeset View
Changeset View
Standalone View
Standalone View
libexec/rtld-elf/debug.h
Show All 31 Lines | |||||
*/ | */ | ||||
#ifndef DEBUG_H | #ifndef DEBUG_H | ||||
#define DEBUG_H 1 | #define DEBUG_H 1 | ||||
#include <sys/cdefs.h> | #include <sys/cdefs.h> | ||||
#include <string.h> | #include <string.h> | ||||
#include <unistd.h> | #include "rtld_printf.h" | ||||
kib: Spurious blank line. | |||||
void debug_printf(const char *, ...) __printflike(1, 2); | void debug_printf(const char *, ...) __printflike(1, 2); | ||||
extern int debug; | extern int debug; | ||||
#ifndef NO_LD_DEBUG | #ifndef NO_LD_DEBUG | ||||
#define dbg(...) debug_printf(__VA_ARGS__) | #define dbg(...) debug_printf(__VA_ARGS__) | ||||
#else | #else | ||||
#define dbg(...) ((void) 0) | #define dbg(...) ((void) 0) | ||||
#endif | #endif | ||||
#ifndef COMPAT_32BIT | #ifndef COMPAT_32BIT | ||||
#define _MYNAME "ld-elf.so.1" | #define _MYNAME "ld-elf.so.1" | ||||
#else | #else | ||||
#define _MYNAME "ld-elf32.so.1" | #define _MYNAME "ld-elf32.so.1" | ||||
#endif | #endif | ||||
#define assert(cond) ((cond) ? (void) 0 : \ | #define assert(cond) ((cond) ? (void) 0 : \ | ||||
(msg(_MYNAME ": assert failed: " __FILE__ ":" \ | (msg(_MYNAME ": assert failed: " __FILE__ ":" \ | ||||
__XSTRING(__LINE__) "\n"), abort())) | __XSTRING(__LINE__) "\n"), abort())) | ||||
#define msg(s) write(STDOUT_FILENO, s, strlen(s)) | #define msg(s) rtld_putstr(s) | ||||
#define trace() msg(_MYNAME ": " __XSTRING(__LINE__) "\n") | #define trace() msg(_MYNAME ": " __XSTRING(__LINE__) "\n") | ||||
#endif /* DEBUG_H */ | #endif /* DEBUG_H */ |
Spurious blank line.