]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
No, really, check in the RIGHT patch!
authorDaniel Jacobowitz <drow@false.org>
Wed, 12 Apr 2006 14:52:05 +0000 (14:52 +0000)
committerDaniel Jacobowitz <drow@false.org>
Wed, 12 Apr 2006 14:52:05 +0000 (14:52 +0000)
[Revert half of changes from previous commit.]

gdb/arm-tdep.c
gdb/doc/gdb.texinfo
gdb/gdbserver/linux-low.c
gdb/gdbserver/server.c
gdb/remote.c
gdb/symfile.c
gdb/symfile.h
gdb/target.c
gdb/target.h
readline/emacs_keymap.c
readline/readline.c

index f59c055804b00941095ba1436b6b6c51a1cc6cc6..6142feb15a12cfe82846177ffa9f21a88d21607b 100644 (file)
@@ -102,17 +102,6 @@ static const char *arm_abi_strings[] =
 static enum arm_abi_kind arm_abi_global = ARM_ABI_AUTO;
 static const char *arm_abi_string = "auto";
 
-/* The execution mode to assume.  */
-static const char *arm_mode_strings[] =
-  {
-    "auto",
-    "arm",
-    "thumb"
-  };
-
-static const char *arm_fallback_mode_string = "auto";
-static const char *arm_force_mode_string = "auto";
-
 /* Number of different reg name sets (options).  */
 static int num_disassembly_options;
 
@@ -202,30 +191,16 @@ arm_pc_is_thumb (CORE_ADDR memaddr)
   if (IS_THUMB_ADDR (memaddr))
     return 1;
 
-  /* If the user wants to override the symbol table, let him.  */
-  if (strcmp (arm_force_mode_string, "arm") == 0)
-    return 0;
-  if (strcmp (arm_force_mode_string, "thumb") == 0)
-    return 1;
-
   /* Thumb functions have a "special" bit set in minimal symbols.  */
   sym = lookup_minimal_symbol_by_pc (memaddr);
   if (sym)
-    return (MSYMBOL_IS_SPECIAL (sym));
-
-  /* If the user wants to override the fallback mode, let them.  */
-  if (strcmp (arm_fallback_mode_string, "arm") == 0)
-    return 0;
-  if (strcmp (arm_fallback_mode_string, "thumb") == 0)
-    return 1;
-
-  /* If we couldn't find any symbol, but we're talking to a running
-     target, then trust the current value of $cpsr.  */
-  if (target_has_registers)
-    return (read_register (ARM_PS_REGNUM) & 0x20) != 0;
-
-  /* Otherwise we're out of luck; we assume ARM.  */
-  return 0;
+    {
+      return (MSYMBOL_IS_SPECIAL (sym));
+    }
+  else
+    {
+      return 0;
+    }
 #else
   /* ARMV7M processors are always in Thumb mode.  */
   return 1;
@@ -2535,28 +2510,6 @@ The current ARM ABI is \"auto\" (currently \"%s\").\n"),
                      arm_abi_string);
 }
 
