* Added an emergency key mechanism to the kernel, inspired by Jan Klötzke's
patch from about a year ago (I couldn't use any code of his yet, though, but there are a few things left). The emergency keys are triggered by pressing Alt-SysReq + key. * By default, only Alt-SysReq+'d' is used as a means to deliberately enter the kernel debugger. F12 belongs to userland again, now :-) * Debugger add-ons now have another optional method to implement their own emergency keys - 'd' for the debugger cannot be overridden, though. * The mechanism can be turned off via a new kernel setting, so it's not that easy anymore to "crash" Haiku if you don't want to. * Right now, the PS/2 driver, and the pre-input_server in-kernel debugger keyboard mini-driver support this, USB not yet. * Minor cleanup. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@31660 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -28,7 +28,11 @@
|
||||
#endif
|
||||
|
||||
#define ASSERT_ALWAYS(x) \
|
||||
do { if (!(x)) { panic("ASSERT FAILED (%s:%d): %s\n", __FILE__, __LINE__, #x); } } while (0)
|
||||
do { \
|
||||
if (!(x)) { \
|
||||
panic("ASSERT FAILED (%s:%d): %s\n", __FILE__, __LINE__, #x); \
|
||||
} \
|
||||
} while (0)
|
||||
|
||||
#define ASSERT_ALWAYS_PRINT(x, format...) \
|
||||
do { \
|
||||
@@ -66,10 +70,13 @@ struct debugger_module_info {
|
||||
void (*enter_debugger)(void);
|
||||
void (*exit_debugger)(void);
|
||||
|
||||
// io hooks
|
||||
// I/O hooks
|
||||
int (*debugger_puts)(const char *str, int32 length);
|
||||
int (*debugger_getchar)(void);
|
||||
// TODO: add hooks for tunnelling gdb ?
|
||||
|
||||
// Misc. hooks
|
||||
bool (*emergency_key_pressed)(char key);
|
||||
};
|
||||
|
||||
struct debugger_demangle_module_info {
|
||||
@@ -113,7 +120,8 @@ extern void debug_stop_screen_debug_output(void);
|
||||
extern void debug_set_page_fault_info(addr_t faultAddress, addr_t pc,
|
||||
uint32 flags);
|
||||
extern debug_page_fault_info* debug_get_page_fault_info();
|
||||
extern void debug_trap_cpu_in_kdl(bool returnIfHandedOver);
|
||||
extern void debug_trap_cpu_in_kdl(bool returnIfHandedOver);
|
||||
extern bool debug_emergency_key_pressed(char key);
|
||||
|
||||
extern char kgetc(void);
|
||||
extern void kputs(const char *string);
|
||||
|
||||
Reference in New Issue
Block a user