summaryrefslogtreecommitdiffstats
path: root/c/src/lib/libbsp/mips/shared/gdbstub/mips-stub.c
diff options
context:
space:
mode:
Diffstat (limited to 'c/src/lib/libbsp/mips/shared/gdbstub/mips-stub.c')
-rw-r--r--c/src/lib/libbsp/mips/shared/gdbstub/mips-stub.c90
1 files changed, 0 insertions, 90 deletions
diff --git a/c/src/lib/libbsp/mips/shared/gdbstub/mips-stub.c b/c/src/lib/libbsp/mips/shared/gdbstub/mips-stub.c
index fc0f867d8b..a6920fe93b 100644
--- a/c/src/lib/libbsp/mips/shared/gdbstub/mips-stub.c
+++ b/c/src/lib/libbsp/mips/shared/gdbstub/mips-stub.c
@@ -210,8 +210,6 @@ static char do_threads; /* != 0 means we are supporting threads */
extern char getDebugChar (void);
extern void putDebugChar (char);
-
-
/*
* The following definitions are used for the gdb stub memory map
*/
@@ -224,11 +222,6 @@ static int is_readable(unsigned,unsigned);
static int is_writeable(unsigned,unsigned);
static int is_steppable(unsigned);
-
-
-
-
-
/*
* BUFMAX defines the maximum number of characters in the inbound & outbound
* packet buffers. At least 4+(sizeof registers)*2 bytes will be needed for
@@ -272,7 +265,6 @@ const char gdb_hexchars[] = "0123456789abcdef";
#define highhex(x) gdb_hexchars [(x >> 4) & 0xf]
#define lowhex(x) gdb_hexchars [x & 0xf]
-
/*
* Convert length bytes of data starting at addr into hex, placing the
* result in buf. Return a pointer to the last (null) char in buf.
@@ -359,7 +351,6 @@ hex (char ch)
return (-1);
}
-
/*
* Convert a string from hex to int until a non-hex digit
* is found. Return the number of characters processed.
@@ -389,7 +380,6 @@ hexToInt (char **ptr, int *intValue)
return (numChars);
}
-
/*
* Convert a string from hex to long long until a non-hex
* digit is found. Return the number of characters processed.
@@ -419,7 +409,6 @@ hexToLongLong (char **ptr, long long *intValue)
return (numChars);
}
-
/*
* Convert the hex array buf into binary, placing the result at the
* specified address. If the conversion fails at any point (i.e.,
@@ -506,7 +495,6 @@ hex2mem (char *buf, void *_addr, int length)
return 1;
}
-
/* Convert the binary stream in BUF to memory.
Gdb will escape $, #, and the escape char (0x7d).
@@ -544,7 +532,6 @@ bin2mem (
return mem;
}
-
/*
* Scan the input stream for a sequence for the form $<data>#<checksum>.
@@ -597,7 +584,6 @@ getpacket (char *buffer)
while (checksum != xmitcsum);
}
-
/*
* Get a positive/negative acknowledgment for a transmitted packet.
*/
@@ -615,7 +601,6 @@ getAck (void)
return c;
}
-
/*
* Send the packet in buffer and wait for a positive acknowledgement.
*/
@@ -665,11 +650,6 @@ putpacket (char *buffer)
while (getAck () != '+');
}
-
-
-
-
-
/*
* Saved instruction data for single step support
@@ -681,7 +661,6 @@ static struct
}
instrBuffer;
-
/*
* If a step breakpoint was planted restore the saved instruction.
*/
@@ -696,7 +675,6 @@ undoSStep (void)
instrBuffer.savedInstr = NOP_INSTR;
}
-
/*
* If a single step is requested put a temporary breakpoint at the instruction
* which logically follows the next one to be executed. If the next instruction
@@ -818,7 +796,6 @@ doSStep (void)
break;
}
-
if( is_steppable((unsigned)instrBuffer.targetAddr) && *(instrBuffer.targetAddr) != BREAK_INSTR )
{
instrBuffer.savedInstr = *instrBuffer.targetAddr;
@@ -832,10 +809,6 @@ doSStep (void)
return;
}
-
-
-
-
/*
* Translate the R4600 exception code into a Unix-compatible signal.
@@ -945,7 +918,6 @@ void gdb_stub_report_exception_info(
*optr++ = '\0';
}
-
/*
@@ -954,15 +926,12 @@ void gdb_stub_report_exception_info(
*/
CPU_Interrupt_frame current_thread_registers;
-
-
/*
* This function handles all exceptions. It only does two things:
* it figures out why it was activated and tells gdb, and then it
* reacts to gdb's requests.
*/
-
void handle_exception (rtems_vector_number vector, CPU_Interrupt_frame *frame)
{
int host_has_detached = 0;
@@ -975,7 +944,6 @@ void handle_exception (rtems_vector_number vector, CPU_Interrupt_frame *frame)
void *regptr;
int binary;
-
registers = (mips_register_t *)frame;
thread = 0;
@@ -986,7 +954,6 @@ void handle_exception (rtems_vector_number vector, CPU_Interrupt_frame *frame)
#endif
current_thread = thread;
-
{
/* reapply all breakpoints regardless of how we came in */
struct z0break *z0, *zother;
@@ -1002,8 +969,6 @@ void handle_exception (rtems_vector_number vector, CPU_Interrupt_frame *frame)
}
}
-
-
/* see if we're coming from a breakpoint */
if( *((unsigned *)frame->epc) == BREAK_INSTR )
{
@@ -1040,16 +1005,10 @@ void handle_exception (rtems_vector_number vector, CPU_Interrupt_frame *frame)
}
}
-
-
-
-
/* reply to host that an exception has occurred with some basic info */
gdb_stub_report_exception_info(vector, frame, thread);
putpacket (outBuffer);
-
-
while (!(host_has_detached)) {
outBuffer[0] = '\0';
getpacket (inBuffer);
@@ -1079,7 +1038,6 @@ void handle_exception (rtems_vector_number vector, CPU_Interrupt_frame *frame)
mem2hex (regptr, NUM_REGS * (sizeof registers), outBuffer);
break;
-
case 'G': /* set the values of the CPU registers - return OK */
regptr = registers;
#if defined(GDB_STUB_ENABLE_THREAD_SUPPORT)
@@ -1092,7 +1050,6 @@ void handle_exception (rtems_vector_number vector, CPU_Interrupt_frame *frame)
strcpy (outBuffer, "E00"); /* E00 = bad "set register" command */
break;
-
case 'P':
/* Pn...=r... Write register n... with value r... - return OK */
ptr = &inBuffer[1];
@@ -1107,7 +1064,6 @@ void handle_exception (rtems_vector_number vector, CPU_Interrupt_frame *frame)
strcpy (outBuffer, "E00"); /* E00 = bad "set register" command */
break;
-
case 'm':
/* mAA..AA,LLLL Read LLLL bytes at address AA..AA */
ptr = &inBuffer[1];
@@ -1121,7 +1077,6 @@ void handle_exception (rtems_vector_number vector, CPU_Interrupt_frame *frame)
strcpy (outBuffer, "E01"); /* E01 = bad 'm' command */
break;
-
case 'X': /* XAA..AA,LLLL:<binary data>#cs */
binary = 1;
case 'M':
@@ -1142,8 +1097,6 @@ void handle_exception (rtems_vector_number vector, CPU_Interrupt_frame *frame)
strcpy (outBuffer, "E02"); /* E02 = bad 'M' command */
break;
-
-
case 'c':
/* cAA..AA Continue at address AA..AA(optional) */
case 's':
@@ -1159,10 +1112,6 @@ void handle_exception (rtems_vector_number vector, CPU_Interrupt_frame *frame)
}
goto stubexit;
-
-
-
-
case 'k': /* remove all zbreaks if any */
dumpzbreaks:
{
@@ -1193,10 +1142,6 @@ void handle_exception (rtems_vector_number vector, CPU_Interrupt_frame *frame)
}
break;
-
-
-
-
case 'q': /* queries */
#if defined(GDB_STUB_ENABLE_THREAD_SUPPORT)
rtems_gdb_process_query( inBuffer, outBuffer, do_threads, thread );
@@ -1281,9 +1226,6 @@ void handle_exception (rtems_vector_number vector, CPU_Interrupt_frame *frame)
#endif
break;
-
-
-
case 'Z': /* Add breakpoint */
{
int ret, type, len;
@@ -1326,7 +1268,6 @@ void handle_exception (rtems_vector_number vector, CPU_Interrupt_frame *frame)
break;
}
-
/* Get entry */
z0 = z0break_avail;
z0break_avail = z0break_avail->next;
@@ -1376,13 +1317,11 @@ void handle_exception (rtems_vector_number vector, CPU_Interrupt_frame *frame)
}
break;
-
case 'z': /* remove breakpoint */
if (inBuffer[1] == 'z')
{
goto dumpzbreaks;
-
/*
* zz packet - remove all breaks *
z0last = NULL;
@@ -1417,7 +1356,6 @@ void handle_exception (rtems_vector_number vector, CPU_Interrupt_frame *frame)
unsigned *address;
struct z0break *z0;
-
ret = parse_zbreak(inBuffer, &type, (unsigned char **)&address, &len);
if (!ret) {
strcpy(outBuffer, "E01");
@@ -1479,7 +1417,6 @@ void handle_exception (rtems_vector_number vector, CPU_Interrupt_frame *frame)
}
break;
-
default: /* do nothing */
break;
}
@@ -1510,15 +1447,6 @@ void handle_exception (rtems_vector_number vector, CPU_Interrupt_frame *frame)
return;
}
-
-
-
-
-
-
-
-
-
static int numsegs;
static struct memseg memsegments[NUM_MEMSEGS];
@@ -1534,9 +1462,6 @@ int gdbstub_add_memsegment( unsigned base, unsigned end, int opts )
return RTEMS_SUCCESSFUL;
}
-
-
-
static int is_readable(unsigned ptr, unsigned len)
{
struct memseg *ms;
@@ -1554,7 +1479,6 @@ static int is_readable(unsigned ptr, unsigned len)
return 0;
}
-
static int is_writeable(unsigned ptr, unsigned len)
{
struct memseg *ms;
@@ -1572,7 +1496,6 @@ static int is_writeable(unsigned ptr, unsigned len)
return 0;
}
-
static int is_steppable(unsigned ptr)
{
struct memseg *ms;
@@ -1590,19 +1513,6 @@ static int is_steppable(unsigned ptr)
return 0;
}
-
-
-
-
-
-
-
-
-
-
-
-
-
static char initialized = 0; /* 0 means we are not initialized */
void mips_gdb_stub_install(int enableThreads)