-static void
-arm_show_fallback_mode (struct ui_file *file, int from_tty,
-                       struct cmd_list_element *c, const char *value)
-{
-  struct gdbarch_tdep *tdep = gdbarch_tdep (current_gdbarch);
-
-  fprintf_filtered (file, _("\
-The current execution mode assumed (when symbols are unavailable) is \"%s\".\n"),
-                   arm_fallback_mode_string);
-}
-
-static void
-arm_show_force_mode (struct ui_file *file, int from_tty,
-                    struct cmd_list_element *c, const char *value)
-{
-  struct gdbarch_tdep *tdep = gdbarch_tdep (current_gdbarch);
-
-  fprintf_filtered (file, _("\
-The current execution mode assumed (even when symbols are available) is \"%s\".\n"),
-                   arm_force_mode_string);
-}
-
 /* If the user changes the register disassembly style used for info
    register and other commands, we have to also switch the style used
    in opcodes for disassembly output.  This function is run in the "set
@@ -3247,21 +3200,6 @@ vfp - VFP co-processor."),
                        NULL, arm_set_abi, arm_show_abi,
                        &setarmcmdlist, &showarmcmdlist);
 
-  /* Add two commands to allow the user to force the assumed
-     execution mode.  */
-  add_setshow_enum_cmd ("fallback-mode", class_support,
-                       arm_mode_strings, &arm_fallback_mode_string,
-                       _("Set the mode assumed when symbols are unavailable."),
-                       _("Show the mode assumed when symbols are unavailable."),
-                       NULL, NULL, arm_show_fallback_mode,
-                       &setarmcmdlist, &showarmcmdlist);
-  add_setshow_enum_cmd ("force-mode", class_support,
-                       arm_mode_strings, &arm_force_mode_string,
-                       _("Set the mode assumed even when symbols are available."),
-                       _("Show the mode assumed even when symbols are available."),
-                       NULL, NULL, arm_show_force_mode,
-                       &setarmcmdlist, &showarmcmdlist);
-
   /* Debugging flag.  */
   add_setshow_boolean_cmd ("arm", class_maintenance, &arm_debug,
                           _("Set ARM debugging."),
index 221a95a2fa962fe66fa1e730007ce7ab7ea81929..d79933a151180c957d5b7628d51e12145d641e86 100644 (file)
@@ -14012,24 +14012,6 @@ This command forces @value{GDBN} to use the specified ABI.
 @item show arm abi
 Show the currently used ABI.
 
-@item set arm fallback-mode
-This command sets the mode (ARM versus Thumb) which @value{GDBN} will
-assume for code without a symbol table.  The default is @samp{auto},
-which causes @value{GDBN} to use the mode associated with the current
-CPSR.
-
-@item show arm fallback-mode
-Show the current fallback execution mode.
-
-@item set arm force-mode
-This command sets the mode (ARM versus Thumb) which @value{GDBN} will
-assume for all code, even when a symbol table is present.  The default
-is @samp{auto}, which causes @value{GDBN} to use the symbol table
-and fall back to the value of @samp{set arm fallback-mode}.
-
-@item show arm force-mode
-Show the currently forced execution mode.
-
 @item set debug arm
 Toggle whether to display ARM-specific debugging messages from the ARM
 target support subsystem.
index 8fdf96a92026be528f79a5fa186adba25b1edc51..08f1d89466d60250e8e1649343cbd2a3798ec8e0 100644 (file)
@@ -263,10 +263,6 @@ linux_kill (void)
       /* Make sure it died.  The loop is most likely unnecessary.  */
       wstat = linux_wait_for_event (thread);
     } while (WIFSTOPPED (wstat));
-
-  clear_inferiors ();
-  free (all_processes.head);
-  all_processes.head = all_processes.tail = NULL;
 }
 
 static void
index 3cb7ad8fb817960907d112d284f7bd7a8c98886e..51b87642a83bd3a921df2726c17363e0167547a5 100644 (file)
@@ -275,7 +275,8 @@ handle_v_cont (char *own_buf, char *status, int *signal)
   return;
 
 err:
-  write_enn (own_buf);
+  /* No other way to report an error... */
+  strcpy (own_buf, "");
   free (resume_info);
   return;
 }
@@ -347,9 +348,6 @@ gdbserver_usage (void)
          "HOST:PORT to listen for a TCP connection.\n");
 }
 
-/* FIXME declare here, give sensible name, give values?  */
-extern int debug_threads;
-
 int
 main (int argc, char *argv[])
 {
@@ -381,13 +379,6 @@ main (int argc, char *argv[])
       exit (1);
     }
 
-  if (argc >= 2 && strcmp (argv[1], "--debug") == 0)
-    {
-      argc--;
-      argv++;
-      debug_threads = 1;
-    }
-
   bad_attach = 0;
   pid = 0;
   attached = 0;
