source: rtems/c/src/librdbg/src/i386/pc386/remdeb_f.x @ 4721cf1

4.104.114.84.95
Last change on this file since 4721cf1 was 4721cf1, checked in by Joel Sherrill <joel.sherrill@…>, on 12/03/98 at 23:54:14

Patch from Emmanuel Raguet <raguet@…> to add remote debug server
and RPC support to RTEMS. Thanks. :) Email follows:

Hello,

For Xmas, here is the Remote Debugger on RTEMS !

Here are 2 patches for the Remote Debugger on RTEMS for pc386 from Linux
host :

  • one for RTEMS it self,
  • one for GDB-4.17.

1/ RTEMS patch
--------------

This patch adds 2 libraries :

  • a simplified SUN RPC library
  • the Remote Debugger library

The configuration command is the following :
../rtems4/configure --target=i386-rtemself --enable-rtemsbsp=pc386
--enable-rdbg

The SUN RPC library is built only if networking is set.
The RDBG library is built if networking and enable-rdbg are set.

The function used to initialize the debugger is :

rtems_rdbg_initialize ();

A special function has been created to force a task to be
in a "debug" state : enterRdbg().
The use of this function is not mandatory.

2/ GDB-4.17 patch
-----------------

This patch create a new RTEMS target for GDB-4.17.

The configuration command is the following :
./configure --enable-shared --target=i386RTEMS

To connect to a target, use :

target rtems [your_site_address]

Then, attach the target using : attach 1

And... Debug ;)

You can obtain the original GDB-4.17 on
ftp://ftp.debian.org/debian/dists/stable/main/source/devel/gdb_4.17.orig.tar.gz

This has been tested from a Debian 2.0.1 linux host.

  • Property mode set to 100644
File size: 1.4 KB
Line 
1/*
2 **************************************************************************
3 *
4 * Component =   rdblib
5 *
6 * Synopsis  =   remdeb_f.x
7 *
8 *
9 **************************************************************************
10 */
11
12struct xdr_regs
13{
14  unsigned int  tabreg[19];
15};
16
17#ifdef RPC_HDR
18
19%/* now define register macros to apply to xdr_reg struct */
20%
21%#define GS     0
22%#define FS     1
23%#define ES     2
24%#define DS     3
25%#define EDI    4
26%#define ESI    5
27%#define EBP    6
28%#define ESP    7
29%#define EBX    8
30%#define EDX    9
31%#define ECX    10
32%#define EAX    11
33%#define TRAPNO 12
34%#define ERR    13
35%#define EIP    14
36%#define CS     15
37%#define EFL    16
38%#define UESP   17
39%#define SS     18
40%
41%#define REG_PC tabreg[EIP]     /* PC (eip) register offset */
42%#define REG_SP tabreg[UESP]    /* SP (uesp) register offset */
43%#define REG_FP tabreg[EBP]     /* FP (ebp) register offset */
44
45%/* now define the BREAKPOINT mask technique to a long word */
46%#define SET_BREAK(l)   ((l&0xFFFFFF00) | 0xCC)
47%#define IS_BREAK(l)    (((l) & 0xFF) == 0xCC)
48%#define ORG_BREAK(c,p) (((c) & 0xFFFFFF00) | ((p) & 0xFF))
49%#define IS_STEP(regs)  (regs.tabreg[TRAPNO] == 1) /* was step and not break */
50%#define BREAK_ADJ      1       /* must subtract one from address after bp */
51%#define BREAK_SIZE     1       /* Breakpoint occupies one byte */
52
53%#define TARGET_PROC_TYPE  0
54
55#endif
56
57
58
Note: See TracBrowser for help on using the repository browser.