-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathdebug.h
executable file
·85 lines (73 loc) · 2.46 KB
/
debug.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
/* Defintions to support the remote debugging interface.
Copyright 2001, 2003 Brian R. Gaeke.
This file is part of VMIPS.
VMIPS 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.
VMIPS 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 VMIPS; if not, write to the Free Software Foundation, Inc.,
59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#ifndef _DEBUG_H_
#define _DEBUG_H_
#include "deviceexc.h"
#include <set>
class CPU;
class Mapper;
class Debug : public DeviceExc {
private:
bool debugger_shutdown;
CPU *cpu;
Mapper *mem;
int signo;
int listener;
long threadno_step;
long threadno_gen;
uint32 rom_baseaddr;
uint32 rom_nwords;
typedef std::set<uint32> wordset;
wordset bp_set;
bool opt_bigendian;
public:
Debug (CPU &c_, Mapper &m_);
virtual ~Debug () { }
bool got_interrupt;
uint32 packet_pop_word(char **packet);
uint8 packet_pop_byte(char **packet);
int setup(uint32 baseaddr, uint32 nwords);
int serverloop(void);
void exception(uint16 excCode, int mode, int coprocno);
private:
int setup_listener_socket(void);
int set_nonblocking(int fd);
void print_local_name(int s);
void targetloop(void);
char *rawpacket(char *str);
char *error_packet(int error_code);
char *signal_packet(int signal);
char *target_kill(char *pkt);
char *target_set_thread(char *pkt);
char *target_read_registers(char *pkt);
char *target_write_registers(char *pkt);
char *target_read_memory(char *pkt);
char *target_write_memory(char *pkt);
uint8 single_step(void);
char *target_continue(char *pkt);
char *target_step(char *pkt);
char *target_last_signal(char *pkt);
char *target_unimplemented(char *pkt);
int exccode_to_signal(int exccode);
/* Breakpoint support methods. */
bool breakpoint_exists(uint32 addr);
void declare_breakpoint(uint32 addr);
void remove_breakpoint(uint32 addr);
bool address_in_rom(uint32 addr);
void get_breakpoint_bitmap_entry(uint32 addr, uint8 *&entry, uint8 &bitno);
bool is_breakpoint_insn(char *packetptr);
char *target_set_or_remove_breakpoint(char *pkt, bool setting);
};
#endif /* _DEBUG_H_ */