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_get_caller(void) 29 { 30 return NULL; 31 } 32 33 34 void 35 arch_debug_save_registers(struct arch_debug_registers* registers) 36 { 37 } 38 39 40 void 41 arch_debug_call_with_fault_handler(cpu_ent* cpu, jmp_buf jumpBuffer, 42 void (*function)(void*), void* parameter) 43 { 44 } 45 46 47 void 48 arch_debug_unset_current_thread(void) 49 { 50 asm volatile("mov %g0, %g7"); 51 } 52 53 54 bool 55 arch_is_debug_variable_defined(const char* variableName) 56 { 57 // TODO: Implement! 58 return false; 59 } 60 61 62 status_t 63 arch_set_debug_variable(const char* variableName, uint64 value) 64 { 65 // TODO: Implement! 66 return B_ENTRY_NOT_FOUND; 67 } 68 69 70 status_t 71 arch_get_debug_variable(const char* variableName, uint64* value) 72 { 73 // TODO: Implement! 74 return B_ENTRY_NOT_FOUND; 75 } 76 77 78 int32 79 arch_debug_get_stack_trace(addr_t* returnAddresses, int32 maxCount, 80 int32 skipIframes, int32 skipFrames, uint32 flags) 81 { 82 return 0; 83 } 84 85 86 ssize_t 87 arch_debug_gdb_get_registers(char* buffer, size_t bufferSize) 88 { 89 // TODO: Implement! 90 return B_NOT_SUPPORTED; 91 } 92 93 94 void* 95 arch_debug_get_interrupt_pc(bool* _isSyscall) 96 { 97 // TODO: Implement! 98 return NULL; 99 } 100 101 102 status_t 103 arch_debug_init(kernel_args *args) 104 { 105 #if 0 106 add_debugger_command("where", &stack_trace, "Same as \"sc\""); 107 add_debugger_command("bt", &stack_trace, "Same as \"sc\" (as in gdb)"); 108 add_debugger_command("sc", &stack_trace, "Stack crawl for current thread"); 109 #endif 110 111 return B_NO_ERROR; 112 } 113 114