source: rtems/c/src/librdbg/src/i386/any/remdeb.h @ 40cf43ea

4.104.114.84.95
Last change on this file since 40cf43ea was 40cf43ea, checked in by Joel Sherrill <joel.sherrill@…>, on 02/01/02 at 17:00:01
  • So many patches have been posted recently on the mailing list and because we were unable to find correct solution to compile on various linux distros (due to rpcgen incompatibilities), and because the coding style of rdbg was rather inconsistant among various pieces of code, I decided to:

1) make some cleaning regarding global coding style (using

indent + manual edits),

2) incorporate/review the paches send by various people

(S. Holford, T. Strauman),

3) Fix the bug due to varying rpcgen code generation

in remdeb_svc.c,

4) Remove some dead code,
5) Apply a patches enabling to call enterRdbg imediately

after rdbg initialization is done,

NB : the paches is huge but it is mainly due to coding styke chnages.
Only few lines of codes have been really changed and they do not impact
rdbg functionnality (AFAIKT).

  • include/rdbg/servrpc.h, include/rdbg/i386/rdbg_f.h, include/rdbg/m68k/rdbg_f.h, include/rdbg/powerpc/rdbg_f.h, src/_servtgt.c, src/awk.svc, src/excep.c, src/ptrace.c, src/rdbg.c, src/remdeb.x, src/servbkpt.c, src/servcon.c, src/servrpc.c, src/servtgt.c, src/servtsp.c, src/servutil.c, src/i386/excep_f.c, src/i386/rdbg_f.c, src/i386/any/Makefile.am, src/i386/any/remdeb.h, src/i386/any/remdeb_svc.c, src/i386/any/remdeb_xdr.c, src/m68k/excep_f.c, src/m68k/rdbg_f.c, src/m68k/any/Makefile.am, src/m68k/any/remdeb.h, src/m68k/any/remdeb_svc.c, src/m68k/any/remdeb_xdr.c, src/powerpc/excep_f.c, src/powerpc/rdbg_f.c, src/powerpc/new_exception_processing/Makefile.am, src/powerpc/new_exception_processing/remdeb.h, src/powerpc/new_exception_processing/remdeb_svc.c, src/powerpc/new_exception_processing/remdeb_xdr.c: Modified.
  • Property mode set to 100644
