summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Jacobowitz <dan@debian.org>2006-04-12 14:52:05 +0000
committerDaniel Jacobowitz <dan@debian.org>2006-04-12 14:52:05 +0000
commit27d51c4b017f5fc2ce7bc680a9c811e45c0ad517 (patch)
tree9683cceae469d243ae4f5b415d7b47f5e9bbfdee
parente5942676847cd7389c9581e171290cddc49bbb35 (diff)
downloadgdb-27d51c4b017f5fc2ce7bc680a9c811e45c0ad517.tar.gz
No, really, check in the RIGHT patch!
[Revert half of changes from previous commit.]
-rw-r--r--gdb/arm-tdep.c76
-rw-r--r--gdb/doc/gdb.texinfo18
-rw-r--r--gdb/gdbserver/linux-low.c4
-rw-r--r--gdb/gdbserver/server.c26
-rw-r--r--gdb/remote.c160
-rw-r--r--gdb/symfile.c100
-rw-r--r--gdb/symfile.h4
-rw-r--r--gdb/target.c34
-rw-r--r--gdb/target.h15
-rw-r--r--readline/emacs_keymap.c4
-rw-r--r--readline/readline.c17
11 files changed, 92 insertions, 366 deletions
diff --git a/gdb/arm-tdep.c b/gdb/arm-tdep.c
index f59c055804b..6142feb15a1 100644
--- a/gdb/arm-tdep.c
+++ b/gdb/arm-tdep.c
@@ -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."),
diff --git a/gdb/doc/gdb.texinfo b/gdb/doc/gdb.texinfo
index 221a95a2fa9..d79933a1511 100644
--- a/gdb/doc/gdb.texinfo
+++ b/gdb/doc/gdb.texinfo
@@ -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.
diff --git a/gdb/gdbserver/linux-low.c b/gdb/gdbserver/linux-low.c
index 8fdf96a9202..08f1d89466d 100644
--- a/gdb/gdbserver/linux-low.c
+++ b/gdb/gdbserver/linux-low.c
@@ -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
diff --git a/gdb/gdbserver/server.c b/gdb/gdbserver/server.c
index 3cb7ad8fb81..51b87642a83 100644
--- a/gdb/gdbserver/server.c
+++ b/gdb/gdbserver/server.c
@@ -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')
diff --git a/gdb/remote.c b/gdb/remote.c
index 9a654046dad..9f14816b25b 100644
--- a/gdb/remote.c
+++ b/gdb/remote.c
@@ -1830,37 +1830,6 @@ remote_threads_extra_info (struct thread_info *tp)
}
-/* 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);
}
@@ -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
diff --git a/gdb/symfile.c b/gdb/symfile.c
index 0df82fbb790..a4c883be12f 100644
--- a/gdb/symfile.c
+++ b/gdb/symfile.c
@@ -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)
{
diff --git a/gdb/symfile.h b/gdb/symfile.h
index 43cfaa97eef..10361e795d9 100644
--- a/gdb/symfile.h
+++ b/gdb/symfile.h
@@ -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,
diff --git a/gdb/target.c b/gdb/target.c
index 820099b5a55..4e0b997179f 100644
--- a/gdb/target.c
+++ b/gdb/target.c
@@ -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
@@ -1981,6 +1974,15 @@ debug_to_detach (char *args, int 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)
{
debug_target.to_resume (ptid, step, 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;
+
}
diff --git a/gdb/target.h b/gdb/target.h
index 648cfd2cabd..f7203abbbf4 100644
--- a/gdb/target.h
+++ b/gdb/target.h
@@ -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). */
diff --git a/readline/emacs_keymap.c b/readline/emacs_keymap.c
index cbacb0309af..ca9d1343b65 100644
--- a/readline/emacs_keymap.c
+++ b/readline/emacs_keymap.c
@@ -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 */
diff --git a/readline/readline.c b/readline/readline.c
index 3ba5cf00cac..07fb58fd210 100644
--- a/readline/readline.c
+++ b/readline/readline.c
@@ -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);