static void detach_command (char *, int);
+static void disconnect_command (char *, int);
+
static void unset_environment_command (char *, int);
static void set_environment_command (char *, int);
The function frame_register_read() should have returned the
pre-cooked register so no conversion is necessary. */
/* Convert raw data to virtual format if necessary. */
- if (REGISTER_CONVERTIBLE (i))
+ if (DEPRECATED_REGISTER_CONVERTIBLE (i))
{
- REGISTER_CONVERT_TO_VIRTUAL (i, register_type (current_gdbarch, i),
+ DEPRECATED_REGISTER_CONVERT_TO_VIRTUAL (i, register_type (current_gdbarch, i),
raw_buffer, virtual_buffer);
}
else
/* A register name? */
{
- int regnum = frame_map_name_to_regnum (start, end - start);
+ int regnum = frame_map_name_to_regnum (deprecated_selected_frame,
+ start, end - start);
if (regnum >= 0)
{
gdbarch_print_registers_info (current_gdbarch, gdb_stdout,
/* A register group? */
{
- struct reggroup *const *group;
- for (group = reggroups (current_gdbarch);
- (*group) != NULL;
- group++)
+ struct reggroup *group;
+ for (group = reggroup_next (current_gdbarch, NULL);
+ group != NULL;
+ group = reggroup_next (current_gdbarch, group))
{
/* Don't bother with a length check. Should the user
enter a short register group name, go with the first
group that matches. */
- if (strncmp (start, reggroup_name ((*group)), end - start) == 0)
+ if (strncmp (start, reggroup_name (group), end - start) == 0)
break;
}
- if ((*group) != NULL)
+ if (group != NULL)
{
int regnum;
for (regnum = 0; regnum < NUM_REGS + NUM_PSEUDO_REGS; regnum++)
{
if (gdbarch_register_reggroup_p (current_gdbarch, regnum,
- (*group)))
+ group))
gdbarch_print_registers_info (current_gdbarch,
gdb_stdout, deprecated_selected_frame,
regnum, fpregs);
detach_hook ();
}
+/* Disconnect from the current target without resuming it (leaving it
+ waiting for a debugger).
+
+ We'd better not have left any breakpoints in the program or the
+ next debugger will get confused. Currently only supported for some
+ remote targets, since the normal attach mechanisms don't work on
+ stopped processes on some native platforms (e.g. GNU/Linux). */
+
+static void
+disconnect_command (char *args, int from_tty)
+{
+ dont_repeat (); /* Not for the faint of heart */
+ target_disconnect (args, from_tty);
+#if defined(SOLIB_RESTART)
+ SOLIB_RESTART ();
+#endif
+ if (detach_hook)
+ detach_hook ();
+}
+
/* Stop the execution of the target while running in async mode, in
the backgound. */
void
If a process, it is no longer traced, and it continues its execution. If\n\
you were debugging a file, the file is closed and gdb no longer accesses it.");
+ add_com ("disconnect", class_run, disconnect_command,
+ "Disconnect from a target.\n\
+The target will wait for another debugger to connect. Not available for\n\
+all targets.");
+
add_com ("signal", class_run, signal_command,
"Continue program giving it signal specified by the argument.\n\
An argument of \"0\" means continue program without giving it a signal.");