@@ -499,16 +490,11 @@ main (int argc, char *argv[])
                  unsigned long gdb_id, thread_id;
 
                  gdb_id = strtoul (&own_buf[2], NULL, 16);
-                 if (gdb_id == 0 || gdb_id == -1)
-                   thread_id = gdb_id;
-                 else
+                 thread_id = gdb_id_to_thread_id (gdb_id);
+                 if (thread_id == 0)
                    {
-                     thread_id = gdb_id_to_thread_id (gdb_id);
-                     if (thread_id == 0)
-                       {
-                         write_enn (own_buf);
-                         break;
-                       }
+                     write_enn (own_buf);
+                     break;
                    }
 
                  if (own_buf[1] == 'g')
index 9a654046dad8114d5bb402450347818a29c45616..9f14816b25bc203ea04ffd3a892a2aaa639c154a 100644 (file)
@@ -1830,37 +1830,6 @@ remote_threads_extra_info (struct thread_info *tp)
 }
 \f
 
-/* Mark OPS as a running target.  This should restore the target to its
-   original state, undoing any effects of remote_mark_killed.  */
-
-static void
-remote_mark_running (struct target_ops *ops)
-{
-  ops->to_has_execution = 1;
-  ops->to_has_all_memory = 1;
-  ops->to_has_memory = 1;
-  ops->to_has_stack = 1;
-  ops->to_has_registers = 1;
-
-  update_current_target ();
-}
-
-/* Mark OPS as a dead target, undoing any effects of remote_mark_running.
-   The target is still on the stack, and GDB is still connected to it,
-   but the process we were debugging has exited.  */
-
-static void
-remote_mark_killed (struct target_ops *ops)
-{
-  ops->to_has_execution = 0;
-  ops->to_has_all_memory = 0;
-  ops->to_has_memory = 0;
-  ops->to_has_stack = 0;
-  ops->to_has_registers = 0;
-
-  update_current_target ();
-}
-
 /* Restart the remote side; this is an extended protocol operation.  */
 
 static void
@@ -1897,7 +1866,7 @@ get_offsets (void)
   struct remote_state *rs = get_remote_state ();
   char *buf = rs->buf;
   char *ptr;
-  int lose, seen_text_seg = 0;
+  int lose;
   CORE_ADDR text_addr, data_addr, bss_addr;
   struct section_offsets *offs;
 
@@ -1933,41 +1902,24 @@ get_offsets (void)
       /* Don't use strtol, could lose on big values.  */
       while (*ptr && *ptr != ';')
        text_addr = (text_addr << 4) + fromhex (*ptr++);
-
-      if (strncmp (ptr, ";Data=", 6) == 0)
-       {
-         ptr += 6;
-         while (*ptr && *ptr != ';')
-           data_addr = (data_addr << 4) + fromhex (*ptr++);
-       }
-      else
-       lose = 1;
-
-      if (!lose && strncmp (ptr, ";Bss=", 5) == 0)
-       {
-         ptr += 5;
-         while (*ptr && *ptr != ';')
-           bss_addr = (bss_addr << 4) + fromhex (*ptr++);
-       }
-      else
-       lose = 1;
     }
-  else if (strncmp (ptr, "TextSeg=", 8) == 0)
+  else
+    lose = 1;
+
+  if (!lose && strncmp (ptr, ";Data=", 6) == 0)
     {
-      ptr += 8;
-      /* Don't use strtol, could lose on big values.  */
+      ptr += 6;
       while (*ptr && *ptr != ';')
-       text_addr = (text_addr << 4) + fromhex (*ptr++);
-      seen_text_seg = 1;
+       data_addr = (data_addr << 4) + fromhex (*ptr++);
+    }
+  else
+    lose = 1;
 
