#include "osdata.h"
#include "splay-tree.h"
#include "tracepoint.h"
+#include "ada-lang.h"
#include <ctype.h>
#include <sys/time.h>
if (current_token)
fputs_unfiltered (current_token, raw_stdout);
fputs_unfiltered ("^exit\n", raw_stdout);
- mi_out_put (uiout, raw_stdout);
+ mi_out_put (current_uiout, raw_stdout);
gdb_flush (raw_stdout);
/* FIXME: The function called is not yet a formal libgdb function. */
quit_force (NULL, FROM_TTY);
enum exec_direction_kind dir = execution_direction;
struct cleanup *old_chain;
- if (dir == EXEC_ERROR)
- error (_("Target %s does not support this command."), target_shortname);
-
if (dir == EXEC_REVERSE)
error (_("Already in reverse mode."));
if (argc != 1)
error (_("-thread-select: USAGE: threadnum."));
- rc = gdb_thread_select (uiout, argv[0], &mi_error_message);
+ rc = gdb_thread_select (current_uiout, argv[0], &mi_error_message);
if (rc == GDB_RC_FAIL)
{
if (argc != 0)
error (_("-thread-list-ids: No arguments required."));
- rc = gdb_list_thread_ids (uiout, &mi_error_message);
+ rc = gdb_list_thread_ids (current_uiout, &mi_error_message);
if (rc == GDB_RC_FAIL)
{
if (argc != 0 && argc != 1)
error (_("Invalid MI command"));
- print_thread_info (uiout, argv[0], -1);
+ print_thread_info (current_uiout, argv[0], -1);
}
struct collect_cores_data
print_one_inferior (struct inferior *inferior, void *xdata)
{
struct print_one_inferior_data *top_data = xdata;
+ struct ui_out *uiout = current_uiout;
if (VEC_empty (int, top_data->inferiors)
|| bsearch (&(inferior->pid), VEC_address (int, top_data->inferiors),
struct osdata *data;
struct osdata_item *item;
int ix_items;
+ struct ui_out *uiout = current_uiout;
/* This keeps a map from integer (pid) to VEC (struct osdata_item *)*
The vector contains information about all threads for the given pid.
void
mi_cmd_list_thread_groups (char *command, char **argv, int argc)
{
+ struct ui_out *uiout = current_uiout;
struct cleanup *back_to;
int available = 0;
int recurse = 0;
{
AVAILABLE_OPT, RECURSE_OPT
};
- static struct mi_opt opts[] =
+ static const struct mi_opt opts[] =
{
{"-available", AVAILABLE_OPT, 0},
{"-recurse", RECURSE_OPT, 1},
mi_cmd_data_list_register_names (char *command, char **argv, int argc)
{
struct gdbarch *gdbarch;
+ struct ui_out *uiout = current_uiout;
int regnum, numregs;
int i;
struct cleanup *cleanup;
mi_cmd_data_list_changed_registers (char *command, char **argv, int argc)
{
static struct regcache *this_regs = NULL;
+ struct ui_out *uiout = current_uiout;
struct regcache *prev_regs;
struct gdbarch *gdbarch;
int regnum, numregs, changed;
void
mi_cmd_data_list_register_values (char *command, char **argv, int argc)
{
+ struct ui_out *uiout = current_uiout;
struct frame_info *frame;
struct gdbarch *gdbarch;
int regnum, numregs, format;
get_register (struct frame_info *frame, int regnum, int format)
{
struct gdbarch *gdbarch = get_frame_arch (frame);
+ struct ui_out *uiout = current_uiout;
CORE_ADDR addr;
enum lval_type lval;
- static struct ui_stream *stb = NULL;
+ struct ui_stream *stb;
struct value *val;
stb = ui_out_stream_new (uiout);
struct value *val;
struct ui_stream *stb = NULL;
struct value_print_options opts;
+ struct ui_out *uiout = current_uiout;
stb = ui_out_stream_new (uiout);
mi_cmd_data_read_memory (char *command, char **argv, int argc)
{
struct gdbarch *gdbarch = get_current_arch ();
+ struct ui_out *uiout = current_uiout;
struct cleanup *cleanups = make_cleanup (null_cleanup, NULL);
CORE_ADDR addr;
long total_bytes;
{
OFFSET_OPT
};
- static struct mi_opt opts[] =
+ static const struct mi_opt opts[] =
{
{"o", OFFSET_OPT, 1},
{ 0, 0, 0 }
mi_cmd_data_read_memory_bytes (char *command, char **argv, int argc)
{
struct gdbarch *gdbarch = get_current_arch ();
+ struct ui_out *uiout = current_uiout;
struct cleanup *cleanups;
CORE_ADDR addr;
LONGEST length;
{
OFFSET_OPT
};
- static struct mi_opt opts[] =
+ static const struct mi_opt opts[] =
{
{"o", OFFSET_OPT, 1},
{ 0, 0, 0 }
/* DATA-MEMORY-WRITE:
- COLUMN_OFFSET: optional argument. Must be preceeded by '-o'. The
+ COLUMN_OFFSET: optional argument. Must be preceded by '-o'. The
offset from the beginning of the memory grid row where the cell to
be written is.
ADDR: start address of the row in the memory grid where the memory
{
OFFSET_OPT
};
- static struct mi_opt opts[] =
+ static const struct mi_opt opts[] =
{
{"o", OFFSET_OPT, 1},
{ 0, 0, 0 }
if (argc == 0)
{
struct cleanup *cleanup = NULL;
+ struct ui_out *uiout = current_uiout;
cleanup = make_cleanup_ui_out_list_begin_end (uiout, "features");
ui_out_field_string (uiout, NULL, "frozen-varobjs");
ui_out_field_string (uiout, NULL, "pending-breakpoints");
ui_out_field_string (uiout, NULL, "thread-info");
ui_out_field_string (uiout, NULL, "data-read-memory-bytes");
+ ui_out_field_string (uiout, NULL, "breakpoint-notifications");
+ ui_out_field_string (uiout, NULL, "ada-task-info");
#if HAVE_PYTHON
ui_out_field_string (uiout, NULL, "python");
if (argc == 0)
{
struct cleanup *cleanup = NULL;
+ struct ui_out *uiout = current_uiout;
cleanup = make_cleanup_ui_out_list_begin_end (uiout, "features");
if (target_can_async_p ())
inf = add_inferior_with_spaces ();
- ui_out_field_fmt (uiout, "inferior", "i%d", inf->num);
+ ui_out_field_fmt (current_uiout, "inferior", "i%d", inf->num);
}
/* Callback used to find the first inferior other than the
TRY_CATCH (result, RETURN_MASK_ALL)
{
- captured_mi_execute_command (uiout, command);
+ captured_mi_execute_command (current_uiout, command);
}
if (result.reason < 0)
{
/* The command execution failed and error() was called
somewhere. */
mi_print_exception (command->token, result);
- mi_out_rewind (uiout);
+ mi_out_rewind (current_uiout);
}
bpstat_do_actions ();
{
struct cleanup *cleanup;
- prepare_execute_command ();
-
- cleanup = make_cleanup (null_cleanup, NULL);
+ cleanup = prepare_execute_command ();
if (parse->all && parse->thread_group != -1)
error (_("Cannot specify --thread-group together with --all"));
current_context = parse;
+ if (strncmp (parse->command, "break-", sizeof ("break-") - 1 ) == 0)
+ {
+ make_cleanup_restore_integer (&mi_suppress_breakpoint_notifications);
+ mi_suppress_breakpoint_notifications = 1;
+ }
+
if (parse->cmd->argv_func != NULL)
- parse->cmd->argv_func (parse->command, parse->argv, parse->argc);
+ {
+ parse->cmd->argv_func (parse->command, parse->argv, parse->argc);
+ }
else if (parse->cmd->cli.cmd != 0)
{
/* FIXME: DELETE THIS. */
execute_command ( /*ui */ run, 0 /*from_tty */ );
- if (target_can_async_p ())
- {
- /* If we're not executing, an exception should have been throw. */
- gdb_assert (is_running (inferior_ptid));
- do_cleanups (old_cleanups);
- }
- else
- {
- /* Do this before doing any printing. It would appear that some
- print code leaves garbage around in the buffer. */
- do_cleanups (old_cleanups);
- }
+ /* Do this before doing any printing. It would appear that some
+ print code leaves garbage around in the buffer. */
+ do_cleanups (old_cleanups);
}
void
static char *previous_sect_name = NULL;
int new_section;
struct ui_out *saved_uiout;
+ struct ui_out *uiout;
/* This function is called through deprecated_show_load_progress
which means uiout may not be correct. Fix it for the duration
of this function. */
- saved_uiout = uiout;
+ saved_uiout = current_uiout;
if (current_interp_named_p (INTERP_MI)
|| current_interp_named_p (INTERP_MI2))
- uiout = mi_out_new (2);
+ current_uiout = mi_out_new (2);
else if (current_interp_named_p (INTERP_MI1))
- uiout = mi_out_new (1);
+ current_uiout = mi_out_new (1);
else if (current_interp_named_p (INTERP_MI3))
- uiout = mi_out_new (3);
+ current_uiout = mi_out_new (3);
else
return;
+ uiout = current_uiout;
+
update_threshold.tv_sec = 0;
update_threshold.tv_usec = 500000;
gettimeofday (&time_now, NULL);
}
xfree (uiout);
- uiout = saved_uiout;
+ current_uiout = saved_uiout;
}
static void
stop_tracing ();
trace_status_mi (1);
}
+
+/* Implement the "-ada-task-info" GDB/MI command. */
+
+void
+mi_cmd_ada_task_info (char *command, char **argv, int argc)
+{
+ if (argc != 0 && argc != 1)
+ error (_("Invalid MI command"));
+
+ print_ada_task_info (current_uiout, argv[0], current_inferior ());
+}