1 /* 2 * Copyright 2019, Haiku, Inc. All rights reserved. 3 * Distributed under the terms of the MIT License. 4 * 5 * Authors: 6 * Adrien Destugues <pulkomandy@pulkomandy.tk> 7 */ 8 9 10 #include <arch/debug.h> 11 12 13 void 14 arch_debug_stack_trace(void) 15 { 16 } 17 18 19 bool 20 arch_debug_contains_call(Thread *thread, const char *symbol, 21 addr_t start, addr_t end) 22 { 23 return false; 24 } 25 26 27 void 28 arch_debug_save_registers(struct arch_debug_registers* registers) 29 { 30 } 31 32 33 void 34 arch_debug_call_with_fault_handler(cpu_ent* cpu, jmp_buf jumpBuffer, 35 void (*function)(void*), void* parameter) 36 { 37 } 38 39 40 void 41 arch_debug_unset_current_thread(void) 42 { 43 asm volatile("mov %g0, %g7"); 44 } 45 46 47 bool 48 arch_is_debug_variable_defined(const char* variableName) 49 { 50 // TODO: Implement! 51 return false; 52 } 53 54 55 status_t 56 arch_set_debug_variable(const char* variableName, uint64 value) 57 { 58 // TODO: Implement! 59 return B_ENTRY_NOT_FOUND; 60 } 61 62 63 status_t 64 arch_get_debug_variable(const char* variableName, uint64* value) 65 { 66 // TODO: Implement! 67 return B_ENTRY_NOT_FOUND; 68 } 69 70 71 int32 72 arch_debug_get_stack_trace(addr_t* returnAddresses, int32 maxCount, 73 int32 skipIframes, int32 skipFrames, uint32 flags) 74 { 75 return 0; 76 } 77 78 79 ssize_t 80 arch_debug_gdb_get_registers(char* buffer, size_t bufferSize) 81 { 82 // TODO: Implement! 83 return B_NOT_SUPPORTED; 84 } 85 86 87 void* 88 arch_debug_get_interrupt_pc(bool* _isSyscall) 89 { 90 // TODO: Implement! 91 return NULL; 92 } 93 94 95 status_t 96 arch_debug_init(kernel_args *args) 97 { 98 #if 0 99 add_debugger_command("where", &stack_trace, "Same as \"sc\""); 100 add_debugger_command("bt", &stack_trace, "Same as \"sc\" (as in gdb)"); 101 add_debugger_command("sc", &stack_trace, "Stack crawl for current thread"); 102 #endif 103 104 return B_NO_ERROR; 105 } 106 107