-      if (strncmp (ptr, ";DataSeg=", 9) == 0)
-       {
-         ptr += 9;
-         while (*ptr && *ptr != ';')
-           data_addr = (data_addr << 4) + fromhex (*ptr++);
-       }
-      else
-       lose = 1;
+  if (!lose && strncmp (ptr, ";Bss=", 5) == 0)
+    {
+      ptr += 5;
+      while (*ptr && *ptr != ';')
+       bss_addr = (bss_addr << 4) + fromhex (*ptr++);
     }
   else
     lose = 1;
@@ -1983,23 +1935,14 @@ get_offsets (void)
   memcpy (offs, symfile_objfile->section_offsets,
          SIZEOF_N_SECTION_OFFSETS (symfile_objfile->num_sections));
 
-  if (seen_text_seg)
-    {
-      if (! symfile_map_offsets_to_segments (symfile_objfile, offs,
-                                            text_addr, data_addr))
-       error (_("Can not handle qOffsets TextSeg response with this symbol file"));
-    }
-  else
-    {
-      offs->offsets[SECT_OFF_TEXT (symfile_objfile)] = text_addr;
+  offs->offsets[SECT_OFF_TEXT (symfile_objfile)] = text_addr;
 
-      /* This is a temporary kludge to force data and bss to use the same offsets
-        because that's what nlmconv does now.  The real solution requires changes
-        to the stub and remote.c that I don't have time to do right now.  */
+  /* This is a temporary kludge to force data and bss to use the same offsets
+     because that's what nlmconv does now.  The real solution requires changes
+     to the stub and remote.c that I don't have time to do right now.  */
 
-      offs->offsets[SECT_OFF_DATA (symfile_objfile)] = data_addr;
-      offs->offsets[SECT_OFF_BSS (symfile_objfile)] = data_addr;
-    }
+  offs->offsets[SECT_OFF_DATA (symfile_objfile)] = data_addr;
+  offs->offsets[SECT_OFF_BSS (symfile_objfile)] = data_addr;
 
   objfile_relocate (symfile_objfile, offs);
 }
