projects
/
deliverable
/
binutils-gdb.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
* remote.c, target.c: Strip trailing whitespace.
[deliverable/binutils-gdb.git]
/
gdb
/
remote.c
diff --git
a/gdb/remote.c
b/gdb/remote.c
index 7b4f55bef7c12f1266ece77c7463584a2f74b4be..6bc53ca29201056aee0e43209f79582d5ea41716 100644
(file)
--- a/
gdb/remote.c
+++ b/
gdb/remote.c
@@
-255,7
+255,7
@@
struct packet_reg
long regnum; /* GDB's internal register number. */
LONGEST pnum; /* Remote protocol register number. */
int in_g_packet; /* Always part of G packet. */
long regnum; /* GDB's internal register number. */
LONGEST pnum; /* Remote protocol register number. */
int in_g_packet; /* Always part of G packet. */
- /* long size in bytes; == register_size (current_gdbarch, regnum);
+ /* long size in bytes; == register_size (current_gdbarch, regnum);
at present. */
/* char *name; == REGISTER_NAME (regnum); at present. */
};
at present. */
/* char *name; == REGISTER_NAME (regnum); at present. */
};
@@
-1041,12
+1041,12
@@
typedef int gdb_threadref; /* Internal GDB thread reference. */
struct gdb_ext_thread_info
{
threadref threadid; /* External form of thread reference. */
struct gdb_ext_thread_info
{
threadref threadid; /* External form of thread reference. */
- int active; /* Has state interesting to GDB?
+ int active; /* Has state interesting to GDB?
regs, stack. */
regs, stack. */
- char display[256]; /* Brief state display, name,
+ char display[256]; /* Brief state display, name,
blocked/suspended. */
char shortname[32]; /* To be used to name threads. */
blocked/suspended. */
char shortname[32]; /* To be used to name threads. */
- char more_display[256]; /* Long info, statistics, queue depth,
+ char more_display[256]; /* Long info, statistics, queue depth,
whatever. */
};
whatever. */
};
@@
-1092,7
+1092,7
@@
static void copy_threadref (threadref *dest, threadref *src);
static int threadmatch (threadref *dest, threadref *src);
static int threadmatch (threadref *dest, threadref *src);
-static char *pack_threadinfo_request (char *pkt, int mode,
+static char *pack_threadinfo_request (char *pkt, int mode,
threadref *id);
static int remote_unpack_thread_info_response (char *pkt,
threadref *id);
static int remote_unpack_thread_info_response (char *pkt,
@@
-1101,7
+1101,7
@@
static int remote_unpack_thread_info_response (char *pkt,
*info);
*info);
-static int remote_get_threadinfo (threadref *threadid,
+static int remote_get_threadinfo (threadref *threadid,
int fieldset, /*TAG mask */
struct gdb_ext_thread_info *info);
int fieldset, /*TAG mask */
struct gdb_ext_thread_info *info);
@@
-1112,14
+1112,14
@@
static char *pack_threadlist_request (char *pkt, int startflag,
static int parse_threadlist_response (char *pkt,
int result_limit,
threadref *original_echo,
static int parse_threadlist_response (char *pkt,
int result_limit,
threadref *original_echo,
- threadref *resultlist,
+ threadref *resultlist,
int *doneflag);
static int remote_get_threadlist (int startflag,
threadref *nextthread,
int result_limit,
int *done,
int *doneflag);
static int remote_get_threadlist (int startflag,
threadref *nextthread,
int result_limit,
int *done,
- int *result_count,
+ int *result_count,
threadref *threadlist);
typedef int (*rmt_thread_action) (threadref *ref, void *context);
threadref *threadlist);
typedef int (*rmt_thread_action) (threadref *ref, void *context);
@@
-1819,13
+1819,13
@@
remote_threads_extra_info (struct thread_info *tp)
if (threadinfo.active)
{
if (*threadinfo.shortname)
if (threadinfo.active)
{
if (*threadinfo.shortname)
- n += xsnprintf (&display_buf[0], sizeof (display_buf) - n,
+ n += xsnprintf (&display_buf[0], sizeof (display_buf) - n,
" Name: %s,", threadinfo.shortname);
if (*threadinfo.display)
" Name: %s,", threadinfo.shortname);
if (*threadinfo.display)
- n += xsnprintf (&display_buf[n], sizeof (display_buf) - n,
+ n += xsnprintf (&display_buf[n], sizeof (display_buf) - n,
" State: %s,", threadinfo.display);
if (*threadinfo.more_display)
" State: %s,", threadinfo.display);
if (*threadinfo.more_display)
- n += xsnprintf (&display_buf[n], sizeof (display_buf) - n,
+ n += xsnprintf (&display_buf[n], sizeof (display_buf) - n,
" Priority: %s", threadinfo.more_display);
if (n > 0)
" Priority: %s", threadinfo.more_display);
if (n > 0)
@@
-1853,7
+1853,7
@@
extended_remote_restart (void)
putpkt (rs->buf);
remote_fileio_reset ();
putpkt (rs->buf);
remote_fileio_reset ();
-
+
/* Now query for status so this looks just like we restarted
gdbserver from scratch. */
putpkt ("?");
/* Now query for status so this looks just like we restarted
gdbserver from scratch. */
putpkt ("?");
@@
-2176,7
+2176,7
@@
remote_packet_size (const struct protocol_feature *feature,
static struct protocol_feature remote_protocol_features[] = {
{ "PacketSize", PACKET_DISABLE, remote_packet_size, -1 },
static struct protocol_feature remote_protocol_features[] = {
{ "PacketSize", PACKET_DISABLE, remote_packet_size, -1 },
- { "q
Part
:auxv:read", PACKET_DISABLE, remote_supported_packet,
+ { "q
Xfer
:auxv:read", PACKET_DISABLE, remote_supported_packet,
PACKET_qXfer_auxv }
};
PACKET_qXfer_auxv }
};
@@
-2813,10
+2813,10
@@
cleanup_sigint_signal_handler (void *dummy)
{
signal (SIGINT, handle_sigint);
if (sigint_remote_twice_token)
{
signal (SIGINT, handle_sigint);
if (sigint_remote_twice_token)
- delete_async_signal_handler ((struct async_signal_handler **)
+ delete_async_signal_handler ((struct async_signal_handler **)
&sigint_remote_twice_token);
if (sigint_remote_token)
&sigint_remote_twice_token);
if (sigint_remote_token)
- delete_async_signal_handler ((struct async_signal_handler **)
+ delete_async_signal_handler ((struct async_signal_handler **)
&sigint_remote_token);
}
&sigint_remote_token);
}
@@
-3069,18
+3069,18
@@
Packet: '%s'\n"),
phex_nz (pnum, 0), p, buf);
fieldsize = hex2bin (p, regs,
phex_nz (pnum, 0), p, buf);
fieldsize = hex2bin (p, regs,
- register_size (current_gdbarch,
+ register_size (current_gdbarch,
reg->regnum));
p += 2 * fieldsize;
reg->regnum));
p += 2 * fieldsize;
- if (fieldsize < register_size (current_gdbarch,
+ if (fieldsize < register_size (current_gdbarch,
reg->regnum))
warning (_("Remote reply is too short: %s"), buf);
reg->regnum))
warning (_("Remote reply is too short: %s"), buf);
- regcache_raw_supply (current_regcache,
+ regcache_raw_supply (current_regcache,
reg->regnum, regs);
}
if (*p++ != ';')
reg->regnum, regs);
}
if (*p++ != ';')
- error (_("Remote register badly formatted: %s\nhere: %s"),
+ error (_("Remote register badly formatted: %s\nhere: %s"),
buf, p);
}
}
buf, p);
}
}
@@
-3265,10
+3265,10
@@
Packet: '%s'\n"),
pnum, p, buf);
fieldsize = hex2bin (p, regs,
pnum, p, buf);
fieldsize = hex2bin (p, regs,
- register_size (current_gdbarch,
+ register_size (current_gdbarch,
reg->regnum));
p += 2 * fieldsize;
reg->regnum));
p += 2 * fieldsize;
- if (fieldsize < register_size (current_gdbarch,
+ if (fieldsize < register_size (current_gdbarch,
reg->regnum))
warning (_("Remote reply is too short: %s"), buf);
regcache_raw_supply (current_regcache, reg->regnum, regs);
reg->regnum))
warning (_("Remote reply is too short: %s"), buf);
regcache_raw_supply (current_regcache, reg->regnum, regs);
@@
-3853,7
+3853,7
@@
check_binary_download (CORE_ADDR addr)
error. Only transfer a single packet. */
int
error. Only transfer a single packet. */
int
-remote_write_bytes (CORE_ADDR memaddr, gdb_byte *myaddr, int len)
+remote_write_bytes (CORE_ADDR memaddr,
const
gdb_byte *myaddr, int len)
{
struct remote_state *rs = get_remote_state ();
char *buf;
{
struct remote_state *rs = get_remote_state ();
char *buf;
@@
-3865,11
+3865,20
@@
remote_write_bytes (CORE_ADDR memaddr, gdb_byte *myaddr, int len)
int payload_size;
int payload_length;
int payload_size;
int payload_length;
+ /* Should this be the selected frame? */
+ gdbarch_remote_translate_xfer_address (current_gdbarch,
+ current_regcache,
+ memaddr, len,
+ &memaddr, &len);
+
+ if (len <= 0)
+ return 0;
+
/* Verify that the target can support a binary download. */
check_binary_download (memaddr);
payload_size = get_memory_write_packet_size ();
/* Verify that the target can support a binary download. */
check_binary_download (memaddr);
payload_size = get_memory_write_packet_size ();
-
+
/* The packet buffer will be large enough for the payload;
get_memory_packet_size ensures this. */
buf = rs->buf;
/* The packet buffer will be large enough for the payload;
get_memory_packet_size ensures this. */
buf = rs->buf;
@@
-4023,6
+4032,15
@@
remote_read_bytes (CORE_ADDR memaddr, gdb_byte *myaddr, int len)
int max_buf_size; /* Max size of packet output buffer. */
int origlen;
int max_buf_size; /* Max size of packet output buffer. */
int origlen;
+ /* Should this be the selected frame? */
+ gdbarch_remote_translate_xfer_address (current_gdbarch,
+ current_regcache,
+ memaddr, len,
+ &memaddr, &len);
+
+ if (len <= 0)
+ return 0;
+
max_buf_size = get_memory_read_packet_size ();
/* The packet buffer will be large enough for the payload;
get_memory_packet_size ensures this. */
max_buf_size = get_memory_read_packet_size ();
/* The packet buffer will be large enough for the payload;
get_memory_packet_size ensures this. */
@@
-4090,22
+4108,12
@@
remote_xfer_memory (CORE_ADDR mem_addr, gdb_byte *buffer, int mem_len,
int should_write, struct mem_attrib *attrib,
struct target_ops *target)
{
int should_write, struct mem_attrib *attrib,
struct target_ops *target)
{
- CORE_ADDR targ_addr;
- int targ_len;
int res;
int res;
- /* Should this be the selected frame? */
- gdbarch_remote_translate_xfer_address (current_gdbarch,
- current_regcache,
- mem_addr, mem_len,
- &targ_addr, &targ_len);
- if (targ_len <= 0)
- return 0;
-
if (should_write)
if (should_write)
- res = remote_write_bytes (
targ_addr, buffer, targ
_len);
+ res = remote_write_bytes (
mem_addr, buffer, mem
_len);
else
else
- res = remote_read_bytes (
targ_addr, buffer, targ
_len);
+ res = remote_read_bytes (
mem_addr, buffer, mem
_len);
return res;
}
return res;
}
@@
-4266,7
+4274,7
@@
putpkt_binary (char *buf, int cnt)
case '$':
{
if (remote_debug)
case '$':
{
if (remote_debug)
- fprintf_unfiltered (gdb_stdlog,
+ fprintf_unfiltered (gdb_stdlog,
"Packet instead of Ack, ignoring it\n");
/* It's probably an old response sent because an ACK
was lost. Gobble up the packet and ack it so it
"Packet instead of Ack, ignoring it\n");
/* It's probably an old response sent because an ACK
was lost. Gobble up the packet and ack it so it
@@
-4392,14
+4400,14
@@
read_frame (char **buf_p,
if (check_0 == SERIAL_TIMEOUT || check_1 == SERIAL_TIMEOUT)
{
if (remote_debug)
if (check_0 == SERIAL_TIMEOUT || check_1 == SERIAL_TIMEOUT)
{
if (remote_debug)
- fputs_filtered ("Timeout in checksum, retrying\n",
+ fputs_filtered ("Timeout in checksum, retrying\n",
gdb_stdlog);
return -1;
}
else if (check_0 < 0 || check_1 < 0)
{
if (remote_debug)
gdb_stdlog);
return -1;
}
else if (check_0 < 0 || check_1 < 0)
{
if (remote_debug)
- fputs_filtered ("Communication error in checksum\n",
+ fputs_filtered ("Communication error in checksum\n",
gdb_stdlog);
return -1;
}
gdb_stdlog);
return -1;
}
@@
-4566,7
+4574,7
@@
getpkt_sane (char **buf, long *sizeof_buf, int forever)
serial_write (remote_desc, "-", 1);
}
serial_write (remote_desc, "-", 1);
}
- /* We have tried hard enough, and just can't receive the packet.
+ /* We have tried hard enough, and just can't receive the packet.
Give up. */
printf_unfiltered (_("Ignoring packet error, continuing...\n"));
Give up. */
printf_unfiltered (_("Ignoring packet error, continuing...\n"));
@@
-4981,7
+4989,7
@@
remote_insert_hw_breakpoint (struct bp_target_info *bp_tgt)
if (remote_protocol_packets[PACKET_Z1].support == PACKET_DISABLE)
return -1;
if (remote_protocol_packets[PACKET_Z1].support == PACKET_DISABLE)
return -1;
-
+
*(p++) = 'Z';
*(p++) = '1';
*(p++) = ',';
*(p++) = 'Z';
*(p++) = '1';
*(p++) = ',';
@@
-5270,22
+5278,16
@@
remote_xfer_partial (struct target_ops *ops, enum target_object object,
char *p2;
char query_type;
char *p2;
char query_type;
- /* Handle memory using
remote_xfer_memory
. */
+ /* Handle memory using
the standard memory routines
. */
if (object == TARGET_OBJECT_MEMORY)
{
int xfered;
errno = 0;
if (writebuf != NULL)
if (object == TARGET_OBJECT_MEMORY)
{
int xfered;
errno = 0;
if (writebuf != NULL)
- {
- void *buffer = xmalloc (len);
- struct cleanup *cleanup = make_cleanup (xfree, buffer);
- memcpy (buffer, writebuf, len);
- xfered = remote_xfer_memory (offset, buffer, len, 1, NULL, ops);
- do_cleanups (cleanup);
- }
+ xfered = remote_write_bytes (offset, writebuf, len);
else
else
- xfered = remote_
xfer_memory (offset, readbuf, len, 0, NULL, ops
);
+ xfered = remote_
read_bytes (offset, readbuf, len
);
if (xfered > 0)
return xfered;
if (xfered > 0)
return xfered;
@@
-5731,7
+5733,7
@@
remote_is_async_p (void)
will be able to delay notifying the client of an event until the
point where an entire packet has been received. */
will be able to delay notifying the client of an event until the
point where an entire packet has been received. */
-static void (*async_client_callback) (enum inferior_event_type event_type,
+static void (*async_client_callback) (enum inferior_event_type event_type,
void *context);
static void *async_client_context;
static serial_event_ftype remote_async_serial_handler;
void *context);
static void *async_client_context;
static serial_event_ftype remote_async_serial_handler;
@@
-5745,7
+5747,7
@@
remote_async_serial_handler (struct serial *scb, void *context)
}
static void
}
static void
-remote_async (void (*callback) (enum inferior_event_type event_type,
+remote_async (void (*callback) (enum inferior_event_type event_type,
void *context), void *context)
{
if (current_target.to_async_mask_value == 0)
void *context), void *context)
{
if (current_target.to_async_mask_value == 0)
@@
-5772,7
+5774,7
@@
static void
init_remote_async_ops (void)
{
remote_async_ops.to_shortname = "async";
init_remote_async_ops (void)
{
remote_async_ops.to_shortname = "async";
- remote_async_ops.to_longname =
+ remote_async_ops.to_longname =
"Remote serial target in async version of the gdb-specific protocol";
remote_async_ops.to_doc =
"Use a remote computer via a serial line, using a gdb-specific protocol.\n\
"Remote serial target in async version of the gdb-specific protocol";
remote_async_ops.to_doc =
"Use a remote computer via a serial line, using a gdb-specific protocol.\n\
@@
-5900,7
+5902,7
@@
_initialize_remote (void)
struct remote_state *rs;
/* architecture specific data */
struct remote_state *rs;
/* architecture specific data */
- remote_gdbarch_data_handle =
+ remote_gdbarch_data_handle =
gdbarch_data_register_post_init (init_remote_state);
/* Old tacky stuff. NOTE: This comes after the remote protocol so
gdbarch_data_register_post_init (init_remote_state);
/* Old tacky stuff. NOTE: This comes after the remote protocol so
This page took
0.030913 seconds
and
4
git commands to generate.