2002-04-24 Michael Snyder <msnyder@redhat.com>
[deliverable/binutils-gdb.git] / gdb / remote.c
index 9b2c88353a024df4be882069adeef78a3224dea8..a7736800edf1b323a4a0a96394a9fdacbd0b07a3 100644 (file)
@@ -1,6 +1,7 @@
 /* Remote target communications for serial-line targets in custom GDB protocol
-   Copyright 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997,
-   1998, 1999, 2000, 2001 Free Software Foundation, Inc.
+
+   Copyright 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996,
+   1997, 1998, 1999, 2000, 2001, 2002 Free Software Foundation, Inc.
 
    This file is part of GDB.
 
@@ -210,7 +211,7 @@ void open_remote_target (char *, int, struct target_ops *, int);
 
 void _initialize_remote (void);
 
-/* Description of the remote protocol.  Strictly speeking, when the
+/* Description of the remote protocol.  Strictly speaking, when the
    target is open()ed, remote.c should create a per-target description
    of the remote protocol using that target's architecture.
    Unfortunatly, the target stack doesn't include local state.  For
@@ -674,7 +675,7 @@ add_packet_config_cmd (struct packet_config *config,
   set_cmd = add_set_auto_boolean_cmd (cmd_name, class_obscure,
                                &config->detect, set_doc,
                                set_remote_list);
-  set_cmd->function.sfunc = set_func;
+  set_cmd_sfunc (set_cmd, set_func);
   show_cmd = add_cmd (cmd_name, class_obscure, show_func, show_doc,
                      show_remote_list);
   /* set/show remote NAME-packet {auto,on,off} -- legacy */
@@ -1001,14 +1002,9 @@ record_currthread (int currthread)
   if (!in_thread_list (pid_to_ptid (currthread)))
     {
       add_thread (pid_to_ptid (currthread));
-#ifdef UI_OUT
       ui_out_text (uiout, "[New ");
       ui_out_text (uiout, target_pid_to_str (pid_to_ptid (currthread)));
       ui_out_text (uiout, "]\n");
-#else
-      printf_filtered ("[New %s]\n",
-                       target_pid_to_str (pid_to_ptid (currthread)));
-#endif
     }
 }
 
@@ -2881,7 +2877,7 @@ interrupt_query (void)
 Give up (and stop debugging it)? "))
     {
       target_mourn_inferior ();
-      return_to_top_level (RETURN_QUIT);
+      throw_exception (RETURN_QUIT);
     }
 
   target_terminal_inferior ();
@@ -3943,8 +3939,7 @@ remote_read_bytes (CORE_ADDR memaddr, char *myaddr, int len)
 /* ARGSUSED */
 static int
 remote_xfer_memory (CORE_ADDR mem_addr, char *buffer, int mem_len,
-                   int should_write,
-                   struct mem_attrib *attrib ATTRIBUTE_UNUSED,
+                   int should_write, struct mem_attrib *attrib,
                    struct target_ops *target)
 {
   CORE_ADDR targ_addr;
@@ -5018,8 +5013,8 @@ compare_sections_command (char *args, int from_tty)
 
       getpkt (buf, (rs->remote_packet_size), 0);
       if (buf[0] == 'E')
-       error ("target memory fault, section %s, range 0x%08x -- 0x%08x",
-              sectname, lma, lma + size);
+       error ("target memory fault, section %s, range 0x%s -- 0x%s",
+              sectname, paddr (lma), paddr (lma + size));
       if (buf[0] != 'C')
        error ("remote target does not support this operation");
 
@@ -5722,7 +5717,7 @@ minitelnet (void)
              if (query ("Interrupt GDB? "))
                {
                  printf_filtered ("Interrupted by user.\n");
-                 return_to_top_level (RETURN_QUIT);
+                 throw_exception (RETURN_QUIT);
                }
              quit_count = 0;
            }
@@ -6104,6 +6099,10 @@ in a memory packet.\n",
                         show_remote_protocol_e_packet_cmd,
                         &remote_set_cmdlist, &remote_show_cmdlist,
                         0);
+  /* Disable by default.  The ``e'' packet has nasty interactions with
+     the threading code - it relies on global state.  */
+  remote_protocol_e.detect = CMD_AUTO_BOOLEAN_FALSE;
+  update_packet_config (&remote_protocol_e);
 
   add_packet_config_cmd (&remote_protocol_E,
                         "E", "step-over-range-w-signal",
@@ -6111,6 +6110,10 @@ in a memory packet.\n",
                         show_remote_protocol_E_packet_cmd,
                         &remote_set_cmdlist, &remote_show_cmdlist,
                         0);
+  /* Disable by default.  The ``e'' packet has nasty interactions with
+     the threading code - it relies on global state.  */
+  remote_protocol_E.detect = CMD_AUTO_BOOLEAN_FALSE;
+  update_packet_config (&remote_protocol_E);
 
   add_packet_config_cmd (&remote_protocol_P,
                         "P", "set-register",
@@ -6159,7 +6162,7 @@ in a memory packet.\n",
                                     &remote_Z_packet_detect,
                                     "\
 Set use of remote protocol `Z' packets", &remote_set_cmdlist);
-  tmpcmd->function.sfunc = set_remote_protocol_Z_packet_cmd;
+  set_cmd_sfunc (tmpcmd, set_remote_protocol_Z_packet_cmd);
   add_cmd ("Z-packet", class_obscure, show_remote_protocol_Z_packet_cmd,
           "Show use of remote protocol `Z' packets ",
           &remote_show_cmdlist);
This page took 0.025957 seconds and 4 git commands to generate.