@@ -2263,10 +2206,6 @@ remote_open_1 (char *name, int from_tty, struct target_ops *target,
 
   unpush_target (target);
 
-  /* We're about to connect; assume that the target will be running
-     when we do so.  */
-  remote_mark_running (target);
-
   remote_desc = remote_serial_open (name);
   if (!remote_desc)
     perror_with_name (name);
@@ -2420,20 +2359,16 @@ remote_detach (char *args, int from_tty)
 /* Same as remote_detach, but don't send the "D" packet; just disconnect.  */
 
 static void
-remote_disconnect (struct target_ops *target, char *args, int from_tty)
+remote_disconnect (char *args, int from_tty)
 {
   if (args)
-    error (_("Argument given to \"disconnect\" when remotely debugging."));
+    error (_("Argument given to \"detach\" when remotely debugging."));
 
   /* Unregister the file descriptor from the event loop.  */
   if (target_is_async_p ())
     serial_async (remote_desc, NULL, 0);
 
-  /* Make sure we unpush even the extended remote targets; mourn
-     won't do it.  So call remote_mourn_1 directly instead of
-     target_mourn_inferior.  */
-  remote_mourn_1 (target);
-
+  target_mourn_inferior ();
   if (from_tty)
     puts_filtered ("Ending remote debugging.\n");
 }
@@ -4553,23 +4488,14 @@ remote_async_mourn (void)
 static void
 extended_remote_mourn (void)
 {
-  /* We do not want to unpush the target; then the next time the
-     user says "run", we won't be connected.  Just mark ourselves
-     as not executing.  */
+  /* We do _not_ want to mourn the target like this; this will
+     remove the extended remote target  from the target stack,
+     and the next time the user says "run" it'll fail.
 
-  generic_mourn_inferior ();
-  remote_mark_killed (&extended_remote_ops);
-}
-
-static void
-extended_async_remote_mourn (void)
-{
-  /* We do not want to unpush the target; then the next time the
-     user says "run", we won't be connected.  Just mark ourselves
-     as not executing.  */
-
-  generic_mourn_inferior ();
-  remote_mark_killed (&extended_async_remote_ops);
+     FIXME: What is the right thing to do here?  */
+#if 0
+  remote_mourn_1 (&extended_remote_ops);
+#endif
 }
 
 /* Worker function for remote_mourn.  */
@@ -4604,8 +4530,6 @@ extended_remote_create_inferior (char *exec_file, char *args,
 
   /* Clean up from the last time we were running.  */
   clear_proceed_status ();
-
-  remote_mark_running (&extended_remote_ops);
 }
 
 /* Async version of extended_remote_create_inferior.  */
@@ -4631,8 +4555,6 @@ extended_remote_async_create_inferior (char *exec_file, char *args,
 
   /* Clean up from the last time we were running.  */
   clear_proceed_status ();
-
-  remote_mark_running (&extended_async_remote_ops);
 }
 \f
 
@@ -4881,7 +4803,7 @@ remote_check_watch_resources (int type, int cnt, int ot)
 static int
 remote_stopped_by_watchpoint (void)
 {
-  return remote_stopped_by_watchpoint_p;
+    return remote_stopped_by_watchpoint_p;
 }
 
 extern int stepped_after_stopped_by_watchpoint;
@@ -4999,7 +4921,7 @@ push_remote_target (char *name, int from_tty)
 /* Table used by the crc32 function to calcuate the checksum.  */
 
 static unsigned long crc32_table[256] =
-  {0, 0};
+{0, 0};
 
 static unsigned long
 crc32 (unsigned char *buf, int len, unsigned int crc)
@@ -5028,10 +4950,10 @@ crc32 (unsigned char *buf, int len, unsigned int crc)
 
 /* compare-sections command
 
-With no arguments, compares each loadable section in the exec bfd
-with the same memory range on the target, and reports mismatches.
-Useful for verifying the image on the target against the exec file.
-Depends on the target understanding the new "qCRC:" request.  */
+   With no arguments, compares each loadable section in the exec bfd
+   with the same memory range on the target, and reports mismatches.
+   Useful for verifying the image on the target against the exec file.
+   Depends on the target understanding the new "qCRC:" request.  */
 
 /* FIXME: cagney/1999-10-26: This command should be broken down into a
    target method (target verify memory) and generic version of the
@@ -5669,9 +5591,9 @@ remote_async (void (*callback) (enum inferior_event_type event_type,
 
 /* Target async and target extended-async.
 
-This are temporary targets, until it is all tested.  Eventually
-async support will be incorporated int the usual 'remote'
-target.  */
+   This are temporary targets, until it is all tested.  Eventually
+   async support will be incorporated int the usual 'remote'
+   target.  */
 
 static void
 init_remote_async_ops (void)
@@ -5746,7 +5668,7 @@ init_extended_async_remote_ops (void)
 Specify the serial device it is connected to (e.g. /dev/ttya).",
     extended_async_remote_ops.to_open = extended_remote_async_open;
   extended_async_remote_ops.to_create_inferior = extended_remote_async_create_inferior;
-  extended_async_remote_ops.to_mourn_inferior = extended_async_remote_mourn;
+  extended_async_remote_ops.to_mourn_inferior = extended_remote_mourn;
 }
 
 static void
index 0df82fbb7904a62da8c178e0d2e1ce68c3ca4213..a4c883be12ffed4d6f37303c7f6e0da3528ba224 100644 (file)
@@ -3723,106 +3723,6 @@ symfile_relocate_debug_section (bfd *abfd, asection *sectp, bfd_byte *buf)
   return bfd_simple_get_relocated_section_contents (abfd, sectp, buf, NULL);
 }
 
