source: rtems/c/src/librdbg/src/awk.svc @ 0bc2339

4.104.114.84.95
Last change on this file since 0bc2339 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: 1.5 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#
11# $Id$
12#
13BEGIN {
14    headerstarted = 0
15    withinproc = 0
16    brack = 0
17}
18
19$1 ~ /^\/\*HEADER_START\*\/$/ {
20    headerstarted = 1
21    printf("#include <rpc/types.h>\n");
22    printf("#include <rpc/rpc.h>\n");
23    printf("#include <stdio.h>\n");
24    printf("#include <stdlib.h>\n");
25    printf("#include <string.h>\n");
26    printf("#include <bsp.h>\n");
27    printf("#include <rdbg/servrpc.h>\n");
28    printf("#include <rdbg/%s>\n", THEPROG);
29    printf("#define fprintf(a,b,c) printf(b,c)\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.