source: rtems/c/src/lib/librdbg/awk.svc @ 5dc30fb

4.104.114.84.95
Last change on this file since 5dc30fb 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.6 KB
Line 
1#########################################################################
2#
3#  Component:   RDBG
4#  Module:      awk.svc
5#
6#  Synopsis:    AWK script which transforms the server skeleton produced
7#               by rpcgen(1) into something suitable for RDB servers.
8#
9#########################################################################
10
11BEGIN {
12    headerstarted = 0
13    withinproc = 0
14    brack = 0
15}
16
17$1 ~ /^\/\*HEADER_START\*\/$/ {
18    headerstarted = 1
19    printf("#include <rpc/types.h>\n");
20    printf("#include <rpc/rpc.h>\n");
21    printf("#include <stdio.h>\n");
22    printf("#include <stdlib.h>\n");
23    printf("#include <string.h>\n");
24    printf("#include <bsp.h>\n");
25    printf("#include <rdbg/servrpc.h>\n");
26    printf("#include <rdbg/%s>\n", THEPROG);
27    printf("#define fprintf(a,b) printf(b)\n");
28    printf("#define msgout(a) printf(a)\n")
29    printf("#define _msgout(a) fprintf(stderr,a)\n");
30}
31
32$1 ~ /^\/\*HEADER_END\*\/$/ {
33    headerstarted = 0
34}
35
36{
37    if (headerstarted == 1) {
38        print $0
39    } else if ($1 ~ /.*_2.*/) {
40        withinproc = 1
41        printf("void\n");
42        print $0
43    } else if (withinproc == 1) {
44        if ($1 == "switch") {
45            print "\tDPRINTF ((\"remotedeb_2: %s (%d)\\n\", "
46            print "\t\t(unsigned) rqstp->rq_proc < "
47            print "\t\t(unsigned) (sizeof names / sizeof names[0]) ?"
48            print "\t\tnames [rqstp->rq_proc] : \"???\", "
49            print "\t\t(int) rqstp->rq_proc));\n"
50        }
51        for (i = 1; i <= NF; i++) {
52            if ($i == "{") {
53                brack++;
54            } else if ($i == "}") {
55                brack--;
56                if (brack == 0) {
57                    withinproc = 0;
58                }
59            }
60        }
61        if ($1 != "_rpcsvcdirty" ) {
62            print $0
63        }
64    }
65}
Note: See TracBrowser for help on using the repository browser.