+2001-06-18 Andrew Cagney <ac131313@redhat.com>
+
+ * infrun.c, breakpoint.c: Use strncmp as the "mi" test. Allow,
+ "mi", "mi0" and "mi1".
+
2001-06-17 Andrew Cagney <ac131313@redhat.com>
* gdbarch.sh: Generate an error when conflicting macro
#ifdef UI_OUT
annotate_breakpoint (bs->breakpoint_at->number);
ui_out_text (uiout, "\nBreakpoint ");
- if (interpreter_p && strcmp (interpreter_p, "mi") == 0)
+ if (interpreter_p && strncmp (interpreter_p, "mi", 2) == 0)
ui_out_field_string (uiout, "reason", "breakpoint-hit");
ui_out_field_int (uiout, "bkptno", bs->breakpoint_at->number);
ui_out_text (uiout, ", ");
{
annotate_watchpoint (bs->breakpoint_at->number);
#ifdef UI_OUT
- if (interpreter_p && strcmp (interpreter_p, "mi") == 0)
+ if (interpreter_p && strncmp (interpreter_p, "mi", 2) == 0)
ui_out_field_string (uiout, "reason", "watchpoint-trigger");
mention (bs->breakpoint_at);
ui_out_tuple_begin (uiout, "value");
case bp_read_watchpoint:
#ifdef UI_OUT
- if (interpreter_p && strcmp (interpreter_p, "mi") == 0)
+ if (interpreter_p && strncmp (interpreter_p, "mi", 2) == 0)
ui_out_field_string (uiout, "reason", "read-watchpoint-trigger");
mention (bs->breakpoint_at);
ui_out_tuple_begin (uiout, "value");
if (bs->old_val != NULL)
{
annotate_watchpoint (bs->breakpoint_at->number);
- if (interpreter_p && strcmp (interpreter_p, "mi") == 0)
+ if (interpreter_p && strncmp (interpreter_p, "mi", 2) == 0)
ui_out_field_string (uiout, "reason", "access-watchpoint-trigger");
mention (bs->breakpoint_at);
ui_out_tuple_begin (uiout, "value");
else
{
mention (bs->breakpoint_at);
- if (interpreter_p && strcmp (interpreter_p, "mi") == 0)
+ if (interpreter_p && strncmp (interpreter_p, "mi", 2) == 0)
ui_out_field_string (uiout, "reason", "access-watchpoint-trigger");
ui_out_tuple_begin (uiout, "value");
ui_out_text (uiout, "\nValue = ");
case bp_finish:
#ifdef UI_OUT
- if (interpreter_p && strcmp (interpreter_p, "mi") == 0)
+ if (interpreter_p && strncmp (interpreter_p, "mi", 2) == 0)
ui_out_field_string (uiout, "reason", "function-finished");
#endif
return PRINT_UNKNOWN;
case bp_until:
#ifdef UI_OUT
- if (interpreter_p && strcmp (interpreter_p, "mi") == 0)
+ if (interpreter_p && strncmp (interpreter_p, "mi", 2) == 0)
ui_out_field_string (uiout, "reason", "location-reached");
#endif
return PRINT_UNKNOWN;
will be deleted already. So we have no choice but print the
information here. */
#ifdef UI_OUT
- if (interpreter_p && strcmp (interpreter_p, "mi") == 0)
+ if (interpreter_p && strncmp (interpreter_p, "mi", 2) == 0)
ui_out_field_string (uiout, "reason", "watchpoint-scope");
ui_out_text (uiout, "\nWatchpoint ");
ui_out_field_int (uiout, "wpnum", bs->breakpoint_at->number);
#ifdef UI_OUT
/* Output the count also if it is zero, but only if this is
mi. FIXME: Should have a better test for this. */
- if (interpreter_p && strcmp (interpreter_p, "mi") == 0)
+ if (interpreter_p && strncmp (interpreter_p, "mi", 2) == 0)
if (show_breakpoint_hit_counts && b->hit_count == 0)
ui_out_field_int (uiout, "times", b->hit_count);
#endif
#endif
case bp_breakpoint:
#ifdef UI_OUT
- if (interpreter_p && strcmp (interpreter_p, "mi") == 0)
+ if (interpreter_p && strncmp (interpreter_p, "mi", 2) == 0)
{
say_where = 0;
break;
break;
case bp_hardware_breakpoint:
#ifdef UI_OUT
- if (interpreter_p && strcmp (interpreter_p, "mi") == 0)
+ if (interpreter_p && strncmp (interpreter_p, "mi", 2) == 0)
{
say_where = 0;
break;
do_cleanups (old_chain);
#endif
#ifdef UI_OUT
- if (interpreter_p && strcmp (interpreter_p, "mi") == 0)
+ if (interpreter_p && strncmp (interpreter_p, "mi", 2) == 0)
return;
#endif
printf_filtered ("\n");
/* Print a message only if not in the middle of doing a "step n"
operation for n > 1 */
if (!step_multi || !stop_step)
- if (interpreter_p && strcmp (interpreter_p, "mi") == 0)
+ if (interpreter_p && strncmp (interpreter_p, "mi", 2) == 0)
ui_out_field_string (uiout, "reason", "end-stepping-range");
#endif
break;
/* The inferior was terminated by a signal. */
#ifdef UI_OUT
annotate_signalled ();
- if (interpreter_p && strcmp (interpreter_p, "mi") == 0)
+ if (interpreter_p && strncmp (interpreter_p, "mi", 2) == 0)
ui_out_field_string (uiout, "reason", "exited-signalled");
ui_out_text (uiout, "\nProgram terminated with signal ");
annotate_signal_name ();
annotate_exited (stop_info);
if (stop_info)
{
- if (interpreter_p && strcmp (interpreter_p, "mi") == 0)
+ if (interpreter_p && strncmp (interpreter_p, "mi", 2) == 0)
ui_out_field_string (uiout, "reason", "exited");
ui_out_text (uiout, "\nProgram exited with code ");
ui_out_field_fmt (uiout, "exit-code", "0%o", (unsigned int) stop_info);
}
else
{
- if (interpreter_p && strcmp (interpreter_p, "mi") == 0)
+ if (interpreter_p && strncmp (interpreter_p, "mi", 2) == 0)
ui_out_field_string (uiout, "reason", "exited-normally");
ui_out_text (uiout, "\nProgram exited normally.\n");
}
#ifdef UI_OUT
/* For mi, have the same behavior every time we stop:
print everything but the source line. */
- if (interpreter_p && strcmp (interpreter_p, "mi") == 0)
+ if (interpreter_p && strncmp (interpreter_p, "mi", 2) == 0)
source_flag = LOC_AND_ADDRESS;
#endif
#ifdef UI_OUT
- if (interpreter_p && strcmp (interpreter_p, "mi") == 0)
+ if (interpreter_p && strncmp (interpreter_p, "mi", 2) == 0)
ui_out_field_int (uiout, "thread-id",
pid_to_thread_id (inferior_ptid));
#endif
+2001-06-18 Andrew Cagney <ac131313@redhat.com>
+
+ * mi-main.c: Use strncmp as the "mi" test. Allow "mi", "mi0" and
+ "mi1".
+ (mi_command_loop): Add parameter mi_version, pass to mi_out_new.
+ (mi1_command_loop, mi0_command_loop): New functions.
+ (_initialize_mi_main): Recognize "mi", "mi0" and "mi1".
+ * mi-out.c (mi_out_new): Add parameter mi_version.
+ (struct ui_out_data): Add field mi_version.
+ * mi-out.h (mi_out_new): Update.
+
2001-06-07 Andrew Cagney <ac131313@redhat.com>
* gdbmi.texinfo (GDB/MI Output Syntax): Add tuples and lists to
static char *previous_sect_name = NULL;
int new_section;
- if (!interpreter_p || strcmp (interpreter_p, "mi") != 0)
+ if (!interpreter_p || strncmp (interpreter_p, "mi", 2) != 0)
return;
update_threshold.tv_sec = 0;
}
static void
-mi_command_loop (void)
+mi_command_loop (int mi_version)
{
/* HACK: Force stdout/stderr to point at the console. This avoids
any potential side effects caused by legacy code that is still
/* HACK: Poke the ui_out table directly. Should we be creating a
mi_out object wired up to the above gdb_stdout / gdb_stderr? */
- uiout = mi_out_new ();
+ uiout = mi_out_new (mi_version);
/* HACK: Override any other interpreter hooks. We need to create a
real event table and pass in that. */
start_event_loop ();
}
+static void
+mi0_command_loop (void)
+{
+ mi_command_loop (0);
+}
+
+static void
+mi1_command_loop (void)
+{
+ mi_command_loop (1);
+}
+
static void
setup_architecture_data (void)
{
void
_initialize_mi_main (void)
{
+ if (interpreter_p == NULL)
+ return;
+
/* If we're _the_ interpreter, take control. */
- if (interpreter_p
- && strcmp (interpreter_p, "mi") == 0)
+ if (strcmp (interpreter_p, "mi0") == 0)
+ command_loop_hook = mi0_command_loop;
+ else if (strcmp (interpreter_p, "mi") == 0
+ || strcmp (interpreter_p, "mi1") == 0)
+ command_loop_hook = mi1_command_loop;
+ else
+ return;
+
+ init_ui_hook = mi_init_ui;
+ setup_architecture_data ();
+ register_gdbarch_swap (&old_regs, sizeof (old_regs), NULL);
+ register_gdbarch_swap (NULL, 0, setup_architecture_data);
+ if (event_loop_p)
{
- init_ui_hook = mi_init_ui;
- command_loop_hook = mi_command_loop;
- setup_architecture_data ();
- register_gdbarch_swap (&old_regs, sizeof (old_regs), NULL);
- register_gdbarch_swap (NULL, 0, setup_architecture_data);
- if (event_loop_p)
- {
- /* These overwrite some of the initialization done in
- _intialize_event_loop. */
- call_readline = gdb_readline2;
- input_handler = mi_execute_command_wrapper;
- add_file_handler (input_fd, stdin_event_handler, 0);
- async_command_editing_p = 0;
- }
+ /* These overwrite some of the initialization done in
+ _intialize_event_loop. */
+ call_readline = gdb_readline2;
+ input_handler = mi_execute_command_wrapper;
+ add_file_handler (input_fd, stdin_event_handler, 0);
+ async_command_editing_p = 0;
}
/* FIXME: Should we notify main that we are here as a possible
interpreter? */
{
int suppress_field_separator;
int first_header;
+ int mi_version;
struct ui_file *buffer;
};
/* initalize private members at startup */
struct ui_out *
-mi_out_new (void)
+mi_out_new (int mi_version)
{
int flags = 0;
struct ui_out_data *data = XMALLOC (struct ui_out_data);
data->suppress_field_separator = 0;
+ data->mi_version = mi_version;
/* FIXME: This code should be using a ``string_file'' and not the
TUI buffer hack. */
data->buffer = mem_fileopen ();
struct ui_out;
struct ui_file;
-extern struct ui_out *mi_out_new (void);
+extern struct ui_out *mi_out_new (int mi_version);
extern void mi_out_put (struct ui_out *uiout, struct ui_file *stream);
extern void mi_out_rewind (struct ui_out *uiout);
extern void mi_out_buffered (struct ui_out *uiout, char *string);
+2001-06-18 Andrew Cagney <ac131313@redhat.com>
+
+ * mi-basics.exp, mi-break.exp, mi-console.exp, mi-disassemble.exp,
+ mi-eval.exp, mi-hack-cli.exp, mi-read-memory.exp, mi-regs.exp,
+ mi-return.exp, mi-simplerun.exp, mi-stack.exp, mi-stepi.exp,
+ mi-until.exp, mi-var-block.exp, mi-var-child.exp, mi-var-cmd.exp,
+ mi-var-display.exp, mi-watch.exp, mi0-basics.exp, mi0-break.exp,
+ mi0-console.exp, mi0-disassemble.exp, mi0-eval.exp,
+ mi0-hack-cli.exp, mi0-read-memory.exp, mi0-regs.exp,
+ mi0-return.exp, mi0-simplerun.exp, mi0-stack.exp, mi0-stepi.exp,
+ mi0-until.exp, mi0-var-block.exp, mi0-var-child.exp,
+ mi0-var-cmd.exp, mi0-var-display.exp, mi0-watch.exp: Use MIFLAGS
+ to explictly select an interpreter.
+
2001-06-16 Andrew Cagney <ac131313@redhat.com>
MI0 was the never enabled MI interface included in GDB 5.0.
#
load_lib mi-support.exp
+set MIFLAGS "-i=mi"
gdb_exit
if [mi_gdb_start] {
#
load_lib mi-support.exp
+set MIFLAGS "-i=mi"
gdb_exit
if [mi_gdb_start] {
# remote target.
load_lib mi-support.exp
+set MIFLAGS "-i=mi"
gdb_exit
if [mi_gdb_start] {
#
load_lib mi-support.exp
+set MIFLAGS "-i=mi"
gdb_exit
if [mi_gdb_start] {
#
load_lib mi-support.exp
+set MIFLAGS "-i=mi"
gdb_exit
if [mi_gdb_start] {
# Some basic checks for the CLI.
load_lib mi-support.exp
+set MIFLAGS "-i=mi"
gdb_exit
if [mi_gdb_start] {
#
load_lib mi-support.exp
+set MIFLAGS "-i=mi"
gdb_exit
if [mi_gdb_start] {
load_lib mi-support.exp
+set MIFLAGS "-i=mi"
gdb_exit
if [mi_gdb_start] {
#
load_lib mi-support.exp
+set MIFLAGS "-i=mi"
gdb_exit
if [mi_gdb_start] {
#
load_lib mi-support.exp
+set MIFLAGS "-i=mi"
gdb_exit
if [mi_gdb_start] {
#
load_lib mi-support.exp
+set MIFLAGS "-i=mi"
gdb_exit
if [mi_gdb_start] {
#
load_lib mi-support.exp
+set MIFLAGS "-i=mi"
gdb_exit
if [mi_gdb_start] {
#
load_lib mi-support.exp
+set MIFLAGS "-i=mi"
gdb_exit
if [mi_gdb_start] {
load_lib mi-support.exp
+set MIFLAGS "-i=mi"
gdb_exit
if [mi_gdb_start] {
load_lib mi-support.exp
+set MIFLAGS "-i=mi"
gdb_exit
if [mi_gdb_start] {
load_lib mi-support.exp
+set MIFLAGS "-i=mi"
gdb_exit
if [mi_gdb_start] {
load_lib mi-support.exp
+set MIFLAGS "-i=mi"
gdb_exit
if [mi_gdb_start] {
#
load_lib mi-support.exp
+set MIFLAGS "-i=mi"
gdb_exit
if [mi_gdb_start] {
#
load_lib mi-support.exp
+set MIFLAGS "-i=mi0"
gdb_exit
if [mi_gdb_start] {
#
load_lib mi-support.exp
+set MIFLAGS "-i=mi0"
gdb_exit
if [mi_gdb_start] {
# remote target.
load_lib mi-support.exp
+set MIFLAGS "-i=mi0"
gdb_exit
if [mi_gdb_start] {
#
load_lib mi-support.exp
+set MIFLAGS "-i=mi0"
gdb_exit
if [mi_gdb_start] {
#
load_lib mi-support.exp
+set MIFLAGS "-i=mi0"
gdb_exit
if [mi_gdb_start] {
# Some basic checks for the CLI.
load_lib mi-support.exp
+set MIFLAGS "-i=mi0"
gdb_exit
if [mi_gdb_start] {
#
load_lib mi-support.exp
+set MIFLAGS "-i=mi0"
gdb_exit
if [mi_gdb_start] {
load_lib mi-support.exp
+set MIFLAGS "-i=mi0"
gdb_exit
if [mi_gdb_start] {
#
load_lib mi-support.exp
+set MIFLAGS "-i=mi0"
gdb_exit
if [mi_gdb_start] {
#
load_lib mi-support.exp
+set MIFLAGS "-i=mi0"
gdb_exit
if [mi_gdb_start] {
#
load_lib mi-support.exp
+set MIFLAGS "-i=mi0"
gdb_exit
if [mi_gdb_start] {
#
load_lib mi-support.exp
+set MIFLAGS "-i=mi0"
gdb_exit
if [mi_gdb_start] {
#
load_lib mi-support.exp
+set MIFLAGS "-i=mi0"
gdb_exit
if [mi_gdb_start] {
load_lib mi-support.exp
+set MIFLAGS "-i=mi0"
gdb_exit
if [mi_gdb_start] {
load_lib mi-support.exp
+set MIFLAGS "-i=mi0"
gdb_exit
if [mi_gdb_start] {
load_lib mi-support.exp
+set MIFLAGS "-i=mi0"
gdb_exit
if [mi_gdb_start] {
load_lib mi-support.exp
+set MIFLAGS "-i=mi0"
gdb_exit
if [mi_gdb_start] {
#
load_lib mi-support.exp
+set MIFLAGS "-i=mi0"
gdb_exit
if [mi_gdb_start] {