static long read_frame (char *buf, long sizeof_buf);
-static int remote_insert_breakpoint (CORE_ADDR, char *);
+static int remote_insert_breakpoint (CORE_ADDR, bfd_byte *);
-static int remote_remove_breakpoint (CORE_ADDR, char *);
+static int remote_remove_breakpoint (CORE_ADDR, bfd_byte *);
static int hexnumlen (ULONGEST num);
int regnum;
struct remote_state *rs = GDBARCH_OBSTACK_ZALLOC (gdbarch, struct remote_state);
- if (deprecated_register_bytes () != 0)
- rs->sizeof_g_packet = deprecated_register_bytes ();
- else
- rs->sizeof_g_packet = 0;
+ rs->sizeof_g_packet = 0;
/* Assume a 1:1 regnum<->pnum table. */
rs->regs = GDBARCH_OBSTACK_CALLOC (gdbarch, NUM_REGS + NUM_PSEUDO_REGS,
/* ...name = REGISTER_NAME (regnum); */
/* Compute packet size by accumulating the size of all registers. */
- if (deprecated_register_bytes () == 0)
- rs->sizeof_g_packet += register_size (current_gdbarch, regnum);
+ if (regnum < NUM_REGS)
+ rs->sizeof_g_packet += register_size (current_gdbarch, regnum);
}
/* Default maximum number of characters in a packet body. Many
remote_open_1 (char *name, int from_tty, struct target_ops *target,
int extended_p, int async_p)
{
- struct exception ex;
struct remote_state *rs = get_remote_state ();
if (name == 0)
error (_("To open a remote debug connection, you need to specify what\n"
been fixed - the function set_cmd_context() makes it possible for
all the ``target ....'' commands to share a common callback
function. See cli-dump.c. */
- ex = catch_exception (uiout, remote_start_remote, NULL, RETURN_MASK_ALL);
- if (ex.reason < 0)
- {
- pop_target ();
- if (async_p)
- wait_forever_enabled_p = 1;
- throw_exception (ex);
- }
+ {
+ struct gdb_exception ex
+ = catch_exception (uiout, remote_start_remote, NULL, RETURN_MASK_ALL);
+ if (ex.reason < 0)
+ {
+ pop_target ();
+ if (async_p)
+ wait_forever_enabled_p = 1;
+ throw_exception (ex);
+ }
+ }
if (async_p)
wait_forever_enabled_p = 1;
static void
remote_disconnect (char *args, int from_tty)
{
- struct remote_state *rs = get_remote_state ();
- char *buf = alloca (rs->remote_packet_size);
-
if (args)
error (_("Argument given to \"detach\" when remotely debugging."));
struct remote_state *rs = get_remote_state ();
char *buf = alloca (rs->remote_packet_size);
int pid = PIDGET (ptid);
- char *p;
last_sent_signal = siggnal;
last_sent_step = step;
continue;
case 'T': /* Status with PC, SP, FP, ... */
{
- int i;
char regs[MAX_REGISTER_SIZE];
/* Expedited reply, containing Signal, {regno, reg} repeat. */
continue;
case 'T': /* Status with PC, SP, FP, ... */
{
- int i;
char regs[MAX_REGISTER_SIZE];
/* Expedited reply, containing Signal, {regno, reg} repeat. */
char *buf = alloca (rs->remote_packet_size);
char regp[MAX_REGISTER_SIZE];
char *p;
- int i;
sprintf (buf, "P%s=", phex_nz (reg->pnum, 0));
p = buf + strlen (buf);
struct remote_state *rs = get_remote_state ();
char *buf;
char *regs;
- int i;
char *p;
set_thread (PIDGET (inferior_ptid), 1);
of bytes returned by BREAKPOINT_FROM_PC. */
static int
-remote_insert_breakpoint (CORE_ADDR addr, char *contents_cache)
+remote_insert_breakpoint (CORE_ADDR addr, bfd_byte *contents_cache)
{
struct remote_state *rs = get_remote_state ();
#ifdef DEPRECATED_REMOTE_BREAKPOINT
}
static int
-remote_remove_breakpoint (CORE_ADDR addr, char *contents_cache)
+remote_remove_breakpoint (CORE_ADDR addr, bfd_byte *contents_cache)
{
struct remote_state *rs = get_remote_state ();
int bp_size;
struct ui_file *outbuf)
{
struct remote_state *rs = get_remote_state ();
- int i;
char *buf = alloca (rs->remote_packet_size);
char *p = buf;
struct remote_state *rs = get_remote_state ();
char *buf = alloca (rs->remote_packet_size);
char *p = buf;
+ enum packet_result result;
strcpy (p, "qGetTLSAddr:");
p += strlen (p);
putpkt (buf);
getpkt (buf, rs->remote_packet_size, 0);
- if (packet_ok (buf, &remote_protocol_qGetTLSAddr) == PACKET_OK)
+ result = packet_ok (buf, &remote_protocol_qGetTLSAddr);
+ if (result == PACKET_OK)
{
ULONGEST result;
unpack_varlen_hex (buf, &result);
return result;
}
+ else if (result == PACKET_UNKNOWN)
+ throw_error (TLS_GENERIC_ERROR,
+ _("Remote target doesn't support qGetTLSAddr packet"));
else
- {
- struct exception e
- = { RETURN_ERROR, TLS_GENERIC_ERROR,
- "Remote target failed to process qGetTLSAddr request" };
- throw_exception (e);
-
- }
+ throw_error (TLS_GENERIC_ERROR,
+ _("Remote target failed to process qGetTLSAddr request"));
}
else
- {
- struct exception e
- = { RETURN_ERROR, TLS_GENERIC_ERROR,
- "TLS not supported or disabled on this target" };
- throw_exception (e);
- }
+ throw_error (TLS_GENERIC_ERROR,
+ _("TLS not supported or disabled on this target"));
/* Not reached. */
return 0;
}
{
static struct cmd_list_element *remote_set_cmdlist;
static struct cmd_list_element *remote_show_cmdlist;
- struct cmd_list_element *tmpcmd;
/* architecture specific data */
remote_gdbarch_data_handle =