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
13void
14arch_debug_stack_trace(void)
15{
16}
17
18
19bool
20arch_debug_contains_call(Thread *thread, const char *symbol,
21	addr_t start, addr_t end)
22{
23	return false;
24}
25
26
27void *
28arch_debug_get_caller(void)
29{
30	return NULL;
31}
32
33
34void
35arch_debug_save_registers(struct arch_debug_registers* registers)
36{
37}
38
39
40void
41arch_debug_call_with_fault_handler(cpu_ent* cpu, jmp_buf jumpBuffer,
42	void (*function)(void*), void* parameter)
43{
44}
45
46
47bool
48arch_is_debug_variable_defined(const char* variableName)
49{
50	// TODO: Implement!
51	return false;
52}
53
54
55status_t
56arch_set_debug_variable(const char* variableName, uint64 value)
57{
58	// TODO: Implement!
59	return B_ENTRY_NOT_FOUND;
60}
61
62
63status_t
64arch_get_debug_variable(const char* variableName, uint64* value)
65{
66	// TODO: Implement!
67	return B_ENTRY_NOT_FOUND;
68}
69
70
71int32
72arch_debug_get_stack_trace(addr_t* returnAddresses, int32 maxCount,
73	int32 skipIframes, int32 skipFrames, uint32 flags)
74{
75	return 0;
76}
77
78
79ssize_t
80arch_debug_gdb_get_registers(char* buffer, size_t bufferSize)
81{
82	// TODO: Implement!
83	return B_NOT_SUPPORTED;
84}
85
86
87void*
88arch_debug_get_interrupt_pc(bool* _isSyscall)
89{
90	// TODO: Implement!
91	return NULL;
92}
93
94
95status_t
96arch_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