1845a180fSFrançois Revol /*
24e44040dSFrançois Revol * Copyright 2007, François Revol, revol@free.fr.
34e44040dSFrançois Revol * Distributed under the terms of the MIT License.
44e44040dSFrançois Revol *
5845a180fSFrançois Revol * Copyright 2005, Axel Dörfler, axeld@pinc-softare.de
6845a180fSFrançois Revol * Distributed under the terms of the MIT License.
7845a180fSFrançois Revol */
8845a180fSFrançois Revol
9845a180fSFrançois Revol
10845a180fSFrançois Revol #include <debugger.h>
11845a180fSFrançois Revol #include <int.h>
12845a180fSFrançois Revol #include <thread.h>
13845a180fSFrançois Revol #include <arch/user_debugger.h>
14845a180fSFrançois Revol
15845a180fSFrançois Revol
161fd024beSFrançois Revol #warning M68K: WRITEME
17845a180fSFrançois Revol void
arch_clear_team_debug_info(struct arch_team_debug_info * info)18845a180fSFrançois Revol arch_clear_team_debug_info(struct arch_team_debug_info *info)
19845a180fSFrançois Revol {
20845a180fSFrançois Revol }
21845a180fSFrançois Revol
22845a180fSFrançois Revol
23845a180fSFrançois Revol void
arch_destroy_team_debug_info(struct arch_team_debug_info * info)24845a180fSFrançois Revol arch_destroy_team_debug_info(struct arch_team_debug_info *info)
25845a180fSFrançois Revol {
26845a180fSFrançois Revol arch_clear_team_debug_info(info);
27845a180fSFrançois Revol }
28845a180fSFrançois Revol
29845a180fSFrançois Revol
30845a180fSFrançois Revol void
arch_clear_thread_debug_info(struct arch_thread_debug_info * info)31845a180fSFrançois Revol arch_clear_thread_debug_info(struct arch_thread_debug_info *info)
32845a180fSFrançois Revol {
33845a180fSFrançois Revol }
34845a180fSFrançois Revol
35845a180fSFrançois Revol
36845a180fSFrançois Revol void
arch_destroy_thread_debug_info(struct arch_thread_debug_info * info)37845a180fSFrançois Revol arch_destroy_thread_debug_info(struct arch_thread_debug_info *info)
38845a180fSFrançois Revol {
39845a180fSFrançois Revol arch_clear_thread_debug_info(info);
40845a180fSFrançois Revol }
41845a180fSFrançois Revol
42845a180fSFrançois Revol
43845a180fSFrançois Revol void
arch_update_thread_single_step()441fd024beSFrançois Revol arch_update_thread_single_step()
451fd024beSFrançois Revol {
461fd024beSFrançois Revol if (struct iframe* frame = m68k_get_user_iframe()) {
474535495dSIngo Weinhold Thread* thread = thread_get_current_thread();
481fd024beSFrançois Revol
491fd024beSFrançois Revol // set/clear T1 in SR depending on if single stepping is desired
501fd024beSFrançois Revol // T1 T0
511fd024beSFrançois Revol // 0 0 no tracing
521fd024beSFrançois Revol // 0 1 trace on flow
531fd024beSFrançois Revol // 1 0 single step
541fd024beSFrançois Revol // 1 1 undef
5530145fa1SFrançois Revol // note 060 and 020(?) only have T1 bit,
5630145fa1SFrançois Revol // but this should be compatible as well.
571fd024beSFrançois Revol if (thread->debug_info.flags & B_THREAD_DEBUG_SINGLE_STEP) {
581fd024beSFrançois Revol frame->cpu.sr &= ~(M68K_SR_T_MASK);
591fd024beSFrançois Revol frame->cpu.sr |= (1 << M68K_SR_T1);
601fd024beSFrançois Revol } else {
611fd024beSFrançois Revol frame->cpu.sr &= ~(M68K_SR_T_MASK);
621fd024beSFrançois Revol }
631fd024beSFrançois Revol }
641fd024beSFrançois Revol }
651fd024beSFrançois Revol
661fd024beSFrançois Revol
671fd024beSFrançois Revol void
arch_set_debug_cpu_state(const debug_cpu_state * cpuState)680b11ecb1SIngo Weinhold arch_set_debug_cpu_state(const debug_cpu_state *cpuState)
69845a180fSFrançois Revol {
70845a180fSFrançois Revol }
71845a180fSFrançois Revol
72845a180fSFrançois Revol
73845a180fSFrançois Revol void
arch_get_debug_cpu_state(debug_cpu_state * cpuState)740b11ecb1SIngo Weinhold arch_get_debug_cpu_state(debug_cpu_state *cpuState)
75845a180fSFrançois Revol {
76568ade58SIngo Weinhold }
77568ade58SIngo Weinhold
78568ade58SIngo Weinhold
79568ade58SIngo Weinhold status_t
arch_get_thread_debug_cpu_state(Thread * thread,debug_cpu_state * cpuState)80*99f00556SIngo Weinhold arch_get_thread_debug_cpu_state(Thread* thread, debug_cpu_state* cpuState)
81*99f00556SIngo Weinhold {
82*99f00556SIngo Weinhold return B_UNSUPPORTED;
83*99f00556SIngo Weinhold }
84*99f00556SIngo Weinhold
85*99f00556SIngo Weinhold
86*99f00556SIngo Weinhold status_t
arch_set_breakpoint(void * address)87845a180fSFrançois Revol arch_set_breakpoint(void *address)
88845a180fSFrançois Revol {
89845a180fSFrançois Revol return B_ERROR;
90845a180fSFrançois Revol }
91845a180fSFrançois Revol
92845a180fSFrançois Revol
93845a180fSFrançois Revol status_t
arch_clear_breakpoint(void * address)94845a180fSFrançois Revol arch_clear_breakpoint(void *address)
95845a180fSFrançois Revol {
96845a180fSFrançois Revol return B_ERROR;
97845a180fSFrançois Revol }
98845a180fSFrançois Revol
99845a180fSFrançois Revol
100845a180fSFrançois Revol status_t
arch_set_watchpoint(void * address,uint32 type,int32 length)101845a180fSFrançois Revol arch_set_watchpoint(void *address, uint32 type, int32 length)
102845a180fSFrançois Revol {
103845a180fSFrançois Revol return B_ERROR;
104845a180fSFrançois Revol }
105845a180fSFrançois Revol
106845a180fSFrançois Revol
107845a180fSFrançois Revol status_t
arch_clear_watchpoint(void * address)108845a180fSFrançois Revol arch_clear_watchpoint(void *address)
109845a180fSFrançois Revol {
110845a180fSFrançois Revol return B_ERROR;
111845a180fSFrançois Revol }
112845a180fSFrançois Revol
1131fd024beSFrançois Revol bool
arch_has_breakpoints(struct arch_team_debug_info * info)1141fd024beSFrançois Revol arch_has_breakpoints(struct arch_team_debug_info *info)
1151fd024beSFrançois Revol {
1161fd024beSFrançois Revol return false;
1171fd024beSFrançois Revol }
118