forked from pulp-platform/debug_bridge
-
Notifications
You must be signed in to change notification settings - Fork 0
/
rsp.h
83 lines (62 loc) · 1.84 KB
/
rsp.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
#ifndef RSP_H
#define RSP_H
#include "mem.h"
#include "debug_if.h"
#include "breakpoints.h"
#include <list>
#include <stdio.h>
#include <stdbool.h>
#include <stdlib.h>
#include <errno.h>
#include <netinet/in.h>
#include <netdb.h>
#include <arpa/inet.h>
#include <fcntl.h>
#include <string.h>
#include <sys/select.h>
class Rsp {
public:
Rsp(int socket_port, MemIF* mem, LogIF *log, std::list<DbgIF*> list_dbgif, BreakPoints* bp);
bool open();
void close();
bool wait_client();
bool loop();
bool decode(char* data, size_t len);
bool multithread(char* data, size_t len);
bool cont(char* data, size_t len); // continue, reserved keyword, thus not used as function name
bool step(char* data, size_t len);
bool query(char* data, size_t len);
bool v_packet(char* data, size_t len);
bool regs_send();
bool reg_read(char* data, size_t len);
bool reg_write(char* data, size_t len);
bool get_packet(char* data, size_t* len);
bool signal();
bool send(const char* data, size_t len);
bool send_str(const char* data);
private:
// internal helper functions
bool pc_read(unsigned int* pc);
bool waitStop(DbgIF* dbgif);
bool resume(bool step);
bool resume(int tid, bool step);
void resumeAll(bool step);
void resumeCore(DbgIF* dbgif, bool step);
void resumeCoresPrepare(DbgIF *dbgif, bool step);
void resumeCores();
bool mem_read(char* data, size_t len);
bool mem_write_ascii(char* data, size_t len);
bool mem_write(char* data, size_t len);
bool bp_insert(char* data, size_t len);
bool bp_remove(char* data, size_t len);
DbgIF* get_dbgif(int thread_id);
int m_socket_port;
int m_socket_in;
int m_socket_client;
int m_thread_sel;
MemIF* m_mem;
LogIF *log;
BreakPoints* m_bp;
std::list<DbgIF*> m_dbgifs;
};
#endif