1 | /* |
---|
2 | * gdb_if.h - definition of the interface between the stub and gdb |
---|
3 | * |
---|
4 | * THIS SOFTWARE IS NOT COPYRIGHTED |
---|
5 | * |
---|
6 | * The following software is offered for use in the public domain. |
---|
7 | * There is no warranty with regard to this software or its performance |
---|
8 | * and the user must accept the software "AS IS" with all faults. |
---|
9 | * |
---|
10 | * THE CONTRIBUTORS DISCLAIM ANY WARRANTIES, EXPRESS OR IMPLIED, WITH |
---|
11 | * REGARD TO THIS SOFTWARE INCLUDING BUT NOT LIMITED TO THE WARRANTIES |
---|
12 | * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. |
---|
13 | * |
---|
14 | * $Id$ |
---|
15 | */ |
---|
16 | |
---|
17 | #ifndef _GDB_IF_H |
---|
18 | #define _GDB_IF_H |
---|
19 | |
---|
20 | /* Max number of threads in qM response */ |
---|
21 | #define QM_MAX_THREADS (20) |
---|
22 | |
---|
23 | struct rtems_gdb_stub_thread_info { |
---|
24 | char display[256]; |
---|
25 | char name[256]; |
---|
26 | char more_display[256]; |
---|
27 | }; |
---|
28 | |
---|
29 | /* |
---|
30 | * Prototypes |
---|
31 | */ |
---|
32 | |
---|
33 | int parse_zbreak(const char *in, int *type, unsigned char **addr, int *len); |
---|
34 | |
---|
35 | |
---|
36 | char* mem2hstr(char *buf, const unsigned char *mem, int count); |
---|
37 | int hstr2mem(unsigned char *mem, const char *buf, int count); |
---|
38 | void set_mem_err(void); |
---|
39 | unsigned char get_byte(const unsigned char *ptr); |
---|
40 | void set_byte(unsigned char *ptr, int val); |
---|
41 | char* thread2vhstr(char *buf, int thread); |
---|
42 | char* thread2fhstr(char *buf, int thread); |
---|
43 | const char* fhstr2thread(const char *buf, int *thread); |
---|
44 | const char* vhstr2thread(const char *buf, int *thread); |
---|
45 | char* int2fhstr(char *buf, int val); |
---|
46 | char* int2vhstr(char *buf, int vali); |
---|
47 | const char* fhstr2int(const char *buf, int *ival); |
---|
48 | const char* vhstr2int(const char *buf, int *ival); |
---|
49 | int hstr2byte(const char *buf, int *bval); |
---|
50 | int hstr2nibble(const char *buf, int *nibble); |
---|
51 | |
---|
52 | Thread_Control *rtems_gdb_index_to_stub_id(int); |
---|
53 | int rtems_gdb_stub_thread_support_ok(void); |
---|
54 | int rtems_gdb_stub_get_current_thread(void); |
---|
55 | int rtems_gdb_stub_get_next_thread(int); |
---|
56 | int rtems_gdb_stub_get_offsets( |
---|
57 | unsigned char **text_addr, |
---|
58 | unsigned char **data_addr, |
---|
59 | unsigned char **bss_addr |
---|
60 | ); |
---|
61 | int rtems_gdb_stub_get_thread_regs( |
---|
62 | int thread, |
---|
63 | unsigned int *registers |
---|
64 | ); |
---|
65 | int rtems_gdb_stub_set_thread_regs( |
---|
66 | int thread, |
---|
67 | unsigned int *registers |
---|
68 | ); |
---|
69 | void rtems_gdb_process_query( |
---|
70 | char *inbuffer, |
---|
71 | char *outbuffer, |
---|
72 | int do_threads, |
---|
73 | int thread |
---|
74 | ); |
---|
75 | |
---|
76 | #if defined (__mc68000__) |
---|
77 | /* there are 180 bytes of registers on a 68020 w/68881 */ |
---|
78 | /* many of the fpa registers are 12 byte (96 bit) registers */ |
---|
79 | #define NUMREGBYTES 180 |
---|
80 | enum regnames {D0,D1,D2,D3,D4,D5,D6,D7, |
---|
81 | A0,A1,A2,A3,A4,A5,A6,A7, |
---|
82 | PS,PC, |
---|
83 | FP0,FP1,FP2,FP3,FP4,FP5,FP6,FP7, |
---|
84 | FPCONTROL,FPSTATUS,FPIADDR |
---|
85 | }; |
---|
86 | #elif defined (__mips__) |
---|
87 | /* |
---|
88 | * MIPS registers, numbered in the order in which gdb expects to see them. |
---|
89 | */ |
---|
90 | #define ZERO 0 |
---|
91 | #define AT 1 |
---|
92 | #define V0 2 |
---|
93 | #define V1 3 |
---|
94 | #define A0 4 |
---|
95 | #define A1 5 |
---|
96 | #define A2 6 |
---|
97 | #define A3 7 |
---|
98 | |
---|
99 | #define T0 8 |
---|
100 | #define T1 9 |
---|
101 | #define T2 10 |
---|
102 | #define T3 11 |
---|
103 | #define T4 12 |
---|
104 | #define T5 13 |
---|
105 | #define T6 14 |
---|
106 | #define T7 15 |
---|
107 | |
---|
108 | #define S0 16 |
---|
109 | #define S1 17 |
---|
110 | #define S2 18 |
---|
111 | #define S3 19 |
---|
112 | #define S4 20 |
---|
113 | #define S5 21 |
---|
114 | #define S6 22 |
---|
115 | #define S7 23 |
---|
116 | |
---|
117 | #define T8 24 |
---|
118 | #define T9 25 |
---|
119 | #define K0 26 |
---|
120 | #define K1 27 |
---|
121 | #define GP 28 |
---|
122 | #define SP 29 |
---|
123 | #define S8 30 |
---|
124 | #define RA 31 |
---|
125 | |
---|
126 | #define SR 32 |
---|
127 | #define LO 33 |
---|
128 | #define HI 34 |
---|
129 | #define BAD_VA 35 |
---|
130 | #define CAUSE 36 |
---|
131 | #define PC 37 |
---|
132 | |
---|
133 | #define F0 38 |
---|
134 | #define F1 39 |
---|
135 | #define F2 40 |
---|
136 | #define F3 41 |
---|
137 | #define F4 42 |
---|
138 | #define F5 43 |
---|
139 | #define F6 44 |
---|
140 | #define F7 45 |
---|
141 | |
---|
142 | #define F8 46 |
---|
143 | #define F9 47 |
---|
144 | #define F10 48 |
---|
145 | #define F11 49 |
---|
146 | #define F12 50 |
---|
147 | #define F13 51 |
---|
148 | #define F14 52 |
---|
149 | #define F15 53 |
---|
150 | |
---|
151 | #define F16 54 |
---|
152 | #define F17 55 |
---|
153 | #define F18 56 |
---|
154 | #define F19 57 |
---|
155 | #define F20 58 |
---|
156 | #define F21 59 |
---|
157 | #define F22 60 |
---|
158 | #define F23 61 |
---|
159 | |
---|
160 | #define F24 62 |
---|
161 | #define F25 63 |
---|
162 | #define F26 64 |
---|
163 | #define F27 65 |
---|
164 | #define F28 66 |
---|
165 | #define F29 67 |
---|
166 | #define F30 68 |
---|
167 | #define F31 69 |
---|
168 | |
---|
169 | #define FCSR 70 |
---|
170 | #define FIRR 71 |
---|
171 | |
---|
172 | #define NUM_REGS 72 |
---|
173 | |
---|
174 | |
---|
175 | |
---|
176 | |
---|
177 | |
---|
178 | void mips_gdb_stub_install(int enableThreads) ; |
---|
179 | #endif /* defined (__mips__) */ |
---|
180 | |
---|
181 | |
---|
182 | #define MEMOPT_READABLE 1 |
---|
183 | #define MEMOPT_WRITEABLE 2 |
---|
184 | |
---|
185 | #define NUM_MEMSEGS 10 |
---|
186 | |
---|
187 | int gdbstub_add_memsegment(unsigned,unsigned,int); |
---|
188 | |
---|
189 | |
---|
190 | |
---|
191 | #endif /* _GDB_IF_H */ |
---|