-/* FIXME: This should probably go through the symfile ops vector.  */
-
-#include "elf/internal.h"
-#include "elf/common.h"
-
-int
-symfile_map_offsets_to_segments (struct objfile *objfile,
-                                struct section_offsets *offsets,
-                                CORE_ADDR text_addr, CORE_ADDR data_addr)
-{
-  Elf_Internal_Phdr *phdrs, *segments[2];
-  int num_phdrs, i, num_segments;
-  long phdrs_size;
-  bfd *abfd = objfile->obfd;
-  asection *sect;
-  CORE_ADDR text_offset, data_offset;
-
-  phdrs_size = bfd_get_elf_phdr_upper_bound (objfile->obfd);
-  if (phdrs_size == -1)
-    return 0;
-
-  phdrs = alloca (phdrs_size);
-  num_phdrs = bfd_get_elf_phdrs (objfile->obfd, phdrs);
-  if (num_phdrs == -1)
-    return 0;
-
-  num_segments = 0;
-  for (i = 0; i < num_phdrs; i++)
-    if (phdrs[i].p_type == PT_LOAD)
-      {
-       if (num_segments == 2)
-         return 0;
-       segments[num_segments++] = &phdrs[i];
-      }
-
-  if (num_segments == 0)
-    return 0;
-
-  if (num_segments == 1)
-    {
-      if ((segments[0]->p_flags & PF_W) && !(segments[0]->p_flags & PF_X))
-       {
-         segments[1] = segments[0];
-         segments[0] = NULL;
-       }
-      else
-       segments[1] = NULL;
-    }
-  else
-    {
-      if ((segments[0]->p_flags & PF_X) && !(segments[1]->p_flags & PF_X))
-       /* OK */;
-      else if ((segments[1]->p_flags & PF_X) && !(segments[0]->p_flags & PF_X))
-       {
-         Elf_Internal_Phdr *tmp = segments[0];
-         segments[0] = segments[1];
-         segments[1] = tmp;
-       }
-      else if ((segments[1]->p_flags & PF_W) && !(segments[0]->p_flags & PF_W))
-       /* OK */;
-      else if ((segments[0]->p_flags & PF_W) && !(segments[1]->p_flags & PF_W))
-       {
-         Elf_Internal_Phdr *tmp = segments[0];
-         segments[0] = segments[1];
-         segments[1] = tmp;
-       }
-      else
-       return 0;
-    }
-
-  text_offset = text_addr - segments[0]->p_vaddr;
-  data_offset = data_addr - segments[1]->p_vaddr;
-
-  for (i = 0, sect = abfd->sections; sect != NULL; i++, sect = sect->next)
-    {
-      CORE_ADDR vma;
-
-      if ((bfd_get_section_flags (abfd, sect) & SEC_LOAD) == 0)
-       continue;
-
-      vma = bfd_get_section_vma (abfd, sect);
-
-      if (segments[0]
-         && vma >= segments[0]->p_vaddr
-         && vma < segments[0]->p_vaddr + segments[0]->p_memsz)
-       offsets->offsets[i] = text_offset;
-
-      else if (segments[1]
-              && vma >= segments[1]->p_vaddr
-              && vma < segments[1]->p_vaddr + segments[1]->p_memsz)
-       offsets->offsets[i] = data_offset;
-
-      else
-       warning (_("Loadable segment \"%s\" outside of ELF segments"),
-                bfd_section_name (abfd, sect));
-    }
-
-  return 1;
-}
-
 void
 _initialize_symfile (void)
 {
index 43cfaa97eef529e064a12147c76276ffce1461ba..10361e795d9189dceedc57cf170c56550a2c66c2 100644 (file)
@@ -319,10 +319,6 @@ extern void symbol_file_clear (int from_tty);
 extern bfd_byte *symfile_relocate_debug_section (bfd *abfd, asection *sectp,
                                                 bfd_byte * buf);
 
-extern int symfile_map_offsets_to_segments (struct objfile *,
-                                           struct section_offsets *,
-                                           CORE_ADDR, CORE_ADDR);
-
 /* From dwarfread.c */
 
 extern void dwarf_build_psymtabs (struct objfile *, int, file_ptr,
index 820099b5a55978df464227ad5d97744f6a60da27..4e0b997179fc2de67d71c0228940966074ad806f 100644 (file)
@@ -97,6 +97,8 @@ static void debug_to_attach (char *, int);
 
 static void debug_to_detach (char *, int);
 
+static void debug_to_disconnect (char *, int);
+
 static void debug_to_resume (ptid_t, int, enum target_signal);
 
 static ptid_t debug_to_wait (ptid_t, struct target_waitstatus *);
@@ -364,7 +366,7 @@ maybe_kill_then_create_inferior (char *exec, char *args, char **env,
    locally search the target stack for the target that can handle the
    request.  */
 
-void
+static void
 update_current_target (void)
 {
   struct target_ops *t;
@@ -386,7 +388,7 @@ update_current_target (void)
       INHERIT (to_attach, t);
       INHERIT (to_post_attach, t);
       INHERIT (to_detach, t);
-      /* Do not inherit to_disconnect.  */
+      INHERIT (to_disconnect, t);
       INHERIT (to_resume, t);
       INHERIT (to_wait, t);
       INHERIT (to_fetch_registers, t);
@@ -482,6 +484,9 @@ update_current_target (void)
   de_fault (to_detach, 
            (void (*) (char *, int)) 
            target_ignore);
+  de_fault (to_disconnect, 
+           (void (*) (char *, int)) 
+           tcomplain);
   de_fault (to_resume, 
            (void (*) (ptid_t, int, enum target_signal)) 
            noprocess);
@@ -1530,19 +1535,7 @@ target_detach (char *args, int from_tty)
 void
 target_disconnect (char *args, int from_tty)
 {
-  struct target_ops *t;
-
-  for (t = current_target.beneath; t != NULL; t = t->beneath)
-    if (t->to_disconnect != NULL)
-       {
-         if (targetdebug)
-           fprintf_unfiltered (gdb_stdlog, "target_disconnect (%s, %d)\n",
-                               args, from_tty);
-         t->to_disconnect (t, args, from_tty);
-         return;
-       }
-
-  tcomplain ();
+  (current_target.to_disconnect) (args, from_tty);
 }
 
 int
@@ -1980,6 +1973,15 @@ debug_to_detach (char *args, int from_tty)
   fprintf_unfiltered (gdb_stdlog, "target_detach (%s, %d)\n", args, from_tty);
 }
 
+static void
+debug_to_disconnect (char *args, int from_tty)
+{
+  debug_target.to_disconnect (args, from_tty);
+
+  fprintf_unfiltered (gdb_stdlog, "target_disconnect (%s, %d)\n",
+                     args, from_tty);
+}
+
 static void
 debug_to_resume (ptid_t ptid, int step, enum target_signal siggnal)
 {
@@ -2586,6 +2588,7 @@ setup_target_debug (void)
   current_target.to_attach = debug_to_attach;
   current_target.to_post_attach = debug_to_post_attach;
   current_target.to_detach = debug_to_detach;
+  current_target.to_disconnect = debug_to_disconnect;
   current_target.to_resume = debug_to_resume;
   current_target.to_wait = debug_to_wait;
   current_target.to_fetch_registers = debug_to_fetch_registers;
@@ -2633,6 +2636,7 @@ setup_target_debug (void)
   current_target.to_enable_exception_callback = debug_to_enable_exception_callback;
   current_target.to_get_current_exception_event = debug_to_get_current_exception_event;
   current_target.to_pid_to_exec_file = debug_to_pid_to_exec_file;
+
 }
 \f
 
index 648cfd2cabd071ce4c12be4e8c30e92578900732..f7203abbbf483ceaeb3bb5615a7e8e1c97fdb282 100644 (file)
@@ -328,7 +328,7 @@ struct target_ops
     void (*to_attach) (char *, int);
     void (*to_post_attach) (int);
     void (*to_detach) (char *, int);
-    void (*to_disconnect) (struct target_ops *, char *, int);
+    void (*to_disconnect) (char *, int);
     void (*to_resume) (ptid_t, int, enum target_signal);
     ptid_t (*to_wait) (ptid_t, struct target_waitstatus *);
     void (*to_fetch_registers) (int);
@@ -897,9 +897,11 @@ int target_follow_fork (int follow_child);
      (current_target.to_has_registers)
 
 /* Does the target have execution?  Can we make it jump (through
-   hoops), or pop its stack a few times?  This used to mean the target
-   was capable of execution; now it means that a program is actually
-   running.  */
+   hoops), or pop its stack a few times?  FIXME: If this is to work that
+   way, it needs to check whether an inferior actually exists.
+   remote-udi.c and probably other targets can be the current target
+   when the inferior doesn't actually exist at the moment.  Right now
+   this just tells us whether this target is *capable* of execution.  */
 
 #define        target_has_execution    \
      (current_target.to_has_execution)
@@ -1156,11 +1158,6 @@ extern void target_preopen (int);
 
 extern void pop_target (void);
 
-/* Update current_target after some target on the current stack has
-   changed state.  */
-
-extern void update_current_target (void);
-
 /* Struct section_table maps address ranges to file sections.  It is
    mostly used with BFD files, but can be used without (e.g. for handling
    raw disks, or files not in formats handled by BFD).  */
index cbacb0309af743f379a1bbd93644b66e18f9d667..ca9d1343b655ca2eae3a04d6bc99c87e1be69854 100644 (file)
@@ -278,11 +278,7 @@ KEYMAP_ENTRY_ARRAY emacs_standard_keymap = {
   { ISFUNC, rl_insert },       /* Latin capital letter Y with acute */
   { ISFUNC, rl_insert },       /* Latin capital letter thorn (Icelandic) */
   { ISFUNC, rl_insert },       /* Latin small letter sharp s (German) */
-#ifndef __MINGW32__
   { ISFUNC, rl_insert },       /* Latin small letter a with grave */
-#else
-  { ISFUNC, 0 },               /* Must leave this unbound for the arrow keys to work.  */
-#endif
   { ISFUNC, rl_insert },       /* Latin small letter a with acute */
   { ISFUNC, rl_insert },       /* Latin small letter a with circumflex */
   { ISFUNC, rl_insert },       /* Latin small letter a with tilde */
index 3ba5cf00cac59805ade9e298e8181a57b6dea440..07fb58fd210d2f973c0bcbc1cf9f6e11af8d5bf9 100644 (file)
@@ -869,10 +869,19 @@ bind_arrow_keys_internal (map)
 #endif
 
 #ifdef __MINGW32__
-  _rl_bind_if_unbound ("\340H", rl_get_previous_history);
-  _rl_bind_if_unbound ("\340P", rl_get_next_history);
-  _rl_bind_if_unbound ("\340M", rl_forward_char);
-  _rl_bind_if_unbound ("\340K", rl_backward_char);
+   /* Under Windows, when an extend key (like an arrow key) is
+      pressed, getch() will return 340 (octal) followed by a code for
+      the extended key.  We use macros to transform those into the
+      normal ANSI terminal sequences for these keys.  */
+
+   /* Up arrow.  */
+   rl_macro_bind ("\340H", "\033[A", map);
+   /* Left arrow.  */
+   rl_macro_bind ("\340K", "\033[D", map);
+   /* Right arrow.  */
+   rl_macro_bind ("\340M", "\033[C", map);
+   /* Down arrow.  */
+   rl_macro_bind ("\340P", "\033[B", map);
 #endif
 
   _rl_bind_if_unbound ("\033[A", rl_get_previous_history);