Skip to content

Instantly share code, notes, and snippets.

@startergo
Forked from knightsc/debug.h
Last active July 15, 2021 15:55
macOS Debug boot-args
/* Debug boot-args */
#define DB_HALT 0x1. /* Halt at boot-time and wait for debugger attach (gdb) */
//#define DB_PRT 0x2 /* Send kernel debugging printf output to console */ -- obsolete
#define DB_NMI 0x4 /* Drop into debugger on NMI (Command–Power, Command-Option-Control-Shift-Escape,
/* or interrupt switch) */
#define DB_KPRT 0x8 /* Send kernel debugging kprintf output to serial port*/
#define DB_KDB 0x10 /* Make ddb (kdb) the default debugger (requires a custom kernel) */
//#define DB_SLOG 0x20 /* Output certain diagnostic info to the system log */ -- obsolete
#define DB_ARP 0x40 /* Allow debugger to ARP and route (allows debugging across routers and removes
/* the need for a permanent ARP entry, but is a potential security hole)—not
/* available in all kernels */
#define DB_KDP_BP_DIS 0x80 /* Support old versions of gdb on newer systems */
//#define DB_LOG_PI_SCRN 0x100 /* Disable graphical panic dialog */ -- obsolete
#define DB_KDP_GETC_ENA 0x200 /* (useful) enable kdp_getc() prompt for (c) continue/(r) reboot */
#define DB_KERN_DUMP_ON_PANIC 0x400 /* Trigger core dump on panic*/
#define DB_KERN_DUMP_ON_NMI 0x800 /* Trigger core dump on NMI */
#define DB_DBG_POST_CORE 0x1000 /* Wait in debugger after NMI core */
#define DB_PANICLOG_DUMP 0x2000 /* Send paniclog on panic,not core */
#define DB_REBOOT_POST_CORE 0x4000 /* Attempt to reboot after */ post-panic crashdump/paniclog dump */
#define DB_NMI_BTN_ENA 0x8000 /* Enable button to directly trigger NMI */
#define DB_PRT_KDEBUG 0x10000 /* kprintf KDEBUG traces */
#define DB_DISABLE_LOCAL_CORE 0x20000 /* ignore local kernel core dump support */
#define DB_DISABLE_GZIP_CORE 0x40000 /* don't gzip kernel core dumps */
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment