static void mi_execute_cli_command (const char *cmd, int args_p,
const char *args);
-static void mi_execute_async_cli_command (char *cli_command,
+static void mi_execute_async_cli_command (char *cli_command,
char **argv, int argc);
static int register_changed_p (int regnum, struct regcache *,
struct regcache *);
/* FIXME: Should call a libgdb function, not a cli wrapper. */
mi_execute_async_cli_command ("jump", argv, argc);
}
-
+
static void
proceed_thread (struct thread_info *thread, int pid)
{
if (!inf)
error (_("Non-existent thread group id '%d'"), id);
-
+
print_thread_info (uiout, NULL, inf->pid);
}
else
}
/* Write given values into registers. The registers and values are
- given as pairs. The corresponding MI command is
+ given as pairs. The corresponding MI command is
-data-write-register-values <format>
[<regnum1> <value1>...<regnumN> <valueN>] */
void
/* This is the -data-read-memory command.
ADDR: start address of data to be dumped.
- WORD-FORMAT: a char indicating format for the ``word''. See
+ WORD-FORMAT: a char indicating format for the ``word''. See
the ``x'' command.
WORD-SIZE: size of each ``word''; 1,2,4, or 8 bytes.
NR_ROW: Number of rows.
{addr="...",rowN={wordN="..." ,... [,ascii="..."]}, ...}
- Returns:
+ Returns:
The number of bytes read is SIZE*ROW*COL. */
void
ADDR: start address of the row in the memory grid where the memory
cell is, if OFFSET_COLUMN is specified. Otherwise, the address of
the location to write to.
- FORMAT: a char indicating format for the ``word''. See
+ FORMAT: a char indicating format for the ``word''. See
the ``x'' command.
WORD_SIZE: size of each ``word''; 1,2,4, or 8 bytes
VALUE: value to be written into the memory address.
if (len < count)
{
- /* Pattern is made of less bytes than count:
+ /* Pattern is made of less bytes than count:
repeat pattern to fill memory. */
data = xmalloc (count);
make_cleanup (xfree, data);
-
+
steps = count / len;
remainder = count % len;
for (j = 0; j < steps; j++)
if (remainder > 0)
memcpy (data + steps * len, databuf, remainder);
}
- else
+ else
{
- /* Pattern is longer than or equal to count:
+ /* Pattern is longer than or equal to count:
just copy len bytes. */
data = databuf;
}
}
else
goto usage_error;
-
+
return;
usage_error:
struct cleanup *cleanup = NULL;
struct ui_out *uiout = current_uiout;
- cleanup = make_cleanup_ui_out_list_begin_end (uiout, "features");
+ 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, "language-option");
ui_out_field_string (uiout, NULL, "info-gdb-mi-command");
ui_out_field_string (uiout, NULL, "undefined-command-error-code");
-
+
#if HAVE_PYTHON
if (gdb_python_initialized)
ui_out_field_string (uiout, NULL, "python");
#endif
-
+
do_cleanups (cleanup);
return;
}
struct cleanup *cleanup = NULL;
struct ui_out *uiout = current_uiout;
- cleanup = make_cleanup_ui_out_list_begin_end (uiout, "features");
+ cleanup = make_cleanup_ui_out_list_begin_end (uiout, "features");
if (target_can_async_p ())
ui_out_field_string (uiout, NULL, "async");
if (target_can_execute_reverse)
ui_out_field_string (uiout, NULL, "reverse");
-
+
do_cleanups (cleanup);
return;
}
/* Callback used to find the first inferior other than the current
one. */
-
+
static int
get_other_inferior (struct inferior *inf, void *arg)
{
if (inf == current_inferior ())
{
struct thread_info *tp = 0;
- struct inferior *new_inferior
+ struct inferior *new_inferior
= iterate_over_inferiors (get_other_inferior, NULL);
if (new_inferior == NULL)
mi_out_put (uiout, raw_stdout);
mi_out_rewind (uiout);
mi_print_timing_maybe ();
- fputs_unfiltered ("\n", raw_stdout);
+ fputs_unfiltered ("\n", raw_stdout);
}
else
mi_out_rewind (uiout);
bpstat_do_actions ();
if (/* The notifications are only output when the top-level
- interpreter (specified on the command line) is MI. */
+ interpreter (specified on the command line) is MI. */
ui_out_is_mi_like_p (interp_ui_out (top_level_interpreter ()))
- /* Don't try report anything if there are no threads --
+ /* Don't try report anything if there are no threads --
the program is dead. */
&& thread_count () != 0
/* -thread-select explicitly changes thread. If frontend uses that
}
if (report_change)
- {
+ {
struct thread_info *ti = inferior_thread ();
target_terminal_ours ();
- fprintf_unfiltered (mi->event_channel,
+ fprintf_unfiltered (mi->event_channel,
"thread-selected,id=\"%d\"",
ti->num);
gdb_flush (mi->event_channel);
run = xstrprintf ("%s %s&", cli_command, argc ? *argv : "");
else
run = xstrprintf ("%s %s", cli_command, argc ? *argv : "");
- old_cleanups = make_cleanup (xfree, run);
+ old_cleanups = make_cleanup (xfree, run);
execute_command (run, 0 /* from_tty */ );
current_uiout = saved_uiout;
}
-static void
+static void
timestamp (struct mi_timestamp *tv)
{
gettimeofday (&tv->wallclock, NULL);
#endif
}
-static void
+static void
print_diff_now (struct mi_timestamp *start)
{
struct mi_timestamp now;
print_diff_now (current_command_ts);
}
-static long
+static long
timeval_diff (struct timeval start, struct timeval end)
{
return ((end.tv_sec - start.tv_sec) * 1000000L)
+ (end.tv_usec - start.tv_usec);
}
-static void
+static void
print_diff (struct mi_timestamp *start, struct mi_timestamp *end)
{
fprintf_unfiltered
(raw_stdout,
- ",time={wallclock=\"%0.5f\",user=\"%0.5f\",system=\"%0.5f\"}",
- timeval_diff (start->wallclock, end->wallclock) / 1000000.0,
- timeval_diff (start->utime, end->utime) / 1000000.0,
+ ",time={wallclock=\"%0.5f\",user=\"%0.5f\",system=\"%0.5f\"}",
+ timeval_diff (start->wallclock, end->wallclock) / 1000000.0,
+ timeval_diff (start->utime, end->utime) / 1000000.0,
timeval_diff (start->stime, end->stime) / 1000000.0);
}