source: rtems/c/src/librdbg/src/m68k/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.4 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    int r_dreg[8];
96    int r_areg[8];
97    int r_sr;
98    int r_pc;
99    int r_vec;
100  };
101  typedef struct xdr_regs xdr_regs;
102/* now define register macros to apply to xdr_reg struct */
103
104#define r_r0   r_dreg[0]        /* r0 for portability */
105#define r_sp   r_areg[7]        /* user stack pointer */
106#define r_ps   r_sr
107#define REG_PC r_pc             /* PC register offset */
108#define REG_SP r_areg[7]        /* SP register offset */
109#define REG_FP r_areg[6]        /* FP register offset */
110/* now define the BREAKPOINT mask technique to a long word */
111#define SET_BREAK(l)   ((l&0x0000FFFF) | 0x4E4F0000)    /* TRAP 15 */
112#define IS_BREAK(l)    (((l) & 0xFFFF0000) == 0x4E4F0000)
113#define ORG_BREAK(c,p) (((c) & 0x0000FFFF) | ((p) & 0xFFFF0000))
114#define IS_STEP(regs)  ((regs).r_vec == 9)
115#define BREAK_ADJ      0
116#define BREAK_SIZE     2
117#define TARGET_PROC_TYPE  2
118#define MAXDEBUGGEE 150
119#define NAMEMAX 17
120  /*
121   * Memory data for read/write text or data. The size is in data. The target
122   * addr is in the addr field.
123   * Be careful before modifying because this value goes into internal
124   * pipes and is allocated on stack too. Pipes and/or the stack could
125   * become too small if this value gets incremented.
126   */
127#define MEM_DATA_MAX 256
128
129  struct xdr_mem {
130    u_long addr;
131    u_int dataNb;
132    u_char data[MEM_DATA_MAX];
133  };
134  typedef struct xdr_mem xdr_mem;
135
136  enum break_type {
137    BRKT_NONE = 0,
138    BRKT_INSTR = 1,
139    BRKT_READ = 2,
140    BRKT_WRITE = 3,
141    BRKT_ACCESS = 4,
142    BRKT_EXEC = 5,
143    BRKT_OS_CALL = 6,
144    BRKT_OS_SWITCH = 7,
145    BRKT_STEPEMUL = 8,
146  };
147  typedef enum break_type break_type;
148#define MAX_THRD_BRK 4
149
150  struct xdr_break {
151    u_char type;
152    u_char thread_spec;
153    u_short handle;
154    u_long ee_loc;
155    u_long ee_type;
156    u_short length;
157    u_char pass_count;
158    u_char curr_pass;
159    u_long thread_list[MAX_THRD_BRK];
160  };
161  typedef struct xdr_break xdr_break;
162#define UTHREAD_MAX 64
163#define THREADNAMEMAX 16
164
165  typedef char *thread_name;
166
167  struct KernThread {
168    u_int threadLi;
169  };
170  typedef struct KernThread KernThread;
171  typedef KernThread *ptThreadList;
172
173  struct thread_list {
174    u_int nbThread;
175    ptThreadList threads;
176  };
177  typedef struct thread_list thread_list;
178
179  struct ptrace_addr_data_in {
180    ptracereq req;
181    union {
182      xdr_regs regs;
183      struct {
184        u_int pregs_len;
185        u_int *pregs_val;
186      } pregs;
187      thread_name name;
188      xdr_mem mem;
189      xdr_break breakp;
190      u_int address;
191    } ptrace_addr_data_in_u;
192  };
193  typedef struct ptrace_addr_data_in ptrace_addr_data_in;
194
195  struct ptrace_addr_data_out {
196    ptracereq req;
197    union {
198      xdr_regs regs;
199      struct {
200        u_int pregs_len;
201        u_int *pregs_val;
202      } pregs;
203      thread_list threads;
204      thread_name name;
205      xdr_mem mem;
206      xdr_break breakp;
207      u_int addr;
208    } ptrace_addr_data_out_u;
209  };
210  typedef struct ptrace_addr_data_out ptrace_addr_data_out;
211
212  typedef struct {
213    u_int CHAR_DATA_len;
214    char *CHAR_DATA_val;
215  } CHAR_DATA;
216#define XRY_MAX_INST_BUFF 128
217#define XRY_MAX_INSTANCES 16
218#ifndef XRY_MAX_CMD_STR
219#define XRY_MAX_CMD_STR 320
220#endif                          /* REMDEB_H */
221
222  struct xry_inst {
223    u_char flags;
224    u_char type;
225    u_char sub_type;
226    u_char res_type;
227    u_long value;
228    u_long value2;
229  };
230  typedef struct xry_inst xry_inst;
231
232  struct instance {
233    struct xry_inst instances[XRY_MAX_INSTANCES];
234    u_char buffer[XRY_MAX_INST_BUFF];
235  };
236  typedef struct instance instance;
237
238  struct instance_union {
239    bool_t instances;
240    union {
241      instance inst;
242      char *buffer;
243    } instance_union_u;
244  };
245  typedef struct instance_union instance_union;
246
247  typedef char *one_arg;
248#define XRY_MAX_OBJ_NAME 32
249  /*
250   * now open_connex() routine which establishes a connection to server
251   */
252
253  enum debug_type {
254    DEBTYP_PROCESS = 0,
255    DEBTYP_C_ACTOR = 1,
256    DEBTYP_KERNEL = 2,
257    DEBTYP_OTHER = 3,
258  };
259  typedef enum debug_type debug_type;
260#define DEBUGGER_IS_GDB 0x2     /* */
261
262  struct open_in {
263    u_char back_port[16];
264    u_short debug_type;
265    u_short flags;
266    u_char destination[16];
267    one_arg user_name;
268  };
269  typedef struct open_in open_in;
270
271  struct open_out {
272    u_long port;
273    u_int pad[4];
274    u_int fp;
275    u_char cmd_table_num;
276    u_char cmd_table_vers;
277    u_short server_vers;
278  };
279  typedef struct open_out open_out;
280  /*
281   * now close_connex() routine which detaches from server
282   */
283
284  enum close_control {
285    CLOSE_IGNORE = 0,
286    CLOSE_KILL = 1,
287    CLOSE_DETACH = 2,
288  };
289  typedef enum close_control close_control;
290
291  struct close_in {
292    close_control control;
293  };
294  typedef struct close_in close_in;
295  /*
296   * now send_signal() routine which sends signals to processes like kill(2)
297   */
298
299  struct signal_in {
300    int pid;
301    int sig;
302  };
303  typedef struct signal_in signal_in;
304
305  struct signal_out {
306    int kill_return;
307    int errNo;
308  };
309  typedef struct signal_out signal_out;
310  /*
311   * now wait_info() routine which returns results of polling the wait status
312   * of a process/actor. It may return 0 if running, else pid or -1
313   */
314
315  enum stop_code {
316    STOP_ERROR = 0,
317    STOP_NONE = 1,
318    STOP_UNKNOWN = 2,
319    STOP_BREAK = 3,
320    STOP_STEP = 4,
321    STOP_SIGNAL = 5,
322    STOP_TERM_EXIT = 6,
323    STOP_TERM_SIG = 7,
324    STOP_DETACHED = 8,
325    STOP_KILLED = 9,
326    STOP_SPAWN_FAILED = 10,
327  };
328  typedef enum stop_code stop_code;
329
330  struct wait_in {
331    int pid;
332  };
333  typedef struct wait_in wait_in;
334
335  struct wait_out {
336    int wait_return;
337    int errNo;
338    int status;
339    stop_code reason;
340    int handle;
341    u_long PC;
342    u_long SP;
343    u_long FP;
344    u_long thread;
345  };
346  typedef struct wait_out wait_out;
347  /*
348   * now ptrace() routine. This matches the Sun UNIX ptrace as well as
349   * some additions
350   */
351#define PTRFLG_FORCE 1
352#define PTRFLG_NON_OWNER 2
353#define PTRFLG_FREE 4
354#define PTRDET_UNOWN 0x100
355
356  struct ptrace_in {
357    int pid;
358    ptrace_addr_data_in addr;
359    u_int data;
360    u_int flags;
361  };
362  typedef struct ptrace_in ptrace_in;
363
364  struct ptrace_out {
365    ptrace_addr_data_out addr;
366    int result;
367    int errNo;
368  };
369  typedef struct ptrace_out ptrace_out;
370
371  struct one_symbol {
372    char *symbolName;
373    long symbolValue;
374  };
375  typedef struct one_symbol one_symbol;
376
377  typedef struct {
378    u_int all_symbols_len;
379    one_symbol *all_symbols_val;
380  } all_symbols;
381
382  struct get_global_symbols_out {
383    all_symbols symbols;
384  };
385  typedef struct get_global_symbols_out get_global_symbols_out;
386
387  struct get_text_data_in {
388    int pid;
389    char *actorName;
390  };
391  typedef struct get_text_data_in get_text_data_in;
392
393  struct get_text_data_out {
394    int result;
395    int errNo;
396    u_long textStart;
397    u_long textSize;
398    u_long dataStart;
399    u_long dataSize;
400  };
401  typedef struct get_text_data_out get_text_data_out;
402
403  struct one_signal {
404    u_int number;
405    char *name;
406  };
407  typedef struct one_signal one_signal;
408
409  typedef struct {
410    u_int all_signals_len;
411    one_signal *all_signals_val;
412  } all_signals;
413
414  struct get_signal_names_out {
415    all_signals signals;
416  };
417  typedef struct get_signal_names_out get_signal_names_out;
418  /*
419   * now define the actual calls we support
420   */
421#define REMDEB_H
422#endif
423
424#define REMOTEDEB 0x20000fff
425#define REMOTEVERS 2
426
427#if defined(__STDC__) || defined(__cplusplus)
428#define OPEN_CONNEX 1
429  extern open_out *open_connex_2 (open_in *, CLIENT *);
430  extern open_out *open_connex_2_svc (open_in *, struct svc_req *);
431#define SEND_SIGNAL 2
432  extern signal_out *send_signal_2 (signal_in *, CLIENT *);
433  extern signal_out *send_signal_2_svc (signal_in *, struct svc_req *);
434#define CLOSE_CONNEX 10
435  extern void *close_connex_2 (close_in *, CLIENT *);
436  extern void *close_connex_2_svc (close_in *, struct svc_req *);
437#define PTRACE 11
438  extern ptrace_out *ptrace_2 (ptrace_in *, CLIENT *);
439  extern ptrace_out *ptrace_2_svc (ptrace_in *, struct svc_req *);
440#define WAIT_INFO 13
441  extern wait_out *wait_info_2 (wait_in *, CLIENT *);
442  extern wait_out *wait_info_2_svc (wait_in *, struct svc_req *);
443#define GET_SIGNAL_NAMES 17
444  extern get_signal_names_out *get_signal_names_2 (void *, CLIENT *);
445  extern get_signal_names_out *get_signal_names_2_svc (void *,
446                                                       struct svc_req *);
447  extern int remotedeb_2_freeresult (SVCXPRT *, xdrproc_t, caddr_t);
448
449#else                           /* K&R C */
450#define OPEN_CONNEX 1
451  extern open_out *open_connex_2 ();
452  extern open_out *open_connex_2_svc ();
453#define SEND_SIGNAL 2
454  extern signal_out *send_signal_2 ();
455  extern signal_out *send_signal_2_svc ();
456#define CLOSE_CONNEX 10
457  extern void *close_connex_2 ();
458  extern void *close_connex_2_svc ();
459#define PTRACE 11
460  extern ptrace_out *ptrace_2 ();
461  extern ptrace_out *ptrace_2_svc ();
462#define WAIT_INFO 13
463  extern wait_out *wait_info_2 ();
464  extern wait_out *wait_info_2_svc ();
465#define GET_SIGNAL_NAMES 17
466  extern get_signal_names_out *get_signal_names_2 ();
467  extern get_signal_names_out *get_signal_names_2_svc ();
468  extern int remotedeb_2_freeresult ();
469#endif                          /* K&R C */
470
471/* the xdr functions */
472
473#if defined(__STDC__) || defined(__cplusplus)
474  extern bool_t xdr_rpc_type (XDR *, rpc_type *);
475  extern bool_t xdr_UDP_MSG (XDR *, UDP_MSG *);
476  extern bool_t xdr_ptracereq (XDR *, ptracereq *);
477  extern bool_t xdr_xdr_regs (XDR *, xdr_regs *);
478  extern bool_t xdr_xdr_mem (XDR *, xdr_mem *);
479  extern bool_t xdr_break_type (XDR *, break_type *);
480  extern bool_t xdr_xdr_break (XDR *, xdr_break *);
481  extern bool_t xdr_thread_name (XDR *, thread_name *);
482  extern bool_t xdr_KernThread (XDR *, KernThread *);
483  extern bool_t xdr_thread_list (XDR *, thread_list *);
484  extern bool_t xdr_ptrace_addr_data_in (XDR *, ptrace_addr_data_in *);
485  extern bool_t xdr_ptrace_addr_data_out (XDR *, ptrace_addr_data_out *);
486  extern bool_t xdr_CHAR_DATA (XDR *, CHAR_DATA *);
487  extern bool_t xdr_xry_inst (XDR *, xry_inst *);
488  extern bool_t xdr_instance (XDR *, instance *);
489  extern bool_t xdr_instance_union (XDR *, instance_union *);
490  extern bool_t xdr_one_arg (XDR *, one_arg *);
491  extern bool_t xdr_debug_type (XDR *, debug_type *);
492  extern bool_t xdr_open_in (XDR *, open_in *);
493  extern bool_t xdr_open_out (XDR *, open_out *);
494  extern bool_t xdr_close_control (XDR *, close_control *);
495  extern bool_t xdr_close_in (XDR *, close_in *);
496  extern bool_t xdr_signal_in (XDR *, signal_in *);
497  extern bool_t xdr_signal_out (XDR *, signal_out *);
498  extern bool_t xdr_stop_code (XDR *, stop_code *);
499  extern bool_t xdr_wait_in (XDR *, wait_in *);
500  extern bool_t xdr_wait_out (XDR *, wait_out *);
501  extern bool_t xdr_ptrace_in (XDR *, ptrace_in *);
502  extern bool_t xdr_ptrace_out (XDR *, ptrace_out *);
503  extern bool_t xdr_one_symbol (XDR *, one_symbol *);
504  extern bool_t xdr_all_symbols (XDR *, all_symbols *);
505  extern bool_t xdr_get_global_symbols_out (XDR *, get_global_symbols_out *);
506  extern bool_t xdr_get_text_data_in (XDR *, get_text_data_in *);
507  extern bool_t xdr_get_text_data_out (XDR *, get_text_data_out *);
508  extern bool_t xdr_one_signal (XDR *, one_signal *);
509  extern bool_t xdr_all_signals (XDR *, all_signals *);
510  extern bool_t xdr_get_signal_names_out (XDR *, get_signal_names_out *);
511
512#else                           /* K&R C */
513  extern bool_t xdr_rpc_type ();
514  extern bool_t xdr_UDP_MSG ();
515  extern bool_t xdr_ptracereq ();
516  extern bool_t xdr_xdr_regs ();
517  extern bool_t xdr_xdr_mem ();
518  extern bool_t xdr_break_type ();
519  extern bool_t xdr_xdr_break ();
520  extern bool_t xdr_thread_name ();
521  extern bool_t xdr_KernThread ();
522  extern bool_t xdr_thread_list ();
523  extern bool_t xdr_ptrace_addr_data_in ();
524  extern bool_t xdr_ptrace_addr_data_out ();
525  extern bool_t xdr_CHAR_DATA ();
526  extern bool_t xdr_xry_inst ();
527  extern bool_t xdr_instance ();
528  extern bool_t xdr_instance_union ();
529  extern bool_t xdr_one_arg ();
530  extern bool_t xdr_debug_type ();
531  extern bool_t xdr_open_in ();
532  extern bool_t xdr_open_out ();
533  extern bool_t xdr_close_control ();
534  extern bool_t xdr_close_in ();
535  extern bool_t xdr_signal_in ();
536  extern bool_t xdr_signal_out ();
537  extern bool_t xdr_stop_code ();
538  extern bool_t xdr_wait_in ();
539  extern bool_t xdr_wait_out ();
540  extern bool_t xdr_ptrace_in ();
541  extern bool_t xdr_ptrace_out ();
542  extern bool_t xdr_one_symbol ();
543  extern bool_t xdr_all_symbols ();
544  extern bool_t xdr_get_global_symbols_out ();
545  extern bool_t xdr_get_text_data_in ();
546  extern bool_t xdr_get_text_data_out ();
547  extern bool_t xdr_one_signal ();
548  extern bool_t xdr_all_signals ();
549  extern bool_t xdr_get_signal_names_out ();
550
551#endif                          /* K&R C */
552
553#ifdef __cplusplus
554}
555#endif
556#endif                          /* !_REMDEB_H_RPCGEN */
Note: See TracBrowser for help on using the repository browser.