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 Revolvoid
18845a180fSFrançois Revolarch_clear_team_debug_info(struct arch_team_debug_info *info)
19845a180fSFrançois Revol{
20845a180fSFrançois Revol}
21845a180fSFrançois Revol
22845a180fSFrançois Revol
23845a180fSFrançois Revolvoid
24845a180fSFrançois Revolarch_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 Revolvoid
31845a180fSFrançois Revolarch_clear_thread_debug_info(struct arch_thread_debug_info *info)
32845a180fSFrançois Revol{
33845a180fSFrançois Revol}
34845a180fSFrançois Revol
35845a180fSFrançois Revol
36845a180fSFrançois Revolvoid
37845a180fSFrançois Revolarch_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
431fd024beSFrançois Revolvoid
441fd024beSFrançois Revolarch_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();
48568ade58SIngo Weinhold
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
55568ade58SIngo Weinhold		// 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
67845a180fSFrançois Revolvoid
680b11ecb1SIngo Weinholdarch_set_debug_cpu_state(const debug_cpu_state *cpuState)
69845a180fSFrançois Revol{
70845a180fSFrançois Revol}
71845a180fSFrançois Revol
72845a180fSFrançois Revol
73845a180fSFrançois Revolvoid
740b11ecb1SIngo Weinholdarch_get_debug_cpu_state(debug_cpu_state *cpuState)
75845a180fSFrançois Revol{
76845a180fSFrançois Revol}
77845a180fSFrançois Revol
78845a180fSFrançois Revol
7999f00556SIngo Weinholdstatus_t
8099f00556SIngo Weinholdarch_get_thread_debug_cpu_state(Thread* thread, debug_cpu_state* cpuState)
8199f00556SIngo Weinhold{
8299f00556SIngo Weinhold	return B_UNSUPPORTED;
8399f00556SIngo Weinhold}
8499f00556SIngo Weinhold
8599f00556SIngo Weinhold
86845a180fSFrançois Revolstatus_t
87845a180fSFrançois Revolarch_set_breakpoint(void *address)
88845a180fSFrançois Revol{
89845a180fSFrançois Revol	return B_ERROR;
90845a180fSFrançois Revol}
91845a180fSFrançois Revol
92845a180fSFrançois Revol
93845a180fSFrançois Revolstatus_t
94845a180fSFrançois Revolarch_clear_breakpoint(void *address)
95845a180fSFrançois Revol{
96845a180fSFrançois Revol	return B_ERROR;
97845a180fSFrançois Revol}
98845a180fSFrançois Revol
99845a180fSFrançois Revol
100845a180fSFrançois Revolstatus_t
101845a180fSFrançois Revolarch_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 Revolstatus_t
108845a180fSFrançois Revolarch_clear_watchpoint(void *address)
109845a180fSFrançois Revol{
110845a180fSFrançois Revol	return B_ERROR;
111845a180fSFrançois Revol}
112845a180fSFrançois Revol
1131fd024beSFrançois Revolbool
1141fd024beSFrançois Revolarch_has_breakpoints(struct arch_team_debug_info *info)
1151fd024beSFrançois Revol{
1161fd024beSFrançois Revol	return false;
1171fd024beSFrançois Revol}
118