* gdb.texinfo (SVR4 Process Information, The isatty call)
[deliverable/binutils-gdb.git] / gdb / remote.c
index 7ad9ec26052d90022702593d7b6121314f0a7d72..a46b92fd7b73b3f07447c95ca83d15da44481d85 100644 (file)
@@ -136,9 +136,9 @@ static void get_offsets (void);
 
 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);
 
@@ -248,10 +248,7 @@ init_remote_state (struct gdbarch *gdbarch)
   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,
@@ -266,8 +263,8 @@ init_remote_state (struct gdbarch *gdbarch)
       /* ...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
@@ -2179,7 +2176,6 @@ static void
 remote_open_1 (char *name, int from_tty, struct target_ops *target,
               int extended_p, int async_p)
 {
-  struct gdb_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"
@@ -2282,14 +2278,17 @@ remote_open_1 (char *name, int from_tty, struct target_ops *target,
      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;
@@ -4498,7 +4497,7 @@ static unsigned char little_break_insn[] = DEPRECATED_LITTLE_REMOTE_BREAKPOINT;
    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
@@ -4558,7 +4557,7 @@ remote_insert_breakpoint (CORE_ADDR addr, char *contents_cache)
 }
 
 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;
@@ -5357,28 +5356,15 @@ remote_get_thread_local_address (ptid_t ptid, CORE_ADDR lm, CORE_ADDR offset)
          return result;
        }
       else if (result == PACKET_UNKNOWN)
-       {
-         struct gdb_exception e
-           = { RETURN_ERROR, TLS_GENERIC_ERROR,
-               "Remote target doesn't support qGetTLSAddr packet" };
-         throw_exception (e);
-       }
+       throw_error (TLS_GENERIC_ERROR,
+                    _("Remote target doesn't support qGetTLSAddr packet"));
       else
-       {
-         struct gdb_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 gdb_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;
 }
This page took 0.024724 seconds and 4 git commands to generate.