1/* 2 * Copyright 2003-201, Haiku, Inc. All rights reserved. 3 * Distributed under the terms of the MIT License. 4 * 5 * Authors: 6 * Ingo Weinhold <bonefish@cs.tu-berlin.de> 7 * François Revol <revol@free.fr> 8 * Jonas Sundström <jonas@kirilla.com> 9 */ 10 11 12#include <arch/debug.h> 13 14#include <arch_cpu.h> 15#include <debug.h> 16#include <elf.h> 17#include <kernel.h> 18#include <kimage.h> 19#include <thread.h> 20 21 22struct stack_frame { 23 struct stack_frame *previous; 24 addr_t return_address; 25}; 26 27 28#define NUM_PREVIOUS_LOCATIONS 32 29 30 31extern struct iframe_stack gBootFrameStack; 32 33 34// #pragma mark - 35 36 37void 38arch_debug_save_registers(struct arch_debug_registers* registers) 39{ 40#warning IMPLEMENT arch_debug_save_registers 41} 42 43 44bool 45arch_debug_contains_call(Thread* thread, const char* symbol, 46 addr_t start, addr_t end) 47{ 48#warning IMPLEMENT arch_debug_contains_call 49 return false; 50} 51 52 53void* 54arch_debug_get_caller(void) 55{ 56#warning IMPLEMENT arch_debug_get_caller 57 return NULL; 58} 59 60 61int32 62arch_debug_get_stack_trace(addr_t* returnAddresses, int32 maxCount, 63 int32 skipIframes, int32 skipFrames, uint32 flags) 64{ 65#warning IMPLEMENT arch_debug_get_stack_trace 66 return 0; 67} 68 69 70void* 71arch_debug_get_interrupt_pc(bool* _isSyscall) 72{ 73#warning IMPLEMENT arch_debug_get_interrupt_pc 74 return NULL; 75} 76 77 78bool 79arch_is_debug_variable_defined(const char* variableName) 80{ 81#warning IMPLEMENT arch_is_debug_variable_defined 82 return false; 83} 84 85 86status_t 87arch_set_debug_variable(const char* variableName, uint64 value) 88{ 89#warning IMPLEMENT arch_set_debug_variable 90 return B_ENTRY_NOT_FOUND; 91} 92 93 94status_t 95arch_get_debug_variable(const char* variableName, uint64* value) 96{ 97#warning IMPLEMENT arch_get_debug_variable 98 return B_ENTRY_NOT_FOUND; 99} 100 101 102ssize_t 103arch_debug_gdb_get_registers(char* buffer, size_t bufferSize) 104{ 105 // TODO: Implement! 106 return B_NOT_SUPPORTED; 107} 108 109 110status_t 111arch_debug_init(kernel_args* args) 112{ 113#warning IMPLEMENT arch_debug_init 114 return B_ERROR; 115} 116 117 118void 119arch_debug_call_with_fault_handler(cpu_ent* cpu, jmp_buf jumpBuffer, 120 void (*function)(void*), void* parameter) 121{ 122#warning IMPLEMENT arch_debug_call_with_fault_handler 123 longjmp(jumpBuffer, 1); 124} 125 126 127void 128arch_debug_unset_current_thread(void) 129{ 130#warning IMPLEMENT arch_debug_unset_current_thread 131} 132 133