diff options
author | Andrew Cagney <cagney@redhat.com> | 2003-02-04 01:26:55 +0000 |
---|---|---|
committer | Andrew Cagney <cagney@redhat.com> | 2003-02-04 01:26:55 +0000 |
commit | c7ecc53175f12417c158b2a1e4f7f5046cf9f7af (patch) | |
tree | 55f565f1c431365d03bb570d60670d93f033f9d3 | |
parent | eab73163fcc75925fd4a4c225e1997b86ce3d322 (diff) | |
download | gdb-c7ecc53175f12417c158b2a1e4f7f5046cf9f7af.tar.gz |
Kill off anything not directly related to the CLI command.
36 files changed, 305 insertions, 357 deletions
diff --git a/gdb/Makefile.in b/gdb/Makefile.in index b15e71f72f7..b4d9676afe7 100644 --- a/gdb/Makefile.in +++ b/gdb/Makefile.in @@ -144,11 +144,15 @@ TARGET_SYSTEM_ROOT_DEFINE = @TARGET_SYSTEM_ROOT_DEFINE@ # CLI sub directory definitons # SUBDIR_CLI_OBS = \ - cli-dump.o cli-decode.o \ - cli-interp.o cli-script.o cli-cmds.o cli-setshow.o cli-utils.o + cli-dump.o \ + cli-decode.o cli-script.o cli-cmds.o \ + cli-interp.o \ + cli-setshow.o cli-utils.o SUBDIR_CLI_SRCS = \ - cli/cli-dump.c cli/cli-decode.c \ - cli/cli-interp.c cli/cli-script.c cli/cli-cmds.c cli/cli-setshow.c \ + cli/cli-dump.c \ + cli/cli-decode.c cli/cli-script.c cli/cli-cmds.c \ + cli/cli-interp.c \ + cli/cli-setshow.c \ cli/cli-utils.c SUBDIR_CLI_DEPS = SUBDIR_CLI_INITS = \ @@ -167,7 +171,6 @@ SUBDIR_MI_OBS = \ mi-out.o mi-console.o \ mi-cmds.o mi-cmd-env.o mi-cmd-var.o mi-cmd-break.o mi-cmd-stack.o \ mi-cmd-disas.o \ - mi-events.o \ mi-interp.o \ mi-main.o mi-parse.o mi-getopt.o SUBDIR_MI_SRCS = \ @@ -175,7 +178,6 @@ SUBDIR_MI_SRCS = \ mi/mi-cmds.c mi/mi-cmd-env.c \ mi/mi-cmd-var.c mi/mi-cmd-break.c mi/mi-cmd-stack.c \ mi/mi-cmd-disas.c \ - mi/mi-events.c \ mi/mi-interp.c \ mi/mi-main.c mi/mi-parse.c mi/mi-getopt.c SUBDIR_MI_DEPS = @@ -520,7 +522,8 @@ SFILES = ada-exp.y ada-lang.c ada-typeprint.c ada-valprint.c ada-tasks.c \ frame-unwind.c \ gdbarch.c arch-utils.c gdbtypes.c gnu-v2-abi.c gnu-v3-abi.c \ hpacc-abi.c \ - inf-loop.c infcmd.c inflow.c infrun.c interps.c \ + inf-loop.c infcmd.c inflow.c infrun.c \ + interps.c \ jv-exp.y jv-lang.c jv-valprint.c jv-typeprint.c \ kod.c kod-cisco.c \ language.c linespec.c \ @@ -742,6 +745,7 @@ cli_utils_h = $(srcdir)/cli/cli-utils.h # gdb/mi/ headers # +mi_h = $(srcdir)/mi/mi.h mi_cmds_h = $(srcdir)/mi/mi-cmds.h mi_console_h = $(srcdir)/mi/mi-console.h mi_getopt_h = $(srcdir)/mi/mi-getopt.h @@ -821,6 +825,7 @@ COMMON_OBS = version.o blockframe.o breakpoint.o findvar.o regcache.o \ source.o values.o eval.o valops.o valarith.o valprint.o printcmd.o \ symtab.o symfile.o symmisc.o linespec.o infcmd.o infrun.o \ expprint.o environ.o stack.o thread.o \ + interps.o \ macrotab.o macrocmd.o macroexp.o macroscope.o \ event-loop.o event-top.o inf-loop.o completer.o \ gdbarch.o arch-utils.o gdbtypes.o osabi.o copying.o $(DEPFILES) \ @@ -833,7 +838,7 @@ COMMON_OBS = version.o blockframe.o breakpoint.o findvar.o regcache.o \ dbxread.o coffread.o elfread.o \ dwarfread.o dwarf2read.o mipsread.o stabsread.o corefile.o \ c-lang.o f-lang.o \ - ui-out.o cli-out.o interps.o \ + ui-out.o cli-out.o \ varobj.o wrapper.o \ jv-lang.o jv-valprint.o jv-typeprint.o \ m2-lang.o p-lang.o p-typeprint.o p-valprint.o \ @@ -1639,10 +1644,9 @@ eval.o: eval.c $(defs_h) $(gdb_string_h) $(symtab_h) $(gdbtypes_h) \ $(value_h) $(expression_h) $(target_h) $(frame_h) $(language_h) \ $(f_lang_h) $(cp_abi_h) event-loop.o: event-loop.c $(defs_h) $(event_loop_h) $(event_top_h) \ - $(gdb_string_h) $(interps_h) + $(gdb_string_h) event-top.o: event-top.c $(defs_h) $(top_h) $(inferior_h) $(target_h) \ - $(terminal_h) $(event_loop_h) $(event_top_h) $(gdbcmd_h) \ - $(readline_h) $(interps_h) + $(terminal_h) $(event_loop_h) $(event_top_h) $(gdbcmd_h) $(readline_h) exec.o: exec.c $(defs_h) $(frame_h) $(inferior_h) $(target_h) $(gdbcmd_h) \ $(language_h) $(symfile_h) $(objfiles_h) $(completer_h) $(value_h) \ $(gdb_string_h) $(gdbcore_h) $(gdb_stat_h) $(xcoffsolib_h) \ @@ -1703,8 +1707,6 @@ go32-nat.o: go32-nat.c $(defs_h) $(inferior_h) $(gdb_wait_h) $(gdbcore_h) \ $(command_h) $(gdbcmd_h) $(floatformat_h) $(buildsym_h) \ $(i387_tdep_h) $(i386_tdep_h) $(value_h) $(regcache_h) \ $(gdb_string_h) -interps.o: interps.c $(defs_h) $(gdbcmd_h) $(ui_out_h) $(event_loop_h) \ - $(event_top_h) $(interps_h) $(gdb_h) $(wrapper_h) $(gdb_events_h) h8300-tdep.o: h8300-tdep.c $(defs_h) $(frame_h) $(symtab_h) $(dis_asm_h) \ $(gdbcmd_h) $(gdbtypes_h) $(gdbcore_h) $(gdb_string_h) $(value_h) \ $(regcache_h) @@ -1801,6 +1803,9 @@ inftarg.o: inftarg.c $(defs_h) $(frame_h) $(inferior_h) $(target_h) \ $(gdbcore_h) $(command_h) $(gdb_stat_h) $(gdb_wait_h) infttrace.o: infttrace.c $(defs_h) $(frame_h) $(inferior_h) $(target_h) \ $(gdb_string_h) $(gdb_wait_h) $(command_h) $(gdbcore_h) +interps.o: interps.c $(defs_h) $(gdbcmd_h) $(ui_out_h) $(event_loop_h) \ + $(event_top_h) $(interps_h) $(completer_h) $(gdb_string_h) \ + $(gdb_events_h) irix4-nat.o: irix4-nat.c $(defs_h) $(inferior_h) $(gdbcore_h) $(regcache_h) \ $(gregset_h) irix5-nat.o: irix5-nat.c $(defs_h) $(inferior_h) $(gdbcore_h) $(target_h) \ @@ -1876,7 +1881,7 @@ macrotab.o: macrotab.c $(defs_h) $(gdb_obstack_h) $(splay_tree_h) \ $(bcache_h) $(complaints_h) main.o: main.c $(defs_h) $(top_h) $(target_h) $(inferior_h) $(symfile_h) \ $(gdbcore_h) $(getopt_h) $(gdb_stat_h) $(gdb_string_h) \ - $(event_loop_h) $(ui_out_h) $(main_h) $(interps_h) + $(event_loop_h) $(ui_out_h) $(main_h) maint.o: maint.c $(defs_h) $(command_h) $(gdbcmd_h) $(symtab_h) \ $(gdbtypes_h) $(demangle_h) $(gdbcore_h) $(expression_h) \ $(language_h) $(symfile_h) $(objfiles_h) $(value_h) $(cli_decode_h) @@ -2319,8 +2324,8 @@ cli-dump.o: $(srcdir)/cli/cli-dump.c $(defs_h) $(gdb_string_h) \ $(cli_decode_h) $(cli_cmds_h) $(value_h) $(completer_h) \ $(cli_dump_h) $(gdb_assert_h) $(target_h) $(readline_h) $(CC) -c $(INTERNAL_CFLAGS) $(srcdir)/cli/cli-dump.c -cli-interp.o: $(srcdir)/cli/cli-interp.c $(defs_h) $(value_h) \ - $(wrapper_h) $(event_top_h) $(ui_out_h) $(cli_out_h) $(top_h) +cli-interp.o: $(srcdir)/cli/cli-interp.c $(defs_h) $(interps_h) $(wrapper_h) \ + $(event_top_h) $(ui_out_h) $(cli_out_h) $(top_h) $(CC) -c $(INTERNAL_CFLAGS) $(srcdir)/cli/cli-interp.c cli-script.o: $(srcdir)/cli/cli-script.c $(defs_h) $(value_h) $(language_h) \ $(ui_out_h) $(gdb_string_h) $(top_h) $(cli_cmds_h) $(cli_decode_h) \ @@ -2482,7 +2487,7 @@ gdbtk-wrapper.o: $(srcdir)/gdbtk/generic/gdbtk-wrapper.c \ mi-cmd-break.o: $(srcdir)/mi/mi-cmd-break.c $(defs_h) $(mi_cmds_h) \ $(ui_out_h) $(mi_out_h) $(breakpoint_h) $(gdb_string_h) \ - $(mi_getopt_h) $(gdb_events_h) $(gdb_h) $(interps_h) + $(mi_getopt_h) $(gdb_events_h) $(gdb_h) $(CC) -c $(INTERNAL_CFLAGS) $(srcdir)/mi/mi-cmd-break.c mi-cmd-disas.o: $(srcdir)/mi/mi-cmd-disas.c $(defs_h) $(target_h) $(value_h) \ $(mi_cmds_h) $(mi_getopt_h) $(ui_out_h) $(gdb_string_h) $(disasm_h) @@ -2503,21 +2508,18 @@ mi-cmds.o: $(srcdir)/mi/mi-cmds.c $(defs_h) $(top_h) $(mi_cmds_h) \ mi-console.o: $(srcdir)/mi/mi-console.c $(defs_h) $(mi_console_h) \ $(gdb_string_h) $(CC) -c $(INTERNAL_CFLAGS) $(srcdir)/mi/mi-console.c -mi-events.o: $(srcdir)/mi/mi-events.c $(defs_h) $(ui_out_h) $(interps_h) \ - $(gdb_h) $(breakpoint_h) $(mi_h) - $(CC) -c $(INTERNAL_CFLAGS) $(srcdir)/mi/mi-events.c mi-getopt.o: $(srcdir)/mi/mi-getopt.c $(defs_h) $(mi_getopt_h) \ $(gdb_string_h) $(CC) -c $(INTERNAL_CFLAGS) $(srcdir)/mi/mi-getopt.c -mi-interp.o: $(srcdir)/mi/mi-interp.c $(defs_h) $(interps_h) \ - $(event_top_h) $(event_loop_h) $(inferior_h) $(ui_out_h) \ - $(top_h) $(mi_h) $(mi_cmds_h) $(mi_out_h) $(mi_console_h) +mi-interp.o: $(srcdir)/mi/mi-interp.c $(defs_h) $(gdb_string_h) $(interps_h) \ + $(event_top_h) $(event_loop_h) $(inferior_h) $(ui_out_h) $(top_h) \ + $(mi_h) $(mi_cmds_h) $(mi_out_h) $(mi_console_h) $(CC) -c $(INTERNAL_CFLAGS) $(srcdir)/mi/mi-interp.c mi-main.o: $(srcdir)/mi/mi-main.c $(defs_h) $(target_h) $(inferior_h) \ $(gdb_string_h) $(top_h) $(gdbthread_h) $(mi_cmds_h) $(mi_parse_h) \ $(mi_getopt_h) $(mi_console_h) $(ui_out_h) $(mi_out_h) \ $(event_loop_h) $(event_top_h) $(gdbcore_h) $(value_h) $(regcache_h) \ - $(gdb_h) $(frame_h) $(interps_h) + $(gdb_h) $(frame_h) $(CC) -c $(INTERNAL_CFLAGS) $(srcdir)/mi/mi-main.c mi-out.o: $(srcdir)/mi/mi-out.c $(defs_h) $(ui_out_h) $(mi_out_h) $(CC) -c $(INTERNAL_CFLAGS) $(srcdir)/mi/mi-out.c diff --git a/gdb/breakpoint.c b/gdb/breakpoint.c index 2190fadbcb6..cd671a9a3e3 100644 --- a/gdb/breakpoint.c +++ b/gdb/breakpoint.c @@ -3899,7 +3899,6 @@ create_internal_breakpoint (CORE_ADDR address, enum bptype type) b = set_raw_breakpoint (sal, type); b->number = internal_breakpoint_number--; b->disposition = disp_donttouch; - breakpoint_create_event (b->number); return b; } @@ -4183,7 +4182,6 @@ solib_load_unload_1 (char *hookname, int tempflag, char *dll_pathname, } mention (b); - breakpoint_create_event (b->number); do_cleanups (old_chain); } @@ -4229,7 +4227,6 @@ create_fork_vfork_event_catchpoint (int tempflag, char *cond_string, b->forked_inferior_pid = 0; mention (b); - breakpoint_create_event (b->number); } void @@ -4268,7 +4265,6 @@ create_exec_event_catchpoint (int tempflag, char *cond_string) b->disposition = tempflag ? disp_del : disp_donttouch; mention (b); - breakpoint_create_event (b->number); } static int @@ -4392,7 +4388,6 @@ set_momentary_breakpoint (struct symtab_and_line sal, struct frame_id frame_id, if (in_thread_list (inferior_ptid)) b->thread = pid_to_thread_id (inferior_ptid); - breakpoint_create_event (b->number); return b; } @@ -4409,6 +4404,15 @@ mention (struct breakpoint *b) stb = ui_out_stream_new (uiout); old_chain = make_cleanup_ui_out_stream_delete (stb); + /* FIXME: This is misplaced; mention() is called by things (like hitting a + watchpoint) other than breakpoint creation. It should be possible to + clean this up and at the same time replace the random calls to + breakpoint_changed with this hook, as has already been done for + delete_breakpoint_hook and so on. */ + if (create_breakpoint_hook) + create_breakpoint_hook (b); + breakpoint_create_event (b->number); + switch (b->type) { case bp_none: @@ -4579,7 +4583,6 @@ create_breakpoints (struct symtabs_and_lines sals, char **addr_string, b->enable_state = bp_enabled; b->disposition = disposition; mention (b); - breakpoint_create_event (b->number); } } } @@ -5434,12 +5437,9 @@ watch_command_1 (char *arg, int accessflag, int from_tty) /* The scope breakpoint is related to the watchpoint. We will need to act on them together. */ b->related_breakpoint = scope_breakpoint; - - breakpoint_create_event (scope_breakpoint->number); } } value_free_to_mark (mark); - breakpoint_create_event (b->number); mention (b); } @@ -6183,7 +6183,6 @@ create_exception_catchpoint (int tempflag, char *cond_string, b->enable_state = bp_enabled; b->disposition = tempflag ? disp_del : disp_donttouch; mention (b); - breakpoint_create_event (b->number); } /* Deal with "catch catch" and "catch throw" commands */ @@ -6349,7 +6348,6 @@ handle_gnu_4_16_catch_command (char *arg, int tempflag, int from_tty) b->disposition = tempflag ? disp_del : disp_donttouch; mention (b); - breakpoint_create_event (b->number); } if (sals.nelts > 1) @@ -6492,7 +6490,6 @@ set_breakpoint_sal (struct symtab_and_line sal) b->number = breakpoint_count; b->cond = 0; b->thread = -1; - breakpoint_create_event (b->number); return b; } diff --git a/gdb/cli-out.h b/gdb/cli-out.h index 90fd446bbba..a984d058390 100644 --- a/gdb/cli-out.h +++ b/gdb/cli-out.h @@ -23,6 +23,8 @@ #define CLI_OUT_H extern struct ui_out *cli_out_new (struct ui_file *stream); + extern struct ui_file *cli_out_set_stream (struct ui_out *uiout, struct ui_file *stream); + #endif diff --git a/gdb/defs.h b/gdb/defs.h index fe53c82b598..d2a16158d37 100644 --- a/gdb/defs.h +++ b/gdb/defs.h @@ -1195,6 +1195,7 @@ extern void (*error_begin_hook) (void); extern int (*ui_load_progress_hook) (const char *section, unsigned long num); + /* Inhibit window interface if non-zero. */ extern int use_windows; diff --git a/gdb/gdb-events.sh b/gdb/gdb-events.sh index bf738d50678..458e4b60b9c 100755 --- a/gdb/gdb-events.sh +++ b/gdb/gdb-events.sh @@ -86,6 +86,7 @@ f:void:selected_thread_changed:int thread_num:thread_num #*:void:warning_hook:const char *string, va_list args:string, args #*:void:target_output_hook:char *b:b #*:void:interactive_hook:void +#*:void:registers_changed_hook:void #*:void:readline_begin_hook:char *format, ...:format #*:char *:readline_hook:char *prompt:prompt #*:void:readline_end_hook:void @@ -100,6 +101,7 @@ f:void:selected_thread_changed:int thread_num:thread_num #*:int:gdb_load_progress_hook:char *section, unsigned long num:section, num #*:void:pre_add_symbol_hook:char *name:name #*:void:post_add_symbol_hook:void +#*:void:selected_frame_level_changed_hook:int level:level #*:int:gdb_loop_hook:int signo:signo ##*:void:solib_create_inferior_hook:void ##*:void:xcoff_relocate_symtab_hook:unsigned int diff --git a/gdb/mi/mi-cmd-break.c b/gdb/mi/mi-cmd-break.c index 5f9d6aca756..5d15aa98b8a 100644 --- a/gdb/mi/mi-cmd-break.c +++ b/gdb/mi/mi-cmd-break.c @@ -28,7 +28,6 @@ #include "mi-getopt.h" #include "gdb-events.h" #include "gdb.h" -#include "interps.h" enum { @@ -40,8 +39,7 @@ enum static void breakpoint_notify (int b) { - if (b > 0) - gdb_breakpoint_query (uiout, b); + gdb_breakpoint_query (uiout, b); } @@ -79,7 +77,7 @@ mi_cmd_break_insert (char *command, char **argv, int argc) int ignore_count = 0; char *condition = NULL; enum gdb_rc rc; - struct gdb_events *old_hooks = NULL; + struct gdb_events *old_hooks; enum opt { HARDWARE_OPT, TEMP_OPT /*, REGEXP_OPT */ , CONDITION_OPT, @@ -135,17 +133,8 @@ mi_cmd_break_insert (char *command, char **argv, int argc) error ("mi_cmd_break_insert: Garbage following <location>"); address = argv[optind]; - /* Save the current event handlers so that we can insert our own. This - allows us to capture the breakpoint information as the breakpoint - is created. Unfortunately, it also overrides any existing event - handlers, so we won't get any event notifications sent out to the - client. MI3+ does NOT send breakpoint information with the -break-insert - command for this reason. */ - if (gdb_interpreter_current_is_named_p (GDB_INTERPRETER_MI2) - || gdb_interpreter_current_is_named_p (GDB_INTERPRETER_MI1)) - old_hooks = set_gdb_event_hooks (&breakpoint_hooks); - /* Now we have what we need, let's insert the breakpoint! */ + old_hooks = set_gdb_event_hooks (&breakpoint_hooks); switch (type) { case REG_BP: @@ -171,10 +160,7 @@ mi_cmd_break_insert (char *command, char **argv, int argc) internal_error (__FILE__, __LINE__, "mi_cmd_break_insert: Bad switch."); } - - if (gdb_interpreter_current_is_named_p (GDB_INTERPRETER_MI2) - || gdb_interpreter_current_is_named_p (GDB_INTERPRETER_MI1)) - set_gdb_event_hooks (old_hooks); + set_gdb_event_hooks (old_hooks); if (rc == GDB_RC_FAIL) return MI_CMD_CAUGHT_ERROR; @@ -250,15 +236,5 @@ mi_cmd_break_watch (char *command, char **argv, int argc) default: error ("mi_cmd_break_watch: Unknown watchpoint type."); } - - /* Ugh. This is a hack. mention and print_one_breakpoint in - breakpoint.c are so overloaded, that watchpoints and breakpoints - cannot use the same printing mechanisms. So for MI3+, we simply - rewind MI's uiout so that we can prevent GDB from printing - any information about the watchpoint we just inserted. */ - if (!gdb_interpreter_current_is_named_p (GDB_INTERPRETER_MI2) - && !gdb_interpreter_current_is_named_p (GDB_INTERPRETER_MI1)) - mi_out_rewind (uiout); - return MI_CMD_DONE; } diff --git a/gdb/mi/mi-cmds.h b/gdb/mi/mi-cmds.h index b8ff05709d3..d346a7659b2 100644 --- a/gdb/mi/mi-cmds.h +++ b/gdb/mi/mi-cmds.h @@ -27,7 +27,7 @@ enum mi_cmd_result { /* Report the command as ``done''. Display both the ``NNN^done'' - message and the completion prompt. */ + message and the completion prompt. */ MI_CMD_DONE = 0, /* The command is still running in the forground. Main loop should display the completion prompt. */ @@ -130,4 +130,5 @@ extern struct ui_file *raw_stdout; extern char *mi_error_message; extern void mi_error_last_message (void); extern void mi_execute_command (char *cmd, int from_tty); + #endif diff --git a/gdb/mi/mi-interp.c b/gdb/mi/mi-interp.c index 456e42d21ee..ee0693702eb 100644 --- a/gdb/mi/mi-interp.c +++ b/gdb/mi/mi-interp.c @@ -129,7 +129,6 @@ mi_interpreter_resume (void *data) /* Replace all the hooks that we know about. There really needs to be a better way of doing this... */ clear_interpreter_hooks (); - set_gdb_event_hooks (&mi_event_handlers); show_load_progress = mi_load_progress; diff --git a/gdb/mi/mi.h b/gdb/mi/mi.h index b553d56c9b2..b6ae425d1e5 100644 --- a/gdb/mi/mi.h +++ b/gdb/mi/mi.h @@ -24,7 +24,6 @@ extern struct gdb_interpreter *mi_interp; extern struct gdb_interpreter *mi1_interp; -extern struct gdb_events mi_event_handlers; extern struct ui_file *mi_event_channel; extern void mi_setup_architecture_data (void); diff --git a/gdb/testsuite/gdb.mi/ChangeLog b/gdb/testsuite/gdb.mi/ChangeLog index 8af7538b053..a13be709b11 100644 --- a/gdb/testsuite/gdb.mi/ChangeLog +++ b/gdb/testsuite/gdb.mi/ChangeLog @@ -1,3 +1,8 @@ +2003-02-03 Andrew Cagney <ac131313@redhat.com> + + * mi-cli.exp: Remove patterns checking for events. Better handle + continuations. + 2002-08-21 Keith Seitz <keiths@redhat.com> * mi-cli.exp: Use "target_changed" instead of "register-update". diff --git a/gdb/testsuite/gdb.mi/mi-break.exp b/gdb/testsuite/gdb.mi/mi-break.exp index ffc23a6b4d8..5cbe4e40d2e 100644 --- a/gdb/testsuite/gdb.mi/mi-break.exp +++ b/gdb/testsuite/gdb.mi/mi-break.exp @@ -1,4 +1,4 @@ -# Copyright 1999, 2002 Free Software Foundation, Inc. +# Copyright 1999 Free Software Foundation, Inc. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -62,20 +62,20 @@ proc test_tbreak_creation_and_listing {} { # -break-list mi_gdb_test "222-break-insert -t main" \ - "=breakpoint-create,number=\"1\"\r\n222\\^done" \ + "222\\^done,bkpt=\{number=\"1\",type=\"breakpoint\",disp=\"del\",enabled=\"y\",addr=\"$hex\",func=\"main\",file=\".*basics.c\",line=\"32\",times=\"0\"\}" \ "break-insert -t operation" mi_gdb_test "333-break-insert -t basics.c:callee2" \ - "=breakpoint-create,number=\"2\"\r\n333\\^done" \ + "333\\^done,bkpt=\{number=\"2\",type=\"breakpoint\",disp=\"del\",enabled=\"y\",addr=\"$hex\",func=\"callee2\",file=\".*basics.c\",line=\"22\",times=\"0\"\}" \ "insert temp breakpoint at basics.c:callee2" mi_gdb_test "444-break-insert -t basics.c:15" \ - "=breakpoint-create,number=\"3\"\r\n444\\^done" \ + "444\\^done,bkpt=\{number=\"3\",type=\"breakpoint\",disp=\"del\",enabled=\"y\",addr=\"$hex\",func=\"callee3\",file=\".*basics.c\",line=\"15\",times=\"0\"\}" \ "insert temp breakpoint at basics.c:15 (callee3)" # Getting the quoting right is tricky. That is "\"<file>\":6" mi_gdb_test "555-break-insert -t \"\\\"${srcfile}\\\":6\"" \ - "=breakpoint-create,number=\"4\"\r\n555\\^done" \ + "555\\^done,bkpt=\{number=\"4\",type=\"breakpoint\",disp=\"del\",enabled=\"y\",addr=\"$hex\",func=\"callee4\",file=\".*basics.c\",line=\"6\",times=\"0\"\}" \ "insert temp breakpoint at \"<fullfilename>\":6 (callee4)" mi_gdb_test "666-break-list" \ diff --git a/gdb/testsuite/gdb.mi/mi-cli.exp b/gdb/testsuite/gdb.mi/mi-cli.exp index 850d177cb19..11773b3ee80 100644 --- a/gdb/testsuite/gdb.mi/mi-cli.exp +++ b/gdb/testsuite/gdb.mi/mi-cli.exp @@ -57,8 +57,12 @@ mi_gdb_test "-interpreter-exec console bogus" \ "&\\\"$msg\\\\n\\\".*\\^error,msg=\\\"$msg\\\".*" \ "-interpreter-exec console bogus" +# NOTE: cagney/2003-02-03: Not yet. +# mi_gdb_test "-interpreter-exec console \"file $binfile\"" \ +# {(=.*)+\^done} \ +# "-interpreter-exec console \"file \$binfile\"" mi_gdb_test "-interpreter-exec console \"file $binfile\"" \ - {(=.*)+\^done} \ + {\^done} \ "-interpreter-exec console \"file \$binfile\"" mi_run_to_main @@ -71,8 +75,12 @@ mi_gdb_test "-interpreter-exec console \"show args\"" \ {\~"Argument list to give program being debugged when it is started is \\\"foobar\\\"\.\\n".*\^done} \ "-interpreter-exec console \"show args\"" +# NOTE: cagney/2003-02-03: Not yet. +# mi_gdb_test "-interpreter-exec console \"break callee4\"" \ +# {(&.*)*.*~"Breakpoint 2 at.*\\n".*=breakpoint-create,number="2".*\^done} \ +# "-interpreter-exec console \"break callee4\"" mi_gdb_test "-interpreter-exec console \"break callee4\"" \ - {(&.*)*.*~"Breakpoint 2 at.*\\n".*=breakpoint-create,number="2".*\^done} \ + {(&.*)*.*~"Breakpoint 2 at.*\\n".*\^done} \ "-interpreter-exec console \"break callee4\"" mi_gdb_test "-interpreter-exec console \"info break\"" \ @@ -87,41 +95,94 @@ mi_gdb_test "-interpreter-exec console \"list\"" \ {.*\~"32[ \t(\\t)]*callee1.*\\n".*\^done} \ "-interpreter-exec console \"list\"" -mi_gdb_test "-exec-continue" \ - {.*\*stopped,reason="breakpoint-hit",.*func="callee4".*file=".*basics.c",line="8"\}} \ - "-interpreter-exec console \"continue to callee4\"" +# # NOTE: cagney/2003-02-03: Not yet. +# mi_gdb_test "-exec-continue" \ +# {.*\*stopped,reason="breakpoint-hit",.*func="callee4".*file=".*basics.c",line="8"\}} \ +# "-interpreter-exec console \"continue to callee4\"" +send_gdb "999-exec-continue\n" +gdb_expect { + -re "999\\^running\[\r\n\]+$mi_gdb_prompt.*999\\*stopped,reason=.breakpoint-hit.*$mi_gdb_prompt$" { + pass "continue to callee4" + } + timeout { + fail "continue to callee4 (timeout)" + } +} -mi_gdb_test "-interpreter-exec console \"delete 2\"" \ - {.*=breakpoint-delete,number=\"2\".*\^done} \ +# NOTE: cagney/2003-02-03: Not yet. +# mi_gdb_test "100-interpreter-exec console \"delete 2\"" \ +# {.*=breakpoint-delete,number=\"2\".*\^done} \ +# "-interpreter-exec console \"delete 2\"" +mi_gdb_test "100-interpreter-exec console \"delete 2\"" \ + {100\^done} \ "-interpreter-exec console \"delete 2\"" -mi_gdb_test "-interpreter-exec console \"up\"" \ - {.*=selected-frame-level-changed,level="1".*\^done} \ +# NOTE: cagney/2003-02-03: Not yet. +# mi_gdb_test "200-interpreter-exec console \"up\"" \ +# {.*=selected-frame-level-changed,level="1".*\^done} \ +# "-interpreter-exec console \"up\"" +mi_gdb_test "200-interpreter-exec console \"up\"" \ + {200\^done} \ "-interpreter-exec console \"up\"" -mi_gdb_test "-interpreter-exec console \"down\"" \ - {.*=selected-frame-level-changed,level="0".*\^done} \ +# NOTE: cagney/2003-02-03: Not yet. +# mi_gdb_test "300-interpreter-exec console \"down\"" \ +# {.*=selected-frame-level-changed,level="0".*\^done} \ +# "-interpreter-exec console \"down\"" +mi_gdb_test "300-interpreter-exec console \"down\"" \ + {300\^done} \ "-interpreter-exec console \"down\"" -mi_gdb_test "-interpreter-exec console \"frame 2\"" \ - {.*=selected-frame-level-changed,level="2".*\^done} \ +# NOTE: cagney/2003-02-03: Not yet. +# mi_gdb_test "-interpreter-exec console \"frame 2\"" \ +# {.*=selected-frame-level-changed,level="2".*\^done} \ +# "-interpreter-exec console \"frame 2\"" +mi_gdb_test "400-interpreter-exec console \"frame 2\"" \ + {400\^done} \ "-interpreter-exec console \"frame 2\"" -mi_gdb_test "-stack-select-frame 0" \ - {.*=selected-frame-level-changed,level="0".*\^done} \ +# NOTE: cagney/2003-02-03: Not yet. +# mi_gdb_test "-stack-select-frame 0" \ +# {.*=selected-frame-level-changed,level="0".*\^done} \ +# "-stack-select-frame 0" +mi_gdb_test "500-stack-select-frame 0" \ + {500\^done} \ "-stack-select-frame 0" -mi_gdb_test "-break-insert -t basics.c:35" \ - {.*=breakpoint-create,number="3".*\^done} \ - "-break-insert -t basics.c:35" - -mi_gdb_test "-exec-continue" \ - {.*\*stopped.*,file=".*basics.c",line="35"\}} \ - "-exec-continue to line 35" +# NOTE: cagney/2003-02-03: Not yet. +# mi_gdb_test "-break-insert -t basics.c:35" \ +# {.*=breakpoint-create,number="3".*\^done} \ +# "-break-insert -t basics.c:35" +mi_gdb_test "600-break-insert -t basics.c:35" \ + {600\^done,bkpt=.number="3",type="breakpoint".*\}} \ + "-break-insert -t basics.c:35" + +# mi_gdb_test "-exec-continue" \ +# {.*\*stopped.*,file=".*basics.c",line="35"\}} \ +# "-exec-continue to line 35" +send_gdb "700-exec-continue\n" +gdb_expect { + -re "700\\^running\[\r\n\]+$mi_gdb_prompt.*\\*stopped.*,file=.*basics.c.,line=.35.*$mi_gdb_prompt$" { + pass "-exec-continue to line 35" + } + timeout { + fail "-exec-continue to line 35" + } +} -mi_gdb_test "-exec-next" \ - {.*\*stopped,reason="end-stepping-range",.*,file=".*basics.c",line="37"\}} \ - "-exec-next to line 37" +# NOTE: cagney/2003-02-03: Not yet. +# mi_gdb_test "-exec-next" \ +# {.*\*stopped,reason="end-stepping-range",.*,file=".*basics.c",line="37"\}} \ +# "-exec-next to line 37" +send_gdb "800-exec-next\n" +gdb_expect { + -re "800\\^running\[\r\n\]+$mi_gdb_prompt.*\\*stopped,reason=.end-stepping-range.*,file=.*basics.c.,line=.37.*$mi_gdb_prompt$" { + pass "-exec-next to line 37" + } + timeout { + fail "-exec-next to line 37" + } +} mi_gdb_test "-interpreter-exec console \"list\"" \ {\~"37[ \t(\\t)]*return 0;\\n".*\^done} \ @@ -131,8 +192,12 @@ mi_gdb_test "-interpreter-exec console \"help set args\"" \ {\~"Set argument list to give program being debugged when it is started\.\\nFollow this command with any number of args, to be passed to the program\.".*\^done} \ "-interpreter-exec console \"help set args\"" -mi_gdb_test "-interpreter-exec console \"set \$pc=0x0\"" \ - {.*=target-changed.*\^done} \ +# NOTE: cagney/2003-02-03: Not yet. +# mi_gdb_test "-interpreter-exec console \"set \$pc=0x0\"" \ +# {.*=target-changed.*\^done} \ +# "-interpreter-exec console \"set \$pc=0x0\"" +mi_gdb_test "888-interpreter-exec console \"set \$pc=0x0\"" \ + {888\^done} \ "-interpreter-exec console \"set \$pc=0x0\"" #mi_gdb_test "-interpreter-exec console \"\"" \ diff --git a/gdb/testsuite/gdb.mi/mi-pthreads.exp b/gdb/testsuite/gdb.mi/mi-pthreads.exp index 8fc5061c803..532134acc04 100644 --- a/gdb/testsuite/gdb.mi/mi-pthreads.exp +++ b/gdb/testsuite/gdb.mi/mi-pthreads.exp @@ -17,11 +17,11 @@ # Please email any bugs, comments, and/or additions to this file to: # bug-gdb@prep.ai.mit.edu -# This file tests that GDB's console can be accessed via the MI. -# Specifically, we are testing the "interpreter-exec" command and that -# the commands that are executed via this command are properly executed. -# Console commands executed via MI should use MI output wrappers, MI event -# handlers, etc. +# This file tests MI thread commands. +# Specifically, we are testing the MI command set and the console (in MI) +# command set ("interpreter-exec") and that the commands that are executed +# via these command pathways are properly executed. Console commands +# executed via MI should use MI output wrappers, MI event handlers, etc. # This only works with native configurations if {![isnative]} { @@ -36,6 +36,10 @@ if {[mi_gdb_start]} { continue } +# The procs below dealing with parsing cli/mi output for the threadlist +# is duplicated in gdb669.exp. Any changes here will probably need to +# be made there as well. + proc get_mi_thread_list {name} { global expect_out @@ -45,11 +49,16 @@ proc get_mi_thread_list {name} { # ^done,thread-ids=[thread-id="1",thread-id="2",...],number-of-threads="N" # (gdb) mi_gdb_test "-thread-list-ids" \ - {\^done,thread-ids=\{(thread-id="[0-9]+"(,)*)+\},number-of-threads="[0-9]+"} \ + {\^done,thread-ids={(thread-id="[0-9]+"(,)?)+},number-of-threads="[0-9]+"} \ "-thread_list_ids ($name)" + set output {} + if {[info exists expect_out(buffer)]} { + set output $expect_out(buffer) + } + set thread_list {} - if {![regexp {thread-ids=\{(thread-id="[0-9]+"(,)?)*\}} $expect_out(buffer) threads]} { + if {![regexp {thread-ids=\{(thread-id="[0-9]+"(,)?)*\}} $output threads]} { fail "finding threads in MI output ($name)" } else { pass "finding threads in MI output ($name)" @@ -74,9 +83,12 @@ proc check_mi_and_console_threads {name} { global expect_out mi_gdb_test "-thread-list-ids" \ - {\^done,thread-ids=\{(thread-id="[0-9]+"(,)*)+\},number-of-threads="[0-9]+"} \ + {\^done,thread-ids={(thread-id="[0-9]+"(,)*)+},number-of-threads="[0-9]+"} \ "-thread-list-ids ($name)" - set mi_output $expect_out(buffer) + set mi_output {} + if {[info exists expect_out(buffer)]} { + set mi_output $expect_out(buffer) + } # GDB will return a list of thread ids and some more info: # @@ -86,10 +98,14 @@ proc check_mi_and_console_threads {name} { # ~" 3 Thread 1026 (LWP 7733) () at __libc_nanosleep:-1" # ~" 2 Thread 2049 (LWP 7732) 0x401411f8 in __poll (fds=0x804bb24, nfds=1, timeout=2000) at ../sysdeps/unix/sysv/linux/poll.c:63" # ~"* 1 Thread 1024 (LWP 7731) main (argc=1, argv=0xbfffdd94) at ../../../src/gdb/testsuite/gdb.mi/pthreads.c:160" - mi_gdb_test {-interpreter-exec console "info threads"} \ + # FIXME: kseitz/2002-09-05: Don't use the hack-cli method. + mi_gdb_test "info threads" \ {.*(~".*"[\r\n]*)+.*} \ "info threads ($name)" - set console_output $expect_out(buffer) + set console_output {} + if {[info exists $expect_out(buffer)]} { + set console_output $expect_out(buffer) + } # Make a list of all known threads to console (gdb's thread IDs) set console_thread_list {} @@ -159,19 +175,6 @@ proc check_mi_and_console_threads {name} { } } -# This procedure checks for the bug gdb/669, where the console -# command "info threads" and the MI command "-thread-list-ids" -# return different threads in the system. -proc check_for_gdb669_bug {} { - mi_run_to_main - check_mi_and_console_threads "at main" - - for {set i 0} {$i < 4} {incr i} { - mi_next "next, try $i" - check_mi_and_console_threads "try $i" - } -} - # This procedure tests the various thread commands in MI. proc check_mi_thread_command_set {} { @@ -192,24 +195,11 @@ proc check_mi_thread_command_set {} { # many of the threads are blocked in libc calls, # and many people have libc's with no symbols. mi_gdb_test "-thread-select $thread" \ - "=context-changed,thread=\"$thread\"\r\n\\^done,new-thread-id=\"$thread\",frame={.*},line=\"(-)?\[0-9\]+\",file=\".*\"" \ + "\\^done,new-thread-id=\"$thread\",frame={.*}(,line=\"(-)?\[0-9\]+\",file=\".*\")?" \ "check_mi_thread_command_set: -thread-select $thread" } } -# This procedure checks that the console and MI don't get out -# of sync with each other. -proc check_console_thread_commands {} { - - # Assumed that we're at done_making_threads - set thread_list [get_mi_thread_list "in check_console_thread_commands"] - foreach thread $thread_list { - mi_gdb_test "-interpreter-exec console \"thread $thread\"" \ - "(\\~\".*\"\r\n)*=context-changed,thread=\"$thread\"\r\n\\^done" \ - "-interpreter-exec console \"thread $thread\"" - } -} - # # Start here # @@ -226,8 +216,6 @@ mi_gdb_reinitialize_dir $srcdir/$subdir mi_gdb_load $binfile check_mi_thread_command_set -check_console_thread_commands -check_for_gdb669_bug mi_gdb_exit diff --git a/gdb/testsuite/gdb.mi/mi-return.exp b/gdb/testsuite/gdb.mi/mi-return.exp index 0454e0ef788..ca37e9fc9fc 100644 --- a/gdb/testsuite/gdb.mi/mi-return.exp +++ b/gdb/testsuite/gdb.mi/mi-return.exp @@ -46,6 +46,7 @@ mi_gdb_reinitialize_dir $srcdir/$subdir mi_gdb_reinitialize_dir $srcdir/$subdir mi_gdb_load ${binfile} + proc test_return_simple {} { global mi_gdb_prompt global hex diff --git a/gdb/testsuite/gdb.mi/mi-simplerun.exp b/gdb/testsuite/gdb.mi/mi-simplerun.exp index 4c6629700a3..a3ebd20910b 100644 --- a/gdb/testsuite/gdb.mi/mi-simplerun.exp +++ b/gdb/testsuite/gdb.mi/mi-simplerun.exp @@ -1,4 +1,4 @@ -# Copyright 1999, 2000, 2002 Free Software Foundation, Inc. +# Copyright 1999, 2000 Free Software Foundation, Inc. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -62,19 +62,19 @@ proc test_breakpoints_creation_and_listing {} { # -break-info mi_gdb_test "200-break-insert main" \ - "=breakpoint-create,number=\"1\"\r\n200\\^done" \ + "200\\^done,bkpt=\{number=\"1\",type=\"breakpoint\",disp=\"keep\",enabled=\"y\",addr=\"$hex\",func=\"main\",file=\".*basics.c\",line=\"32\",times=\"0\"\}" \ "break-insert operation" mi_gdb_test "201-break-insert basics.c:callee2" \ - "=breakpoint-create,number=\"2\"\r\n201\\^done" \ + "201\\^done,bkpt=\{number=\"2\",type=\"breakpoint\",disp=\"keep\",enabled=\"y\",addr=\"$hex\",func=\"callee2\",file=\".*basics.c\",line=\"22\",times=\"0\"\}" \ "insert breakpoint at basics.c:callee2" mi_gdb_test "202-break-insert basics.c:15" \ - "=breakpoint-create,number=\"3\"\r\n202\\^done" \ + "202\\^done,bkpt=\{number=\"3\",type=\"breakpoint\",disp=\"keep\",enabled=\"y\",addr=\"$hex\",func=\"callee3\",file=\".*basics.c\",line=\"15\",times=\"0\"\}" \ "insert breakpoint at basics.c:15 (callee3)" mi_gdb_test "203-break-insert \"\\\"${srcfile}\\\":6\"" \ - "=breakpoint-create,number=\"4\"\r\n203\\^done" \ + "203\\^done,bkpt=\{number=\"4\",type=\"breakpoint\",disp=\"keep\",enabled=\"y\",addr=\"$hex\",func=\"callee4\",file=\".*basics.c\",line=\"6\",times=\"0\"\}" \ "insert breakpoint at \"<fullfilename>\":6 (callee4)" mi_gdb_test "204-break-list" \ @@ -82,7 +82,7 @@ proc test_breakpoints_creation_and_listing {} { "list of breakpoints" mi_gdb_test "205-break-disable 2 3 4" \ - "=breakpoint-modify,number=\"2\"\r\n=breakpoint-modify,number=\"3\"\r\n=breakpoint-modify,number=\"4\"\r\n205\\^done.*" \ + "205\\^done.*" \ "disabling of breakpoints" mi_gdb_test "206-break-info 2" \ diff --git a/gdb/testsuite/gdb.mi/mi-until.exp b/gdb/testsuite/gdb.mi/mi-until.exp index 8e82a0c053a..ac276cc5229 100644 --- a/gdb/testsuite/gdb.mi/mi-until.exp +++ b/gdb/testsuite/gdb.mi/mi-until.exp @@ -1,4 +1,4 @@ -# Copyright 1999, 2000, 2002 Free Software Foundation, Inc. +# Copyright 1999, 2000 Free Software Foundation, Inc. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -46,13 +46,12 @@ mi_gdb_reinitialize_dir $srcdir/$subdir mi_gdb_reinitialize_dir $srcdir/$subdir mi_gdb_load ${binfile} -set timeout 5 proc test_running_to_foo {} { global mi_gdb_prompt global hex mi_gdb_test "200-break-insert 10" \ - "=breakpoint-create,number=\"1\"\r\n200\\^done" \ + "200\\^done,bkpt=\{number=\"1\",type=\"breakpoint\",disp=\"keep\",enabled=\"y\",addr=\"$hex\",func=\"foo\",file=\".*until.c\",line=\"10\",times=\"0\"\}" \ "break-insert operation" mi_run_cmd @@ -69,7 +68,7 @@ proc test_running_to_foo {} { } } - mi_gdb_test "100-break-delete 1" "=breakpoint-delete,number=\"1\"\r\n100\\^done" "break-delete 1" + mi_gdb_test "100-break-delete 1" "100\\^done" "break-delete 1" } @@ -89,7 +88,7 @@ proc test_until {} { send_gdb "222-exec-until 15\n" gdb_expect { - -re "222\\^running\r\n${mi_gdb_prompt}(=breakpoint-.*\r\n)*222\\*stopped,reason=\"location-reached\",thread-id=\"\[01\]\",frame=\{addr=\"$hex\",func=\"foo\",args=\\\[\\\],file=\".*until.c\",line=\"15\"\}\r\n$mi_gdb_prompt$" { + -re "222\\^running\r\n${mi_gdb_prompt}222\\*stopped,reason=\"location-reached\",thread-id=\"\[01\]\",frame=\{addr=\"$hex\",func=\"foo\",args=\\\[\\\],file=\".*until.c\",line=\"15\"\}\r\n$mi_gdb_prompt$" { pass "until line number" } timeout { @@ -99,7 +98,7 @@ proc test_until {} { send_gdb "333-exec-until until.c:17\n" gdb_expect { - -re "333\\^running\r\n${mi_gdb_prompt}(=breakpoint-.*\r\n)*333\\*stopped,reason=\"location-reached\",thread-id=\"\[01\]\",frame=\{addr=\"$hex\",func=\"foo\",args=\\\[\\\],file=\".*until.c\",line=\"17\"\}\r\n$mi_gdb_prompt$" { + -re "333\\^running\r\n${mi_gdb_prompt}333\\*stopped,reason=\"location-reached\",thread-id=\"\[01\]\",frame=\{addr=\"$hex\",func=\"foo\",args=\\\[\\\],file=\".*until.c\",line=\"17\"\}\r\n$mi_gdb_prompt$" { pass "until line number:file" } timeout { @@ -111,7 +110,7 @@ proc test_until {} { send_gdb "444-exec-until until.c:25\n" gdb_expect { - -re "444\\^running\r\n${mi_gdb_prompt}(=breakpoint-.*\r\n)*444\\*stopped,reason=\"location-reached\",thread-id=\"\[01\]\",frame=\{addr=\"$hex\",func=\"main\",args=\\\[\\\],file=\".*until.c\",line=\"24\"\}\r\n$mi_gdb_prompt$" { + -re "444\\^running\r\n${mi_gdb_prompt}444\\*stopped,reason=\"location-reached\",thread-id=\"\[01\]\",frame=\{addr=\"$hex\",func=\"main\",args=\\\[\\\],file=\".*until.c\",line=\"24\"\}\r\n$mi_gdb_prompt$" { pass "until after current function" } timeout { diff --git a/gdb/testsuite/gdb.mi/mi-var-cmd.exp b/gdb/testsuite/gdb.mi/mi-var-cmd.exp index bdb4f75fbd6..7d02b36943a 100644 --- a/gdb/testsuite/gdb.mi/mi-var-cmd.exp +++ b/gdb/testsuite/gdb.mi/mi-var-cmd.exp @@ -385,7 +385,7 @@ mi_gdb_test "-var-assign lsimple.integer 333" \ ##### mi_gdb_test "-break-insert subroutine1" \ - "=breakpoint-create,number=\"2\"\r\n\\^done" \ + "\\^done,bkpt=\{number=\"2\",type=\"breakpoint\",disp=\"keep\",enabled=\"y\",addr=\"$hex\",func=\"subroutine1\",file=\".*var-cmd.c\",line=\"146\",times=\"0\"\}" \ "break-insert subroutine1" mi_continue_to "2" "subroutine1" \ "\{name=\"i\",value=\"4321\"\},\{name=\"l\",value=\"$hex\"\}" \ @@ -530,7 +530,7 @@ mi_gdb_test "-var-delete l" \ # Test whether we can follow the name of a variable through multiple # stack frames. mi_gdb_test "-break-insert do_special_tests" \ - "=breakpoint-create,number=\"\[0-9\]+\"\r\n\\^done" \ + {\^done,bkpt=.*} \ "set breakpoint at do_special_tests" mi_continue_to {.*} do_special_tests {.*} {.*var-cmd.c} {.*} {stop in do_special_tests} @@ -540,7 +540,7 @@ mi_gdb_test "-var-create selected_a @ a" \ "create selected_a" mi_gdb_test "-break-insert incr_a" \ - "=breakpoint-create,number=\"\[0-9\]+\"\r\n\\^done" \ + {\^done,bkpt=.*} \ "set breakpoint at incr_a" mi_continue_to {.*} incr_a {.*} {.*var-cmd.c} {.*} {stop in incr_a} diff --git a/gdb/testsuite/gdb.mi/mi-var-display.exp b/gdb/testsuite/gdb.mi/mi-var-display.exp index 1a888dfa0df..fafa79a3390 100644 --- a/gdb/testsuite/gdb.mi/mi-var-display.exp +++ b/gdb/testsuite/gdb.mi/mi-var-display.exp @@ -43,7 +43,7 @@ mi_gdb_reinitialize_dir $srcdir/$subdir mi_gdb_load ${binfile} mi_gdb_test "200-break-insert 260" \ - "=breakpoint-create,number=\"1\"\r\n200\\^done" \ + "200\\^done,bkpt=\{number=\"1\",type=\"breakpoint\",disp=\"keep\",enabled=\"y\",addr=\"$hex\",func=\"do_children_tests\",file=\".*var-cmd.c\",line=\"260\",times=\"0\"\}" \ "break-insert operation" mi_run_cmd @@ -325,12 +325,12 @@ mi_gdb_test "-var-delete weird" \ # Stop in "do_special_tests" mi_gdb_test "200-break-insert do_special_tests" \ - "=breakpoint-create,number=\"2\"\r\n200\\^done" \ + "200\\^done,bkpt=\{number=\"2\",type=\"breakpoint\",disp=\"keep\",enabled=\"y\",addr=\"$hex\",func=\"do_special_tests\",file=\".*var-cmd.c\",line=\"282\",times=\"0\"\}" \ "break-insert operation" send_gdb "-exec-continue\n" gdb_expect { - -re "\\^running\r\n${mi_gdb_prompt}(=breakpoint-.*\r\n)*\\*stopped,reason=\"breakpoint-hit\",bkptno=\"2\",thread-id=\"\[01\]\",frame=\{addr=\"$hex\",func=\"do_special_tests\",args=\\\[\\\],file=\".*var-cmd.c\",line=\"282\"\}\r\n$mi_gdb_prompt$" { + -re "\\^running\r\n${mi_gdb_prompt}\\*stopped,reason=\"breakpoint-hit\",bkptno=\"2\",thread-id=\"\[01\]\",frame=\{addr=\"$hex\",func=\"do_special_tests\",args=\\\[\\\],file=\".*var-cmd.c\",line=\"282\"\}\r\n$mi_gdb_prompt$" { pass "continue to do_special_tests" } timeout { @@ -584,14 +584,14 @@ gdb_expect { } mi_gdb_test "200-break-insert incr_a" \ - "=breakpoint-create,number=\"3\"\r\n200\\^done" \ + "200\\^done,bkpt=\{number=\"3\",type=\"breakpoint\",disp=\"keep\",enabled=\"y\",addr=\"$hex\",func=\"incr_a\",file=\".*var-cmd.c\",line=\"85\",times=\"0\"\}" \ "break-insert operation" send_gdb "-exec-continue\n" gdb_expect { - -re "\\^running\r\n${mi_gdb_prompt}(=breakpoint-.*\r\n)*\\*stopped,reason=\"breakpoint-hit\",bkptno=\"3\",thread-id=\"\[01\]\",frame=\{addr=\"$hex\",func=\"incr_a\",args=\\\[\{name=\"a\",value=\"2\.*\"\}\\\],file=\".*var-cmd.c\",line=\"85\"\}\r\n$mi_gdb_prompt$" { + -re "\\^running\r\n${mi_gdb_prompt}\\*stopped,reason=\"breakpoint-hit\",bkptno=\"3\",thread-id=\"\[01\]\",frame=\{addr=\"$hex\",func=\"incr_a\",args=\\\[\{name=\"a\",value=\"2\.*\"\}\\\],file=\".*var-cmd.c\",line=\"85\"\}\r\n$mi_gdb_prompt$" { pass "continue to incr_a" } - -re "\\^running\r\n${mi_gdb_prompt}(=breakpoint-.*\r\n)*\\*stopped,reason=\"breakpoint-hit\",bkptno=\"3\",thread-id=\"\[01\]\",frame=\{addr=\"$hex\",func=\"incr_a\",args=\\\[\{name=\"a\",value=\"\.*\"\}\\\],file=\".*var-cmd.c\",line=\"8\[345\]\"\}\r\n$mi_gdb_prompt$" { + -re "\\^running\r\n${mi_gdb_prompt}\\*stopped,reason=\"breakpoint-hit\",bkptno=\"3\",thread-id=\"\[01\]\",frame=\{addr=\"$hex\",func=\"incr_a\",args=\\\[\{name=\"a\",value=\"\.*\"\}\\\],file=\".*var-cmd.c\",line=\"8\[345\]\"\}\r\n$mi_gdb_prompt$" { fail "continue to incr_a (compiler debug info incorrect)" } -re "\\^running\r\n${mi_gdb_prompt}.*\r\n$mi_gdb_prompt$" { diff --git a/gdb/testsuite/gdb.mi/mi-watch.exp b/gdb/testsuite/gdb.mi/mi-watch.exp index c7bffb510e4..ba243999d19 100644 --- a/gdb/testsuite/gdb.mi/mi-watch.exp +++ b/gdb/testsuite/gdb.mi/mi-watch.exp @@ -58,7 +58,7 @@ proc test_watchpoint_creation_and_listing {} { # -break-list mi_gdb_test "111-break-watch C" \ - "=breakpoint-create,number=\"2\"\r\n111\\^done" \ + "111\\^done,wpt=\{number=\"2\",exp=\"C\"\}" \ "break-watch operation" mi_gdb_test "222-break-list" \ @@ -79,7 +79,7 @@ proc test_awatch_creation_and_listing {} { # -break-list mi_gdb_test "333-break-watch -a A" \ - "=breakpoint-create,number=\"1\"\r\n333\\^done" \ + "333\\^done,bkpt=\{number=\"1\",addr=\"$hex\",file=\".*basics.c\",line=\"32\"\}" \ "break-watch -a operation" mi_gdb_test "444-break-list" \ @@ -87,7 +87,7 @@ proc test_awatch_creation_and_listing {} { "list of watchpoints awatch" mi_gdb_test "777-break-delete 3" \ - "=breakpoint-delete,number=\"3\"\r\n777\\^done" \ + "777\\^done" \ "delete access watchpoint" } @@ -103,7 +103,7 @@ proc test_rwatch_creation_and_listing {} { # -break-list mi_gdb_test "200-break-watch -r C" \ - "=breakpoint-create,number=\"5"\r\n200\\^done" \ + "200\\^done,bkpt=\{number=\"5\",type=\"breakpoint\",disp=\"keep\",enabled=\"y\",addr=\"$hex\",func=\"callee4\",file=\".*basics.c\",line=\"32\",times=\"0\"\}" \ "break-insert -r operation" mi_gdb_test "300-break-list" \ @@ -111,7 +111,7 @@ proc test_rwatch_creation_and_listing {} { "list of breakpoints" mi_gdb_test "177-break-delete 4" \ - "=breakpoint-delete,number=\"4\"\r\n177\\^done" \ + "177\\^done" \ "delete read watchpoint" } diff --git a/gdb/testsuite/gdb.mi/mi1-basics.exp b/gdb/testsuite/gdb.mi/mi1-basics.exp index a10468b3c10..42d022d6861 100644 --- a/gdb/testsuite/gdb.mi/mi1-basics.exp +++ b/gdb/testsuite/gdb.mi/mi1-basics.exp @@ -1,4 +1,4 @@ -# Copyright 2002 Free Software Foundation, Inc. +# Copyright 1999, 2000 Free Software Foundation, Inc. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/gdb/testsuite/gdb.mi/mi1-break.exp b/gdb/testsuite/gdb.mi/mi1-break.exp index 04e353494ea..34a6ef7b141 100644 --- a/gdb/testsuite/gdb.mi/mi1-break.exp +++ b/gdb/testsuite/gdb.mi/mi1-break.exp @@ -1,4 +1,4 @@ -# Copyright 2002 Free Software Foundation, Inc. +# Copyright 1999 Free Software Foundation, Inc. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/gdb/testsuite/gdb.mi/mi1-console.exp b/gdb/testsuite/gdb.mi/mi1-console.exp index 5d7a381a753..ab7f5ac5d3f 100644 --- a/gdb/testsuite/gdb.mi/mi1-console.exp +++ b/gdb/testsuite/gdb.mi/mi1-console.exp @@ -1,4 +1,4 @@ -# Copyright 2002 Free Software Foundation, Inc. +# Copyright 1999, 2000, 2001, 2002 Free Software Foundation, Inc. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/gdb/testsuite/gdb.mi/mi1-hack-cli.exp b/gdb/testsuite/gdb.mi/mi1-hack-cli.exp index 0f59249e10f..951981a16b9 100644 --- a/gdb/testsuite/gdb.mi/mi1-hack-cli.exp +++ b/gdb/testsuite/gdb.mi/mi1-hack-cli.exp @@ -1,4 +1,4 @@ -# Copyright 2002 Free Software Foundation, Inc. +# Copyright 1999 Free Software Foundation, Inc. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/gdb/testsuite/gdb.mi/mi1-return.exp b/gdb/testsuite/gdb.mi/mi1-return.exp index 476fe576769..539a61cbf44 100644 --- a/gdb/testsuite/gdb.mi/mi1-return.exp +++ b/gdb/testsuite/gdb.mi/mi1-return.exp @@ -53,7 +53,7 @@ proc test_return_simple {} { send_gdb "111-exec-return\n" gdb_expect { - -re "111\\^done,frame=\{level=\"0 \",addr=\"$hex\",func=\"callee3\",args=\\\[.*\\\],file=\".*basics.c\",line=\"18\"\}\r\n$mi_gdb_prompt$" {pass "return from callee4 now"} + -re "111\\^done,frame=\{level=\"0\",addr=\"$hex\",func=\"callee3\",args=\\\[.*\\\],file=\".*basics.c\",line=\"18\"\}\r\n$mi_gdb_prompt$" {pass "return from callee4 now"} -re ".*\r\n$mi_gdb_prompt$" { fail "return from callee4 now" } timeout { fail "return from callee4 now (timeout)" } diff --git a/gdb/testsuite/gdb.mi/mi1-simplerun.exp b/gdb/testsuite/gdb.mi/mi1-simplerun.exp index bef690532f0..839903a02cc 100644 --- a/gdb/testsuite/gdb.mi/mi1-simplerun.exp +++ b/gdb/testsuite/gdb.mi/mi1-simplerun.exp @@ -1,4 +1,4 @@ -# Copyright 2002 Free Software Foundation, Inc. +# Copyright 1999, 2000 Free Software Foundation, Inc. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/gdb/testsuite/gdb.mi/mi1-stack.exp b/gdb/testsuite/gdb.mi/mi1-stack.exp index 7de39992c7b..b8c7cab5ce3 100644 --- a/gdb/testsuite/gdb.mi/mi1-stack.exp +++ b/gdb/testsuite/gdb.mi/mi1-stack.exp @@ -57,13 +57,13 @@ proc test_stack_frame_listing {} { # -stack-list-frames 1 3 mi_gdb_test "231-stack-list-frames" \ - "231\\^done,stack=\\\[frame=\{level=\"0 \",addr=\"$hex\",func=\"callee4\",file=\".*basics.c\",line=\"8\"\},frame=\{level=\"1 \",addr=\"$hex\",func=\"callee3\",.*\},frame=\{level=\"2 \",addr=\"$hex\",func=\"callee2\",.*\},frame=\{level=\"3 \",addr=\"$hex\",func=\"callee1\",.*\},frame=\{level=\"4 \",addr=\"$hex\",func=\"main\",.*\}\\\]" \ + "231\\^done,stack=\\\[frame=\{level=\"0\",addr=\"$hex\",func=\"callee4\",file=\".*basics.c\",line=\"8\"\},frame=\{level=\"1\",addr=\"$hex\",func=\"callee3\",.*\},frame=\{level=\"2\",addr=\"$hex\",func=\"callee2\",.*\},frame=\{level=\"3\",addr=\"$hex\",func=\"callee1\",.*\},frame=\{level=\"4\",addr=\"$hex\",func=\"main\",.*\}\\\]" \ "stack frame listing" mi_gdb_test "232-stack-list-frames 1 1" \ - "232\\^done,stack=\\\[frame=\{level=\"1 \",addr=\"$hex\",func=\"callee3\",.*\}\\\]" \ + "232\\^done,stack=\\\[frame=\{level=\"1\",addr=\"$hex\",func=\"callee3\",.*\}\\\]" \ "stack frame listing 1 1" mi_gdb_test "233-stack-list-frames 1 3" \ - "233\\^done,stack=\\\[frame=\{level=\"1 \",addr=\"$hex\",func=\"callee3\",.*\},frame=\{level=\"2 \",addr=\"$hex\",func=\"callee2\",.*\},frame=\{level=\"3 \",addr=\"$hex\",func=\"callee1\",.*\}\\\]" \ + "233\\^done,stack=\\\[frame=\{level=\"1\",addr=\"$hex\",func=\"callee3\",.*\},frame=\{level=\"2\",addr=\"$hex\",func=\"callee2\",.*\},frame=\{level=\"3\",addr=\"$hex\",func=\"callee1\",.*\}\\\]" \ "stack frame listing 1 3" mi_gdb_test "234-stack-list-frames 1" \ diff --git a/gdb/testsuite/gdb.mi/mi1-until.exp b/gdb/testsuite/gdb.mi/mi1-until.exp index 44daf79c9bd..a036b937c68 100644 --- a/gdb/testsuite/gdb.mi/mi1-until.exp +++ b/gdb/testsuite/gdb.mi/mi1-until.exp @@ -1,4 +1,4 @@ -# Copyright 2002 Free Software Foundation, Inc. +# Copyright 1999, 2000 Free Software Foundation, Inc. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/gdb/testsuite/gdb.mi/mi1-var-child.exp b/gdb/testsuite/gdb.mi/mi1-var-child.exp index 91536a67d57..92ae3819277 100644 --- a/gdb/testsuite/gdb.mi/mi1-var-child.exp +++ b/gdb/testsuite/gdb.mi/mi1-var-child.exp @@ -1,5 +1,5 @@ -# Copyright 2002 Free Software Foundation, Inc. -# +# Copyright (C) 1999, 2000, 2002 Free Software Foundation + # This Program Is Free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or @@ -42,19 +42,7 @@ mi_delete_breakpoints mi_gdb_reinitialize_dir $srcdir/$subdir mi_gdb_load ${binfile} -mi_gdb_test "200-break-insert do_children_tests" \ - "200\\^done,bkpt=\{number=\"1\",type=\"breakpoint\",disp=\"keep\",enabled=\"y\",addr=\"$hex\",func=\"do_children_tests\",file=\".*var-cmd.c\",line=\"190\",times=\"0\"\}" \ - "break-insert operation" - -mi_run_cmd -# The running part has been checked already by mi_run_cmd -gdb_expect { - -re "\[\r\n\]*000\\*stopped,reason=\"breakpoint-hit\",bkptno=\"1\",thread-id=\"\[01\]\",frame=\{addr=\"$hex\",func=\"do_children_tests\",args=\\\[\\\],file=\".*var-cmd.c\",line=\"190\"\}\r\n$mi_gdb_prompt$" { - pass "run to do_children_tests" - } - -re ".*$mi_gdb_prompt$" {fail "run to do_children_tests (2)"} - timeout {fail "run to do_children_tests (timeout 2)"} -} +mi_runto do_children_tests ##### ##### # # @@ -567,16 +555,8 @@ mi_gdb_test "-var-info-num-children struct_declarations.int_ptr_ptr.*int_ptr_ptr # Step to "struct_declarations.integer = 123;" -send_gdb "-exec-step\n" -gdb_expect { - -re "\\^running\r\n${mi_gdb_prompt}\\*stopped,reason=\"end-stepping-range\",thread-id=\"\[01\]\",frame=\{addr=\"$hex\",func=\"do_children_tests\",args=\\\[\\\],file=\".*var-cmd.c\",line=\"192\"\}\r\n$mi_gdb_prompt$" { - pass "step at do_children_tests" - } - timeout { - fail "step at do_children_tests (timeout)" - } -} - +set line 192 +mi_step_to do_children_tests {} {.*var-cmd.c} $line "step to line $line" # Test: c_variable-4.81 # Desc: create local variable "weird" @@ -774,15 +754,8 @@ mi_gdb_test "-var-update *" \ "update all vars. None changed" # Step over "struct_declarations.integer = 123;" -send_gdb "-exec-step\n" -gdb_expect { - -re "\\^running\r\n${mi_gdb_prompt}\\*stopped,reason=\"end-stepping-range\",thread-id=\"\[01\]\",frame=\{addr=\"$hex\",func=\"do_children_tests\",args=\\\[\\\],file=\".*var-cmd.c\",line=\"193\"\}\r\n$mi_gdb_prompt$" { - pass "step at do_children_tests" - } - timeout { - fail "step at do_children_tests (timeout)" - } -} +set line 193 +mi_step_to do_children_tests {} {.*var-cmd.c} $line "step $line" # Test: c_variable-5.2 # Desc: check that integer changed @@ -794,16 +767,8 @@ mi_gdb_test "-var-update *" \ # weird->char_ptr = "hello"; # bar = 2121; # foo = &bar; - -send_gdb "-exec-step 3\n" -gdb_expect { - -re "\\^running\r\n${mi_gdb_prompt}\\*stopped,reason=\"end-stepping-range\",thread-id=\"\[01\]\",frame=\{addr=\"$hex\",func=\"do_children_tests\",args=\\\[\\\],file=\".*var-cmd.c\",line=\"196\"\}\r\n$mi_gdb_prompt$" { - pass "step at do_children_tests" - } - timeout { - fail "step at do_children_tests (timeout)" - } -} +set line 196 +mi_execute_to "exec-step 3" "end-stepping-range" do_children_tests {} {.*var-cmd.c} $line {} "step $line" # Test: c_variable-5.3 # Desc: check that char_ptr changed @@ -812,15 +777,8 @@ mi_gdb_test "-var-update *" \ "update all vars struct_declarations.char_ptr" # Step over "struct_declarations.int_ptr_ptr = &foo;" -send_gdb "-exec-step\n" -gdb_expect { - -re "\\^running\r\n${mi_gdb_prompt}\\*stopped,reason=\"end-stepping-range\",thread-id=\"\[01\]\",frame=\{addr=\"$hex\",func=\"do_children_tests\",args=\\\[\\\],file=\".*var-cmd.c\",line=\"197\"\}\r\n$mi_gdb_prompt$" { - pass "step at do_children_tests" - } - timeout { - fail "step at do_children_tests (timeout)" - } -} +set line 197 +mi_step_to do_children_tests {} {.*var-cmd.c} $line "step $line" # Test: c_variable-5.4 # Desc: check that int_ptr_ptr and children changed @@ -829,15 +787,8 @@ mi_gdb_test "-var-update *" \ "update all vars int_ptr_ptr and children changed" # Step over "weird->long_array[0] = 1234;" -send_gdb "-exec-step\n" -gdb_expect { - -re "\\^running\r\n${mi_gdb_prompt}\\*stopped,reason=\"end-stepping-range\",thread-id=\"\[01\]\",frame=\{addr=\"$hex\",func=\"do_children_tests\",args=\\\[\\\],file=\".*var-cmd.c\",line=\"198\"\}\r\n$mi_gdb_prompt$" { - pass "step at do_children_tests" - } - timeout { - fail "step at do_children_tests (timeout)" - } -} +set line 198 +mi_step_to do_children_tests {} {.*var-cmd.c} $line "step $line" # Test: c_variable-5.5 # Desc: check that long_array[0] changed @@ -846,15 +797,8 @@ mi_gdb_test "-var-update *" \ "update all vars struct_declarations.long_array.0 changed" # Step over "struct_declarations.long_array[1] = 2345;" -send_gdb "-exec-step\n" -gdb_expect { - -re "\\^running\r\n${mi_gdb_prompt}\\*stopped,reason=\"end-stepping-range\",thread-id=\"\[01\]\",frame=\{addr=\"$hex\",func=\"do_children_tests\",args=\\\[\\\],file=\".*var-cmd.c\",line=\"199\"\}\r\n$mi_gdb_prompt$" { - pass "step at do_children_tests" - } - timeout { - fail "step at do_children_tests (timeout)" - } -} +set line 199 +mi_step_to do_children_tests {} {.*var-cmd.c} $line "step $line" # Test: c_variable-5.6 # Desc: check that long_array[1] changed @@ -863,15 +807,8 @@ mi_gdb_test "-var-update *" \ "update all vars struct_declarations.long_array.1 changed" # Step over "weird->long_array[2] = 3456;" -send_gdb "-exec-step\n" -gdb_expect { - -re "\\^running\r\n${mi_gdb_prompt}\\*stopped,reason=\"end-stepping-range\",thread-id=\"\[01\]\",frame=\{addr=\"$hex\",func=\"do_children_tests\",args=\\\[\\\],file=\".*var-cmd.c\",line=\"200\"\}\r\n$mi_gdb_prompt$" { - pass "step at do_children_tests" - } - timeout { - fail "step at do_children_tests (timeout)" - } -} +set line 200 +mi_step_to do_children_tests {} {.*var-cmd.c} $line "step $line" # Test: c_variable-5.7 # Desc: check that long_array[2] changed @@ -887,15 +824,8 @@ mi_gdb_test "-var-update *" \ # struct_declarations.long_array[7] = 8901; # weird->long_array[8] = 9012; # struct_declarations.long_array[9] = 1234; -send_gdb "-exec-step 7\n" -gdb_expect { - -re "\\^running\r\n${mi_gdb_prompt}\\*stopped,reason=\"end-stepping-range\",thread-id=\"\[01\]\",frame=\{addr=\"$hex\",func=\"do_children_tests\",args=\\\[\\\],file=\".*var-cmd.c\",line=\"208\"\}\r\n$mi_gdb_prompt$" { - pass "step at do_children_tests" - } - timeout { - fail "step at do_children_tests (timeout)" - } -} +set line 208 +mi_execute_to "exec-step 7" "end-stepping-range" do_children_tests {} {.*var-cmd.c} $line {} "step $line" # Test: c_variable-5.8 # Desc: check that long_array[3-9] changed @@ -905,15 +835,8 @@ mi_gdb_test "-var-update *" \ # Step over "weird->func_ptr = nothing;" -send_gdb "-exec-step\n" -gdb_expect { - -re "\\^running\r\n${mi_gdb_prompt}\\*stopped,reason=\"end-stepping-range\",thread-id=\"\[01\]\",frame=\{addr=\"$hex\",func=\"do_children_tests\",args=\\\[\\\],file=\".*var-cmd.c\",line=\"211\"\}\r\n$mi_gdb_prompt$" { - pass "step at do_children_tests" - } - timeout { - fail "step at do_children_tests (timeout)" - } -} +set line 211 +mi_step_to do_children_tests {} {.*var-cmd.c} $line "step $line" # Test: c_variable-5.9 # Desc: check that func_ptr changed @@ -933,15 +856,8 @@ mi_gdb_test "-var-delete weird->int_ptr_ptr" \ # Step over all lines: # ... # psnp = &snp0; -send_gdb "-exec-step 43\n" -gdb_expect { - -re "\\^running\r\n${mi_gdb_prompt}\\*stopped,reason=\"end-stepping-range\",thread-id=\"\[01\]\",frame=\{addr=\"$hex\",func=\"do_children_tests\",args=\\\[\\\],file=\".*var-cmd.c\",line=\"254\"\}\r\n$mi_gdb_prompt$" { - pass "step at do_children_tests" - } - timeout { - fail "step at do_children_tests (timeout)" - } -} +set line 254 +mi_execute_to "exec-step 43" "end-stepping-range" do_children_tests {} {.*var-cmd.c} $line {} "step $line" # Test: c_variable-5.10 # Desc: create psnp->char_ptr @@ -1211,15 +1127,8 @@ mi_gdb_test "-var-list-children psnp->ptrs.0.next.next.ptrs" \ "get children of psnp->ptrs.0.next.next.ptrs" # Step over "snp0.char_ptr = &b3;" -send_gdb "-exec-step\n" -gdb_expect { - -re "\\^running\r\n${mi_gdb_prompt}\\*stopped,reason=\"end-stepping-range\",thread-id=\"\[01\]\",frame=\{addr=\"$hex\",func=\"do_children_tests\",args=\\\[\\\],file=\".*var-cmd.c\",line=\"255\"\}\r\n$mi_gdb_prompt$" { - pass "step at do_children_tests" - } - timeout { - fail "step at do_children_tests (timeout)" - } -} +set line 255 +mi_step_to do_children_tests {} {.*var-cmd.c} $line "step $line" # Test: c_variable-5.47 # Desc: check that psnp->char_ptr (and [0].char_ptr) changed @@ -1228,16 +1137,8 @@ mi_gdb_test "-var-update *" \ "update all vars psnp->char_ptr (and 0.char_ptr) changed" # Step over "snp1.char_ptr = &c3;" -send_gdb "-exec-step\n" -gdb_expect { - -re "\\^running\r\n${mi_gdb_prompt}\\*stopped,reason=\"end-stepping-range\",thread-id=\"\[01\]\",frame=\{addr=\"$hex\",func=\"do_children_tests\",args=\\\[\\\],file=\".*var-cmd.c\",line=\"256\"\}\r\n$mi_gdb_prompt$" { - pass "step at do_children_tests" - } - timeout { - fail "step at do_children_tests (timeout)" - } -} - +set line 256 +mi_step_to do_children_tests {} {.*var-cmd.c} $line "step $line" # Test: c_variable-5.48 # Desc: check that psnp->next->char_ptr (and [1].char_ptr) changed @@ -1247,16 +1148,8 @@ mi_gdb_test "-var-update *" \ # Step over "snp2.char_ptr = &a3;" -send_gdb "-exec-step\n" -gdb_expect { - -re "\\^running\r\n${mi_gdb_prompt}\\*stopped,reason=\"end-stepping-range\",thread-id=\"\[01\]\",frame=\{addr=\"$hex\",func=\"do_children_tests\",args=\\\[\\\],file=\".*var-cmd.c\",line=\"257\"\}\r\n$mi_gdb_prompt$" { - pass "step at do_children_tests" - } - timeout { - fail "step at do_children_tests (timeout)" - } -} - +set line 257 +mi_step_to do_children_tests {} {.*var-cmd.c} $line "step $line" # Test: c_variable-5.49 # Desc: check that psnp->next->next->char_ptr (and [2].char_ptr) changed @@ -1266,15 +1159,8 @@ mi_gdb_test "-var-update *" \ # Step over "snp0.long_ptr = &y3;" -send_gdb "-exec-step\n" -gdb_expect { - -re "\\^running\r\n${mi_gdb_prompt}\\*stopped,reason=\"end-stepping-range\",thread-id=\"\[01\]\",frame=\{addr=\"$hex\",func=\"do_children_tests\",args=\\\[\\\],file=\".*var-cmd.c\",line=\"258\"\}\r\n$mi_gdb_prompt$" { - pass "step at do_children_tests" - } - timeout { - fail "step at do_children_tests (timeout)" - } -} +set line 258 +mi_step_to do_children_tests {} {.*var-cmd.c} $line "step $line" # Test: c_variable-5.50 # Desc: check that psnp->long_ptr (and [0].long_ptr) changed @@ -1284,16 +1170,8 @@ mi_gdb_test "-var-update *" \ # Step over "snp1.long_ptr = &x3;" -send_gdb "-exec-step\n" -gdb_expect { - -re "\\^running\r\n${mi_gdb_prompt}\\*stopped,reason=\"end-stepping-range\",thread-id=\"\[01\]\",frame=\{addr=\"$hex\",func=\"do_children_tests\",args=\\\[\\\],file=\".*var-cmd.c\",line=\"259\"\}\r\n$mi_gdb_prompt$" { - pass "step at do_children_tests" - } - timeout { - fail "step at do_children_tests (timeout)" - } -} - +set line 259 +mi_step_to do_children_tests {} {.*var-cmd.c} $line "step $line" # Test: c_variable-5.51 # Desc: check that psnp->next->long_ptr (and [1].long_ptr) changed @@ -1309,16 +1187,8 @@ clear_xfail *-*-* # # Step over "snp2.long_ptr = &z3;" -send_gdb "-exec-step\n" -gdb_expect { - -re "\\^running\r\n${mi_gdb_prompt}\\*stopped,reason=\"end-stepping-range\",thread-id=\"\[01\]\",frame=\{addr=\"$hex\",func=\"do_children_tests\",args=\\\[\\\],file=\".*var-cmd.c\",line=\"260\"\}\r\n$mi_gdb_prompt$" { - pass "step at do_children_tests" - } - timeout { - fail "step at do_children_tests (timeout)" - } -} - +set line 260 +mi_step_to do_children_tests {} {.*var-cmd.c} $line "step $line" # Test: c_variable-5.52 # Desc: check that psnp->next->next->long_ptr (and [2].long_ptr) changed diff --git a/gdb/testsuite/gdb.mi/mi1-var-cmd.exp b/gdb/testsuite/gdb.mi/mi1-var-cmd.exp index ca98d7e52d6..c6a88b6bd93 100644 --- a/gdb/testsuite/gdb.mi/mi1-var-cmd.exp +++ b/gdb/testsuite/gdb.mi/mi1-var-cmd.exp @@ -276,6 +276,18 @@ mi_gdb_test "-var-assign linteger 3333" \ "\\^done,value=\"3333\"" \ "assign to linteger" +mi_gdb_test "-var-update *" \ + "\\^done,changelist=\{name=\"linteger\",in_scope=\"true\",type_changed=\"false\"\}" \ + "update all vars: linteger changed after assign" + +mi_gdb_test "-var-assign linteger 3333" \ + "\\^done,value=\"3333\"" \ + "assign to linteger again, same value" + +mi_gdb_test "-var-update *" \ + "\\^done,changelist=\{\}" \ + "update all vars: linteger not changed after same assign" + mi_gdb_test "-var-evaluate-expression linteger" \ "\\^done,value=\"3333\"" \ "eval linteger" @@ -284,6 +296,14 @@ mi_gdb_test "-var-assign lpinteger \"&linteger + 3\"" \ "\\^done,value=\"$hex\"" \ "assign to lpinteger" +mi_gdb_test "-var-update *" \ + "\\^done,changelist=\{name=\"lpinteger\",in_scope=\"true\",type_changed=\"false\"\}" \ + "update all vars: lpinteger changed after assign" + +mi_gdb_test "-var-update *" \ + "\\^done,changelist=\{\}" \ + "update all vars: no changes for second update" + mi_gdb_test "-var-evaluate-expression lpinteger" \ "\\^done,value=\"$hex\"" \ "eval lpinteger" @@ -507,5 +527,34 @@ mi_gdb_test "-var-delete l" \ "\\^done,ndeleted=\"1\"" \ "delete var l" +# Test whether we can follow the name of a variable through multiple +# stack frames. +mi_gdb_test "-break-insert do_special_tests" \ + {\^done,bkpt=.*} \ + "set breakpoint at do_special_tests" + +mi_continue_to {.*} do_special_tests {.*} {.*var-cmd.c} {.*} {stop in do_special_tests} + +mi_gdb_test "-var-create selected_a @ a" \ + {\^done,name="selected_a",numchild="0",type="int"} \ + "create selected_a" + +mi_gdb_test "-break-insert incr_a" \ + {\^done,bkpt=.*} \ + "set breakpoint at incr_a" + +mi_continue_to {.*} incr_a {.*} {.*var-cmd.c} {.*} {stop in incr_a} + +mi_gdb_test "-var-update selected_a" \ + {\^done,changelist=\{name="selected_a",in_scope="true",new_type="char",new_num_children="0"\}} \ + "update selected_a in incr_a" + +mi_next "step a line in incr_a" +mi_next "return from incr_a to do_special_tests" + +mi_gdb_test "-var-update selected_a" \ + {\^done,changelist=\{name="selected_a",in_scope="true",new_type="int",new_num_children="0"\}} \ + "update selected_a in do_special_tests" + mi_gdb_exit return 0 diff --git a/gdb/testsuite/gdb.mi/mi1-var-display.exp b/gdb/testsuite/gdb.mi/mi1-var-display.exp index a2873dac99d..0bdaee44ae4 100644 --- a/gdb/testsuite/gdb.mi/mi1-var-display.exp +++ b/gdb/testsuite/gdb.mi/mi1-var-display.exp @@ -1,4 +1,4 @@ -# Copyright 2002 Free Software Foundation, Inc. +# Copyright (C) 1999, 2000, 2002 Free Software Foundation, Inc. # # This Program Is Free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/gdb/testsuite/lib/mi-support.exp b/gdb/testsuite/lib/mi-support.exp index b9c9d3c138c..4b057d49623 100644 --- a/gdb/testsuite/lib/mi-support.exp +++ b/gdb/testsuite/lib/mi-support.exp @@ -209,7 +209,7 @@ proc mi_delete_breakpoints {} { send_gdb "y\n"; exp_continue } - -re ".*102-break-delete\r\n(=.*)*102\\\^done\r\n$mi_gdb_prompt$" { + -re ".*102-break-delete\r\n102\\\^done\r\n$mi_gdb_prompt$" { # This happens if there were no breakpoints } timeout { perror "Delete all breakpoints in mi_delete_breakpoints (timeout)" ; return } @@ -711,7 +711,7 @@ proc mi_runto {func} { set test "mi runto $func" mi_gdb_test "200-break-insert $func" \ - "\(=breakpoint-create,number=\"\[0-9\]+\")\r\n200\\^done" \ + "200\\^done,bkpt=\{number=\"\[0-9\]+\",type=\"breakpoint\",disp=\"keep\",enabled=\"y\",addr=\"$hex\",func=\"$func\",file=\".*\",line=\"\[0-9\]*\",times=\"0\"\}" \ "breakpoint at $func" if {![regexp {number="[0-9]+"} $expect_out(buffer) str] diff --git a/gdb/thread.c b/gdb/thread.c index 50d5b563a3a..2c70ee5f955 100644 --- a/gdb/thread.c +++ b/gdb/thread.c @@ -694,12 +694,10 @@ do_captured_thread_select (struct ui_out *uiout, void *tidstr) { int num; - ptid_t old_ptid; struct thread_info *tp; num = value_as_long (parse_and_eval (tidstr)); - old_ptid = inferior_ptid; tp = find_thread_id (num); if (!tp) @@ -722,10 +720,6 @@ do_captured_thread_select (struct ui_out *uiout, print_stack_frame (deprecated_selected_frame, frame_relative_level (deprecated_selected_frame), 1); - - if (!ptid_equal (old_ptid, inferior_ptid)) - selected_thread_changed_event (pid_to_thread_id (inferior_ptid)); - return GDB_RC_OK; } diff --git a/gdb/valops.c b/gdb/valops.c index 22c97c723ff..2304274c2bb 100644 --- a/gdb/valops.c +++ b/gdb/valops.c @@ -727,8 +727,6 @@ value_assign (struct value *toval, struct value *fromval) error ("Attempt to assign to an unmodifiable value."); } - if (regno > VALUE_FRAME_REGNUM (toval) + reg_offset) - regno = -1; if (register_changed_hook) register_changed_hook (-1); target_changed_event (); diff --git a/gdb/version.in b/gdb/version.in index dbeb39b31c4..41a8f6c94da 100644 --- a/gdb/version.in +++ b/gdb/version.in @@ -1 +1 @@ -2003-02-03-cvs +2003-02-04-cvs diff --git a/gdb/wrapper.c b/gdb/wrapper.c index e57f19a49cb..6c9c6d60cef 100644 --- a/gdb/wrapper.c +++ b/gdb/wrapper.c @@ -20,7 +20,7 @@ #include "value.h" #include "wrapper.h" -/* use this struct to pass arguments to wrapper routines. We assume +/* Use this struct to pass arguments to wrapper routines. We assume (arbitrarily) that no gdb function takes more than ten arguments. */ struct gdb_wrapper_arguments { @@ -330,3 +330,4 @@ do_captured_value_struct_elt (struct ui_out *uiout, void *data) cargs->static_memfuncp, cargs->err); return GDB_RC_OK; } + diff --git a/gdb/wrapper.h b/gdb/wrapper.h index 99c1e1672f7..b287b29db1e 100644 --- a/gdb/wrapper.h +++ b/gdb/wrapper.h @@ -21,10 +21,8 @@ #include "gdb.h" struct value; -struct block; struct expression; -struct ui_out; -struct type; +struct block; /* Use this struct to pass arguments to wrapper routines. */ struct gdb_wrapper_arguments; @@ -49,4 +47,5 @@ extern enum gdb_rc gdb_value_struct_elt (struct ui_out *uiout, struct value **re extern int gdb_value_ind (struct value *val, struct value ** rval); extern int gdb_parse_and_eval_type (char *, int, struct type **); + #endif /* WRAPPER_H */ |