* remote-fileio.c (remote_fileio_return_success): Take a gdb_byte
argument. (remote_fileio_func_open, remote_fileio_func_rename) (remote_fileio_func_unlink, remote_fileio_func_stat) (remote_fileio_func_fstat, remote_fileio_func_gettimeofday) (remote_fileio_func_system): Cast the arguments to remote_read_bytes and remote_write_bytes. (remote_fileio_func_read, remote_fileio_func_write): Use a gdb_byte buffer. * remote.h (remote_read_bytes, remote_write_bytes): Update prototypes. * remote.c (hex2bin, bin2hex): Use gdb_byte for the BIN argument. (threadref_to_int): Replace bogus char * cast. (remote_unpack_thread_info_response): Use int for tag. (remote_threads_extra_info, remote_check_symbols): Cast string arguments to hex2bin. (remote_wait): Use a char buffer for packets and a gdb_byte buffer for registers. (remote_async_wait): Likewise. (remote_prepare_to_store, store_register_using_P) (remote_store_registers): Use gdb_byte buffers. (remote_write_bytes, remote_read_bytes): Use a gdb_byte pointer for MYADDR and char buffers for strings. (remote_xfer_partial): Add casts for string operations on READBUF. (remote_rcmd): Cast strings passed to bin2hex.
This commit is contained in:
parent
b56cbdb94b
commit
cfd77fa13e
4 changed files with 87 additions and 59 deletions
|
@ -1,3 +1,31 @@
|
||||||
|
2006-01-17 Daniel Jacobowitz <dan@codesourcery.com>
|
||||||
|
|
||||||
|
* remote-fileio.c (remote_fileio_return_success): Take a gdb_byte
|
||||||
|
argument.
|
||||||
|
(remote_fileio_func_open, remote_fileio_func_rename)
|
||||||
|
(remote_fileio_func_unlink, remote_fileio_func_stat)
|
||||||
|
(remote_fileio_func_fstat, remote_fileio_func_gettimeofday)
|
||||||
|
(remote_fileio_func_system): Cast the arguments to
|
||||||
|
remote_read_bytes and remote_write_bytes.
|
||||||
|
(remote_fileio_func_read, remote_fileio_func_write): Use a
|
||||||
|
gdb_byte buffer.
|
||||||
|
* remote.h (remote_read_bytes, remote_write_bytes): Update
|
||||||
|
prototypes.
|
||||||
|
* remote.c (hex2bin, bin2hex): Use gdb_byte for the BIN argument.
|
||||||
|
(threadref_to_int): Replace bogus char * cast.
|
||||||
|
(remote_unpack_thread_info_response): Use int for tag.
|
||||||
|
(remote_threads_extra_info, remote_check_symbols): Cast string
|
||||||
|
arguments to hex2bin.
|
||||||
|
(remote_wait): Use a char buffer for packets and a gdb_byte
|
||||||
|
buffer for registers.
|
||||||
|
(remote_async_wait): Likewise.
|
||||||
|
(remote_prepare_to_store, store_register_using_P)
|
||||||
|
(remote_store_registers): Use gdb_byte buffers.
|
||||||
|
(remote_write_bytes, remote_read_bytes): Use a gdb_byte pointer
|
||||||
|
for MYADDR and char buffers for strings.
|
||||||
|
(remote_xfer_partial): Add casts for string operations on READBUF.
|
||||||
|
(remote_rcmd): Cast strings passed to bin2hex.
|
||||||
|
|
||||||
2006-01-16 Mark Mitchell <mark@codesourcery.com>
|
2006-01-16 Mark Mitchell <mark@codesourcery.com>
|
||||||
|
|
||||||
* aclocal.m4: Regenerate.
|
* aclocal.m4: Regenerate.
|
||||||
|
|
|
@ -570,7 +570,7 @@ remote_fileio_return_success (int retcode)
|
||||||
write only one packet, regardless of the requested number of bytes to
|
write only one packet, regardless of the requested number of bytes to
|
||||||
transfer. This wrapper calls remote_write_bytes() as often as needed. */
|
transfer. This wrapper calls remote_write_bytes() as often as needed. */
|
||||||
static int
|
static int
|
||||||
remote_fileio_write_bytes (CORE_ADDR memaddr, char *myaddr, int len)
|
remote_fileio_write_bytes (CORE_ADDR memaddr, gdb_byte *myaddr, int len)
|
||||||
{
|
{
|
||||||
int ret = 0, written;
|
int ret = 0, written;
|
||||||
|
|
||||||
|
@ -618,7 +618,7 @@ remote_fileio_func_open (char *buf)
|
||||||
|
|
||||||
/* Request pathname using 'm' packet */
|
/* Request pathname using 'm' packet */
|
||||||
pathname = alloca (length);
|
pathname = alloca (length);
|
||||||
retlength = remote_read_bytes (ptrval, pathname, length);
|
retlength = remote_read_bytes (ptrval, (gdb_byte *) pathname, length);
|
||||||
if (retlength != length)
|
if (retlength != length)
|
||||||
{
|
{
|
||||||
remote_fileio_ioerror ();
|
remote_fileio_ioerror ();
|
||||||
|
@ -688,7 +688,7 @@ remote_fileio_func_read (char *buf)
|
||||||
LONGEST lnum;
|
LONGEST lnum;
|
||||||
CORE_ADDR ptrval;
|
CORE_ADDR ptrval;
|
||||||
int fd, ret, retlength;
|
int fd, ret, retlength;
|
||||||
char *buffer;
|
gdb_byte *buffer;
|
||||||
size_t length;
|
size_t length;
|
||||||
off_t old_offset, new_offset;
|
off_t old_offset, new_offset;
|
||||||
|
|
||||||
|
@ -729,7 +729,7 @@ remote_fileio_func_read (char *buf)
|
||||||
static char *remaining_buf = NULL;
|
static char *remaining_buf = NULL;
|
||||||
static int remaining_length = 0;
|
static int remaining_length = 0;
|
||||||
|
|
||||||
buffer = (char *) xmalloc (32768);
|
buffer = (gdb_byte *) xmalloc (32768);
|
||||||
if (remaining_buf)
|
if (remaining_buf)
|
||||||
{
|
{
|
||||||
remote_fio_no_longjmp = 1;
|
remote_fio_no_longjmp = 1;
|
||||||
|
@ -751,7 +751,7 @@ remote_fileio_func_read (char *buf)
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
ret = ui_file_read (gdb_stdtargin, buffer, 32767);
|
ret = ui_file_read (gdb_stdtargin, (char *) buffer, 32767);
|
||||||
remote_fio_no_longjmp = 1;
|
remote_fio_no_longjmp = 1;
|
||||||
if (ret > 0 && (size_t)ret > length)
|
if (ret > 0 && (size_t)ret > length)
|
||||||
{
|
{
|
||||||
|
@ -764,7 +764,7 @@ remote_fileio_func_read (char *buf)
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
buffer = (char *) xmalloc (length);
|
buffer = (gdb_byte *) xmalloc (length);
|
||||||
/* POSIX defines EINTR behaviour of read in a weird way. It's allowed
|
/* POSIX defines EINTR behaviour of read in a weird way. It's allowed
|
||||||
for read() to return -1 even if "some" bytes have been read. It
|
for read() to return -1 even if "some" bytes have been read. It
|
||||||
has been corrected in SUSv2 but that doesn't help us much...
|
has been corrected in SUSv2 but that doesn't help us much...
|
||||||
|
@ -806,7 +806,7 @@ remote_fileio_func_write (char *buf)
|
||||||
LONGEST lnum;
|
LONGEST lnum;
|
||||||
CORE_ADDR ptrval;
|
CORE_ADDR ptrval;
|
||||||
int fd, ret, retlength;
|
int fd, ret, retlength;
|
||||||
char *buffer;
|
gdb_byte *buffer;
|
||||||
size_t length;
|
size_t length;
|
||||||
|
|
||||||
/* 1. Parameter: file descriptor */
|
/* 1. Parameter: file descriptor */
|
||||||
|
@ -836,7 +836,7 @@ remote_fileio_func_write (char *buf)
|
||||||
}
|
}
|
||||||
length = (size_t) num;
|
length = (size_t) num;
|
||||||
|
|
||||||
buffer = (char *) xmalloc (length);
|
buffer = (gdb_byte *) xmalloc (length);
|
||||||
retlength = remote_read_bytes (ptrval, buffer, length);
|
retlength = remote_read_bytes (ptrval, buffer, length);
|
||||||
if (retlength != length)
|
if (retlength != length)
|
||||||
{
|
{
|
||||||
|
@ -852,8 +852,8 @@ remote_fileio_func_write (char *buf)
|
||||||
remote_fileio_badfd ();
|
remote_fileio_badfd ();
|
||||||
return;
|
return;
|
||||||
case FIO_FD_CONSOLE_OUT:
|
case FIO_FD_CONSOLE_OUT:
|
||||||
ui_file_write (target_fd == 1 ? gdb_stdtarg : gdb_stdtargerr, buffer,
|
ui_file_write (target_fd == 1 ? gdb_stdtarg : gdb_stdtargerr,
|
||||||
length);
|
(char *) buffer, length);
|
||||||
gdb_flush (target_fd == 1 ? gdb_stdtarg : gdb_stdtargerr);
|
gdb_flush (target_fd == 1 ? gdb_stdtarg : gdb_stdtargerr);
|
||||||
ret = length;
|
ret = length;
|
||||||
break;
|
break;
|
||||||
|
@ -943,7 +943,7 @@ remote_fileio_func_rename (char *buf)
|
||||||
}
|
}
|
||||||
/* Request oldpath using 'm' packet */
|
/* Request oldpath using 'm' packet */
|
||||||
oldpath = alloca (length);
|
oldpath = alloca (length);
|
||||||
retlength = remote_read_bytes (ptrval, oldpath, length);
|
retlength = remote_read_bytes (ptrval, (gdb_byte *) oldpath, length);
|
||||||
if (retlength != length)
|
if (retlength != length)
|
||||||
{
|
{
|
||||||
remote_fileio_ioerror ();
|
remote_fileio_ioerror ();
|
||||||
|
@ -957,7 +957,7 @@ remote_fileio_func_rename (char *buf)
|
||||||
}
|
}
|
||||||
/* Request newpath using 'm' packet */
|
/* Request newpath using 'm' packet */
|
||||||
newpath = alloca (length);
|
newpath = alloca (length);
|
||||||
retlength = remote_read_bytes (ptrval, newpath, length);
|
retlength = remote_read_bytes (ptrval, (gdb_byte *) newpath, length);
|
||||||
if (retlength != length)
|
if (retlength != length)
|
||||||
{
|
{
|
||||||
remote_fileio_ioerror ();
|
remote_fileio_ioerror ();
|
||||||
|
@ -1034,7 +1034,7 @@ remote_fileio_func_unlink (char *buf)
|
||||||
}
|
}
|
||||||
/* Request pathname using 'm' packet */
|
/* Request pathname using 'm' packet */
|
||||||
pathname = alloca (length);
|
pathname = alloca (length);
|
||||||
retlength = remote_read_bytes (ptrval, pathname, length);
|
retlength = remote_read_bytes (ptrval, (gdb_byte *) pathname, length);
|
||||||
if (retlength != length)
|
if (retlength != length)
|
||||||
{
|
{
|
||||||
remote_fileio_ioerror ();
|
remote_fileio_ioerror ();
|
||||||
|
@ -1076,7 +1076,7 @@ remote_fileio_func_stat (char *buf)
|
||||||
}
|
}
|
||||||
/* Request pathname using 'm' packet */
|
/* Request pathname using 'm' packet */
|
||||||
pathname = alloca (length);
|
pathname = alloca (length);
|
||||||
retlength = remote_read_bytes (ptrval, pathname, length);
|
retlength = remote_read_bytes (ptrval, (gdb_byte *) pathname, length);
|
||||||
if (retlength != length)
|
if (retlength != length)
|
||||||
{
|
{
|
||||||
remote_fileio_ioerror ();
|
remote_fileio_ioerror ();
|
||||||
|
@ -1110,7 +1110,7 @@ remote_fileio_func_stat (char *buf)
|
||||||
remote_fileio_to_fio_stat (&st, &fst);
|
remote_fileio_to_fio_stat (&st, &fst);
|
||||||
remote_fileio_to_fio_uint (0, fst.fst_dev);
|
remote_fileio_to_fio_uint (0, fst.fst_dev);
|
||||||
|
|
||||||
retlength = remote_fileio_write_bytes (ptrval, (char *) &fst, sizeof fst);
|
retlength = remote_fileio_write_bytes (ptrval, (gdb_byte *) &fst, sizeof fst);
|
||||||
if (retlength != sizeof fst)
|
if (retlength != sizeof fst)
|
||||||
{
|
{
|
||||||
remote_fileio_return_errno (-1);
|
remote_fileio_return_errno (-1);
|
||||||
|
@ -1193,7 +1193,7 @@ remote_fileio_func_fstat (char *buf)
|
||||||
{
|
{
|
||||||
remote_fileio_to_fio_stat (&st, &fst);
|
remote_fileio_to_fio_stat (&st, &fst);
|
||||||
|
|
||||||
retlength = remote_fileio_write_bytes (ptrval, (char *) &fst, sizeof fst);
|
retlength = remote_fileio_write_bytes (ptrval, (gdb_byte *) &fst, sizeof fst);
|
||||||
if (retlength != sizeof fst)
|
if (retlength != sizeof fst)
|
||||||
{
|
{
|
||||||
remote_fileio_return_errno (-1);
|
remote_fileio_return_errno (-1);
|
||||||
|
@ -1245,7 +1245,7 @@ remote_fileio_func_gettimeofday (char *buf)
|
||||||
{
|
{
|
||||||
remote_fileio_to_fio_timeval (&tv, &ftv);
|
remote_fileio_to_fio_timeval (&tv, &ftv);
|
||||||
|
|
||||||
retlength = remote_fileio_write_bytes (ptrval, (char *) &ftv, sizeof ftv);
|
retlength = remote_fileio_write_bytes (ptrval, (gdb_byte *) &ftv, sizeof ftv);
|
||||||
if (retlength != sizeof ftv)
|
if (retlength != sizeof ftv)
|
||||||
{
|
{
|
||||||
remote_fileio_return_errno (-1);
|
remote_fileio_return_errno (-1);
|
||||||
|
@ -1297,7 +1297,7 @@ remote_fileio_func_system (char *buf)
|
||||||
}
|
}
|
||||||
/* Request commandline using 'm' packet */
|
/* Request commandline using 'm' packet */
|
||||||
cmdline = alloca (length);
|
cmdline = alloca (length);
|
||||||
retlength = remote_read_bytes (ptrval, cmdline, length);
|
retlength = remote_read_bytes (ptrval, (gdb_byte *) cmdline, length);
|
||||||
if (retlength != length)
|
if (retlength != length)
|
||||||
{
|
{
|
||||||
remote_fileio_ioerror ();
|
remote_fileio_ioerror ();
|
||||||
|
|
74
gdb/remote.c
74
gdb/remote.c
|
@ -172,9 +172,9 @@ static void record_currthread (int currthread);
|
||||||
|
|
||||||
static int fromhex (int a);
|
static int fromhex (int a);
|
||||||
|
|
||||||
static int hex2bin (const char *hex, char *bin, int count);
|
static int hex2bin (const char *hex, gdb_byte *bin, int count);
|
||||||
|
|
||||||
static int bin2hex (const char *bin, char *hex, int count);
|
static int bin2hex (const gdb_byte *bin, char *hex, int count);
|
||||||
|
|
||||||
static int putpkt_binary (char *buf, int cnt);
|
static int putpkt_binary (char *buf, int cnt);
|
||||||
|
|
||||||
|
@ -1409,7 +1409,7 @@ threadref_to_int (threadref *ref)
|
||||||
int i, value = 0;
|
int i, value = 0;
|
||||||
unsigned char *scan;
|
unsigned char *scan;
|
||||||
|
|
||||||
scan = (char *) ref;
|
scan = *ref;
|
||||||
scan += 4;
|
scan += 4;
|
||||||
i = 4;
|
i = 4;
|
||||||
while (i-- > 0)
|
while (i-- > 0)
|
||||||
|
@ -1487,7 +1487,7 @@ remote_unpack_thread_info_response (char *pkt, threadref *expectedref,
|
||||||
{
|
{
|
||||||
struct remote_state *rs = get_remote_state ();
|
struct remote_state *rs = get_remote_state ();
|
||||||
int mask, length;
|
int mask, length;
|
||||||
unsigned int tag;
|
int tag;
|
||||||
threadref ref;
|
threadref ref;
|
||||||
char *limit = pkt + rs->remote_packet_size; /* Plausible parsing limit. */
|
char *limit = pkt + rs->remote_packet_size; /* Plausible parsing limit. */
|
||||||
int retval = 1;
|
int retval = 1;
|
||||||
|
@ -1876,7 +1876,7 @@ remote_threads_extra_info (struct thread_info *tp)
|
||||||
if (bufp[0] != 0)
|
if (bufp[0] != 0)
|
||||||
{
|
{
|
||||||
n = min (strlen (bufp) / 2, sizeof (display_buf));
|
n = min (strlen (bufp) / 2, sizeof (display_buf));
|
||||||
result = hex2bin (bufp, display_buf, n);
|
result = hex2bin (bufp, (gdb_byte *) display_buf, n);
|
||||||
display_buf [result] = '\0';
|
display_buf [result] = '\0';
|
||||||
return display_buf;
|
return display_buf;
|
||||||
}
|
}
|
||||||
|
@ -2134,7 +2134,7 @@ remote_check_symbols (struct objfile *objfile)
|
||||||
while (strncmp (reply, "qSymbol:", 8) == 0)
|
while (strncmp (reply, "qSymbol:", 8) == 0)
|
||||||
{
|
{
|
||||||
tmp = &reply[8];
|
tmp = &reply[8];
|
||||||
end = hex2bin (tmp, msg, strlen (tmp) / 2);
|
end = hex2bin (tmp, (gdb_byte *) msg, strlen (tmp) / 2);
|
||||||
msg[end] = '\0';
|
msg[end] = '\0';
|
||||||
sym = lookup_minimal_symbol (msg, NULL, NULL);
|
sym = lookup_minimal_symbol (msg, NULL, NULL);
|
||||||
if (sym == NULL)
|
if (sym == NULL)
|
||||||
|
@ -2375,7 +2375,7 @@ fromhex (int a)
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
hex2bin (const char *hex, char *bin, int count)
|
hex2bin (const char *hex, gdb_byte *bin, int count)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
|
@ -2405,12 +2405,12 @@ tohex (int nib)
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
bin2hex (const char *bin, char *hex, int count)
|
bin2hex (const gdb_byte *bin, char *hex, int count)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
/* May use a length, or a nul-terminated string as input. */
|
/* May use a length, or a nul-terminated string as input. */
|
||||||
if (count == 0)
|
if (count == 0)
|
||||||
count = strlen (bin);
|
count = strlen ((char *) bin);
|
||||||
|
|
||||||
for (i = 0; i < count; i++)
|
for (i = 0; i < count; i++)
|
||||||
{
|
{
|
||||||
|
@ -2830,7 +2830,7 @@ static ptid_t
|
||||||
remote_wait (ptid_t ptid, struct target_waitstatus *status)
|
remote_wait (ptid_t ptid, struct target_waitstatus *status)
|
||||||
{
|
{
|
||||||
struct remote_state *rs = get_remote_state ();
|
struct remote_state *rs = get_remote_state ();
|
||||||
unsigned char *buf = alloca (rs->remote_packet_size);
|
char *buf = alloca (rs->remote_packet_size);
|
||||||
ULONGEST thread_num = -1;
|
ULONGEST thread_num = -1;
|
||||||
ULONGEST addr;
|
ULONGEST addr;
|
||||||
|
|
||||||
|
@ -2839,7 +2839,7 @@ remote_wait (ptid_t ptid, struct target_waitstatus *status)
|
||||||
|
|
||||||
while (1)
|
while (1)
|
||||||
{
|
{
|
||||||
unsigned char *p;
|
char *p;
|
||||||
|
|
||||||
ofunc = signal (SIGINT, remote_interrupt);
|
ofunc = signal (SIGINT, remote_interrupt);
|
||||||
getpkt (buf, rs->remote_packet_size, 1);
|
getpkt (buf, rs->remote_packet_size, 1);
|
||||||
|
@ -2862,7 +2862,7 @@ remote_wait (ptid_t ptid, struct target_waitstatus *status)
|
||||||
continue;
|
continue;
|
||||||
case 'T': /* Status with PC, SP, FP, ... */
|
case 'T': /* Status with PC, SP, FP, ... */
|
||||||
{
|
{
|
||||||
char regs[MAX_REGISTER_SIZE];
|
gdb_byte regs[MAX_REGISTER_SIZE];
|
||||||
|
|
||||||
/* Expedited reply, containing Signal, {regno, reg} repeat. */
|
/* Expedited reply, containing Signal, {regno, reg} repeat. */
|
||||||
/* format is: 'Tssn...:r...;n...:r...;n...:r...;#cc', where
|
/* format is: 'Tssn...:r...;n...:r...;n...:r...;#cc', where
|
||||||
|
@ -2874,7 +2874,7 @@ remote_wait (ptid_t ptid, struct target_waitstatus *status)
|
||||||
|
|
||||||
while (*p)
|
while (*p)
|
||||||
{
|
{
|
||||||
unsigned char *p1;
|
char *p1;
|
||||||
char *p_temp;
|
char *p_temp;
|
||||||
int fieldsize;
|
int fieldsize;
|
||||||
LONGEST pnum = 0;
|
LONGEST pnum = 0;
|
||||||
|
@ -2890,14 +2890,14 @@ remote_wait (ptid_t ptid, struct target_waitstatus *status)
|
||||||
{
|
{
|
||||||
/* Read the ``P'' register number. */
|
/* Read the ``P'' register number. */
|
||||||
pnum = strtol (p, &p_temp, 16);
|
pnum = strtol (p, &p_temp, 16);
|
||||||
p1 = (unsigned char *) p_temp;
|
p1 = p_temp;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
p1 = p;
|
p1 = p;
|
||||||
|
|
||||||
if (p1 == p) /* No register number present here. */
|
if (p1 == p) /* No register number present here. */
|
||||||
{
|
{
|
||||||
p1 = (unsigned char *) strchr (p, ':');
|
p1 = strchr (p, ':');
|
||||||
if (p1 == NULL)
|
if (p1 == NULL)
|
||||||
warning (_("Malformed packet(a) (missing colon): %s\n\
|
warning (_("Malformed packet(a) (missing colon): %s\n\
|
||||||
Packet: '%s'\n"),
|
Packet: '%s'\n"),
|
||||||
|
@ -2906,7 +2906,7 @@ Packet: '%s'\n"),
|
||||||
{
|
{
|
||||||
p_temp = unpack_varlen_hex (++p1, &thread_num);
|
p_temp = unpack_varlen_hex (++p1, &thread_num);
|
||||||
record_currthread (thread_num);
|
record_currthread (thread_num);
|
||||||
p = (unsigned char *) p_temp;
|
p = p_temp;
|
||||||
}
|
}
|
||||||
else if ((strncmp (p, "watch", p1 - p) == 0)
|
else if ((strncmp (p, "watch", p1 - p) == 0)
|
||||||
|| (strncmp (p, "rwatch", p1 - p) == 0)
|
|| (strncmp (p, "rwatch", p1 - p) == 0)
|
||||||
|
@ -2921,7 +2921,7 @@ Packet: '%s'\n"),
|
||||||
/* Silently skip unknown optional info. */
|
/* Silently skip unknown optional info. */
|
||||||
p_temp = strchr (p1 + 1, ';');
|
p_temp = strchr (p1 + 1, ';');
|
||||||
if (p_temp)
|
if (p_temp)
|
||||||
p = (unsigned char *) p_temp;
|
p = p_temp;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -3019,7 +3019,7 @@ static ptid_t
|
||||||
remote_async_wait (ptid_t ptid, struct target_waitstatus *status)
|
remote_async_wait (ptid_t ptid, struct target_waitstatus *status)
|
||||||
{
|
{
|
||||||
struct remote_state *rs = get_remote_state ();
|
struct remote_state *rs = get_remote_state ();
|
||||||
unsigned char *buf = alloca (rs->remote_packet_size);
|
char *buf = alloca (rs->remote_packet_size);
|
||||||
ULONGEST thread_num = -1;
|
ULONGEST thread_num = -1;
|
||||||
ULONGEST addr;
|
ULONGEST addr;
|
||||||
|
|
||||||
|
@ -3030,7 +3030,7 @@ remote_async_wait (ptid_t ptid, struct target_waitstatus *status)
|
||||||
|
|
||||||
while (1)
|
while (1)
|
||||||
{
|
{
|
||||||
unsigned char *p;
|
char *p;
|
||||||
|
|
||||||
if (!target_is_async_p ())
|
if (!target_is_async_p ())
|
||||||
ofunc = signal (SIGINT, remote_interrupt);
|
ofunc = signal (SIGINT, remote_interrupt);
|
||||||
|
@ -3057,7 +3057,7 @@ remote_async_wait (ptid_t ptid, struct target_waitstatus *status)
|
||||||
continue;
|
continue;
|
||||||
case 'T': /* Status with PC, SP, FP, ... */
|
case 'T': /* Status with PC, SP, FP, ... */
|
||||||
{
|
{
|
||||||
char regs[MAX_REGISTER_SIZE];
|
gdb_byte regs[MAX_REGISTER_SIZE];
|
||||||
|
|
||||||
/* Expedited reply, containing Signal, {regno, reg} repeat. */
|
/* Expedited reply, containing Signal, {regno, reg} repeat. */
|
||||||
/* format is: 'Tssn...:r...;n...:r...;n...:r...;#cc', where
|
/* format is: 'Tssn...:r...;n...:r...;n...:r...;#cc', where
|
||||||
|
@ -3069,7 +3069,7 @@ remote_async_wait (ptid_t ptid, struct target_waitstatus *status)
|
||||||
|
|
||||||
while (*p)
|
while (*p)
|
||||||
{
|
{
|
||||||
unsigned char *p1;
|
char *p1;
|
||||||
char *p_temp;
|
char *p_temp;
|
||||||
int fieldsize;
|
int fieldsize;
|
||||||
long pnum = 0;
|
long pnum = 0;
|
||||||
|
@ -3085,14 +3085,14 @@ remote_async_wait (ptid_t ptid, struct target_waitstatus *status)
|
||||||
{
|
{
|
||||||
/* Read the register number. */
|
/* Read the register number. */
|
||||||
pnum = strtol (p, &p_temp, 16);
|
pnum = strtol (p, &p_temp, 16);
|
||||||
p1 = (unsigned char *) p_temp;
|
p1 = p_temp;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
p1 = p;
|
p1 = p;
|
||||||
|
|
||||||
if (p1 == p) /* No register number present here. */
|
if (p1 == p) /* No register number present here. */
|
||||||
{
|
{
|
||||||
p1 = (unsigned char *) strchr (p, ':');
|
p1 = strchr (p, ':');
|
||||||
if (p1 == NULL)
|
if (p1 == NULL)
|
||||||
error (_("Malformed packet(a) (missing colon): %s\n\
|
error (_("Malformed packet(a) (missing colon): %s\n\
|
||||||
Packet: '%s'\n"),
|
Packet: '%s'\n"),
|
||||||
|
@ -3101,7 +3101,7 @@ Packet: '%s'\n"),
|
||||||
{
|
{
|
||||||
p_temp = unpack_varlen_hex (++p1, &thread_num);
|
p_temp = unpack_varlen_hex (++p1, &thread_num);
|
||||||
record_currthread (thread_num);
|
record_currthread (thread_num);
|
||||||
p = (unsigned char *) p_temp;
|
p = p_temp;
|
||||||
}
|
}
|
||||||
else if ((strncmp (p, "watch", p1 - p) == 0)
|
else if ((strncmp (p, "watch", p1 - p) == 0)
|
||||||
|| (strncmp (p, "rwatch", p1 - p) == 0)
|
|| (strncmp (p, "rwatch", p1 - p) == 0)
|
||||||
|
@ -3114,7 +3114,7 @@ Packet: '%s'\n"),
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
/* Silently skip unknown optional info. */
|
/* Silently skip unknown optional info. */
|
||||||
p_temp = (unsigned char *) strchr (p1 + 1, ';');
|
p_temp = strchr (p1 + 1, ';');
|
||||||
if (p_temp)
|
if (p_temp)
|
||||||
p = p_temp;
|
p = p_temp;
|
||||||
}
|
}
|
||||||
|
@ -3405,7 +3405,7 @@ remote_prepare_to_store (void)
|
||||||
{
|
{
|
||||||
struct remote_state *rs = get_remote_state ();
|
struct remote_state *rs = get_remote_state ();
|
||||||
int i;
|
int i;
|
||||||
char buf[MAX_REGISTER_SIZE];
|
gdb_byte buf[MAX_REGISTER_SIZE];
|
||||||
|
|
||||||
/* Make sure the entire registers array is valid. */
|
/* Make sure the entire registers array is valid. */
|
||||||
switch (remote_protocol_P.support)
|
switch (remote_protocol_P.support)
|
||||||
|
@ -3432,7 +3432,7 @@ store_register_using_P (int regnum)
|
||||||
struct packet_reg *reg = packet_reg_from_regnum (rs, regnum);
|
struct packet_reg *reg = packet_reg_from_regnum (rs, regnum);
|
||||||
/* Try storing a single register. */
|
/* Try storing a single register. */
|
||||||
char *buf = alloca (rs->remote_packet_size);
|
char *buf = alloca (rs->remote_packet_size);
|
||||||
char regp[MAX_REGISTER_SIZE];
|
gdb_byte regp[MAX_REGISTER_SIZE];
|
||||||
char *p;
|
char *p;
|
||||||
|
|
||||||
xsnprintf (buf, rs->remote_packet_size, "P%s=", phex_nz (reg->pnum, 0));
|
xsnprintf (buf, rs->remote_packet_size, "P%s=", phex_nz (reg->pnum, 0));
|
||||||
|
@ -3453,7 +3453,7 @@ remote_store_registers (int regnum)
|
||||||
{
|
{
|
||||||
struct remote_state *rs = get_remote_state ();
|
struct remote_state *rs = get_remote_state ();
|
||||||
char *buf;
|
char *buf;
|
||||||
char *regs;
|
gdb_byte *regs;
|
||||||
char *p;
|
char *p;
|
||||||
|
|
||||||
set_thread (PIDGET (inferior_ptid), 1);
|
set_thread (PIDGET (inferior_ptid), 1);
|
||||||
|
@ -3637,17 +3637,17 @@ check_binary_download (CORE_ADDR addr)
|
||||||
error. Only transfer a single packet. */
|
error. Only transfer a single packet. */
|
||||||
|
|
||||||
int
|
int
|
||||||
remote_write_bytes (CORE_ADDR memaddr, char *myaddr, int len)
|
remote_write_bytes (CORE_ADDR memaddr, gdb_byte *myaddr, int len)
|
||||||
{
|
{
|
||||||
unsigned char *buf;
|
char *buf;
|
||||||
unsigned char *p;
|
char *p;
|
||||||
unsigned char *plen;
|
char *plen;
|
||||||
long sizeof_buf;
|
long sizeof_buf;
|
||||||
int plenlen;
|
int plenlen;
|
||||||
int todo;
|
int todo;
|
||||||
int nr_bytes;
|
int nr_bytes;
|
||||||
int payload_size;
|
int payload_size;
|
||||||
unsigned char *payload_start;
|
char *payload_start;
|
||||||
|
|
||||||
/* Verify that the target can support a binary download. */
|
/* Verify that the target can support a binary download. */
|
||||||
check_binary_download (memaddr);
|
check_binary_download (memaddr);
|
||||||
|
@ -3797,7 +3797,7 @@ remote_write_bytes (CORE_ADDR memaddr, char *myaddr, int len)
|
||||||
handling partial reads. */
|
handling partial reads. */
|
||||||
|
|
||||||
int
|
int
|
||||||
remote_read_bytes (CORE_ADDR memaddr, char *myaddr, int len)
|
remote_read_bytes (CORE_ADDR memaddr, gdb_byte *myaddr, int len)
|
||||||
{
|
{
|
||||||
char *buf;
|
char *buf;
|
||||||
int max_buf_size; /* Max size of packet output buffer. */
|
int max_buf_size; /* Max size of packet output buffer. */
|
||||||
|
@ -5078,9 +5078,9 @@ remote_xfer_partial (struct target_ops *ops, enum target_object object,
|
||||||
if (i < 0)
|
if (i < 0)
|
||||||
return i;
|
return i;
|
||||||
|
|
||||||
getpkt (readbuf, len, 0);
|
getpkt ((char *) readbuf, len, 0);
|
||||||
|
|
||||||
return strlen (readbuf);
|
return strlen ((char *) readbuf);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
@ -5106,7 +5106,7 @@ remote_rcmd (char *command,
|
||||||
error (_("\"monitor\" command ``%s'' is too long."), command);
|
error (_("\"monitor\" command ``%s'' is too long."), command);
|
||||||
|
|
||||||
/* Encode the actual command. */
|
/* Encode the actual command. */
|
||||||
bin2hex (command, p, 0);
|
bin2hex ((gdb_byte *) command, p, 0);
|
||||||
|
|
||||||
if (putpkt (buf) < 0)
|
if (putpkt (buf) < 0)
|
||||||
error (_("Communication problem with target."));
|
error (_("Communication problem with target."));
|
||||||
|
|
|
@ -54,9 +54,9 @@ extern void remote_cisco_objfile_relocate (bfd_signed_vma text_off,
|
||||||
|
|
||||||
extern void async_remote_interrupt_twice (void *arg);
|
extern void async_remote_interrupt_twice (void *arg);
|
||||||
|
|
||||||
extern int remote_write_bytes (CORE_ADDR memaddr, char *myaddr, int len);
|
extern int remote_write_bytes (CORE_ADDR memaddr, gdb_byte *myaddr, int len);
|
||||||
|
|
||||||
extern int remote_read_bytes (CORE_ADDR memaddr, char *myaddr, int len);
|
extern int remote_read_bytes (CORE_ADDR memaddr, gdb_byte *myaddr, int len);
|
||||||
|
|
||||||
extern void (*deprecated_target_resume_hook) (void);
|
extern void (*deprecated_target_resume_hook) (void);
|
||||||
extern void (*deprecated_target_wait_loop_hook) (void);
|
extern void (*deprecated_target_wait_loop_hook) (void);
|
||||||
|
|
Loading…
Add table
Reference in a new issue