mirror of
https://github.com/espressif/binutils-gdb.git
synced 2025-06-20 09:58:19 +08:00
2009-08-12 Michael Snyder <msnyder@vmware.com>
* remote.c (remote_add_inferior): Remove unused local. (remote_add_thread): Ditto. (read_ptid): Ditto. (remote_current_thread): Ditto. (remote_stop_ns): Ditto. (remote_parse_stop_reply): Ditto. (remote_get_pending_stop_replies): Ditto. (remote_wait_ns): Ditto. (remote_wait_as): Ditto. (send_g_packet): Ditto. (remote_fetch_registers): Ditto. (store_register_using_P): Ditto. (remote_store_registers): Ditto. (remote_remove_breakpoint): Ditto. (remote_write_qxfer): Ditto. (remote_read_qxfer): Ditto.
This commit is contained in:
@ -1,3 +1,22 @@
|
|||||||
|
2009-08-12 Michael Snyder <msnyder@vmware.com>
|
||||||
|
|
||||||
|
* remote.c (remote_add_inferior): Remove unused local.
|
||||||
|
(remote_add_thread): Ditto.
|
||||||
|
(read_ptid): Ditto.
|
||||||
|
(remote_current_thread): Ditto.
|
||||||
|
(remote_stop_ns): Ditto.
|
||||||
|
(remote_parse_stop_reply): Ditto.
|
||||||
|
(remote_get_pending_stop_replies): Ditto.
|
||||||
|
(remote_wait_ns): Ditto.
|
||||||
|
(remote_wait_as): Ditto.
|
||||||
|
(send_g_packet): Ditto.
|
||||||
|
(remote_fetch_registers): Ditto.
|
||||||
|
(store_register_using_P): Ditto.
|
||||||
|
(remote_store_registers): Ditto.
|
||||||
|
(remote_remove_breakpoint): Ditto.
|
||||||
|
(remote_write_qxfer): Ditto.
|
||||||
|
(remote_read_qxfer): Ditto.
|
||||||
|
|
||||||
2009-08-11 Tom Tromey <tromey@redhat.com>
|
2009-08-11 Tom Tromey <tromey@redhat.com>
|
||||||
|
|
||||||
* dwarf2loc.c (dwarf2_evaluate_loc_desc): Make a cleanup.
|
* dwarf2loc.c (dwarf2_evaluate_loc_desc): Make a cleanup.
|
||||||
|
224
gdb/remote.c
224
gdb/remote.c
@ -1170,7 +1170,6 @@ remote_query_attached (int pid)
|
|||||||
static struct inferior *
|
static struct inferior *
|
||||||
remote_add_inferior (int pid, int attached)
|
remote_add_inferior (int pid, int attached)
|
||||||
{
|
{
|
||||||
struct remote_state *rs = get_remote_state ();
|
|
||||||
struct inferior *inf;
|
struct inferior *inf;
|
||||||
|
|
||||||
/* Check whether this process we're learning about is to be
|
/* Check whether this process we're learning about is to be
|
||||||
@ -1207,8 +1206,6 @@ remote_add_thread (ptid_t ptid, int running)
|
|||||||
static void
|
static void
|
||||||
remote_notice_new_inferior (ptid_t currthread, int running)
|
remote_notice_new_inferior (ptid_t currthread, int running)
|
||||||
{
|
{
|
||||||
struct remote_state *rs = get_remote_state ();
|
|
||||||
|
|
||||||
/* If this is a new thread, add it to GDB's thread list.
|
/* If this is a new thread, add it to GDB's thread list.
|
||||||
If we leave it up to WFI to do this, bad things will happen. */
|
If we leave it up to WFI to do this, bad things will happen. */
|
||||||
|
|
||||||
@ -1426,7 +1423,6 @@ static int
|
|||||||
remote_thread_alive (struct target_ops *ops, ptid_t ptid)
|
remote_thread_alive (struct target_ops *ops, ptid_t ptid)
|
||||||
{
|
{
|
||||||
struct remote_state *rs = get_remote_state ();
|
struct remote_state *rs = get_remote_state ();
|
||||||
int tid = ptid_get_tid (ptid);
|
|
||||||
char *p, *endp;
|
char *p, *endp;
|
||||||
|
|
||||||
if (ptid_equal (ptid, magic_null_ptid))
|
if (ptid_equal (ptid, magic_null_ptid))
|
||||||
@ -1602,7 +1598,6 @@ read_ptid (char *buf, char **obuf)
|
|||||||
char *p = buf;
|
char *p = buf;
|
||||||
char *pp;
|
char *pp;
|
||||||
ULONGEST pid = 0, tid = 0;
|
ULONGEST pid = 0, tid = 0;
|
||||||
ptid_t ptid;
|
|
||||||
|
|
||||||
if (*p == 'p')
|
if (*p == 'p')
|
||||||
{
|
{
|
||||||
@ -2198,9 +2193,6 @@ static ptid_t
|
|||||||
remote_current_thread (ptid_t oldpid)
|
remote_current_thread (ptid_t oldpid)
|
||||||
{
|
{
|
||||||
struct remote_state *rs = get_remote_state ();
|
struct remote_state *rs = get_remote_state ();
|
||||||
char *p = rs->buf;
|
|
||||||
int tid;
|
|
||||||
int pid;
|
|
||||||
|
|
||||||
putpkt ("qC");
|
putpkt ("qC");
|
||||||
getpkt (&rs->buf, &rs->buf_size, 0);
|
getpkt (&rs->buf, &rs->buf_size, 0);
|
||||||
@ -3954,7 +3946,6 @@ remote_stop_ns (ptid_t ptid)
|
|||||||
struct remote_state *rs = get_remote_state ();
|
struct remote_state *rs = get_remote_state ();
|
||||||
char *p = rs->buf;
|
char *p = rs->buf;
|
||||||
char *endp = rs->buf + get_remote_packet_size ();
|
char *endp = rs->buf + get_remote_packet_size ();
|
||||||
struct stop_reply *reply, *next;
|
|
||||||
|
|
||||||
if (remote_protocol_packets[PACKET_vCont].support == PACKET_SUPPORT_UNKNOWN)
|
if (remote_protocol_packets[PACKET_vCont].support == PACKET_SUPPORT_UNKNOWN)
|
||||||
remote_vcont_probe (rs);
|
remote_vcont_probe (rs);
|
||||||
@ -4309,122 +4300,118 @@ remote_parse_stop_reply (char *buf, struct stop_reply *event)
|
|||||||
switch (buf[0])
|
switch (buf[0])
|
||||||
{
|
{
|
||||||
case 'T': /* Status with PC, SP, FP, ... */
|
case 'T': /* Status with PC, SP, FP, ... */
|
||||||
{
|
/* Expedited reply, containing Signal, {regno, reg} repeat. */
|
||||||
gdb_byte regs[MAX_REGISTER_SIZE];
|
/* format is: 'Tssn...:r...;n...:r...;n...:r...;#cc', where
|
||||||
|
ss = signal number
|
||||||
|
n... = register number
|
||||||
|
r... = register contents
|
||||||
|
*/
|
||||||
|
|
||||||
/* Expedited reply, containing Signal, {regno, reg} repeat. */
|
p = &buf[3]; /* after Txx */
|
||||||
/* format is: 'Tssn...:r...;n...:r...;n...:r...;#cc', where
|
while (*p)
|
||||||
ss = signal number
|
{
|
||||||
n... = register number
|
char *p1;
|
||||||
r... = register contents
|
char *p_temp;
|
||||||
*/
|
int fieldsize;
|
||||||
|
LONGEST pnum = 0;
|
||||||
|
|
||||||
p = &buf[3]; /* after Txx */
|
/* If the packet contains a register number, save it in
|
||||||
while (*p)
|
pnum and set p1 to point to the character following it.
|
||||||
{
|
Otherwise p1 points to p. */
|
||||||
char *p1;
|
|
||||||
char *p_temp;
|
|
||||||
int fieldsize;
|
|
||||||
LONGEST pnum = 0;
|
|
||||||
|
|
||||||
/* If the packet contains a register number, save it in
|
/* If this packet is an awatch packet, don't parse the 'a'
|
||||||
pnum and set p1 to point to the character following it.
|
as a register number. */
|
||||||
Otherwise p1 points to p. */
|
|
||||||
|
|
||||||
/* If this packet is an awatch packet, don't parse the 'a'
|
if (strncmp (p, "awatch", strlen("awatch")) != 0)
|
||||||
as a register number. */
|
{
|
||||||
|
/* Read the ``P'' register number. */
|
||||||
|
pnum = strtol (p, &p_temp, 16);
|
||||||
|
p1 = p_temp;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
p1 = p;
|
||||||
|
|
||||||
if (strncmp (p, "awatch", strlen("awatch")) != 0)
|
if (p1 == p) /* No register number present here. */
|
||||||
{
|
{
|
||||||
/* Read the ``P'' register number. */
|
p1 = strchr (p, ':');
|
||||||
pnum = strtol (p, &p_temp, 16);
|
if (p1 == NULL)
|
||||||
p1 = p_temp;
|
error (_("Malformed packet(a) (missing colon): %s\n\
|
||||||
}
|
|
||||||
else
|
|
||||||
p1 = p;
|
|
||||||
|
|
||||||
if (p1 == p) /* No register number present here. */
|
|
||||||
{
|
|
||||||
p1 = strchr (p, ':');
|
|
||||||
if (p1 == NULL)
|
|
||||||
error (_("Malformed packet(a) (missing colon): %s\n\
|
|
||||||
Packet: '%s'\n"),
|
Packet: '%s'\n"),
|
||||||
p, buf);
|
p, buf);
|
||||||
if (strncmp (p, "thread", p1 - p) == 0)
|
if (strncmp (p, "thread", p1 - p) == 0)
|
||||||
event->ptid = read_ptid (++p1, &p);
|
event->ptid = read_ptid (++p1, &p);
|
||||||
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)
|
||||||
|| (strncmp (p, "awatch", p1 - p) == 0))
|
|| (strncmp (p, "awatch", p1 - p) == 0))
|
||||||
{
|
{
|
||||||
event->stopped_by_watchpoint_p = 1;
|
event->stopped_by_watchpoint_p = 1;
|
||||||
p = unpack_varlen_hex (++p1, &addr);
|
p = unpack_varlen_hex (++p1, &addr);
|
||||||
event->watch_data_address = (CORE_ADDR) addr;
|
event->watch_data_address = (CORE_ADDR) addr;
|
||||||
}
|
}
|
||||||
else if (strncmp (p, "library", p1 - p) == 0)
|
else if (strncmp (p, "library", p1 - p) == 0)
|
||||||
{
|
{
|
||||||
p1++;
|
p1++;
|
||||||
p_temp = p1;
|
p_temp = p1;
|
||||||
while (*p_temp && *p_temp != ';')
|
while (*p_temp && *p_temp != ';')
|
||||||
p_temp++;
|
p_temp++;
|
||||||
|
|
||||||
event->solibs_changed = 1;
|
event->solibs_changed = 1;
|
||||||
|
p = p_temp;
|
||||||
|
}
|
||||||
|
else if (strncmp (p, "replaylog", p1 - p) == 0)
|
||||||
|
{
|
||||||
|
/* NO_HISTORY event.
|
||||||
|
p1 will indicate "begin" or "end", but
|
||||||
|
it makes no difference for now, so ignore it. */
|
||||||
|
event->replay_event = 1;
|
||||||
|
p_temp = strchr (p1 + 1, ';');
|
||||||
|
if (p_temp)
|
||||||
p = p_temp;
|
p = p_temp;
|
||||||
}
|
}
|
||||||
else if (strncmp (p, "replaylog", p1 - p) == 0)
|
else
|
||||||
{
|
{
|
||||||
/* NO_HISTORY event.
|
/* Silently skip unknown optional info. */
|
||||||
p1 will indicate "begin" or "end", but
|
p_temp = strchr (p1 + 1, ';');
|
||||||
it makes no difference for now, so ignore it. */
|
if (p_temp)
|
||||||
event->replay_event = 1;
|
p = p_temp;
|
||||||
p_temp = strchr (p1 + 1, ';');
|
}
|
||||||
if (p_temp)
|
}
|
||||||
p = p_temp;
|
else
|
||||||
}
|
{
|
||||||
else
|
struct packet_reg *reg = packet_reg_from_pnum (rsa, pnum);
|
||||||
{
|
cached_reg_t cached_reg;
|
||||||
/* Silently skip unknown optional info. */
|
|
||||||
p_temp = strchr (p1 + 1, ';');
|
|
||||||
if (p_temp)
|
|
||||||
p = p_temp;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
struct packet_reg *reg = packet_reg_from_pnum (rsa, pnum);
|
|
||||||
cached_reg_t cached_reg;
|
|
||||||
|
|
||||||
p = p1;
|
p = p1;
|
||||||
|
|
||||||
if (*p != ':')
|
if (*p != ':')
|
||||||
error (_("Malformed packet(b) (missing colon): %s\n\
|
error (_("Malformed packet(b) (missing colon): %s\n\
|
||||||
Packet: '%s'\n"),
|
Packet: '%s'\n"),
|
||||||
p, buf);
|
p, buf);
|
||||||
++p;
|
++p;
|
||||||
|
|
||||||
if (reg == NULL)
|
if (reg == NULL)
|
||||||
error (_("Remote sent bad register number %s: %s\n\
|
error (_("Remote sent bad register number %s: %s\n\
|
||||||
Packet: '%s'\n"),
|
Packet: '%s'\n"),
|
||||||
phex_nz (pnum, 0), p, buf);
|
phex_nz (pnum, 0), p, buf);
|
||||||
|
|
||||||
cached_reg.num = reg->regnum;
|
cached_reg.num = reg->regnum;
|
||||||
|
|
||||||
fieldsize = hex2bin (p, cached_reg.data,
|
fieldsize = hex2bin (p, cached_reg.data,
|
||||||
register_size (target_gdbarch,
|
register_size (target_gdbarch,
|
||||||
reg->regnum));
|
reg->regnum));
|
||||||
p += 2 * fieldsize;
|
p += 2 * fieldsize;
|
||||||
if (fieldsize < register_size (target_gdbarch,
|
if (fieldsize < register_size (target_gdbarch,
|
||||||
reg->regnum))
|
reg->regnum))
|
||||||
warning (_("Remote reply is too short: %s"), buf);
|
warning (_("Remote reply is too short: %s"), buf);
|
||||||
|
|
||||||
VEC_safe_push (cached_reg_t, event->regcache, &cached_reg);
|
VEC_safe_push (cached_reg_t, event->regcache, &cached_reg);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (*p != ';')
|
if (*p != ';')
|
||||||
error (_("Remote register badly formatted: %s\nhere: %s"),
|
error (_("Remote register badly formatted: %s\nhere: %s"),
|
||||||
buf, p);
|
buf, p);
|
||||||
++p;
|
++p;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
/* fall through */
|
/* fall through */
|
||||||
case 'S': /* Old style status, just signal only. */
|
case 'S': /* Old style status, just signal only. */
|
||||||
if (event->solibs_changed)
|
if (event->solibs_changed)
|
||||||
@ -4540,7 +4527,6 @@ static void
|
|||||||
remote_get_pending_stop_replies (void)
|
remote_get_pending_stop_replies (void)
|
||||||
{
|
{
|
||||||
struct remote_state *rs = get_remote_state ();
|
struct remote_state *rs = get_remote_state ();
|
||||||
int ret;
|
|
||||||
|
|
||||||
if (pending_stop_reply)
|
if (pending_stop_reply)
|
||||||
{
|
{
|
||||||
@ -4634,8 +4620,6 @@ static ptid_t
|
|||||||
remote_wait_ns (ptid_t ptid, struct target_waitstatus *status, int options)
|
remote_wait_ns (ptid_t ptid, struct target_waitstatus *status, int options)
|
||||||
{
|
{
|
||||||
struct remote_state *rs = get_remote_state ();
|
struct remote_state *rs = get_remote_state ();
|
||||||
struct remote_arch_state *rsa = get_remote_arch_state ();
|
|
||||||
ptid_t event_ptid = null_ptid;
|
|
||||||
struct stop_reply *stop_reply;
|
struct stop_reply *stop_reply;
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
@ -4694,11 +4678,8 @@ static ptid_t
|
|||||||
remote_wait_as (ptid_t ptid, struct target_waitstatus *status, int options)
|
remote_wait_as (ptid_t ptid, struct target_waitstatus *status, int options)
|
||||||
{
|
{
|
||||||
struct remote_state *rs = get_remote_state ();
|
struct remote_state *rs = get_remote_state ();
|
||||||
struct remote_arch_state *rsa = get_remote_arch_state ();
|
|
||||||
ptid_t event_ptid = null_ptid;
|
ptid_t event_ptid = null_ptid;
|
||||||
ULONGEST addr;
|
char *buf;
|
||||||
int solibs_changed = 0;
|
|
||||||
char *buf, *p;
|
|
||||||
struct stop_reply *stop_reply;
|
struct stop_reply *stop_reply;
|
||||||
|
|
||||||
again:
|
again:
|
||||||
@ -4919,9 +4900,7 @@ static int
|
|||||||
send_g_packet (void)
|
send_g_packet (void)
|
||||||
{
|
{
|
||||||
struct remote_state *rs = get_remote_state ();
|
struct remote_state *rs = get_remote_state ();
|
||||||
int i, buf_len;
|
int buf_len;
|
||||||
char *p;
|
|
||||||
char *regs;
|
|
||||||
|
|
||||||
sprintf (rs->buf, "g");
|
sprintf (rs->buf, "g");
|
||||||
remote_send (&rs->buf, &rs->buf_size);
|
remote_send (&rs->buf, &rs->buf_size);
|
||||||
@ -5052,7 +5031,6 @@ static void
|
|||||||
remote_fetch_registers (struct target_ops *ops,
|
remote_fetch_registers (struct target_ops *ops,
|
||||||
struct regcache *regcache, int regnum)
|
struct regcache *regcache, int regnum)
|
||||||
{
|
{
|
||||||
struct remote_state *rs = get_remote_state ();
|
|
||||||
struct remote_arch_state *rsa = get_remote_arch_state ();
|
struct remote_arch_state *rsa = get_remote_arch_state ();
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
@ -5129,7 +5107,6 @@ store_register_using_P (const struct regcache *regcache,
|
|||||||
{
|
{
|
||||||
struct gdbarch *gdbarch = get_regcache_arch (regcache);
|
struct gdbarch *gdbarch = get_regcache_arch (regcache);
|
||||||
struct remote_state *rs = get_remote_state ();
|
struct remote_state *rs = get_remote_state ();
|
||||||
struct remote_arch_state *rsa = get_remote_arch_state ();
|
|
||||||
/* Try storing a single register. */
|
/* Try storing a single register. */
|
||||||
char *buf = rs->buf;
|
char *buf = rs->buf;
|
||||||
gdb_byte regp[MAX_REGISTER_SIZE];
|
gdb_byte regp[MAX_REGISTER_SIZE];
|
||||||
@ -5208,7 +5185,6 @@ static void
|
|||||||
remote_store_registers (struct target_ops *ops,
|
remote_store_registers (struct target_ops *ops,
|
||||||
struct regcache *regcache, int regnum)
|
struct regcache *regcache, int regnum)
|
||||||
{
|
{
|
||||||
struct remote_state *rs = get_remote_state ();
|
|
||||||
struct remote_arch_state *rsa = get_remote_arch_state ();
|
struct remote_arch_state *rsa = get_remote_arch_state ();
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
@ -6699,7 +6675,6 @@ static int
|
|||||||
extended_remote_run (char *args)
|
extended_remote_run (char *args)
|
||||||
{
|
{
|
||||||
struct remote_state *rs = get_remote_state ();
|
struct remote_state *rs = get_remote_state ();
|
||||||
char *p;
|
|
||||||
int len;
|
int len;
|
||||||
|
|
||||||
/* If the user has disabled vRun support, or we have detected that
|
/* If the user has disabled vRun support, or we have detected that
|
||||||
@ -6871,7 +6846,6 @@ remote_remove_breakpoint (struct gdbarch *gdbarch,
|
|||||||
{
|
{
|
||||||
CORE_ADDR addr = bp_tgt->placed_address;
|
CORE_ADDR addr = bp_tgt->placed_address;
|
||||||
struct remote_state *rs = get_remote_state ();
|
struct remote_state *rs = get_remote_state ();
|
||||||
int bp_size;
|
|
||||||
|
|
||||||
if (remote_protocol_packets[PACKET_Z0].support != PACKET_DISABLE)
|
if (remote_protocol_packets[PACKET_Z0].support != PACKET_DISABLE)
|
||||||
{
|
{
|
||||||
@ -7237,7 +7211,6 @@ remote_write_qxfer (struct target_ops *ops, const char *object_name,
|
|||||||
{
|
{
|
||||||
int i, buf_len;
|
int i, buf_len;
|
||||||
ULONGEST n;
|
ULONGEST n;
|
||||||
gdb_byte *wbuf;
|
|
||||||
struct remote_state *rs = get_remote_state ();
|
struct remote_state *rs = get_remote_state ();
|
||||||
int max_size = get_memory_write_packet_size ();
|
int max_size = get_memory_write_packet_size ();
|
||||||
|
|
||||||
@ -7282,7 +7255,6 @@ remote_read_qxfer (struct target_ops *ops, const char *object_name,
|
|||||||
static ULONGEST finished_offset;
|
static ULONGEST finished_offset;
|
||||||
|
|
||||||
struct remote_state *rs = get_remote_state ();
|
struct remote_state *rs = get_remote_state ();
|
||||||
unsigned int total = 0;
|
|
||||||
LONGEST i, n, packet_len;
|
LONGEST i, n, packet_len;
|
||||||
|
|
||||||
if (packet->support == PACKET_DISABLE)
|
if (packet->support == PACKET_DISABLE)
|
||||||
@ -8613,7 +8585,7 @@ void
|
|||||||
remote_file_get (const char *remote_file, const char *local_file, int from_tty)
|
remote_file_get (const char *remote_file, const char *local_file, int from_tty)
|
||||||
{
|
{
|
||||||
struct cleanup *back_to, *close_cleanup;
|
struct cleanup *back_to, *close_cleanup;
|
||||||
int retcode, fd, remote_errno, bytes, io_size;
|
int fd, remote_errno, bytes, io_size;
|
||||||
FILE *file;
|
FILE *file;
|
||||||
gdb_byte *buffer;
|
gdb_byte *buffer;
|
||||||
ULONGEST offset;
|
ULONGEST offset;
|
||||||
|
Reference in New Issue
Block a user