From 4721cf1ecb949b37c98b6fce79163541711de2e5 Mon Sep 17 00:00:00 2001 From: Joel Sherrill Date: Thu, 3 Dec 1998 23:54:14 +0000 Subject: Patch from Emmanuel 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. --- c/src/librdbg/src/awk.svc | 65 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 65 insertions(+) create mode 100644 c/src/librdbg/src/awk.svc (limited to 'c/src/librdbg/src/awk.svc') diff --git a/c/src/librdbg/src/awk.svc b/c/src/librdbg/src/awk.svc new file mode 100644 index 0000000000..79e24a9d90 --- /dev/null +++ b/c/src/librdbg/src/awk.svc @@ -0,0 +1,65 @@ +######################################################################### +# +# Component: RDBG +# Module: awk.svc +# +# Synopsis: AWK script which transforms the server skeleton produced +# by rpcgen(1) into something suitable for RDB servers. +# +######################################################################### + +BEGIN { + headerstarted = 0 + withinproc = 0 + brack = 0 +} + +$1 ~ /^\/\*HEADER_START\*\/$/ { + headerstarted = 1 + printf("#include \n"); + printf("#include \n"); + printf("#include \n"); + printf("#include \n"); + printf("#include \n"); + printf("#include \n"); + printf("#include \n"); + printf("#include \n", THEPROG); + printf("#define fprintf(a,b) printf(b)\n"); + printf("#define msgout(a) printf(a)\n") + printf("#define _msgout(a) fprintf(stderr,a)\n"); +} + +$1 ~ /^\/\*HEADER_END\*\/$/ { + headerstarted = 0 +} + +{ + if (headerstarted == 1) { + print $0 + } else if ($1 ~ /.*_2.*/) { + withinproc = 1 + printf("void\n"); + print $0 + } else if (withinproc == 1) { + if ($1 == "switch") { + print "\tDPRINTF ((\"remotedeb_2: %s (%d)\\n\", " + print "\t\t(unsigned) rqstp->rq_proc < " + print "\t\t(unsigned) (sizeof names / sizeof names[0]) ?" + print "\t\tnames [rqstp->rq_proc] : \"???\", " + print "\t\t(int) rqstp->rq_proc));\n" + } + for (i = 1; i <= NF; i++) { + if ($i == "{") { + brack++; + } else if ($i == "}") { + brack--; + if (brack == 0) { + withinproc = 0; + } + } + } + if ($1 != "_rpcsvcdirty" ) { + print $0 + } + } +} -- cgit v1.2.3