breakpoints.h 2.8 KB
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
/***************************************************************************
 *   Copyright (C) 2005 by Dominic Rath                                    *
 *   Dominic.Rath@gmx.de                                                   *
 *                                                                         *
 *   This program is free software; you can redistribute it and/or modify  *
 *   it under the terms of the GNU General Public License as published by  *
 *   the Free Software Foundation; either version 2 of the License, or     *
 *   (at your option) any later version.                                   *
 *                                                                         *
 *   This program is distributed in the hope that it will be useful,       *
 *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
 *   GNU General Public License for more details.                          *
 *                                                                         *
 *   You should have received a copy of the GNU General Public License     *
 *   along with this program; if not, write to the                         *
 *   Free Software Foundation, Inc.,                                       *
 *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
 ***************************************************************************/
#ifndef BREAKPOINTS_H
#define BREAKPOINTS_H

23
#include <helper/types.h>
24

Zachary T Welch's avatar
Zachary T Welch committed
25
struct target;
26
27
28
29
30
31
32
33
34
35
36
37

enum breakpoint_type
{
	BKPT_HARD,
	BKPT_SOFT,
};

enum watchpoint_rw
{
	WPT_READ = 0, WPT_WRITE = 1, WPT_ACCESS = 2
};

38
struct breakpoint
39
{
40
	uint32_t address;
41
	uint32_t asid;
42
43
44
	int length;
	enum breakpoint_type type;
	int set;
45
	uint8_t *orig_instr;
46
	struct breakpoint *next;
47
48
	uint32_t unique_id;
	int linked_BRP; 
49
};
50

51
struct watchpoint
52
{
53
	uint32_t address;
David Brownell's avatar
David Brownell committed
54
	uint32_t length;
55
56
	uint32_t mask;
	uint32_t value;
57
58
	enum watchpoint_rw rw;
	int set;
59
	struct watchpoint *next;
60
	int unique_id;
61
};
62

Zachary T Welch's avatar
Zachary T Welch committed
63
64
void breakpoint_clear_target(struct target *target);
int breakpoint_add(struct target *target,
65
		uint32_t address, uint32_t length, enum breakpoint_type type);
66
67
68
69
int context_breakpoint_add(struct target *target,
		uint32_t asid, uint32_t length, enum breakpoint_type type);
int hybrid_breakpoint_add(struct target *target,
		uint32_t address, uint32_t asid, uint32_t length, enum breakpoint_type type);
Zachary T Welch's avatar
Zachary T Welch committed
70
void breakpoint_remove(struct target *target, uint32_t address);
71

Zachary T Welch's avatar
Zachary T Welch committed
72
struct breakpoint* breakpoint_find(struct target *target, uint32_t address);
73

Zachary T Welch's avatar
Zachary T Welch committed
74
75
void watchpoint_clear_target(struct target *target);
int watchpoint_add(struct target *target,
76
77
		uint32_t address, uint32_t length,
		enum watchpoint_rw rw, uint32_t value, uint32_t mask);
Zachary T Welch's avatar
Zachary T Welch committed
78
void watchpoint_remove(struct target *target, uint32_t address);
79
80

#endif /* BREAKPOINTS_H */