* 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.
This commit is contained in:
Joel Sherrill committed 2002-02-01 17:00:01 +00:00
1 parent 8e3caa52cd
commit 40cf43eab4
35 files changed
+5725 -5455

No files matched your search

+35
View File
@@ -1,3 +1,38 @@
* 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.
2002-01-18 Till Straumann <strauman@slac.stanford.edu>
* src/powerpc/excep_f.c: This patch addresses the following issues:
+1
View File
@@ -34,6 +34,7 @@ static inline int getExcNum(Exception_context *ctx)
}
extern void connect_rdbg_exception();
extern void disconnect_rdbg_exception();
#endif
+1
View File
@@ -32,6 +32,7 @@ static inline int getExcNum(Exception_context *ctx)
}
extern void connect_rdbg_exception();
extern void disconnect_rdbg_exception();
#endif
@@ -21,6 +21,7 @@ static inline int isRdbgException(Exception_context *ctx)
{
if (
ctx->ctx->_EXC_number != ASM_SYS_VECTOR &&
ctx->ctx->_EXC_number != ASM_PROG_VECTOR &&
ctx->ctx->_EXC_number != ASM_TRACE_VECTOR
) return 0;
else return 1;
@@ -31,6 +32,7 @@ static inline int getExcNum(Exception_context *ctx)
}
extern void connect_rdbg_exception();
extern void disconnect_rdbg_exception();
#endif
+1 -1
View File
@@ -23,7 +23,7 @@ extern int CONN_LIST_INC;
extern int PID_LIST_INC;
extern int TSP_RETRIES;
extern int BackPort;
extern char ActName[];
extern char taskName[];
extern int getId();
File diff suppressed because it is too large. Load diff
+1 -1
View File
@@ -26,7 +26,7 @@ $1 ~ /^\/\*HEADER_START\*\/$/ {
printf("#include <bsp.h>\n");
printf("#include <rdbg/servrpc.h>\n");
printf("#include <rdbg/%s>\n", THEPROG);
printf("#define fprintf(a,b) printf(b)\n");
printf("#define fprintf(a,b,c) printf(b,c)\n");
}
$1 ~ /^\/\*HEADER_END\*\/$/ {
+55 -45
View File
@@ -24,30 +24,32 @@ Exception_context *LastCtx = NULL;
CPU_Exception_frame SavedContext;
/*
* Save an exception context at the end of a list
*/
/********* Save an exception context at the end of a list *****/
int PushExceptCtx ( Objects_Id Id, Objects_Id semId, CPU_Exception_frame *ctx ) {
int
PushExceptCtx (Objects_Id Id, Objects_Id semId, CPU_Exception_frame * ctx)
{
Exception_context *SaveCtx;
SaveCtx = (Exception_context *)malloc(sizeof(Exception_context));
SaveCtx = (Exception_context *) malloc (sizeof (Exception_context));
if (SaveCtx == NULL)
rtems_panic("Can't allocate memory to save Exception context");
rtems_panic ("Can't allocate memory to save Exception context");
SaveCtx->id = Id;
SaveCtx->ctx = ctx;
SaveCtx->semaphoreId = semId;
SaveCtx->previous = NULL;
SaveCtx->next = NULL;
if (FirstCtx == NULL){ /* initialization */
if (FirstCtx == NULL) { /* initialization */
FirstCtx = SaveCtx;
LastCtx = SaveCtx;
LastCtx = SaveCtx;
NbExceptCtx = 1;
}
else {
NbExceptCtx ++;
} else {
NbExceptCtx++;
LastCtx->next = SaveCtx;
SaveCtx->previous = LastCtx;
LastCtx = SaveCtx;
@@ -55,36 +57,41 @@ int PushExceptCtx ( Objects_Id Id, Objects_Id semId, CPU_Exception_frame *ctx )
return 0;
}
/********* Save an temporary exception context in a ******/
/********* global variable ******/
/*
* Save an temporary exception context in a global variable
*/
int PushSavedExceptCtx ( Objects_Id Id, CPU_Exception_frame *ctx ) {
memcpy (&(SavedContext), ctx, sizeof(CPU_Exception_frame));
int
PushSavedExceptCtx (Objects_Id Id, CPU_Exception_frame * ctx)
{
memcpy (&(SavedContext), ctx, sizeof (CPU_Exception_frame));
return 0;
}
/*
* Remove the context of the specified Id thread.
* If Id = -1, then return the first context
*/
/****** Remove the context of the specified Id thread *********/
/****** If Id = -1, then return the first context *********/
int PopExceptCtx ( Objects_Id Id ) {
int
PopExceptCtx (Objects_Id Id)
{
Exception_context *ExtractCtx;
if (FirstCtx == NULL) return -1;
if (Id == -1) {
if (FirstCtx == NULL)
return -1;
if (Id == -1) {
ExtractCtx = LastCtx;
LastCtx = LastCtx->previous;
free(ExtractCtx);
NbExceptCtx --;
free (ExtractCtx);
NbExceptCtx--;
return 0;
}
ExtractCtx = LastCtx;
while (ExtractCtx->id != Id && ExtractCtx != NULL) {
ExtractCtx = ExtractCtx->previous;
}
@@ -92,37 +99,40 @@ int PopExceptCtx ( Objects_Id Id ) {
if (ExtractCtx == NULL)
return -1;
if ( ExtractCtx->previous != NULL)
if (ExtractCtx->previous != NULL)
(ExtractCtx->previous)->next = ExtractCtx->next;
if ( ExtractCtx->next != NULL)
if (ExtractCtx->next != NULL)
(ExtractCtx->next)->previous = ExtractCtx->previous;
if (ExtractCtx == FirstCtx)
FirstCtx = FirstCtx->next;
else
if (ExtractCtx == LastCtx)
else if (ExtractCtx == LastCtx)
LastCtx = LastCtx->previous;
free(ExtractCtx);
NbExceptCtx --;
free (ExtractCtx);
NbExceptCtx--;
return 0;
}
/****** Return the context of the specified Id thread *********/
/****** If Id = -1, then return the first context *********/
/*
* Return the context of the specified Id thread.
* If Id = -1, then return the first context.
*/
Exception_context *GetExceptCtx ( Objects_Id Id ) {
Exception_context *
GetExceptCtx (Objects_Id Id)
{
Exception_context *ExtractCtx;
if (FirstCtx == NULL) return NULL;
if (Id == -1) {
if (FirstCtx == NULL)
return NULL;
if (Id == -1) {
return LastCtx;
}
ExtractCtx = LastCtx;
while (ExtractCtx->id != Id && ExtractCtx != NULL) {
+2
View File
@@ -71,6 +71,8 @@ if RPCTOOLS
-o i386/any/tmpSvc.c remdeb.x; \
$(AWK) -f ./awk.svc THEPROG="remdeb.h" i386/any/tmpSvc.c \
> i386/any/remdeb_svc.c; \
$(SED) -e 's/fprintf.*,/printf(/' i386/any/remdeb_svc.c > i386/any/remdeb_svc.tmp; \
mv i386/any/remdeb_svc.tmp i386/any/remdeb_svc.c; \
rm -f i386/any/tmpSvc.c )
endif
File diff suppressed because it is too large. Load diff
+95 -84
View File
@@ -22,101 +22,112 @@
* become too small if this value gets incremented.
*/
#ifndef XRY_MAX_CMD_STR
#endif /* REMDEB_H */
/* now open_connex() routine which establishes a connection to server */
#define DEBUGGER_IS_GDB 0x2 /* */
/* now close_connex() routine which detaches from server */
/* now send_signal() routine which sends signals to processes like kill(2) */
/* now wait_info() routine which returns results of polling the wait status
of a process/actor. It may return 0 if running, else pid or -1 */
/* now ptrace() routine. This matches the Sun UNIX ptrace as well as
some additions */
/* now define the actual calls we support */
const char* names [] = {
"NULLPROC", "OPEN_CONNEX", "SEND_SIGNAL", "name3",
"name4", "name5", "name6", "name7",
"name8", "name9", "CLOSE_CONNEX", "PTRACE",
"name12", "WAIT_INFO", "name14", "name15",
"name16", "GET_SIGNAL_NAMES", "name18"
#endif /* REMDEB_H */
/*
* now open_connex() routine which establishes a connection to server
*/
#define DEBUGGER_IS_GDB 0x2 /* */
/*
* now close_connex() routine which detaches from server
*/
/*
* now send_signal() routine which sends signals to processes like kill(2)
*/
/*
* now wait_info() routine which returns results of polling the wait status
* of a process/actor. It may return 0 if running, else pid or -1
*/
/*
* now ptrace() routine. This matches the Sun UNIX ptrace as well as
* some additions
*/
/*
* now define the actual calls we support
*/
const char *names[] = {
"NULLPROC", "OPEN_CONNEX", "SEND_SIGNAL", "name3",
"name4", "name5", "name6", "name7",
"name8", "name9", "CLOSE_CONNEX", "PTRACE",
"name12", "WAIT_INFO", "name14", "name15",
"name16", "GET_SIGNAL_NAMES", "name18"
};
void
remotedeb_2(struct svc_req *rqstp, register SVCXPRT *transp)
remotedeb_2 (struct svc_req *rqstp, register SVCXPRT * transp)
{
union {
open_in open_connex_2_arg;
signal_in send_signal_2_arg;
close_in close_connex_2_arg;
ptrace_in ptrace_2_arg;
wait_in wait_info_2_arg;
} argument;
char *result;
xdrproc_t _xdr_argument, _xdr_result;
char *(*local)(char *, struct svc_req *);
union {
open_in open_connex_2_arg;
signal_in send_signal_2_arg;
close_in close_connex_2_arg;
ptrace_in ptrace_2_arg;
wait_in wait_info_2_arg;
} argument;
char *result;
xdrproc_t _xdr_argument, _xdr_result;
char *(*local) (char *, struct svc_req *);
DPRINTF (("remotedeb_2: %s (%d)\n",
(unsigned) rqstp->rq_proc <
(unsigned) (sizeof names / sizeof names[0]) ?
names [rqstp->rq_proc] : "???",
(int) rqstp->rq_proc));
DPRINTF (("remotedeb_2: %s (%d)\n",
(unsigned) rqstp->rq_proc <
(unsigned) (sizeof names / sizeof names[0]) ?
names[rqstp->rq_proc] : "???", (int) rqstp->rq_proc));
switch (rqstp->rq_proc) {
case NULLPROC:
(void) svc_sendreply (transp, (xdrproc_t) xdr_void, (char *)NULL);
return;
switch (rqstp->rq_proc) {
case NULLPROC:
(void) svc_sendreply (transp, (xdrproc_t) xdr_void, (char *) NULL);
return;
case OPEN_CONNEX:
_xdr_argument = (xdrproc_t) xdr_open_in;
_xdr_result = (xdrproc_t) xdr_open_out;
local = (char *(*)(char *, struct svc_req *)) open_connex_2_svc;
break;
case OPEN_CONNEX:
_xdr_argument = (xdrproc_t) xdr_open_in;
_xdr_result = (xdrproc_t) xdr_open_out;
local = (char *(*)(char *, struct svc_req *)) open_connex_2_svc;
break;
case SEND_SIGNAL:
_xdr_argument = (xdrproc_t) xdr_signal_in;
_xdr_result = (xdrproc_t) xdr_signal_out;
local = (char *(*)(char *, struct svc_req *)) send_signal_2_svc;
break;
case SEND_SIGNAL:
_xdr_argument = (xdrproc_t) xdr_signal_in;
_xdr_result = (xdrproc_t) xdr_signal_out;
local = (char *(*)(char *, struct svc_req *)) send_signal_2_svc;
break;
case CLOSE_CONNEX:
_xdr_argument = (xdrproc_t) xdr_close_in;
_xdr_result = (xdrproc_t) xdr_void;
local = (char *(*)(char *, struct svc_req *)) close_connex_2_svc;
break;
case CLOSE_CONNEX:
_xdr_argument = (xdrproc_t) xdr_close_in;
_xdr_result = (xdrproc_t) xdr_void;
local = (char *(*)(char *, struct svc_req *)) close_connex_2_svc;
break;
case PTRACE:
_xdr_argument = (xdrproc_t) xdr_ptrace_in;
_xdr_result = (xdrproc_t) xdr_ptrace_out;
local = (char *(*)(char *, struct svc_req *)) ptrace_2_svc;
break;
case PTRACE:
_xdr_argument = (xdrproc_t) xdr_ptrace_in;
_xdr_result = (xdrproc_t) xdr_ptrace_out;
local = (char *(*)(char *, struct svc_req *)) ptrace_2_svc;
break;
case WAIT_INFO:
_xdr_argument = (xdrproc_t) xdr_wait_in;
_xdr_result = (xdrproc_t) xdr_wait_out;
local = (char *(*)(char *, struct svc_req *)) wait_info_2_svc;
break;
case WAIT_INFO:
_xdr_argument = (xdrproc_t) xdr_wait_in;
_xdr_result = (xdrproc_t) xdr_wait_out;
local = (char *(*)(char *, struct svc_req *)) wait_info_2_svc;
break;
case GET_SIGNAL_NAMES:
_xdr_argument = (xdrproc_t) xdr_void;
_xdr_result = (xdrproc_t) xdr_get_signal_names_out;
local = (char *(*)(char *, struct svc_req *)) get_signal_names_2_svc;
break;
case GET_SIGNAL_NAMES:
_xdr_argument = (xdrproc_t) xdr_void;
_xdr_result = (xdrproc_t) xdr_get_signal_names_out;
local = (char *(*)(char *, struct svc_req *)) get_signal_names_2_svc;
break;
default:
svcerr_noproc (transp);
return;
}
memset ((char *)&argument, 0, sizeof (argument));
if (!svc_getargs (transp, _xdr_argument, (caddr_t) &argument)) {
svcerr_decode (transp);
return;
}
result = (*local)((char *)&argument, rqstp);
if (result != NULL && !svc_sendreply(transp, _xdr_result, result)) {
svcerr_systemerr (transp);
}
if (!svc_freeargs (transp, _xdr_argument, (caddr_t) &argument)) {
fprintf (stderr, "unable to free arguments");
exit (1);
}
return;
default:
svcerr_noproc (transp);
return;
}
memset ((char *) &argument, 0, sizeof (argument));
if (!svc_getargs (transp, _xdr_argument, (caddr_t) & argument)) {
svcerr_decode (transp);
return;
}
result = (*local) ((char *) &argument, rqstp);
if (result != NULL && !svc_sendreply (transp, _xdr_result, result)) {
svcerr_systemerr (transp);
}
if (!svc_freeargs (transp, _xdr_argument, (caddr_t) & argument)) {
fprintf (stderr, "unable to free arguments");
exit (1);
}
return;
}
File diff suppressed because it is too large. Load diff
File diff suppressed because it is too large. Load diff
File diff suppressed because it is too large. Load diff
+2
View File
@@ -71,6 +71,8 @@ if RPCTOOLS
-o m68k/any/tmpSvc.c remdeb.x; \
$(AWK) -f ./awk.svc THEPROG="remdeb.h" m68k/any/tmpSvc.c \
> m68k/any/remdeb_svc.c; \
$(SED) -e 's/fprintf.*,/printf(/' m68k/any/remdeb_svc.c > m68k/any/remdeb_svc.tmp; \
mv m68k/any/remdeb_svc.tmp m68k/any/remdeb_svc.c; \
rm -f m68k/any/tmpSvc.c )
endif
File diff suppressed because it is too large. Load diff
+95 -84
View File
@@ -22,101 +22,112 @@
* become too small if this value gets incremented.
*/
#ifndef XRY_MAX_CMD_STR
#endif /* REMDEB_H */
/* now open_connex() routine which establishes a connection to server */
#define DEBUGGER_IS_GDB 0x2 /* */
/* now close_connex() routine which detaches from server */
/* now send_signal() routine which sends signals to processes like kill(2) */
/* now wait_info() routine which returns results of polling the wait status
of a process/actor. It may return 0 if running, else pid or -1 */
/* now ptrace() routine. This matches the Sun UNIX ptrace as well as
some additions */
/* now define the actual calls we support */
const char* names [] = {
"NULLPROC", "OPEN_CONNEX", "SEND_SIGNAL", "name3",
"name4", "name5", "name6", "name7",
"name8", "name9", "CLOSE_CONNEX", "PTRACE",
"name12", "WAIT_INFO", "name14", "name15",
"name16", "GET_SIGNAL_NAMES", "name18"
#endif /* REMDEB_H */
/*
* now open_connex() routine which establishes a connection to server
*/
#define DEBUGGER_IS_GDB 0x2 /* */
/*
* now close_connex() routine which detaches from server
*/
/*
* now send_signal() routine which sends signals to processes like kill(2)
*/
/*
* now wait_info() routine which returns results of polling the wait status
* of a process/actor. It may return 0 if running, else pid or -1
*/
/*
* now ptrace() routine. This matches the Sun UNIX ptrace as well as
* some additions
*/
/*
* now define the actual calls we support
*/
const char *names[] = {
"NULLPROC", "OPEN_CONNEX", "SEND_SIGNAL", "name3",
"name4", "name5", "name6", "name7",
"name8", "name9", "CLOSE_CONNEX", "PTRACE",
"name12", "WAIT_INFO", "name14", "name15",
"name16", "GET_SIGNAL_NAMES", "name18"
};
void
remotedeb_2(struct svc_req *rqstp, register SVCXPRT *transp)
remotedeb_2 (struct svc_req *rqstp, register SVCXPRT * transp)
{
union {
open_in open_connex_2_arg;
signal_in send_signal_2_arg;
close_in close_connex_2_arg;
ptrace_in ptrace_2_arg;
wait_in wait_info_2_arg;
} argument;
char *result;
xdrproc_t _xdr_argument, _xdr_result;
char *(*local)(char *, struct svc_req *);
union {
open_in open_connex_2_arg;
signal_in send_signal_2_arg;
close_in close_connex_2_arg;
ptrace_in ptrace_2_arg;
wait_in wait_info_2_arg;
} argument;
char *result;
xdrproc_t _xdr_argument, _xdr_result;
char *(*local) (char *, struct svc_req *);
DPRINTF (("remotedeb_2: %s (%d)\n",
(unsigned) rqstp->rq_proc <
(unsigned) (sizeof names / sizeof names[0]) ?
names [rqstp->rq_proc] : "???",
(int) rqstp->rq_proc));
DPRINTF (("remotedeb_2: %s (%d)\n",
(unsigned) rqstp->rq_proc <
(unsigned) (sizeof names / sizeof names[0]) ?
names[rqstp->rq_proc] : "???", (int) rqstp->rq_proc));
switch (rqstp->rq_proc) {
case NULLPROC:
(void) svc_sendreply (transp, (xdrproc_t) xdr_void, (char *)NULL);
return;
switch (rqstp->rq_proc) {
case NULLPROC:
(void) svc_sendreply (transp, (xdrproc_t) xdr_void, (char *) NULL);
return;
case OPEN_CONNEX:
_xdr_argument = (xdrproc_t) xdr_open_in;
_xdr_result = (xdrproc_t) xdr_open_out;
local = (char *(*)(char *, struct svc_req *)) open_connex_2_svc;
break;
case OPEN_CONNEX:
_xdr_argument = (xdrproc_t) xdr_open_in;
_xdr_result = (xdrproc_t) xdr_open_out;
local = (char *(*)(char *, struct svc_req *)) open_connex_2_svc;
break;
case SEND_SIGNAL:
_xdr_argument = (xdrproc_t) xdr_signal_in;
_xdr_result = (xdrproc_t) xdr_signal_out;
local = (char *(*)(char *, struct svc_req *)) send_signal_2_svc;
break;
case SEND_SIGNAL:
_xdr_argument = (xdrproc_t) xdr_signal_in;
_xdr_result = (xdrproc_t) xdr_signal_out;
local = (char *(*)(char *, struct svc_req *)) send_signal_2_svc;
break;
case CLOSE_CONNEX:
_xdr_argument = (xdrproc_t) xdr_close_in;
_xdr_result = (xdrproc_t) xdr_void;
local = (char *(*)(char *, struct svc_req *)) close_connex_2_svc;
break;
case CLOSE_CONNEX:
_xdr_argument = (xdrproc_t) xdr_close_in;
_xdr_result = (xdrproc_t) xdr_void;
local = (char *(*)(char *, struct svc_req *)) close_connex_2_svc;
break;
case PTRACE:
_xdr_argument = (xdrproc_t) xdr_ptrace_in;
_xdr_result = (xdrproc_t) xdr_ptrace_out;
local = (char *(*)(char *, struct svc_req *)) ptrace_2_svc;
break;
case PTRACE:
_xdr_argument = (xdrproc_t) xdr_ptrace_in;
_xdr_result = (xdrproc_t) xdr_ptrace_out;
local = (char *(*)(char *, struct svc_req *)) ptrace_2_svc;
break;
case WAIT_INFO:
_xdr_argument = (xdrproc_t) xdr_wait_in;
_xdr_result = (xdrproc_t) xdr_wait_out;
local = (char *(*)(char *, struct svc_req *)) wait_info_2_svc;
break;
case WAIT_INFO:
_xdr_argument = (xdrproc_t) xdr_wait_in;
_xdr_result = (xdrproc_t) xdr_wait_out;
local = (char *(*)(char *, struct svc_req *)) wait_info_2_svc;
break;
case GET_SIGNAL_NAMES:
_xdr_argument = (xdrproc_t) xdr_void;
_xdr_result = (xdrproc_t) xdr_get_signal_names_out;
local = (char *(*)(char *, struct svc_req *)) get_signal_names_2_svc;
break;
case GET_SIGNAL_NAMES:
_xdr_argument = (xdrproc_t) xdr_void;
_xdr_result = (xdrproc_t) xdr_get_signal_names_out;
local = (char *(*)(char *, struct svc_req *)) get_signal_names_2_svc;
break;
default:
svcerr_noproc (transp);
return;
}
memset ((char *)&argument, 0, sizeof (argument));
if (!svc_getargs (transp, _xdr_argument, (caddr_t) &argument)) {
svcerr_decode (transp);
return;
}
result = (*local)((char *)&argument, rqstp);
if (result != NULL && !svc_sendreply(transp, _xdr_result, result)) {
svcerr_systemerr (transp);
}
if (!svc_freeargs (transp, _xdr_argument, (caddr_t) &argument)) {
fprintf (stderr, "unable to free arguments");
exit (1);
}
return;
default:
svcerr_noproc (transp);
return;
}
memset ((char *) &argument, 0, sizeof (argument));
if (!svc_getargs (transp, _xdr_argument, (caddr_t) & argument)) {
svcerr_decode (transp);
return;
}
result = (*local) ((char *) &argument, rqstp);
if (result != NULL && !svc_sendreply (transp, _xdr_result, result)) {
svcerr_systemerr (transp);
}
if (!svc_freeargs (transp, _xdr_argument, (caddr_t) & argument)) {
fprintf (stderr, "unable to free arguments");
exit (1);
}
return;
}
File diff suppressed because it is too large. Load diff
File diff suppressed because it is too large. Load diff
File diff suppressed because it is too large. Load diff
File diff suppressed because it is too large. Load diff
@@ -71,6 +71,8 @@ if RPCTOOLS
-o powerpc/new_exception_processing/tmpSvc.c remdeb.x; \
$(AWK) -f ./awk.svc THEPROG="remdeb.h" powerpc/new_exception_processing/tmpSvc.c \
> powerpc/new_exception_processing/remdeb_svc.c; \
$(SED) -e 's/fprintf.*,/printf(/' powerpc/new_exception_processing/remdeb_svc.c; > powerpc/new_exception_processing/remdeb_svc.tmp; \
mv powerpc/new_exception_processing/remdeb_svc.tmp powerpc/new_exception_processing/remdeb_svc.c; \
rm -f powerpc/new_exception_processing/tmpSvc.c )
endif
File diff suppressed because it is too large. Load diff
@@ -6,7 +6,7 @@
#include <bsp.h>
#include <rdbg/servrpc.h>
#include <rdbg/remdeb.h>
#define fprintf(fp, ...) printf(__VA_ARGS__)
#define printf(c)
/*HEADER_START*/
#define RTEMS_PORT 2071
#define RTEMS_BACK_PORT 2073
@@ -14,30 +14,28 @@
* Sun request values for the remote ptrace system call
*/
/*
/*
* Memory data for read/write text or data. The size is in data. The target
* addr is in the addr field.
* Be careful before modifying because this value goes into internal
* pipes and is allocated on stack too. Pipes and/or the stack could
* become too small if this value gets incremented.
*/
#ifndef XRY_MAX_CMD_STR
#endif /* REMDEB_H */
/* now open_connex() routine which establishes a connection to server */
#define DEBUGGER_IS_GDB 0x2 /* */
/* now close_connex() routine which detaches from server */
/* now send_signal() routine which sends signals to processes like kill(2) */
/* now wait_info() routine which returns results of polling the wait status
/* now open_connex() routine which establishes a connection to server */
#define DEBUGGER_IS_GDB 0x2 /* */
/* now close_connex() routine which detaches from server */
/* now send_signal() routine which sends signals to processes like kill(2) */
/* now wait_info() routine which returns results of polling the wait status
of a process/actor. It may return 0 if running, else pid or -1 */
/* now ptrace() routine. This matches the Sun UNIX ptrace as well as
some additions */
/* now define the actual calls we support */
/* now ptrace() routine. This matches the Sun UNIX ptrace as well as
some additions */
/* now define the actual calls we support */
const char* names [] = {
"NULLPROC", "OPEN_CONNEX", "SEND_SIGNAL", "name3",
"name4", "name5", "name6", "name7",
"name8", "name9", "CLOSE_CONNEX", "PTRACE",
"name12", "WAIT_INFO", "name14", "name15",
"name16", "GET_SIGNAL_NAMES", "name18"
"NULLPROC", "OPEN_CONNEX", "SEND_SIGNAL", "name3",
"name4", "name5", "name6", "name7",
"name8", "name9", "CLOSE_CONNEX", "PTRACE",
"name12", "WAIT_INFO", "name14", "name15",
"name16", "GET_SIGNAL_NAMES", "name18"
};
void
@@ -115,7 +113,7 @@ remotedeb_2(struct svc_req *rqstp, register SVCXPRT *transp)
svcerr_systemerr (transp);
}
if (!svc_freeargs (transp, _xdr_argument, (caddr_t) &argument)) {
fprintf (stderr, "%s", "unable to free arguments");
printf( "unable to free arguments");
exit (1);
}
return;
@@ -97,7 +97,7 @@ xdr_xdr_regs (XDR *xdrs, xdr_regs *objp)
return FALSE;
return TRUE;
}
/*
/*
* Memory data for read/write text or data. The size is in data. The target
* addr is in the addr field.
* Be careful before modifying because this value goes into internal
@@ -105,16 +105,16 @@ xdr_xdr_regs (XDR *xdrs, xdr_regs *objp)
* become too small if this value gets incremented.
*/
bool_t xdr_xdr_mem(xdrs, objp)
XDR *xdrs;
struct xdr_mem *objp;
XDR *xdrs;
struct xdr_mem *objp;
{
if (!xdr_u_long(xdrs, &objp->addr)) {
return (FALSE);
}
if (!xdr_u_int(xdrs, &objp->dataNb)) {
return(FALSE);
}
return (xdr_opaque(xdrs, objp->data, objp->dataNb));
if (!xdr_u_long(xdrs, &objp->addr)) {
return (FALSE);
}
if (!xdr_u_int(xdrs, &objp->dataNb)) {
return(FALSE);
}
return (xdr_opaque(xdrs, objp->data, objp->dataNb));
}
bool_t
@@ -262,11 +262,11 @@ xdr_KernThread (XDR *xdrs, KernThread *objp)
return TRUE;
}
bool_t xdr_thread_list(xdrs, objp)
XDR *xdrs;
struct thread_list *objp;
XDR *xdrs;
struct thread_list *objp;
{
return (xdr_array(xdrs, (char**)&objp->threads, &objp->nbThread,
UTHREAD_MAX, sizeof(KernThread), xdr_KernThread));
return (xdr_array(xdrs, (char**)&objp->threads, &objp->nbThread,
UTHREAD_MAX, sizeof(KernThread), xdr_KernThread));
}
bool_t
@@ -386,65 +386,6 @@ xdr_CHAR_DATA (XDR *xdrs, CHAR_DATA *objp)
return FALSE;
return TRUE;
}
#ifndef XRY_MAX_CMD_STR
#endif /* REMDEB_H */
bool_t
xdr_xry_inst (XDR *xdrs, xry_inst *objp)
{
register int32_t *buf;
if (!xdr_u_char (xdrs, &objp->flags))
return FALSE;
if (!xdr_u_char (xdrs, &objp->type))
return FALSE;
if (!xdr_u_char (xdrs, &objp->sub_type))
return FALSE;
if (!xdr_u_char (xdrs, &objp->res_type))
return FALSE;
if (!xdr_u_long (xdrs, &objp->value))
return FALSE;
if (!xdr_u_long (xdrs, &objp->value2))
return FALSE;
return TRUE;
}
bool_t
xdr_instance (XDR *xdrs, instance *objp)
{
register int32_t *buf;
int i;
if (!xdr_vector (xdrs, (char *)objp->instances, XRY_MAX_INSTANCES,
sizeof (xry_inst), (xdrproc_t) xdr_xry_inst))
return FALSE;
if (!xdr_vector (xdrs, (char *)objp->buffer, XRY_MAX_INST_BUFF,
sizeof (u_char), (xdrproc_t) xdr_u_char))
return FALSE;
return TRUE;
}
bool_t
xdr_instance_union (XDR *xdrs, instance_union *objp)
{
register int32_t *buf;
if (!xdr_bool (xdrs, &objp->instances))
return FALSE;
switch (objp->instances) {
case TRUE:
if (!xdr_instance (xdrs, &objp->instance_union_u.inst))
return FALSE;
break;
case FALSE:
if (!xdr_string (xdrs, &objp->instance_union_u.buffer, XRY_MAX_CMD_STR))
return FALSE;
break;
default:
return FALSE;
}
return TRUE;
}
bool_t
xdr_one_arg (XDR *xdrs, one_arg *objp)
@@ -455,7 +396,7 @@ xdr_one_arg (XDR *xdrs, one_arg *objp)
return FALSE;
return TRUE;
}
/* now open_connex() routine which establishes a connection to server */
/* now open_connex() routine which establishes a connection to server */
bool_t
xdr_debug_type (XDR *xdrs, debug_type *objp)
@@ -466,7 +407,7 @@ xdr_debug_type (XDR *xdrs, debug_type *objp)
return FALSE;
return TRUE;
}
#define DEBUGGER_IS_GDB 0x2 /* */
#define DEBUGGER_IS_GDB 0x2 /* */
bool_t
xdr_open_in (XDR *xdrs, open_in *objp)
@@ -573,7 +514,7 @@ xdr_open_out (XDR *xdrs, open_out *objp)
return FALSE;
return TRUE;
}
/* now close_connex() routine which detaches from server */
/* now close_connex() routine which detaches from server */
bool_t
xdr_close_control (XDR *xdrs, close_control *objp)
@@ -594,7 +535,7 @@ xdr_close_in (XDR *xdrs, close_in *objp)
return FALSE;
return TRUE;
}
/* now send_signal() routine which sends signals to processes like kill(2) */
/* now send_signal() routine which sends signals to processes like kill(2) */
bool_t
xdr_signal_in (XDR *xdrs, signal_in *objp)
@@ -619,7 +560,7 @@ xdr_signal_out (XDR *xdrs, signal_out *objp)
return FALSE;
return TRUE;
}
/* now wait_info() routine which returns results of polling the wait status
/* now wait_info() routine which returns results of polling the wait status
of a process/actor. It may return 0 if running, else pid or -1 */
bool_t
@@ -744,8 +685,8 @@ xdr_wait_out (XDR *xdrs, wait_out *objp)
return FALSE;
return TRUE;
}
/* now ptrace() routine. This matches the Sun UNIX ptrace as well as
some additions */
/* now ptrace() routine. This matches the Sun UNIX ptrace as well as
some additions */
bool_t
xdr_ptrace_in (XDR *xdrs, ptrace_in *objp)
@@ -925,4 +866,4 @@ xdr_get_signal_names_out (XDR *xdrs, get_signal_names_out *objp)
return FALSE;
return TRUE;
}
/* now define the actual calls we support */
/* now define the actual calls we support */
File diff suppressed because it is too large. Load diff
+248 -253
View File
File diff suppressed because it is too large. Load diff
File diff suppressed because it is too large. Load diff
-35
View File
@@ -291,43 +291,8 @@ union ptrace_addr_data_out switch (ptracereq req) {
typedef opaque CHAR_DATA <NET_SAFE>; /* variable sized data */
const XRY_MAX_INST_BUFF = 128;
const XRY_MAX_INSTANCES = 16;
%#ifndef XRY_MAX_CMD_STR
const XRY_MAX_CMD_STR = 320; /* XRY_MAX_INST_BUFF+(XRY_MAX_INSTANCES*12) */
%#endif /* REMDEB_H */
struct xry_inst
{
unsigned char flags; /* value2 interp, etc. INFL_xxx */
unsigned char type; /* base type of data (str, val, etc) INST_xxx */
unsigned char sub_type; /* specific type (task, res, etc). This is
set and defined by the user defined instance
processor and not the auto-processor */
unsigned char res_type;
u_long value; /* pointer to value or value itself */
u_long value2; /* second value (optional - based on flags) */
};
struct instance
{
struct xry_inst instances[XRY_MAX_INSTANCES];
unsigned char buffer[XRY_MAX_INST_BUFF];
};
union instance_union switch (bool instances)
{
case TRUE:
instance inst;
case FALSE:
string buffer <XRY_MAX_CMD_STR>;
};
typedef string one_arg <NET_SAFE>;
const XRY_MAX_OBJ_NAME = 32; /* objname in some commands */
% /* now open_connex() routine which establishes a connection to server */
enum debug_type
File diff suppressed because it is too large. Load diff
File diff suppressed because it is too large. Load diff
File diff suppressed because it is too large. Load diff
File diff suppressed because it is too large. Load diff
File diff suppressed because it is too large. Load diff
+73 -70
View File
@@ -25,30 +25,32 @@
* list. The fields list, list_sz and list_alloc are affected.
*/
Boolean
ListAlloc(buff, clst)
Boolean
ListAlloc (buff, clst)
char *buff;
CONN_LIST *clst; /* place to copy it */
CONN_LIST *clst; /* place to copy it */
{
int tmp;
char* name;
int new_len;
int len;
int tmp;
char *name;
int new_len;
int len;
tmp = strlen(buff);
new_len = (int)clst->list_sz + 1 + tmp;
if (clst->list_alloc < (unsigned)new_len) {
/* need more space */
name = (char *)Realloc(clst->list, len = new_len + MAX_FILENAME);
if (name == NULL) {
return(False); /* failed, no space */
}
clst->list_alloc = len;
clst->list = name;
tmp = strlen (buff);
new_len = (int) clst->list_sz + 1 + tmp;
if (clst->list_alloc < (unsigned) new_len) {
/*
* need more space
*/
name = (char *) Realloc (clst->list, len = new_len + MAX_FILENAME);
if (name == NULL) {
return (False); /* failed, no space */
}
strcpy(clst->list + clst->list_sz, buff);
clst->list_sz += tmp;
return(True);
clst->list_alloc = len;
clst->list = name;
}
strcpy (clst->list + clst->list_sz, buff);
clst->list_sz += tmp;
return (True);
}
/*----- Management of processes -----*/
@@ -57,21 +59,22 @@ ListAlloc(buff, clst)
* FindPidEntry - locate pid_list entry from pid
*/
int
FindPidEntry (pid)
int pid; /* process identifier */
int
FindPidEntry (int pid) /* pid = process identifier */
{
int idx;
int idx;
/* pid 0 is invalid, and signals a free slot */
if (pid_list == NULL || pid == 0) {
return -1;
}
for (idx = 0; idx < pid_list_cnt; idx++) {
if (pid_list [idx].pid == pid )
return idx;
}
/*
* pid 0 is invalid, and signals a free slot
*/
if (pid_list == NULL || pid == 0) {
return -1;
}
for (idx = 0; idx < pid_list_cnt; idx++) {
if (pid_list[idx].pid == pid)
return idx;
}
return -1;
}
/*----- Debug suport -----*/
@@ -82,51 +85,51 @@ FindPidEntry (pid)
* Names of debug primitives
*/
const char* PtraceNames [] = {
const char *PtraceNames[] = {
"RPT_TRACEME", "RPT_PEEKTEXT", "RPT_PEEKDATA", "RPT_PEEKUSER",
"RPT_POKETEXT", "RPT_POKEDATA", "RPT_POKEUSER", "RPT_CONT",
"RPT_KILL", "RPT_SINGLESTEP", "RPT_ATTACH", "RPT_DETACH",
"RPT_GETREGS", "RPT_SETREGS", "RPT_GETFPREGS", "RPT_SETFPREGS",
"RPT_READDATA", "RPT_WRITEDATA", "RPT_READTEXT", "RPT_WRITETEXT",
"RPT_GETFPAREGS", "RPT_SETFPAREGS", "RPT_22", "RPT_23",
"RPT_SYSCALL", "RPT_DUMPCORE", "RPT_26", "RPT_27",
"RPT_28", "RPT_GETUCODE", "RPT_30", "RPT_31",
"RPT_32", "RPT_33", "RPT_34", "RPT_35",
"RPT_36", "RPT_37", "RPT_38", "RPT_39",
"RPT_40", "RPT_41", "RPT_42", "RPT_43",
"RPT_44", "RPT_45", "RPT_46", "RPT_47",
"RPT_48", "RPT_49", "RPT_GETTARGETTHREAD", "RPT_SETTARGETTHREAD",
"RPT_THREADSUSPEND", "RPT_THREADRESUME", "RPT_THREADLIST", "RPT_GETTHREADNAME",
"RPT_SETTHREADNAME", "RPT_SETTHREADREGS", "RPT_GETTHREADREGS",
"RPT_59",
"RPT_60", "RPT_61", "RPT_62", "RPT_63",
"RPT_64", "RPT_65", "RPT_66", "RPT_67",
"RPT_68", "RPT_69", "RPT_70", "RPT_71",
"RPT_72", "RPT_73", "RPT_74", "RPT_STEPRANGE",
"RPT_CONTTO", "RPT_SETBREAK", "RPT_CLRBREAK", "RPT_GETBREAK",
"RPT_GETNAME", "RPT_STOP",
"RPT_PGETREGS", "RPT_PSETREGS",
"RPT_PSETTHREADREGS", "RPT_PGETTHREADREGS"
"RPT_TRACEME", "RPT_PEEKTEXT", "RPT_PEEKDATA", "RPT_PEEKUSER",
"RPT_POKETEXT", "RPT_POKEDATA", "RPT_POKEUSER", "RPT_CONT",
"RPT_KILL", "RPT_SINGLESTEP", "RPT_ATTACH", "RPT_DETACH",
"RPT_GETREGS", "RPT_SETREGS", "RPT_GETFPREGS", "RPT_SETFPREGS",
"RPT_READDATA", "RPT_WRITEDATA", "RPT_READTEXT", "RPT_WRITETEXT",
"RPT_GETFPAREGS", "RPT_SETFPAREGS", "RPT_22", "RPT_23",
"RPT_SYSCALL", "RPT_DUMPCORE", "RPT_26", "RPT_27",
"RPT_28", "RPT_GETUCODE", "RPT_30", "RPT_31",
"RPT_32", "RPT_33", "RPT_34", "RPT_35",
"RPT_36", "RPT_37", "RPT_38", "RPT_39",
"RPT_40", "RPT_41", "RPT_42", "RPT_43",
"RPT_44", "RPT_45", "RPT_46", "RPT_47",
"RPT_48", "RPT_49", "RPT_GETTARGETTHREAD", "RPT_SETTARGETTHREAD",
"RPT_THREADSUSPEND", "RPT_THREADRESUME", "RPT_THREADLIST",
"RPT_GETTHREADNAME",
"RPT_SETTHREADNAME", "RPT_SETTHREADREGS", "RPT_GETTHREADREGS",
"RPT_59",
"RPT_60", "RPT_61", "RPT_62", "RPT_63",
"RPT_64", "RPT_65", "RPT_66", "RPT_67",
"RPT_68", "RPT_69", "RPT_70", "RPT_71",
"RPT_72", "RPT_73", "RPT_74", "RPT_STEPRANGE",
"RPT_CONTTO", "RPT_SETBREAK", "RPT_CLRBREAK", "RPT_GETBREAK",
"RPT_GETNAME", "RPT_STOP",
"RPT_PGETREGS", "RPT_PSETREGS",
"RPT_PSETTHREADREGS", "RPT_PGETTHREADREGS"
};
const char*
PtraceName(req)
int req;
const char *
PtraceName (int req)
{
static char bufret[40];
static char bufret[40];
if ((req < 0) || (req >= sizeof(PtraceNames)/sizeof(char*))) {
sprintf(bufret, "BAD_REQ_%d", req);
return bufret;
}
return PtraceNames[req];
if ((req < 0) || (req >= sizeof (PtraceNames) / sizeof (char *))) {
sprintf (bufret, "BAD_REQ_%d", req);
return bufret;
}
return PtraceNames[req];
}
const char* BmsgNames [] = {
"?", "WARM", "WAIT", "BREAK",
"EXEC_FAIL", "DETACH", "KILLED", "NOT_PRIM",
"NEW_PID"
const char *BmsgNames[] = {
"?", "WARM", "WAIT", "BREAK",
"EXEC_FAIL", "DETACH", "KILLED", "NOT_PRIM",
"NEW_PID"
};
#endif /* DDEBUG */