OpenCores
URL https://opencores.org/ocsvn/openrisc_2011-10-31/openrisc_2011-10-31/trunk

Subversion Repositories openrisc_2011-10-31

[/] [openrisc/] [trunk/] [rtos/] [rtems/] [c/] [src/] [librdbg/] [src/] [awk.svc] - Blame information for rev 620

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 30 unneback
#########################################################################
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: awk.svc,v 1.2 2001-09-27 12:02:01 chris Exp $
12
#
13
BEGIN {
14
    headerstarted = 0
15
    withinproc = 0
16
    brack = 0
17
}
18
 
19
$1 ~ /^\/\*HEADER_START\*\/$/ {
20
    headerstarted = 1
21
    printf("#include \n");
22
    printf("#include \n");
23
    printf("#include \n");
24
    printf("#include \n");
25
    printf("#include \n");
26
    printf("#include \n");
27
    printf("#include \n");
28
    printf("#include \n", THEPROG);
29
    printf("#define fprintf(a,b) printf(b)\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
}

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.