xref: /haiku/src/system/kernel/arch/m68k/arch_user_debugger.cpp (revision 568ade58d054e27ce4cd9da0d4e73ecb79563b96)
1 /*
2  * Copyright 2007, François Revol, revol@free.fr.
3  * Distributed under the terms of the MIT License.
4  *
5  * Copyright 2005, Axel Dörfler, axeld@pinc-softare.de
6  * Distributed under the terms of the MIT License.
7  */
8 
9 
10 #include <debugger.h>
11 #include <int.h>
12 #include <thread.h>
13 #include <arch/user_debugger.h>
14 
15 
16 #warning M68K: WRITEME
17 void
18 arch_clear_team_debug_info(struct arch_team_debug_info *info)
19 {
20 }
21 
22 
23 void
24 arch_destroy_team_debug_info(struct arch_team_debug_info *info)
25 {
26 	arch_clear_team_debug_info(info);
27 }
28 
29 
30 void
31 arch_clear_thread_debug_info(struct arch_thread_debug_info *info)
32 {
33 }
34 
35 
36 void
37 arch_destroy_thread_debug_info(struct arch_thread_debug_info *info)
38 {
39 	arch_clear_thread_debug_info(info);
40 }
41 
42 
43 void
44 arch_update_thread_single_step()
45 {
46 	if (struct iframe* frame = m68k_get_user_iframe()) {
47 		struct thread* thread = thread_get_current_thread();
48 
49 		// set/clear T1 in SR depending on if single stepping is desired
50 		// T1 T0
51 		// 0  0  no tracing
52 		// 0  1  trace on flow
53 		// 1  0  single step
54 		// 1  1  undef
55 		// note 060 and 020(?) only have T1 bit,
56 		// but this should be compatible as well.
57 		if (thread->debug_info.flags & B_THREAD_DEBUG_SINGLE_STEP) {
58 			frame->cpu.sr &= ~(M68K_SR_T_MASK);
59 			frame->cpu.sr |= (1 << M68K_SR_T1);
60 		} else {
61 			frame->cpu.sr &= ~(M68K_SR_T_MASK);
62 		}
63 	}
64 }
65 
66 
67 void
68 arch_set_debug_cpu_state(const struct debug_cpu_state *cpuState)
69 {
70 }
71 
72 
73 void
74 arch_get_debug_cpu_state(struct debug_cpu_state *cpuState)
75 {
76 }
77 
78 
79 status_t
80 arch_get_thread_debug_cpu_state(struct thread *thread,
81 	struct debug_cpu_state *cpuState)
82 {
83 	return B_UNSUPPORTED;
84 }
85 
86 
87 status_t
88 arch_set_breakpoint(void *address)
89 {
90 	return B_ERROR;
91 }
92 
93 
94 status_t
95 arch_clear_breakpoint(void *address)
96 {
97 	return B_ERROR;
98 }
99 
100 
101 status_t
102 arch_set_watchpoint(void *address, uint32 type, int32 length)
103 {
104 	return B_ERROR;
105 }
106 
107 
108 status_t
109 arch_clear_watchpoint(void *address)
110 {
111 	return B_ERROR;
112 }
113 
114 bool
115 arch_has_breakpoints(struct arch_team_debug_info *info)
116 {
117 	return false;
118 }
119