File size: 14.7 KB
Line 
1/*
2 * Please do not edit this file.
3 * It was generated using rpcgen.
4 */
5
6#ifndef _REMDEB_H_RPCGEN
7#define _REMDEB_H_RPCGEN
8
9#include <rpc/rpc.h>
10
11#ifdef __cplusplus
12extern "C" {
13#endif
14
15#define RTEMS_PORT 2071
16#define RTEMS_BACK_PORT 2073
17#ifndef REMDEB_H
18#define RPCGENSRVNAME(a)     a
19
20  enum rpc_type {
21    SUNRPC = 0,
22    BADRPCTYPE = 25,
23  };
24  typedef enum rpc_type rpc_type;
25#define NET_SAFE 1400
26
27  struct UDP_MSG {
28    u_char type;
29    u_char msg_num;
30    u_short spec;
31    long pid;
32    u_long context;
33  };
34  typedef struct UDP_MSG UDP_MSG;
35/*
36 * Sun request values for the remote ptrace system call
37 */
38
39  enum ptracereq {
40    RPT_TRACEME = 0,
41    RPT_CHILDDONE = 0,
42    RPT_PEEKTEXT = 0 + 1,
43    RPT_PEEKDATA = 0 + 2,
44    RPT_PEEKUSER = 0 + 3,
45    RPT_POKETEXT = 0 + 4,
46    RPT_POKEDATA = 0 + 5,
47    RPT_POKEUSER = 0 + 6,
48    RPT_CONT = 0 + 7,
49    RPT_KILL = 0 + 8,
50    RPT_SINGLESTEP = 0 + 9,
51    RPT_ATTACH = 0 + 10,
52    RPT_DETACH = 0 + 11,
53    RPT_GETREGS = 0 + 12,
54    RPT_SETREGS = 0 + 13,
55    RPT_GETFPREGS = 0 + 14,
56    RPT_SETFPREGS = 0 + 15,
57    RPT_READDATA = 0 + 16,
58    RPT_WRITEDATA = 0 + 17,
59    RPT_READTEXT = 0 + 18,
60    RPT_WRITETEXT = 0 + 19,
61    RPT_GETFPAREGS = 0 + 20,
62    RPT_SETFPAREGS = 0 + 21,
63    RPT_22 = 0 + 22,
64    RPT_23 = 0 + 23,
65    RPT_SYSCALL = 0 + 24,
66    RPT_DUMPCORE = 0 + 25,
67    RPT_26 = 0 + 26,
68    RPT_27 = 0 + 27,
69    RPT_28 = 0 + 28,
70    RPT_GETUCODE = 0 + 29,
71    RPT_GETTARGETTHREAD = 50,
72    RPT_SETTARGETTHREAD = 51,
73    RPT_THREADSUSPEND = 52,
74    RPT_THREADRESUME = 53,
75    RPT_THREADLIST = 54,
76    RPT_GETTHREADNAME = 55,
77    RPT_SETTHREADNAME = 56,
78    RPT_SETTHREADREGS = 57,
79    RPT_GETTHREADREGS = 58,
80    RPT_STEPRANGE = 75,
81    RPT_CONTTO = 76,
82    RPT_SETBREAK = 77,
83    RPT_CLRBREAK = 78,
84    RPT_GETBREAK = 79,
85    RPT_GETNAME = 80,
86    RPT_STOP = 81,
87    RPT_PGETREGS = 82,
88    RPT_PSETREGS = 83,
89    RPT_PSETTHREADREGS = 84,
90    RPT_PGETTHREADREGS = 85,
91  };
92  typedef enum ptracereq ptracereq;
93
94  struct xdr_regs {
95    u_int tabreg[19];
96  };
97  typedef struct xdr_regs xdr_regs;
98/* now define register macros to apply to xdr_reg struct */
99
100#define GS     0
101#define FS     1
102#define ES     2
103#define DS     3
104#define EDI    4
105#define ESI    5
106#define EBP    6
107#define ESP    7
108#define EBX    8
109#define EDX    9
110#define ECX    10
111#define EAX    11
112#define TRAPNO 12
113#define ERR    13
114#define EIP    14
115#define CS     15
116#define EFL    16
117#define UESP   17
118#define SS     18
119
120#define REG_PC tabreg[EIP]      /* PC (eip) register offset */
121#define REG_SP tabreg[UESP]     /* SP (uesp) register offset */
122#define REG_FP tabreg[EBP]      /* FP (ebp) register offset */
123/* now define the BREAKPOINT mask technique to a long word */
124#define SET_BREAK(l)   ((l&0xFFFFFF00) | 0xCC)
125#define IS_BREAK(l)    (((l) & 0xFF) == 0xCC)
126#define ORG_BREAK(c,p) (((c) & 0xFFFFFF00) | ((p) & 0xFF))
127#define IS_STEP(regs)  (regs.tabreg[TRAPNO] == 1)   /* was step and not break */
128#define BREAK_ADJ      1        /* must subtract one from address after bp */
129#define BREAK_SIZE     1        /* Breakpoint occupies one byte */
130#define TARGET_PROC_TYPE  0
131#define MAXDEBUGGEE 150
132#define NAMEMAX 17
133  /*
134   * Memory data for read/write text or data. The size is in data. The target
135   * addr is in the addr field.
136   * Be careful before modifying because this value goes into internal
137   * pipes and is allocated on stack too. Pipes and/or the stack could
138   * become too small if this value gets incremented.
139   */
140#define MEM_DATA_MAX 256
141
142  struct xdr_mem {
143    u_long addr;
144    u_int dataNb;
145    u_char data[MEM_DATA_MAX];
146  };
147  typedef struct xdr_mem xdr_mem;
148
149  enum break_type {
150    BRKT_NONE = 0,
151    BRKT_INSTR = 1,
152    BRKT_READ = 2,
153    BRKT_WRITE = 3,
154    BRKT_ACCESS = 4,
155    BRKT_EXEC = 5,
156    BRKT_OS_CALL = 6,
157    BRKT_OS_SWITCH = 7,
158    BRKT_STEPEMUL = 8,
159  };
160  typedef enum break_type break_type;
161#define MAX_THRD_BRK 4
162
163  struct xdr_break {
164    u_char type;
165    u_char thread_spec;
166    u_short handle;
167    u_long ee_loc;
168    u_long ee_type;
169    u_short length;
170    u_char pass_count;
171    u_char curr_pass;
172    u_long thread_list[MAX_THRD_BRK];
173  };
174  typedef struct xdr_break xdr_break;
175#define UTHREAD_MAX 64
176#define THREADNAMEMAX 16
177
178  typedef char *thread_name;
179
180  struct KernThread {
181    u_int threadLi;
182  };
183  typedef struct KernThread KernThread;
184  typedef KernThread *ptThreadList;
185
186  struct thread_list {
187    u_int nbThread;
188    ptThreadList threads;
189  };
190  typedef struct thread_list thread_list;
191
192  struct ptrace_addr_data_in {
193    ptracereq req;
194    union {
195      xdr_regs regs;
196      struct {
197        u_int pregs_len;
198        u_int *pregs_val;
199      } pregs;
200      thread_name name;
201      xdr_mem mem;
202      xdr_break breakp;
203      u_int address;
204    } ptrace_addr_data_in_u;
205  };
206  typedef struct ptrace_addr_data_in ptrace_addr_data_in;
207
208  struct ptrace_addr_data_out {
209    ptracereq req;
210    union {
211      xdr_regs regs;
212      struct {
213        u_int pregs_len;
214        u_int *pregs_val;
215      } pregs;
216      thread_list threads;
217      thread_name name;
218      xdr_mem mem;
219      xdr_break breakp;
220      u_int addr;
221    } ptrace_addr_data_out_u;
222  };
223  typedef struct ptrace_addr_data_out ptrace_addr_data_out;
224
225  typedef struct {
226    u_int CHAR_DATA_len;
227    char *CHAR_DATA_val;
228  } CHAR_DATA;
229#define XRY_MAX_INST_BUFF 128
230#define XRY_MAX_INSTANCES 16
231#ifndef XRY_MAX_CMD_STR
232#define XRY_MAX_CMD_STR 320
233#endif                          /* REMDEB_H */
234
235  struct xry_inst {
236    u_char flags;
237    u_char type;
238    u_char sub_type;
239    u_char res_type;
240    u_long value;
241    u_long value2;
242  };
243  typedef struct xry_inst xry_inst;
244
245  struct instance {
246    struct xry_inst instances[XRY_MAX_INSTANCES];
247    u_char buffer[XRY_MAX_INST_BUFF];
248  };
249  typedef struct instance instance;
250
251  struct instance_union {
252    bool_t instances;
253    union {
254      instance inst;
255      char *buffer;
256    } instance_union_u;
257  };
258  typedef struct instance_union instance_union;
259
260  typedef char *one_arg;
261#define XRY_MAX_OBJ_NAME 32
262  /*
263   * now open_connex() routine which establishes a connection to server
264   */
265
266  enum debug_type {
267    DEBTYP_PROCESS = 0,
268    DEBTYP_C_ACTOR = 1,
269    DEBTYP_KERNEL = 2,
270    DEBTYP_OTHER = 3,
271  };
272  typedef enum debug_type debug_type;
273#define DEBUGGER_IS_GDB 0x2     /* */
274
275  struct open_in {
276    u_char back_port[16];
277    u_short debug_type;
278    u_short flags;
279    u_char destination[16];
280    one_arg user_name;
281  };
282  typedef struct open_in open_in;
283
284  struct open_out {
285    u_long port;
286    u_int pad[4];
287    u_int fp;
288    u_char cmd_table_num;
289    u_char cmd_table_vers;
290    u_short server_vers;
291  };
292  typedef struct open_out open_out;
293  /*
294   * now close_connex() routine which detaches from server
295   */
296
297  enum close_control {
298    CLOSE_IGNORE = 0,
299    CLOSE_KILL = 1,
300    CLOSE_DETACH = 2,
301  };
302  typedef enum close_control close_control;
303
304  struct close_in {
305    close_control control;
306  };
307  typedef struct close_in close_in;
308  /*
309   * now send_signal() routine which sends signals to processes like kill(2)
310   */
311
312  struct signal_in {
313    int pid;
314    int sig;
315  };
316  typedef struct signal_in signal_in;
317
318  struct signal_out {
319    int kill_return;
320    int errNo;
321  };
322  typedef struct signal_out signal_out;
323  /*
324   * now wait_info() routine which returns results of polling the wait status
325   * of a process/actor. It may return 0 if running, else pid or -1
326   */
327
328  enum stop_code {
329    STOP_ERROR = 0,
330    STOP_NONE = 1,
331    STOP_UNKNOWN = 2,
332    STOP_BREAK = 3,
333    STOP_STEP = 4,
334    STOP_SIGNAL = 5,
335    STOP_TERM_EXIT = 6,
336    STOP_TERM_SIG = 7,
337    STOP_DETACHED = 8,
338    STOP_KILLED = 9,
339    STOP_SPAWN_FAILED = 10,
340  };
341  typedef enum stop_code stop_code;
342
343  struct wait_in {
344    int pid;
345  };
346  typedef struct wait_in wait_in;
347
348  struct wait_out {
349    int wait_return;
350    int errNo;
351    int status;
352    stop_code reason;
353    int handle;
354    u_long PC;
355    u_long SP;
356    u_long FP;
357    u_long thread;
358  };
359  typedef struct wait_out wait_out;
360  /*
361   * now ptrace() routine. This matches the Sun UNIX ptrace as well as
362   * some additions
363   */
364#define PTRFLG_FORCE 1
365#define PTRFLG_NON_OWNER 2
366#define PTRFLG_FREE 4
367#define PTRDET_UNOWN 0x100
368
369  struct ptrace_in {
370    int pid;
371    ptrace_addr_data_in addr;
372    u_int data;
373    u_int flags;
374  };
375  typedef struct ptrace_in ptrace_in;
376
377  struct ptrace_out {
378    ptrace_addr_data_out addr;
379    int result;
380    int errNo;
381  };
382  typedef struct ptrace_out ptrace_out;
383
384  struct one_symbol {
385    char *symbolName;
386    long symbolValue;
387  };
388  typedef struct one_symbol one_symbol;
389
390  typedef struct {
391    u_int all_symbols_len;
392    one_symbol *all_symbols_val;
393  } all_symbols;
394
395  struct get_global_symbols_out {
396    all_symbols symbols;
397  };
398  typedef struct get_global_symbols_out get_global_symbols_out;
399
400  struct get_text_data_in {
401    int pid;
402    char *actorName;
403  };
404  typedef struct get_text_data_in get_text_data_in;
405
406  struct get_text_data_out {
407    int result;
408    int errNo;
409    u_long textStart;
410    u_long textSize;
411    u_long dataStart;
412    u_long dataSize;
413  };
414  typedef struct get_text_data_out get_text_data_out;
415
416  struct one_signal {
417    u_int number;
418    char *name;
419  };
420  typedef struct one_signal one_signal;
421
422  typedef struct {
423    u_int all_signals_len;
424    one_signal *all_signals_val;
425  } all_signals;
426
427  struct get_signal_names_out {
428    all_signals signals;
429  };
430  typedef struct get_signal_names_out get_signal_names_out;
431  /*
432   * now define the actual calls we support
433   */
434#define REMDEB_H
435#endif
436
437#define REMOTEDEB 0x20000fff
438#define REMOTEVERS 2
439
440#if defined(__STDC__) || defined(__cplusplus)
441#define OPEN_CONNEX 1
442  extern open_out *open_connex_2 (open_in *, CLIENT *);
443  extern open_out *open_connex_2_svc (open_in *, struct svc_req *);
444#define SEND_SIGNAL 2
445  extern signal_out *send_signal_2 (signal_in *, CLIENT *);
446  extern signal_out *send_signal_2_svc (signal_in *, struct svc_req *);
447#define CLOSE_CONNEX 10
448  extern void *close_connex_2 (close_in *, CLIENT *);
449  extern void *close_connex_2_svc (close_in *, struct svc_req *);
450#define PTRACE 11
451  extern ptrace_out *ptrace_2 (ptrace_in *, CLIENT *);
452  extern ptrace_out *ptrace_2_svc (ptrace_in *, struct svc_req *);
453#define WAIT_INFO 13
454  extern wait_out *wait_info_2 (wait_in *, CLIENT *);
455  extern wait_out *wait_info_2_svc (wait_in *, struct svc_req *);
456#define GET_SIGNAL_NAMES 17
457  extern get_signal_names_out *get_signal_names_2 (void *, CLIENT *);
458  extern get_signal_names_out *get_signal_names_2_svc (void *,
459                                                       struct svc_req *);
460  extern int remotedeb_2_freeresult (SVCXPRT *, xdrproc_t, caddr_t);
461
462#else                           /* K&R C */
463#define OPEN_CONNEX 1
464  extern open_out *open_connex_2 ();
465  extern open_out *open_connex_2_svc ();
466#define SEND_SIGNAL 2
467  extern signal_out *send_signal_2 ();
468  extern signal_out *send_signal_2_svc ();
469#define CLOSE_CONNEX 10
470  extern void *close_connex_2 ();
471  extern void *close_connex_2_svc ();
472#define PTRACE 11
473  extern ptrace_out *ptrace_2 ();
474  extern ptrace_out *ptrace_2_svc ();
475#define WAIT_INFO 13
476  extern wait_out *wait_info_2 ();
477  extern wait_out *wait_info_2_svc ();
478#define GET_SIGNAL_NAMES 17
479  extern get_signal_names_out *get_signal_names_2 ();
480  extern get_signal_names_out *get_signal_names_2_svc ();
481  extern int remotedeb_2_freeresult ();
482#endif                          /* K&R C */
483
484/* the xdr functions */
485
486#if defined(__STDC__) || defined(__cplusplus)
487  extern bool_t xdr_rpc_type (XDR *, rpc_type *);
488  extern bool_t xdr_UDP_MSG (XDR *, UDP_MSG *);
489  extern bool_t xdr_ptracereq (XDR *, ptracereq *);
490  extern bool_t xdr_xdr_regs (XDR *, xdr_regs *);
491  extern bool_t xdr_xdr_mem (XDR *, xdr_mem *);
492  extern bool_t xdr_break_type (XDR *, break_type *);
493  extern bool_t xdr_xdr_break (XDR *, xdr_break *);
494  extern bool_t xdr_thread_name (XDR *, thread_name *);
495  extern bool_t xdr_KernThread (XDR *, KernThread *);
496  extern bool_t xdr_thread_list (XDR *, thread_list *);
497  extern bool_t xdr_ptrace_addr_data_in (XDR *, ptrace_addr_data_in *);
498  extern bool_t xdr_ptrace_addr_data_out (XDR *, ptrace_addr_data_out *);
499  extern bool_t xdr_CHAR_DATA (XDR *, CHAR_DATA *);
500  extern bool_t xdr_xry_inst (XDR *, xry_inst *);
501  extern bool_t xdr_instance (XDR *, instance *);
502  extern bool_t xdr_instance_union (XDR *, instance_union *);
503  extern bool_t xdr_one_arg (XDR *, one_arg *);
504  extern bool_t xdr_debug_type (XDR *, debug_type *);
505  extern bool_t xdr_open_in (XDR *, open_in *);
506  extern bool_t xdr_open_out (XDR *, open_out *);
507  extern bool_t xdr_close_control (XDR *, close_control *);
508  extern bool_t xdr_close_in (XDR *, close_in *);
509  extern bool_t xdr_signal_in (XDR *, signal_in *);
510  extern bool_t xdr_signal_out (XDR *, signal_out *);
511  extern bool_t xdr_stop_code (XDR *, stop_code *);
512  extern bool_t xdr_wait_in (XDR *, wait_in *);
513  extern bool_t xdr_wait_out (XDR *, wait_out *);
514  extern bool_t xdr_ptrace_in (XDR *, ptrace_in *);
515  extern bool_t xdr_ptrace_out (XDR *, ptrace_out *);
516  extern bool_t xdr_one_symbol (XDR *, one_symbol *);
517  extern bool_t xdr_all_symbols (XDR *, all_symbols *);
518  extern bool_t xdr_get_global_symbols_out (XDR *, get_global_symbols_out *);
519  extern bool_t xdr_get_text_data_in (XDR *, get_text_data_in *);
520  extern bool_t xdr_get_text_data_out (XDR *, get_text_data_out *);
521  extern bool_t xdr_one_signal (XDR *, one_signal *);
522  extern bool_t xdr_all_signals (XDR *, all_signals *);
523  extern bool_t xdr_get_signal_names_out (XDR *, get_signal_names_out *);
524
525#else                           /* K&R C */
526  extern bool_t xdr_rpc_type ();
527  extern bool_t xdr_UDP_MSG ();
528  extern bool_t xdr_ptracereq ();
529  extern bool_t xdr_xdr_regs ();
530  extern bool_t xdr_xdr_mem ();
531  extern bool_t xdr_break_type ();
532  extern bool_t xdr_xdr_break ();
533  extern bool_t xdr_thread_name ();
534  extern bool_t xdr_KernThread ();
535  extern bool_t xdr_thread_list ();
536  extern bool_t xdr_ptrace_addr_data_in ();
537  extern bool_t xdr_ptrace_addr_data_out ();
538  extern bool_t xdr_CHAR_DATA ();
539  extern bool_t xdr_xry_inst ();
540  extern bool_t xdr_instance ();
541  extern bool_t xdr_instance_union ();
542  extern bool_t xdr_one_arg ();
543  extern bool_t xdr_debug_type ();
544  extern bool_t xdr_open_in ();
545  extern bool_t xdr_open_out ();
546  extern bool_t xdr_close_control ();
547  extern bool_t xdr_close_in ();
548  extern bool_t xdr_signal_in ();
549  extern bool_t xdr_signal_out ();
550  extern bool_t xdr_stop_code ();
551  extern bool_t xdr_wait_in ();
552  extern bool_t xdr_wait_out ();
553  extern bool_t xdr_ptrace_in ();
554  extern bool_t xdr_ptrace_out ();
555  extern bool_t xdr_one_symbol ();
556  extern bool_t xdr_all_symbols ();
557  extern bool_t xdr_get_global_symbols_out ();
558  extern bool_t xdr_get_text_data_in ();
559  extern bool_t xdr_get_text_data_out ();
560  extern bool_t xdr_one_signal ();
561  extern bool_t xdr_all_signals ();
562  extern bool_t xdr_get_signal_names_out ();
563
564#endif                          /* K&R C */
565
566#ifdef __cplusplus
567}
568#endif
569#endif                          /* !_REMDEB_H_RPCGEN */
Note: See TracBrowser for help on using the repository browser.