• R/O
  • HTTP
  • SSH
  • HTTPS

Commit

Tags
No Tags

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

GNU Binutils with patches for OS216


Commit MetaInfo

Revisión02c08270fa34d257c3930afe16e4cddf7421c2a9 (tree)
Tiempo2003-02-04 10:26:55
AutorAndrew Cagney <cagney@redh...>
CommiterAndrew Cagney

Log Message

Kill off anything not directly related to the CLI command.

Cambiar Resumen

Diferencia incremental

--- a/gdb/Makefile.in
+++ b/gdb/Makefile.in
@@ -144,11 +144,15 @@ TARGET_SYSTEM_ROOT_DEFINE = @TARGET_SYSTEM_ROOT_DEFINE@
144144 # CLI sub directory definitons
145145 #
146146 SUBDIR_CLI_OBS = \
147- cli-dump.o cli-decode.o \
148- cli-interp.o cli-script.o cli-cmds.o cli-setshow.o cli-utils.o
147+ cli-dump.o \
148+ cli-decode.o cli-script.o cli-cmds.o \
149+ cli-interp.o \
150+ cli-setshow.o cli-utils.o
149151 SUBDIR_CLI_SRCS = \
150- cli/cli-dump.c cli/cli-decode.c \
151- cli/cli-interp.c cli/cli-script.c cli/cli-cmds.c cli/cli-setshow.c \
152+ cli/cli-dump.c \
153+ cli/cli-decode.c cli/cli-script.c cli/cli-cmds.c \
154+ cli/cli-interp.c \
155+ cli/cli-setshow.c \
152156 cli/cli-utils.c
153157 SUBDIR_CLI_DEPS =
154158 SUBDIR_CLI_INITS = \
@@ -167,7 +171,6 @@ SUBDIR_MI_OBS = \
167171 mi-out.o mi-console.o \
168172 mi-cmds.o mi-cmd-env.o mi-cmd-var.o mi-cmd-break.o mi-cmd-stack.o \
169173 mi-cmd-disas.o \
170- mi-events.o \
171174 mi-interp.o \
172175 mi-main.o mi-parse.o mi-getopt.o
173176 SUBDIR_MI_SRCS = \
@@ -175,7 +178,6 @@ SUBDIR_MI_SRCS = \
175178 mi/mi-cmds.c mi/mi-cmd-env.c \
176179 mi/mi-cmd-var.c mi/mi-cmd-break.c mi/mi-cmd-stack.c \
177180 mi/mi-cmd-disas.c \
178- mi/mi-events.c \
179181 mi/mi-interp.c \
180182 mi/mi-main.c mi/mi-parse.c mi/mi-getopt.c
181183 SUBDIR_MI_DEPS =
@@ -520,7 +522,8 @@ SFILES = ada-exp.y ada-lang.c ada-typeprint.c ada-valprint.c ada-tasks.c \
520522 frame-unwind.c \
521523 gdbarch.c arch-utils.c gdbtypes.c gnu-v2-abi.c gnu-v3-abi.c \
522524 hpacc-abi.c \
523- inf-loop.c infcmd.c inflow.c infrun.c interps.c \
525+ inf-loop.c infcmd.c inflow.c infrun.c \
526+ interps.c \
524527 jv-exp.y jv-lang.c jv-valprint.c jv-typeprint.c \
525528 kod.c kod-cisco.c \
526529 language.c linespec.c \
@@ -742,6 +745,7 @@ cli_utils_h = $(srcdir)/cli/cli-utils.h
742745 # gdb/mi/ headers
743746 #
744747
748+mi_h = $(srcdir)/mi/mi.h
745749 mi_cmds_h = $(srcdir)/mi/mi-cmds.h
746750 mi_console_h = $(srcdir)/mi/mi-console.h
747751 mi_getopt_h = $(srcdir)/mi/mi-getopt.h
@@ -821,6 +825,7 @@ COMMON_OBS = version.o blockframe.o breakpoint.o findvar.o regcache.o \
821825 source.o values.o eval.o valops.o valarith.o valprint.o printcmd.o \
822826 symtab.o symfile.o symmisc.o linespec.o infcmd.o infrun.o \
823827 expprint.o environ.o stack.o thread.o \
828+ interps.o \
824829 macrotab.o macrocmd.o macroexp.o macroscope.o \
825830 event-loop.o event-top.o inf-loop.o completer.o \
826831 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 \
833838 dbxread.o coffread.o elfread.o \
834839 dwarfread.o dwarf2read.o mipsread.o stabsread.o corefile.o \
835840 c-lang.o f-lang.o \
836- ui-out.o cli-out.o interps.o \
841+ ui-out.o cli-out.o \
837842 varobj.o wrapper.o \
838843 jv-lang.o jv-valprint.o jv-typeprint.o \
839844 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) \
16391644 $(value_h) $(expression_h) $(target_h) $(frame_h) $(language_h) \
16401645 $(f_lang_h) $(cp_abi_h)
16411646 event-loop.o: event-loop.c $(defs_h) $(event_loop_h) $(event_top_h) \
1642- $(gdb_string_h) $(interps_h)
1647+ $(gdb_string_h)
16431648 event-top.o: event-top.c $(defs_h) $(top_h) $(inferior_h) $(target_h) \
1644- $(terminal_h) $(event_loop_h) $(event_top_h) $(gdbcmd_h) \
1645- $(readline_h) $(interps_h)
1649+ $(terminal_h) $(event_loop_h) $(event_top_h) $(gdbcmd_h) $(readline_h)
16461650 exec.o: exec.c $(defs_h) $(frame_h) $(inferior_h) $(target_h) $(gdbcmd_h) \
16471651 $(language_h) $(symfile_h) $(objfiles_h) $(completer_h) $(value_h) \
16481652 $(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) \
17031707 $(command_h) $(gdbcmd_h) $(floatformat_h) $(buildsym_h) \
17041708 $(i387_tdep_h) $(i386_tdep_h) $(value_h) $(regcache_h) \
17051709 $(gdb_string_h)
1706-interps.o: interps.c $(defs_h) $(gdbcmd_h) $(ui_out_h) $(event_loop_h) \
1707- $(event_top_h) $(interps_h) $(gdb_h) $(wrapper_h) $(gdb_events_h)
17081710 h8300-tdep.o: h8300-tdep.c $(defs_h) $(frame_h) $(symtab_h) $(dis_asm_h) \
17091711 $(gdbcmd_h) $(gdbtypes_h) $(gdbcore_h) $(gdb_string_h) $(value_h) \
17101712 $(regcache_h)
@@ -1801,6 +1803,9 @@ inftarg.o: inftarg.c $(defs_h) $(frame_h) $(inferior_h) $(target_h) \
18011803 $(gdbcore_h) $(command_h) $(gdb_stat_h) $(gdb_wait_h)
18021804 infttrace.o: infttrace.c $(defs_h) $(frame_h) $(inferior_h) $(target_h) \
18031805 $(gdb_string_h) $(gdb_wait_h) $(command_h) $(gdbcore_h)
1806+interps.o: interps.c $(defs_h) $(gdbcmd_h) $(ui_out_h) $(event_loop_h) \
1807+ $(event_top_h) $(interps_h) $(completer_h) $(gdb_string_h) \
1808+ $(gdb_events_h)
18041809 irix4-nat.o: irix4-nat.c $(defs_h) $(inferior_h) $(gdbcore_h) $(regcache_h) \
18051810 $(gregset_h)
18061811 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) \
18761881 $(bcache_h) $(complaints_h)
18771882 main.o: main.c $(defs_h) $(top_h) $(target_h) $(inferior_h) $(symfile_h) \
18781883 $(gdbcore_h) $(getopt_h) $(gdb_stat_h) $(gdb_string_h) \
1879- $(event_loop_h) $(ui_out_h) $(main_h) $(interps_h)
1884+ $(event_loop_h) $(ui_out_h) $(main_h)
18801885 maint.o: maint.c $(defs_h) $(command_h) $(gdbcmd_h) $(symtab_h) \
18811886 $(gdbtypes_h) $(demangle_h) $(gdbcore_h) $(expression_h) \
18821887 $(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) \
23192324 $(cli_decode_h) $(cli_cmds_h) $(value_h) $(completer_h) \
23202325 $(cli_dump_h) $(gdb_assert_h) $(target_h) $(readline_h)
23212326 $(CC) -c $(INTERNAL_CFLAGS) $(srcdir)/cli/cli-dump.c
2322-cli-interp.o: $(srcdir)/cli/cli-interp.c $(defs_h) $(value_h) \
2323- $(wrapper_h) $(event_top_h) $(ui_out_h) $(cli_out_h) $(top_h)
2327+cli-interp.o: $(srcdir)/cli/cli-interp.c $(defs_h) $(interps_h) $(wrapper_h) \
2328+ $(event_top_h) $(ui_out_h) $(cli_out_h) $(top_h)
23242329 $(CC) -c $(INTERNAL_CFLAGS) $(srcdir)/cli/cli-interp.c
23252330 cli-script.o: $(srcdir)/cli/cli-script.c $(defs_h) $(value_h) $(language_h) \
23262331 $(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 \
24822487
24832488 mi-cmd-break.o: $(srcdir)/mi/mi-cmd-break.c $(defs_h) $(mi_cmds_h) \
24842489 $(ui_out_h) $(mi_out_h) $(breakpoint_h) $(gdb_string_h) \
2485- $(mi_getopt_h) $(gdb_events_h) $(gdb_h) $(interps_h)
2490+ $(mi_getopt_h) $(gdb_events_h) $(gdb_h)
24862491 $(CC) -c $(INTERNAL_CFLAGS) $(srcdir)/mi/mi-cmd-break.c
24872492 mi-cmd-disas.o: $(srcdir)/mi/mi-cmd-disas.c $(defs_h) $(target_h) $(value_h) \
24882493 $(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) \
25032508 mi-console.o: $(srcdir)/mi/mi-console.c $(defs_h) $(mi_console_h) \
25042509 $(gdb_string_h)
25052510 $(CC) -c $(INTERNAL_CFLAGS) $(srcdir)/mi/mi-console.c
2506-mi-events.o: $(srcdir)/mi/mi-events.c $(defs_h) $(ui_out_h) $(interps_h) \
2507- $(gdb_h) $(breakpoint_h) $(mi_h)
2508- $(CC) -c $(INTERNAL_CFLAGS) $(srcdir)/mi/mi-events.c
25092511 mi-getopt.o: $(srcdir)/mi/mi-getopt.c $(defs_h) $(mi_getopt_h) \
25102512 $(gdb_string_h)
25112513 $(CC) -c $(INTERNAL_CFLAGS) $(srcdir)/mi/mi-getopt.c
2512-mi-interp.o: $(srcdir)/mi/mi-interp.c $(defs_h) $(interps_h) \
2513- $(event_top_h) $(event_loop_h) $(inferior_h) $(ui_out_h) \
2514- $(top_h) $(mi_h) $(mi_cmds_h) $(mi_out_h) $(mi_console_h)
2514+mi-interp.o: $(srcdir)/mi/mi-interp.c $(defs_h) $(gdb_string_h) $(interps_h) \
2515+ $(event_top_h) $(event_loop_h) $(inferior_h) $(ui_out_h) $(top_h) \
2516+ $(mi_h) $(mi_cmds_h) $(mi_out_h) $(mi_console_h)
25152517 $(CC) -c $(INTERNAL_CFLAGS) $(srcdir)/mi/mi-interp.c
25162518 mi-main.o: $(srcdir)/mi/mi-main.c $(defs_h) $(target_h) $(inferior_h) \
25172519 $(gdb_string_h) $(top_h) $(gdbthread_h) $(mi_cmds_h) $(mi_parse_h) \
25182520 $(mi_getopt_h) $(mi_console_h) $(ui_out_h) $(mi_out_h) \
25192521 $(event_loop_h) $(event_top_h) $(gdbcore_h) $(value_h) $(regcache_h) \
2520- $(gdb_h) $(frame_h) $(interps_h)
2522+ $(gdb_h) $(frame_h)
25212523 $(CC) -c $(INTERNAL_CFLAGS) $(srcdir)/mi/mi-main.c
25222524 mi-out.o: $(srcdir)/mi/mi-out.c $(defs_h) $(ui_out_h) $(mi_out_h)
25232525 $(CC) -c $(INTERNAL_CFLAGS) $(srcdir)/mi/mi-out.c
--- a/gdb/breakpoint.c
+++ b/gdb/breakpoint.c
@@ -3899,7 +3899,6 @@ create_internal_breakpoint (CORE_ADDR address, enum bptype type)
38993899 b = set_raw_breakpoint (sal, type);
39003900 b->number = internal_breakpoint_number--;
39013901 b->disposition = disp_donttouch;
3902- breakpoint_create_event (b->number);
39033902
39043903 return b;
39053904 }
@@ -4183,7 +4182,6 @@ solib_load_unload_1 (char *hookname, int tempflag, char *dll_pathname,
41834182 }
41844183
41854184 mention (b);
4186- breakpoint_create_event (b->number);
41874185 do_cleanups (old_chain);
41884186 }
41894187
@@ -4229,7 +4227,6 @@ create_fork_vfork_event_catchpoint (int tempflag, char *cond_string,
42294227 b->forked_inferior_pid = 0;
42304228
42314229 mention (b);
4232- breakpoint_create_event (b->number);
42334230 }
42344231
42354232 void
@@ -4268,7 +4265,6 @@ create_exec_event_catchpoint (int tempflag, char *cond_string)
42684265 b->disposition = tempflag ? disp_del : disp_donttouch;
42694266
42704267 mention (b);
4271- breakpoint_create_event (b->number);
42724268 }
42734269
42744270 static int
@@ -4392,7 +4388,6 @@ set_momentary_breakpoint (struct symtab_and_line sal, struct frame_id frame_id,
43924388 if (in_thread_list (inferior_ptid))
43934389 b->thread = pid_to_thread_id (inferior_ptid);
43944390
4395- breakpoint_create_event (b->number);
43964391 return b;
43974392 }
43984393
@@ -4409,6 +4404,15 @@ mention (struct breakpoint *b)
44094404 stb = ui_out_stream_new (uiout);
44104405 old_chain = make_cleanup_ui_out_stream_delete (stb);
44114406
4407+ /* FIXME: This is misplaced; mention() is called by things (like hitting a
4408+ watchpoint) other than breakpoint creation. It should be possible to
4409+ clean this up and at the same time replace the random calls to
4410+ breakpoint_changed with this hook, as has already been done for
4411+ delete_breakpoint_hook and so on. */
4412+ if (create_breakpoint_hook)
4413+ create_breakpoint_hook (b);
4414+ breakpoint_create_event (b->number);
4415+
44124416 switch (b->type)
44134417 {
44144418 case bp_none:
@@ -4579,7 +4583,6 @@ create_breakpoints (struct symtabs_and_lines sals, char **addr_string,
45794583 b->enable_state = bp_enabled;
45804584 b->disposition = disposition;
45814585 mention (b);
4582- breakpoint_create_event (b->number);
45834586 }
45844587 }
45854588 }
@@ -5434,12 +5437,9 @@ watch_command_1 (char *arg, int accessflag, int from_tty)
54345437 /* The scope breakpoint is related to the watchpoint. We
54355438 will need to act on them together. */
54365439 b->related_breakpoint = scope_breakpoint;
5437-
5438- breakpoint_create_event (scope_breakpoint->number);
54395440 }
54405441 }
54415442 value_free_to_mark (mark);
5442- breakpoint_create_event (b->number);
54435443 mention (b);
54445444 }
54455445
@@ -6183,7 +6183,6 @@ create_exception_catchpoint (int tempflag, char *cond_string,
61836183 b->enable_state = bp_enabled;
61846184 b->disposition = tempflag ? disp_del : disp_donttouch;
61856185 mention (b);
6186- breakpoint_create_event (b->number);
61876186 }
61886187
61896188 /* 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)
63496348 b->disposition = tempflag ? disp_del : disp_donttouch;
63506349
63516350 mention (b);
6352- breakpoint_create_event (b->number);
63536351 }
63546352
63556353 if (sals.nelts > 1)
@@ -6492,7 +6490,6 @@ set_breakpoint_sal (struct symtab_and_line sal)
64926490 b->number = breakpoint_count;
64936491 b->cond = 0;
64946492 b->thread = -1;
6495- breakpoint_create_event (b->number);
64966493 return b;
64976494 }
64986495
--- a/gdb/cli-out.h
+++ b/gdb/cli-out.h
@@ -23,6 +23,8 @@
2323 #define CLI_OUT_H
2424
2525 extern struct ui_out *cli_out_new (struct ui_file *stream);
26+
2627 extern struct ui_file *cli_out_set_stream (struct ui_out *uiout,
2728 struct ui_file *stream);
29+
2830 #endif
--- a/gdb/defs.h
+++ b/gdb/defs.h
@@ -1195,6 +1195,7 @@ extern void (*error_begin_hook) (void);
11951195
11961196 extern int (*ui_load_progress_hook) (const char *section, unsigned long num);
11971197
1198+
11981199 /* Inhibit window interface if non-zero. */
11991200
12001201 extern int use_windows;
--- a/gdb/gdb-events.sh
+++ b/gdb/gdb-events.sh
@@ -86,6 +86,7 @@ f:void:selected_thread_changed:int thread_num:thread_num
8686 #*:void:warning_hook:const char *string, va_list args:string, args
8787 #*:void:target_output_hook:char *b:b
8888 #*:void:interactive_hook:void
89+#*:void:registers_changed_hook:void
8990 #*:void:readline_begin_hook:char *format, ...:format
9091 #*:char *:readline_hook:char *prompt:prompt
9192 #*:void:readline_end_hook:void
@@ -100,6 +101,7 @@ f:void:selected_thread_changed:int thread_num:thread_num
100101 #*:int:gdb_load_progress_hook:char *section, unsigned long num:section, num
101102 #*:void:pre_add_symbol_hook:char *name:name
102103 #*:void:post_add_symbol_hook:void
104+#*:void:selected_frame_level_changed_hook:int level:level
103105 #*:int:gdb_loop_hook:int signo:signo
104106 ##*:void:solib_create_inferior_hook:void
105107 ##*:void:xcoff_relocate_symtab_hook:unsigned int
--- a/gdb/mi/mi-cmd-break.c
+++ b/gdb/mi/mi-cmd-break.c
@@ -28,7 +28,6 @@
2828 #include "mi-getopt.h"
2929 #include "gdb-events.h"
3030 #include "gdb.h"
31-#include "interps.h"
3231
3332 enum
3433 {
@@ -40,8 +39,7 @@ enum
4039 static void
4140 breakpoint_notify (int b)
4241 {
43- if (b > 0)
44- gdb_breakpoint_query (uiout, b);
42+ gdb_breakpoint_query (uiout, b);
4543 }
4644
4745
@@ -79,7 +77,7 @@ mi_cmd_break_insert (char *command, char **argv, int argc)
7977 int ignore_count = 0;
8078 char *condition = NULL;
8179 enum gdb_rc rc;
82- struct gdb_events *old_hooks = NULL;
80+ struct gdb_events *old_hooks;
8381 enum opt
8482 {
8583 HARDWARE_OPT, TEMP_OPT /*, REGEXP_OPT */ , CONDITION_OPT,
@@ -135,17 +133,8 @@ mi_cmd_break_insert (char *command, char **argv, int argc)
135133 error ("mi_cmd_break_insert: Garbage following <location>");
136134 address = argv[optind];
137135
138- /* Save the current event handlers so that we can insert our own. This
139- allows us to capture the breakpoint information as the breakpoint
140- is created. Unfortunately, it also overrides any existing event
141- handlers, so we won't get any event notifications sent out to the
142- client. MI3+ does NOT send breakpoint information with the -break-insert
143- command for this reason. */
144- if (gdb_interpreter_current_is_named_p (GDB_INTERPRETER_MI2)
145- || gdb_interpreter_current_is_named_p (GDB_INTERPRETER_MI1))
146- old_hooks = set_gdb_event_hooks (&breakpoint_hooks);
147-
148136 /* Now we have what we need, let's insert the breakpoint! */
137+ old_hooks = set_gdb_event_hooks (&breakpoint_hooks);
149138 switch (type)
150139 {
151140 case REG_BP:
@@ -171,10 +160,7 @@ mi_cmd_break_insert (char *command, char **argv, int argc)
171160 internal_error (__FILE__, __LINE__,
172161 "mi_cmd_break_insert: Bad switch.");
173162 }
174-
175- if (gdb_interpreter_current_is_named_p (GDB_INTERPRETER_MI2)
176- || gdb_interpreter_current_is_named_p (GDB_INTERPRETER_MI1))
177- set_gdb_event_hooks (old_hooks);
163+ set_gdb_event_hooks (old_hooks);
178164
179165 if (rc == GDB_RC_FAIL)
180166 return MI_CMD_CAUGHT_ERROR;
@@ -250,15 +236,5 @@ mi_cmd_break_watch (char *command, char **argv, int argc)
250236 default:
251237 error ("mi_cmd_break_watch: Unknown watchpoint type.");
252238 }
253-
254- /* Ugh. This is a hack. mention and print_one_breakpoint in
255- breakpoint.c are so overloaded, that watchpoints and breakpoints
256- cannot use the same printing mechanisms. So for MI3+, we simply
257- rewind MI's uiout so that we can prevent GDB from printing
258- any information about the watchpoint we just inserted. */
259- if (!gdb_interpreter_current_is_named_p (GDB_INTERPRETER_MI2)
260- && !gdb_interpreter_current_is_named_p (GDB_INTERPRETER_MI1))
261- mi_out_rewind (uiout);
262-
263239 return MI_CMD_DONE;
264240 }
--- a/gdb/mi/mi-cmds.h
+++ b/gdb/mi/mi-cmds.h
@@ -27,7 +27,7 @@
2727 enum mi_cmd_result
2828 {
2929 /* Report the command as ``done''. Display both the ``NNN^done''
30- message and the completion prompt. */
30+ message and the completion prompt. */
3131 MI_CMD_DONE = 0,
3232 /* The command is still running in the forground. Main loop should
3333 display the completion prompt. */
@@ -130,4 +130,5 @@ extern struct ui_file *raw_stdout;
130130 extern char *mi_error_message;
131131 extern void mi_error_last_message (void);
132132 extern void mi_execute_command (char *cmd, int from_tty);
133+
133134 #endif
--- a/gdb/mi/mi-interp.c
+++ b/gdb/mi/mi-interp.c
@@ -129,7 +129,6 @@ mi_interpreter_resume (void *data)
129129 /* Replace all the hooks that we know about. There really needs to
130130 be a better way of doing this... */
131131 clear_interpreter_hooks ();
132- set_gdb_event_hooks (&mi_event_handlers);
133132
134133 show_load_progress = mi_load_progress;
135134
--- a/gdb/mi/mi.h
+++ b/gdb/mi/mi.h
@@ -24,7 +24,6 @@
2424
2525 extern struct gdb_interpreter *mi_interp;
2626 extern struct gdb_interpreter *mi1_interp;
27-extern struct gdb_events mi_event_handlers;
2827 extern struct ui_file *mi_event_channel;
2928
3029 extern void mi_setup_architecture_data (void);
--- a/gdb/testsuite/gdb.mi/ChangeLog
+++ b/gdb/testsuite/gdb.mi/ChangeLog
@@ -1,3 +1,8 @@
1+2003-02-03 Andrew Cagney <ac131313@redhat.com>
2+
3+ * mi-cli.exp: Remove patterns checking for events. Better handle
4+ continuations.
5+
16 2002-08-21 Keith Seitz <keiths@redhat.com>
27
38 * mi-cli.exp: Use "target_changed" instead of "register-update".
--- a/gdb/testsuite/gdb.mi/mi-break.exp
+++ b/gdb/testsuite/gdb.mi/mi-break.exp
@@ -1,4 +1,4 @@
1-# Copyright 1999, 2002 Free Software Foundation, Inc.
1+# Copyright 1999 Free Software Foundation, Inc.
22
33 # This program is free software; you can redistribute it and/or modify
44 # it under the terms of the GNU General Public License as published by
@@ -62,20 +62,20 @@ proc test_tbreak_creation_and_listing {} {
6262 # -break-list
6363
6464 mi_gdb_test "222-break-insert -t main" \
65- "=breakpoint-create,number=\"1\"\r\n222\\^done" \
65+ "222\\^done,bkpt=\{number=\"1\",type=\"breakpoint\",disp=\"del\",enabled=\"y\",addr=\"$hex\",func=\"main\",file=\".*basics.c\",line=\"32\",times=\"0\"\}" \
6666 "break-insert -t operation"
6767
6868 mi_gdb_test "333-break-insert -t basics.c:callee2" \
69- "=breakpoint-create,number=\"2\"\r\n333\\^done" \
69+ "333\\^done,bkpt=\{number=\"2\",type=\"breakpoint\",disp=\"del\",enabled=\"y\",addr=\"$hex\",func=\"callee2\",file=\".*basics.c\",line=\"22\",times=\"0\"\}" \
7070 "insert temp breakpoint at basics.c:callee2"
7171
7272 mi_gdb_test "444-break-insert -t basics.c:15" \
73- "=breakpoint-create,number=\"3\"\r\n444\\^done" \
73+ "444\\^done,bkpt=\{number=\"3\",type=\"breakpoint\",disp=\"del\",enabled=\"y\",addr=\"$hex\",func=\"callee3\",file=\".*basics.c\",line=\"15\",times=\"0\"\}" \
7474 "insert temp breakpoint at basics.c:15 (callee3)"
7575
7676 # Getting the quoting right is tricky. That is "\"<file>\":6"
7777 mi_gdb_test "555-break-insert -t \"\\\"${srcfile}\\\":6\"" \
78- "=breakpoint-create,number=\"4\"\r\n555\\^done" \
78+ "555\\^done,bkpt=\{number=\"4\",type=\"breakpoint\",disp=\"del\",enabled=\"y\",addr=\"$hex\",func=\"callee4\",file=\".*basics.c\",line=\"6\",times=\"0\"\}" \
7979 "insert temp breakpoint at \"<fullfilename>\":6 (callee4)"
8080
8181 mi_gdb_test "666-break-list" \
--- 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" \
5757 "&\\\"$msg\\\\n\\\".*\\^error,msg=\\\"$msg\\\".*" \
5858 "-interpreter-exec console bogus"
5959
60+# NOTE: cagney/2003-02-03: Not yet.
61+# mi_gdb_test "-interpreter-exec console \"file $binfile\"" \
62+# {(=.*)+\^done} \
63+# "-interpreter-exec console \"file \$binfile\""
6064 mi_gdb_test "-interpreter-exec console \"file $binfile\"" \
61- {(=.*)+\^done} \
65+ {\^done} \
6266 "-interpreter-exec console \"file \$binfile\""
6367
6468 mi_run_to_main
@@ -71,8 +75,12 @@ mi_gdb_test "-interpreter-exec console \"show args\"" \
7175 {\~"Argument list to give program being debugged when it is started is \\\"foobar\\\"\.\\n".*\^done} \
7276 "-interpreter-exec console \"show args\""
7377
78+# NOTE: cagney/2003-02-03: Not yet.
79+# mi_gdb_test "-interpreter-exec console \"break callee4\"" \
80+# {(&.*)*.*~"Breakpoint 2 at.*\\n".*=breakpoint-create,number="2".*\^done} \
81+# "-interpreter-exec console \"break callee4\""
7482 mi_gdb_test "-interpreter-exec console \"break callee4\"" \
75- {(&.*)*.*~"Breakpoint 2 at.*\\n".*=breakpoint-create,number="2".*\^done} \
83+ {(&.*)*.*~"Breakpoint 2 at.*\\n".*\^done} \
7684 "-interpreter-exec console \"break callee4\""
7785
7886 mi_gdb_test "-interpreter-exec console \"info break\"" \
@@ -87,41 +95,94 @@ mi_gdb_test "-interpreter-exec console \"list\"" \
8795 {.*\~"32[ \t(\\t)]*callee1.*\\n".*\^done} \
8896 "-interpreter-exec console \"list\""
8997
90-mi_gdb_test "-exec-continue" \
91- {.*\*stopped,reason="breakpoint-hit",.*func="callee4".*file=".*basics.c",line="8"\}} \
92- "-interpreter-exec console \"continue to callee4\""
98+# # NOTE: cagney/2003-02-03: Not yet.
99+# mi_gdb_test "-exec-continue" \
100+# {.*\*stopped,reason="breakpoint-hit",.*func="callee4".*file=".*basics.c",line="8"\}} \
101+# "-interpreter-exec console \"continue to callee4\""
102+send_gdb "999-exec-continue\n"
103+gdb_expect {
104+ -re "999\\^running\[\r\n\]+$mi_gdb_prompt.*999\\*stopped,reason=.breakpoint-hit.*$mi_gdb_prompt$" {
105+ pass "continue to callee4"
106+ }
107+ timeout {
108+ fail "continue to callee4 (timeout)"
109+ }
110+}
93111
94-mi_gdb_test "-interpreter-exec console \"delete 2\"" \
95- {.*=breakpoint-delete,number=\"2\".*\^done} \
112+# NOTE: cagney/2003-02-03: Not yet.
113+# mi_gdb_test "100-interpreter-exec console \"delete 2\"" \
114+# {.*=breakpoint-delete,number=\"2\".*\^done} \
115+# "-interpreter-exec console \"delete 2\""
116+mi_gdb_test "100-interpreter-exec console \"delete 2\"" \
117+ {100\^done} \
96118 "-interpreter-exec console \"delete 2\""
97119
98-mi_gdb_test "-interpreter-exec console \"up\"" \
99- {.*=selected-frame-level-changed,level="1".*\^done} \
120+# NOTE: cagney/2003-02-03: Not yet.
121+# mi_gdb_test "200-interpreter-exec console \"up\"" \
122+# {.*=selected-frame-level-changed,level="1".*\^done} \
123+# "-interpreter-exec console \"up\""
124+mi_gdb_test "200-interpreter-exec console \"up\"" \
125+ {200\^done} \
100126 "-interpreter-exec console \"up\""
101127
102-mi_gdb_test "-interpreter-exec console \"down\"" \
103- {.*=selected-frame-level-changed,level="0".*\^done} \
128+# NOTE: cagney/2003-02-03: Not yet.
129+# mi_gdb_test "300-interpreter-exec console \"down\"" \
130+# {.*=selected-frame-level-changed,level="0".*\^done} \
131+# "-interpreter-exec console \"down\""
132+mi_gdb_test "300-interpreter-exec console \"down\"" \
133+ {300\^done} \
104134 "-interpreter-exec console \"down\""
105135
106-mi_gdb_test "-interpreter-exec console \"frame 2\"" \
107- {.*=selected-frame-level-changed,level="2".*\^done} \
136+# NOTE: cagney/2003-02-03: Not yet.
137+# mi_gdb_test "-interpreter-exec console \"frame 2\"" \
138+# {.*=selected-frame-level-changed,level="2".*\^done} \
139+# "-interpreter-exec console \"frame 2\""
140+mi_gdb_test "400-interpreter-exec console \"frame 2\"" \
141+ {400\^done} \
108142 "-interpreter-exec console \"frame 2\""
109143
110-mi_gdb_test "-stack-select-frame 0" \
111- {.*=selected-frame-level-changed,level="0".*\^done} \
144+# NOTE: cagney/2003-02-03: Not yet.
145+# mi_gdb_test "-stack-select-frame 0" \
146+# {.*=selected-frame-level-changed,level="0".*\^done} \
147+# "-stack-select-frame 0"
148+mi_gdb_test "500-stack-select-frame 0" \
149+ {500\^done} \
112150 "-stack-select-frame 0"
113151
114-mi_gdb_test "-break-insert -t basics.c:35" \
115- {.*=breakpoint-create,number="3".*\^done} \
116- "-break-insert -t basics.c:35"
117-
118-mi_gdb_test "-exec-continue" \
119- {.*\*stopped.*,file=".*basics.c",line="35"\}} \
120- "-exec-continue to line 35"
152+# NOTE: cagney/2003-02-03: Not yet.
153+# mi_gdb_test "-break-insert -t basics.c:35" \
154+# {.*=breakpoint-create,number="3".*\^done} \
155+# "-break-insert -t basics.c:35"
156+mi_gdb_test "600-break-insert -t basics.c:35" \
157+ {600\^done,bkpt=.number="3",type="breakpoint".*\}} \
158+ "-break-insert -t basics.c:35"
159+
160+# mi_gdb_test "-exec-continue" \
161+# {.*\*stopped.*,file=".*basics.c",line="35"\}} \
162+# "-exec-continue to line 35"
163+send_gdb "700-exec-continue\n"
164+gdb_expect {
165+ -re "700\\^running\[\r\n\]+$mi_gdb_prompt.*\\*stopped.*,file=.*basics.c.,line=.35.*$mi_gdb_prompt$" {
166+ pass "-exec-continue to line 35"
167+ }
168+ timeout {
169+ fail "-exec-continue to line 35"
170+ }
171+}
121172
122-mi_gdb_test "-exec-next" \
123- {.*\*stopped,reason="end-stepping-range",.*,file=".*basics.c",line="37"\}} \
124- "-exec-next to line 37"
173+# NOTE: cagney/2003-02-03: Not yet.
174+# mi_gdb_test "-exec-next" \
175+# {.*\*stopped,reason="end-stepping-range",.*,file=".*basics.c",line="37"\}} \
176+# "-exec-next to line 37"
177+send_gdb "800-exec-next\n"
178+gdb_expect {
179+ -re "800\\^running\[\r\n\]+$mi_gdb_prompt.*\\*stopped,reason=.end-stepping-range.*,file=.*basics.c.,line=.37.*$mi_gdb_prompt$" {
180+ pass "-exec-next to line 37"
181+ }
182+ timeout {
183+ fail "-exec-next to line 37"
184+ }
185+}
125186
126187 mi_gdb_test "-interpreter-exec console \"list\"" \
127188 {\~"37[ \t(\\t)]*return 0;\\n".*\^done} \
@@ -131,8 +192,12 @@ mi_gdb_test "-interpreter-exec console \"help set args\"" \
131192 {\~"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} \
132193 "-interpreter-exec console \"help set args\""
133194
134-mi_gdb_test "-interpreter-exec console \"set \$pc=0x0\"" \
135- {.*=target-changed.*\^done} \
195+# NOTE: cagney/2003-02-03: Not yet.
196+# mi_gdb_test "-interpreter-exec console \"set \$pc=0x0\"" \
197+# {.*=target-changed.*\^done} \
198+# "-interpreter-exec console \"set \$pc=0x0\""
199+mi_gdb_test "888-interpreter-exec console \"set \$pc=0x0\"" \
200+ {888\^done} \
136201 "-interpreter-exec console \"set \$pc=0x0\""
137202
138203 #mi_gdb_test "-interpreter-exec console \"\"" \
--- a/gdb/testsuite/gdb.mi/mi-pthreads.exp
+++ b/gdb/testsuite/gdb.mi/mi-pthreads.exp
@@ -17,11 +17,11 @@
1717 # Please email any bugs, comments, and/or additions to this file to:
1818 # bug-gdb@prep.ai.mit.edu
1919
20-# This file tests that GDB's console can be accessed via the MI.
21-# Specifically, we are testing the "interpreter-exec" command and that
22-# the commands that are executed via this command are properly executed.
23-# Console commands executed via MI should use MI output wrappers, MI event
24-# handlers, etc.
20+# This file tests MI thread commands.
21+# Specifically, we are testing the MI command set and the console (in MI)
22+# command set ("interpreter-exec") and that the commands that are executed
23+# via these command pathways are properly executed. Console commands
24+# executed via MI should use MI output wrappers, MI event handlers, etc.
2525
2626 # This only works with native configurations
2727 if {![isnative]} {
@@ -36,6 +36,10 @@ if {[mi_gdb_start]} {
3636 continue
3737 }
3838
39+# The procs below dealing with parsing cli/mi output for the threadlist
40+# is duplicated in gdb669.exp. Any changes here will probably need to
41+# be made there as well.
42+
3943 proc get_mi_thread_list {name} {
4044 global expect_out
4145
@@ -45,11 +49,16 @@ proc get_mi_thread_list {name} {
4549 # ^done,thread-ids=[thread-id="1",thread-id="2",...],number-of-threads="N"
4650 # (gdb)
4751 mi_gdb_test "-thread-list-ids" \
48- {\^done,thread-ids=\{(thread-id="[0-9]+"(,)*)+\},number-of-threads="[0-9]+"} \
52+ {\^done,thread-ids={(thread-id="[0-9]+"(,)?)+},number-of-threads="[0-9]+"} \
4953 "-thread_list_ids ($name)"
5054
55+ set output {}
56+ if {[info exists expect_out(buffer)]} {
57+ set output $expect_out(buffer)
58+ }
59+
5160 set thread_list {}
52- if {![regexp {thread-ids=\{(thread-id="[0-9]+"(,)?)*\}} $expect_out(buffer) threads]} {
61+ if {![regexp {thread-ids=\{(thread-id="[0-9]+"(,)?)*\}} $output threads]} {
5362 fail "finding threads in MI output ($name)"
5463 } else {
5564 pass "finding threads in MI output ($name)"
@@ -74,9 +83,12 @@ proc check_mi_and_console_threads {name} {
7483 global expect_out
7584
7685 mi_gdb_test "-thread-list-ids" \
77- {\^done,thread-ids=\{(thread-id="[0-9]+"(,)*)+\},number-of-threads="[0-9]+"} \
86+ {\^done,thread-ids={(thread-id="[0-9]+"(,)*)+},number-of-threads="[0-9]+"} \
7887 "-thread-list-ids ($name)"
79- set mi_output $expect_out(buffer)
88+ set mi_output {}
89+ if {[info exists expect_out(buffer)]} {
90+ set mi_output $expect_out(buffer)
91+ }
8092
8193 # GDB will return a list of thread ids and some more info:
8294 #
@@ -86,10 +98,14 @@ proc check_mi_and_console_threads {name} {
8698 # ~" 3 Thread 1026 (LWP 7733) () at __libc_nanosleep:-1"
8799 # ~" 2 Thread 2049 (LWP 7732) 0x401411f8 in __poll (fds=0x804bb24, nfds=1, timeout=2000) at ../sysdeps/unix/sysv/linux/poll.c:63"
88100 # ~"* 1 Thread 1024 (LWP 7731) main (argc=1, argv=0xbfffdd94) at ../../../src/gdb/testsuite/gdb.mi/pthreads.c:160"
89- mi_gdb_test {-interpreter-exec console "info threads"} \
101+ # FIXME: kseitz/2002-09-05: Don't use the hack-cli method.
102+ mi_gdb_test "info threads" \
90103 {.*(~".*"[\r\n]*)+.*} \
91104 "info threads ($name)"
92- set console_output $expect_out(buffer)
105+ set console_output {}
106+ if {[info exists $expect_out(buffer)]} {
107+ set console_output $expect_out(buffer)
108+ }
93109
94110 # Make a list of all known threads to console (gdb's thread IDs)
95111 set console_thread_list {}
@@ -159,19 +175,6 @@ proc check_mi_and_console_threads {name} {
159175 }
160176 }
161177
162-# This procedure checks for the bug gdb/669, where the console
163-# command "info threads" and the MI command "-thread-list-ids"
164-# return different threads in the system.
165-proc check_for_gdb669_bug {} {
166- mi_run_to_main
167- check_mi_and_console_threads "at main"
168-
169- for {set i 0} {$i < 4} {incr i} {
170- mi_next "next, try $i"
171- check_mi_and_console_threads "try $i"
172- }
173-}
174-
175178 # This procedure tests the various thread commands in MI.
176179 proc check_mi_thread_command_set {} {
177180
@@ -192,24 +195,11 @@ proc check_mi_thread_command_set {} {
192195 # many of the threads are blocked in libc calls,
193196 # and many people have libc's with no symbols.
194197 mi_gdb_test "-thread-select $thread" \
195- "=context-changed,thread=\"$thread\"\r\n\\^done,new-thread-id=\"$thread\",frame={.*},line=\"(-)?\[0-9\]+\",file=\".*\"" \
198+ "\\^done,new-thread-id=\"$thread\",frame={.*}(,line=\"(-)?\[0-9\]+\",file=\".*\")?" \
196199 "check_mi_thread_command_set: -thread-select $thread"
197200 }
198201 }
199202
200-# This procedure checks that the console and MI don't get out
201-# of sync with each other.
202-proc check_console_thread_commands {} {
203-
204- # Assumed that we're at done_making_threads
205- set thread_list [get_mi_thread_list "in check_console_thread_commands"]
206- foreach thread $thread_list {
207- mi_gdb_test "-interpreter-exec console \"thread $thread\"" \
208- "(\\~\".*\"\r\n)*=context-changed,thread=\"$thread\"\r\n\\^done" \
209- "-interpreter-exec console \"thread $thread\""
210- }
211-}
212-
213203 #
214204 # Start here
215205 #
@@ -226,8 +216,6 @@ mi_gdb_reinitialize_dir $srcdir/$subdir
226216 mi_gdb_load $binfile
227217
228218 check_mi_thread_command_set
229-check_console_thread_commands
230-check_for_gdb669_bug
231219
232220 mi_gdb_exit
233221
--- 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
4646 mi_gdb_reinitialize_dir $srcdir/$subdir
4747 mi_gdb_load ${binfile}
4848
49+
4950 proc test_return_simple {} {
5051 global mi_gdb_prompt
5152 global hex
--- a/gdb/testsuite/gdb.mi/mi-simplerun.exp
+++ b/gdb/testsuite/gdb.mi/mi-simplerun.exp
@@ -1,4 +1,4 @@
1-# Copyright 1999, 2000, 2002 Free Software Foundation, Inc.
1+# Copyright 1999, 2000 Free Software Foundation, Inc.
22
33 # This program is free software; you can redistribute it and/or modify
44 # it under the terms of the GNU General Public License as published by
@@ -62,19 +62,19 @@ proc test_breakpoints_creation_and_listing {} {
6262 # -break-info
6363
6464 mi_gdb_test "200-break-insert main" \
65- "=breakpoint-create,number=\"1\"\r\n200\\^done" \
65+ "200\\^done,bkpt=\{number=\"1\",type=\"breakpoint\",disp=\"keep\",enabled=\"y\",addr=\"$hex\",func=\"main\",file=\".*basics.c\",line=\"32\",times=\"0\"\}" \
6666 "break-insert operation"
6767
6868 mi_gdb_test "201-break-insert basics.c:callee2" \
69- "=breakpoint-create,number=\"2\"\r\n201\\^done" \
69+ "201\\^done,bkpt=\{number=\"2\",type=\"breakpoint\",disp=\"keep\",enabled=\"y\",addr=\"$hex\",func=\"callee2\",file=\".*basics.c\",line=\"22\",times=\"0\"\}" \
7070 "insert breakpoint at basics.c:callee2"
7171
7272 mi_gdb_test "202-break-insert basics.c:15" \
73- "=breakpoint-create,number=\"3\"\r\n202\\^done" \
73+ "202\\^done,bkpt=\{number=\"3\",type=\"breakpoint\",disp=\"keep\",enabled=\"y\",addr=\"$hex\",func=\"callee3\",file=\".*basics.c\",line=\"15\",times=\"0\"\}" \
7474 "insert breakpoint at basics.c:15 (callee3)"
7575
7676 mi_gdb_test "203-break-insert \"\\\"${srcfile}\\\":6\"" \
77- "=breakpoint-create,number=\"4\"\r\n203\\^done" \
77+ "203\\^done,bkpt=\{number=\"4\",type=\"breakpoint\",disp=\"keep\",enabled=\"y\",addr=\"$hex\",func=\"callee4\",file=\".*basics.c\",line=\"6\",times=\"0\"\}" \
7878 "insert breakpoint at \"<fullfilename>\":6 (callee4)"
7979
8080 mi_gdb_test "204-break-list" \
@@ -82,7 +82,7 @@ proc test_breakpoints_creation_and_listing {} {
8282 "list of breakpoints"
8383
8484 mi_gdb_test "205-break-disable 2 3 4" \
85- "=breakpoint-modify,number=\"2\"\r\n=breakpoint-modify,number=\"3\"\r\n=breakpoint-modify,number=\"4\"\r\n205\\^done.*" \
85+ "205\\^done.*" \
8686 "disabling of breakpoints"
8787
8888 mi_gdb_test "206-break-info 2" \
--- a/gdb/testsuite/gdb.mi/mi-until.exp
+++ b/gdb/testsuite/gdb.mi/mi-until.exp
@@ -1,4 +1,4 @@
1-# Copyright 1999, 2000, 2002 Free Software Foundation, Inc.
1+# Copyright 1999, 2000 Free Software Foundation, Inc.
22
33 # This program is free software; you can redistribute it and/or modify
44 # it under the terms of the GNU General Public License as published by
@@ -46,13 +46,12 @@ mi_gdb_reinitialize_dir $srcdir/$subdir
4646 mi_gdb_reinitialize_dir $srcdir/$subdir
4747 mi_gdb_load ${binfile}
4848
49-set timeout 5
5049 proc test_running_to_foo {} {
5150 global mi_gdb_prompt
5251 global hex
5352
5453 mi_gdb_test "200-break-insert 10" \
55- "=breakpoint-create,number=\"1\"\r\n200\\^done" \
54+ "200\\^done,bkpt=\{number=\"1\",type=\"breakpoint\",disp=\"keep\",enabled=\"y\",addr=\"$hex\",func=\"foo\",file=\".*until.c\",line=\"10\",times=\"0\"\}" \
5655 "break-insert operation"
5756
5857 mi_run_cmd
@@ -69,7 +68,7 @@ proc test_running_to_foo {} {
6968 }
7069 }
7170
72- mi_gdb_test "100-break-delete 1" "=breakpoint-delete,number=\"1\"\r\n100\\^done" "break-delete 1"
71+ mi_gdb_test "100-break-delete 1" "100\\^done" "break-delete 1"
7372
7473 }
7574
@@ -89,7 +88,7 @@ proc test_until {} {
8988
9089 send_gdb "222-exec-until 15\n"
9190 gdb_expect {
92- -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$" {
91+ -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$" {
9392 pass "until line number"
9493 }
9594 timeout {
@@ -99,7 +98,7 @@ proc test_until {} {
9998
10099 send_gdb "333-exec-until until.c:17\n"
101100 gdb_expect {
102- -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$" {
101+ -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$" {
103102 pass "until line number:file"
104103 }
105104 timeout {
@@ -111,7 +110,7 @@ proc test_until {} {
111110
112111 send_gdb "444-exec-until until.c:25\n"
113112 gdb_expect {
114- -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$" {
113+ -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$" {
115114 pass "until after current function"
116115 }
117116 timeout {
--- 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" \
385385 #####
386386
387387 mi_gdb_test "-break-insert subroutine1" \
388- "=breakpoint-create,number=\"2\"\r\n\\^done" \
388+ "\\^done,bkpt=\{number=\"2\",type=\"breakpoint\",disp=\"keep\",enabled=\"y\",addr=\"$hex\",func=\"subroutine1\",file=\".*var-cmd.c\",line=\"146\",times=\"0\"\}" \
389389 "break-insert subroutine1"
390390 mi_continue_to "2" "subroutine1" \
391391 "\{name=\"i\",value=\"4321\"\},\{name=\"l\",value=\"$hex\"\}" \
@@ -530,7 +530,7 @@ mi_gdb_test "-var-delete l" \
530530 # Test whether we can follow the name of a variable through multiple
531531 # stack frames.
532532 mi_gdb_test "-break-insert do_special_tests" \
533- "=breakpoint-create,number=\"\[0-9\]+\"\r\n\\^done" \
533+ {\^done,bkpt=.*} \
534534 "set breakpoint at do_special_tests"
535535
536536 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" \
540540 "create selected_a"
541541
542542 mi_gdb_test "-break-insert incr_a" \
543- "=breakpoint-create,number=\"\[0-9\]+\"\r\n\\^done" \
543+ {\^done,bkpt=.*} \
544544 "set breakpoint at incr_a"
545545
546546 mi_continue_to {.*} incr_a {.*} {.*var-cmd.c} {.*} {stop in incr_a}
--- 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
4343 mi_gdb_load ${binfile}
4444
4545 mi_gdb_test "200-break-insert 260" \
46- "=breakpoint-create,number=\"1\"\r\n200\\^done" \
46+ "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\"\}" \
4747 "break-insert operation"
4848
4949 mi_run_cmd
@@ -325,12 +325,12 @@ mi_gdb_test "-var-delete weird" \
325325
326326 # Stop in "do_special_tests"
327327 mi_gdb_test "200-break-insert do_special_tests" \
328- "=breakpoint-create,number=\"2\"\r\n200\\^done" \
328+ "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\"\}" \
329329 "break-insert operation"
330330
331331 send_gdb "-exec-continue\n"
332332 gdb_expect {
333- -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$" {
333+ -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$" {
334334 pass "continue to do_special_tests"
335335 }
336336 timeout {
@@ -584,14 +584,14 @@ gdb_expect {
584584 }
585585
586586 mi_gdb_test "200-break-insert incr_a" \
587- "=breakpoint-create,number=\"3\"\r\n200\\^done" \
587+ "200\\^done,bkpt=\{number=\"3\",type=\"breakpoint\",disp=\"keep\",enabled=\"y\",addr=\"$hex\",func=\"incr_a\",file=\".*var-cmd.c\",line=\"85\",times=\"0\"\}" \
588588 "break-insert operation"
589589 send_gdb "-exec-continue\n"
590590 gdb_expect {
591- -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$" {
591+ -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$" {
592592 pass "continue to incr_a"
593593 }
594- -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$" {
594+ -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$" {
595595 fail "continue to incr_a (compiler debug info incorrect)"
596596 }
597597 -re "\\^running\r\n${mi_gdb_prompt}.*\r\n$mi_gdb_prompt$" {
--- 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 {} {
5858 # -break-list
5959
6060 mi_gdb_test "111-break-watch C" \
61- "=breakpoint-create,number=\"2\"\r\n111\\^done" \
61+ "111\\^done,wpt=\{number=\"2\",exp=\"C\"\}" \
6262 "break-watch operation"
6363
6464 mi_gdb_test "222-break-list" \
@@ -79,7 +79,7 @@ proc test_awatch_creation_and_listing {} {
7979 # -break-list
8080
8181 mi_gdb_test "333-break-watch -a A" \
82- "=breakpoint-create,number=\"1\"\r\n333\\^done" \
82+ "333\\^done,bkpt=\{number=\"1\",addr=\"$hex\",file=\".*basics.c\",line=\"32\"\}" \
8383 "break-watch -a operation"
8484
8585 mi_gdb_test "444-break-list" \
@@ -87,7 +87,7 @@ proc test_awatch_creation_and_listing {} {
8787 "list of watchpoints awatch"
8888
8989 mi_gdb_test "777-break-delete 3" \
90- "=breakpoint-delete,number=\"3\"\r\n777\\^done" \
90+ "777\\^done" \
9191 "delete access watchpoint"
9292 }
9393
@@ -103,7 +103,7 @@ proc test_rwatch_creation_and_listing {} {
103103 # -break-list
104104
105105 mi_gdb_test "200-break-watch -r C" \
106- "=breakpoint-create,number=\"5"\r\n200\\^done" \
106+ "200\\^done,bkpt=\{number=\"5\",type=\"breakpoint\",disp=\"keep\",enabled=\"y\",addr=\"$hex\",func=\"callee4\",file=\".*basics.c\",line=\"32\",times=\"0\"\}" \
107107 "break-insert -r operation"
108108
109109 mi_gdb_test "300-break-list" \
@@ -111,7 +111,7 @@ proc test_rwatch_creation_and_listing {} {
111111 "list of breakpoints"
112112
113113 mi_gdb_test "177-break-delete 4" \
114- "=breakpoint-delete,number=\"4\"\r\n177\\^done" \
114+ "177\\^done" \
115115 "delete read watchpoint"
116116 }
117117
--- a/gdb/testsuite/gdb.mi/mi1-basics.exp
+++ b/gdb/testsuite/gdb.mi/mi1-basics.exp
@@ -1,4 +1,4 @@
1-# Copyright 2002 Free Software Foundation, Inc.
1+# Copyright 1999, 2000 Free Software Foundation, Inc.
22
33 # This program is free software; you can redistribute it and/or modify
44 # it under the terms of the GNU General Public License as published by
--- a/gdb/testsuite/gdb.mi/mi1-break.exp
+++ b/gdb/testsuite/gdb.mi/mi1-break.exp
@@ -1,4 +1,4 @@
1-# Copyright 2002 Free Software Foundation, Inc.
1+# Copyright 1999 Free Software Foundation, Inc.
22
33 # This program is free software; you can redistribute it and/or modify
44 # it under the terms of the GNU General Public License as published by
--- a/gdb/testsuite/gdb.mi/mi1-console.exp
+++ b/gdb/testsuite/gdb.mi/mi1-console.exp
@@ -1,4 +1,4 @@
1-# Copyright 2002 Free Software Foundation, Inc.
1+# Copyright 1999, 2000, 2001, 2002 Free Software Foundation, Inc.
22
33 # This program is free software; you can redistribute it and/or modify
44 # it under the terms of the GNU General Public License as published by
--- a/gdb/testsuite/gdb.mi/mi1-hack-cli.exp
+++ b/gdb/testsuite/gdb.mi/mi1-hack-cli.exp
@@ -1,4 +1,4 @@
1-# Copyright 2002 Free Software Foundation, Inc.
1+# Copyright 1999 Free Software Foundation, Inc.
22
33 # This program is free software; you can redistribute it and/or modify
44 # it under the terms of the GNU General Public License as published by
--- a/gdb/testsuite/gdb.mi/mi1-return.exp
+++ b/gdb/testsuite/gdb.mi/mi1-return.exp
@@ -53,7 +53,7 @@ proc test_return_simple {} {
5353
5454 send_gdb "111-exec-return\n"
5555 gdb_expect {
56- -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"}
56+ -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"}
5757 -re ".*\r\n$mi_gdb_prompt$" { fail "return from callee4 now" }
5858 timeout { fail "return from callee4 now (timeout)"
5959 }
--- a/gdb/testsuite/gdb.mi/mi1-simplerun.exp
+++ b/gdb/testsuite/gdb.mi/mi1-simplerun.exp
@@ -1,4 +1,4 @@
1-# Copyright 2002 Free Software Foundation, Inc.
1+# Copyright 1999, 2000 Free Software Foundation, Inc.
22
33 # This program is free software; you can redistribute it and/or modify
44 # it under the terms of the GNU General Public License as published by
--- 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 {} {
5757 # -stack-list-frames 1 3
5858
5959 mi_gdb_test "231-stack-list-frames" \
60- "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\",.*\}\\\]" \
60+ "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\",.*\}\\\]" \
6161 "stack frame listing"
6262 mi_gdb_test "232-stack-list-frames 1 1" \
63- "232\\^done,stack=\\\[frame=\{level=\"1 \",addr=\"$hex\",func=\"callee3\",.*\}\\\]" \
63+ "232\\^done,stack=\\\[frame=\{level=\"1\",addr=\"$hex\",func=\"callee3\",.*\}\\\]" \
6464 "stack frame listing 1 1"
6565 mi_gdb_test "233-stack-list-frames 1 3" \
66- "233\\^done,stack=\\\[frame=\{level=\"1 \",addr=\"$hex\",func=\"callee3\",.*\},frame=\{level=\"2 \",addr=\"$hex\",func=\"callee2\",.*\},frame=\{level=\"3 \",addr=\"$hex\",func=\"callee1\",.*\}\\\]" \
66+ "233\\^done,stack=\\\[frame=\{level=\"1\",addr=\"$hex\",func=\"callee3\",.*\},frame=\{level=\"2\",addr=\"$hex\",func=\"callee2\",.*\},frame=\{level=\"3\",addr=\"$hex\",func=\"callee1\",.*\}\\\]" \
6767 "stack frame listing 1 3"
6868
6969 mi_gdb_test "234-stack-list-frames 1" \
--- a/gdb/testsuite/gdb.mi/mi1-until.exp
+++ b/gdb/testsuite/gdb.mi/mi1-until.exp
@@ -1,4 +1,4 @@
1-# Copyright 2002 Free Software Foundation, Inc.
1+# Copyright 1999, 2000 Free Software Foundation, Inc.
22
33 # This program is free software; you can redistribute it and/or modify
44 # it under the terms of the GNU General Public License as published by
--- a/gdb/testsuite/gdb.mi/mi1-var-child.exp
+++ b/gdb/testsuite/gdb.mi/mi1-var-child.exp
@@ -1,5 +1,5 @@
1-# Copyright 2002 Free Software Foundation, Inc.
2-#
1+# Copyright (C) 1999, 2000, 2002 Free Software Foundation
2+
33 # This Program Is Free software; you can redistribute it and/or modify
44 # it under the terms of the GNU General Public License as published by
55 # the Free Software Foundation; either version 2 of the License, or
@@ -42,19 +42,7 @@ mi_delete_breakpoints
4242 mi_gdb_reinitialize_dir $srcdir/$subdir
4343 mi_gdb_load ${binfile}
4444
45-mi_gdb_test "200-break-insert do_children_tests" \
46- "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\"\}" \
47- "break-insert operation"
48-
49-mi_run_cmd
50-# The running part has been checked already by mi_run_cmd
51-gdb_expect {
52- -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$" {
53- pass "run to do_children_tests"
54- }
55- -re ".*$mi_gdb_prompt$" {fail "run to do_children_tests (2)"}
56- timeout {fail "run to do_children_tests (timeout 2)"}
57-}
45+mi_runto do_children_tests
5846
5947 ##### #####
6048 # #
@@ -567,16 +555,8 @@ mi_gdb_test "-var-info-num-children struct_declarations.int_ptr_ptr.*int_ptr_ptr
567555
568556
569557 # Step to "struct_declarations.integer = 123;"
570-send_gdb "-exec-step\n"
571-gdb_expect {
572- -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$" {
573- pass "step at do_children_tests"
574- }
575- timeout {
576- fail "step at do_children_tests (timeout)"
577- }
578-}
579-
558+set line 192
559+mi_step_to do_children_tests {} {.*var-cmd.c} $line "step to line $line"
580560
581561 # Test: c_variable-4.81
582562 # Desc: create local variable "weird"
@@ -774,15 +754,8 @@ mi_gdb_test "-var-update *" \
774754 "update all vars. None changed"
775755
776756 # Step over "struct_declarations.integer = 123;"
777-send_gdb "-exec-step\n"
778-gdb_expect {
779- -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$" {
780- pass "step at do_children_tests"
781- }
782- timeout {
783- fail "step at do_children_tests (timeout)"
784- }
785-}
757+set line 193
758+mi_step_to do_children_tests {} {.*var-cmd.c} $line "step $line"
786759
787760 # Test: c_variable-5.2
788761 # Desc: check that integer changed
@@ -794,16 +767,8 @@ mi_gdb_test "-var-update *" \
794767 # weird->char_ptr = "hello";
795768 # bar = 2121;
796769 # foo = &bar;
797-
798-send_gdb "-exec-step 3\n"
799-gdb_expect {
800- -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$" {
801- pass "step at do_children_tests"
802- }
803- timeout {
804- fail "step at do_children_tests (timeout)"
805- }
806-}
770+set line 196
771+mi_execute_to "exec-step 3" "end-stepping-range" do_children_tests {} {.*var-cmd.c} $line {} "step $line"
807772
808773 # Test: c_variable-5.3
809774 # Desc: check that char_ptr changed
@@ -812,15 +777,8 @@ mi_gdb_test "-var-update *" \
812777 "update all vars struct_declarations.char_ptr"
813778
814779 # Step over "struct_declarations.int_ptr_ptr = &foo;"
815-send_gdb "-exec-step\n"
816-gdb_expect {
817- -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$" {
818- pass "step at do_children_tests"
819- }
820- timeout {
821- fail "step at do_children_tests (timeout)"
822- }
823-}
780+set line 197
781+mi_step_to do_children_tests {} {.*var-cmd.c} $line "step $line"
824782
825783 # Test: c_variable-5.4
826784 # Desc: check that int_ptr_ptr and children changed
@@ -829,15 +787,8 @@ mi_gdb_test "-var-update *" \
829787 "update all vars int_ptr_ptr and children changed"
830788
831789 # Step over "weird->long_array[0] = 1234;"
832-send_gdb "-exec-step\n"
833-gdb_expect {
834- -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$" {
835- pass "step at do_children_tests"
836- }
837- timeout {
838- fail "step at do_children_tests (timeout)"
839- }
840-}
790+set line 198
791+mi_step_to do_children_tests {} {.*var-cmd.c} $line "step $line"
841792
842793 # Test: c_variable-5.5
843794 # Desc: check that long_array[0] changed
@@ -846,15 +797,8 @@ mi_gdb_test "-var-update *" \
846797 "update all vars struct_declarations.long_array.0 changed"
847798
848799 # Step over "struct_declarations.long_array[1] = 2345;"
849-send_gdb "-exec-step\n"
850-gdb_expect {
851- -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$" {
852- pass "step at do_children_tests"
853- }
854- timeout {
855- fail "step at do_children_tests (timeout)"
856- }
857-}
800+set line 199
801+mi_step_to do_children_tests {} {.*var-cmd.c} $line "step $line"
858802
859803 # Test: c_variable-5.6
860804 # Desc: check that long_array[1] changed
@@ -863,15 +807,8 @@ mi_gdb_test "-var-update *" \
863807 "update all vars struct_declarations.long_array.1 changed"
864808
865809 # Step over "weird->long_array[2] = 3456;"
866-send_gdb "-exec-step\n"
867-gdb_expect {
868- -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$" {
869- pass "step at do_children_tests"
870- }
871- timeout {
872- fail "step at do_children_tests (timeout)"
873- }
874-}
810+set line 200
811+mi_step_to do_children_tests {} {.*var-cmd.c} $line "step $line"
875812
876813 # Test: c_variable-5.7
877814 # Desc: check that long_array[2] changed
@@ -887,15 +824,8 @@ mi_gdb_test "-var-update *" \
887824 # struct_declarations.long_array[7] = 8901;
888825 # weird->long_array[8] = 9012;
889826 # struct_declarations.long_array[9] = 1234;
890-send_gdb "-exec-step 7\n"
891-gdb_expect {
892- -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$" {
893- pass "step at do_children_tests"
894- }
895- timeout {
896- fail "step at do_children_tests (timeout)"
897- }
898-}
827+set line 208
828+mi_execute_to "exec-step 7" "end-stepping-range" do_children_tests {} {.*var-cmd.c} $line {} "step $line"
899829
900830 # Test: c_variable-5.8
901831 # Desc: check that long_array[3-9] changed
@@ -905,15 +835,8 @@ mi_gdb_test "-var-update *" \
905835
906836
907837 # Step over "weird->func_ptr = nothing;"
908-send_gdb "-exec-step\n"
909-gdb_expect {
910- -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$" {
911- pass "step at do_children_tests"
912- }
913- timeout {
914- fail "step at do_children_tests (timeout)"
915- }
916-}
838+set line 211
839+mi_step_to do_children_tests {} {.*var-cmd.c} $line "step $line"
917840
918841 # Test: c_variable-5.9
919842 # Desc: check that func_ptr changed
@@ -933,15 +856,8 @@ mi_gdb_test "-var-delete weird->int_ptr_ptr" \
933856 # Step over all lines:
934857 # ...
935858 # psnp = &snp0;
936-send_gdb "-exec-step 43\n"
937-gdb_expect {
938- -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$" {
939- pass "step at do_children_tests"
940- }
941- timeout {
942- fail "step at do_children_tests (timeout)"
943- }
944-}
859+set line 254
860+mi_execute_to "exec-step 43" "end-stepping-range" do_children_tests {} {.*var-cmd.c} $line {} "step $line"
945861
946862 # Test: c_variable-5.10
947863 # Desc: create psnp->char_ptr
@@ -1211,15 +1127,8 @@ mi_gdb_test "-var-list-children psnp->ptrs.0.next.next.ptrs" \
12111127 "get children of psnp->ptrs.0.next.next.ptrs"
12121128
12131129 # Step over "snp0.char_ptr = &b3;"
1214-send_gdb "-exec-step\n"
1215-gdb_expect {
1216- -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$" {
1217- pass "step at do_children_tests"
1218- }
1219- timeout {
1220- fail "step at do_children_tests (timeout)"
1221- }
1222-}
1130+set line 255
1131+mi_step_to do_children_tests {} {.*var-cmd.c} $line "step $line"
12231132
12241133 # Test: c_variable-5.47
12251134 # Desc: check that psnp->char_ptr (and [0].char_ptr) changed
@@ -1228,16 +1137,8 @@ mi_gdb_test "-var-update *" \
12281137 "update all vars psnp->char_ptr (and 0.char_ptr) changed"
12291138
12301139 # Step over "snp1.char_ptr = &c3;"
1231-send_gdb "-exec-step\n"
1232-gdb_expect {
1233- -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$" {
1234- pass "step at do_children_tests"
1235- }
1236- timeout {
1237- fail "step at do_children_tests (timeout)"
1238- }
1239-}
1240-
1140+set line 256
1141+mi_step_to do_children_tests {} {.*var-cmd.c} $line "step $line"
12411142
12421143 # Test: c_variable-5.48
12431144 # Desc: check that psnp->next->char_ptr (and [1].char_ptr) changed
@@ -1247,16 +1148,8 @@ mi_gdb_test "-var-update *" \
12471148
12481149
12491150 # Step over "snp2.char_ptr = &a3;"
1250-send_gdb "-exec-step\n"
1251-gdb_expect {
1252- -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$" {
1253- pass "step at do_children_tests"
1254- }
1255- timeout {
1256- fail "step at do_children_tests (timeout)"
1257- }
1258-}
1259-
1151+set line 257
1152+mi_step_to do_children_tests {} {.*var-cmd.c} $line "step $line"
12601153
12611154 # Test: c_variable-5.49
12621155 # Desc: check that psnp->next->next->char_ptr (and [2].char_ptr) changed
@@ -1266,15 +1159,8 @@ mi_gdb_test "-var-update *" \
12661159
12671160
12681161 # Step over "snp0.long_ptr = &y3;"
1269-send_gdb "-exec-step\n"
1270-gdb_expect {
1271- -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$" {
1272- pass "step at do_children_tests"
1273- }
1274- timeout {
1275- fail "step at do_children_tests (timeout)"
1276- }
1277-}
1162+set line 258
1163+mi_step_to do_children_tests {} {.*var-cmd.c} $line "step $line"
12781164
12791165 # Test: c_variable-5.50
12801166 # Desc: check that psnp->long_ptr (and [0].long_ptr) changed
@@ -1284,16 +1170,8 @@ mi_gdb_test "-var-update *" \
12841170
12851171
12861172 # Step over "snp1.long_ptr = &x3;"
1287-send_gdb "-exec-step\n"
1288-gdb_expect {
1289- -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$" {
1290- pass "step at do_children_tests"
1291- }
1292- timeout {
1293- fail "step at do_children_tests (timeout)"
1294- }
1295-}
1296-
1173+set line 259
1174+mi_step_to do_children_tests {} {.*var-cmd.c} $line "step $line"
12971175
12981176 # Test: c_variable-5.51
12991177 # Desc: check that psnp->next->long_ptr (and [1].long_ptr) changed
@@ -1309,16 +1187,8 @@ clear_xfail *-*-*
13091187 #
13101188
13111189 # Step over "snp2.long_ptr = &z3;"
1312-send_gdb "-exec-step\n"
1313-gdb_expect {
1314- -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$" {
1315- pass "step at do_children_tests"
1316- }
1317- timeout {
1318- fail "step at do_children_tests (timeout)"
1319- }
1320-}
1321-
1190+set line 260
1191+mi_step_to do_children_tests {} {.*var-cmd.c} $line "step $line"
13221192
13231193 # Test: c_variable-5.52
13241194 # Desc: check that psnp->next->next->long_ptr (and [2].long_ptr) changed
--- 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" \
276276 "\\^done,value=\"3333\"" \
277277 "assign to linteger"
278278
279+mi_gdb_test "-var-update *" \
280+ "\\^done,changelist=\{name=\"linteger\",in_scope=\"true\",type_changed=\"false\"\}" \
281+ "update all vars: linteger changed after assign"
282+
283+mi_gdb_test "-var-assign linteger 3333" \
284+ "\\^done,value=\"3333\"" \
285+ "assign to linteger again, same value"
286+
287+mi_gdb_test "-var-update *" \
288+ "\\^done,changelist=\{\}" \
289+ "update all vars: linteger not changed after same assign"
290+
279291 mi_gdb_test "-var-evaluate-expression linteger" \
280292 "\\^done,value=\"3333\"" \
281293 "eval linteger"
@@ -284,6 +296,14 @@ mi_gdb_test "-var-assign lpinteger \"&linteger + 3\"" \
284296 "\\^done,value=\"$hex\"" \
285297 "assign to lpinteger"
286298
299+mi_gdb_test "-var-update *" \
300+ "\\^done,changelist=\{name=\"lpinteger\",in_scope=\"true\",type_changed=\"false\"\}" \
301+ "update all vars: lpinteger changed after assign"
302+
303+mi_gdb_test "-var-update *" \
304+ "\\^done,changelist=\{\}" \
305+ "update all vars: no changes for second update"
306+
287307 mi_gdb_test "-var-evaluate-expression lpinteger" \
288308 "\\^done,value=\"$hex\"" \
289309 "eval lpinteger"
@@ -507,5 +527,34 @@ mi_gdb_test "-var-delete l" \
507527 "\\^done,ndeleted=\"1\"" \
508528 "delete var l"
509529
530+# Test whether we can follow the name of a variable through multiple
531+# stack frames.
532+mi_gdb_test "-break-insert do_special_tests" \
533+ {\^done,bkpt=.*} \
534+ "set breakpoint at do_special_tests"
535+
536+mi_continue_to {.*} do_special_tests {.*} {.*var-cmd.c} {.*} {stop in do_special_tests}
537+
538+mi_gdb_test "-var-create selected_a @ a" \
539+ {\^done,name="selected_a",numchild="0",type="int"} \
540+ "create selected_a"
541+
542+mi_gdb_test "-break-insert incr_a" \
543+ {\^done,bkpt=.*} \
544+ "set breakpoint at incr_a"
545+
546+mi_continue_to {.*} incr_a {.*} {.*var-cmd.c} {.*} {stop in incr_a}
547+
548+mi_gdb_test "-var-update selected_a" \
549+ {\^done,changelist=\{name="selected_a",in_scope="true",new_type="char",new_num_children="0"\}} \
550+ "update selected_a in incr_a"
551+
552+mi_next "step a line in incr_a"
553+mi_next "return from incr_a to do_special_tests"
554+
555+mi_gdb_test "-var-update selected_a" \
556+ {\^done,changelist=\{name="selected_a",in_scope="true",new_type="int",new_num_children="0"\}} \
557+ "update selected_a in do_special_tests"
558+
510559 mi_gdb_exit
511560 return 0
--- a/gdb/testsuite/gdb.mi/mi1-var-display.exp
+++ b/gdb/testsuite/gdb.mi/mi1-var-display.exp
@@ -1,4 +1,4 @@
1-# Copyright 2002 Free Software Foundation, Inc.
1+# Copyright (C) 1999, 2000, 2002 Free Software Foundation, Inc.
22 #
33 # This Program Is Free software; you can redistribute it and/or modify
44 # it under the terms of the GNU General Public License as published by
--- a/gdb/testsuite/lib/mi-support.exp
+++ b/gdb/testsuite/lib/mi-support.exp
@@ -209,7 +209,7 @@ proc mi_delete_breakpoints {} {
209209 send_gdb "y\n";
210210 exp_continue
211211 }
212- -re ".*102-break-delete\r\n(=.*)*102\\\^done\r\n$mi_gdb_prompt$" {
212+ -re ".*102-break-delete\r\n102\\\^done\r\n$mi_gdb_prompt$" {
213213 # This happens if there were no breakpoints
214214 }
215215 timeout { perror "Delete all breakpoints in mi_delete_breakpoints (timeout)" ; return }
@@ -711,7 +711,7 @@ proc mi_runto {func} {
711711
712712 set test "mi runto $func"
713713 mi_gdb_test "200-break-insert $func" \
714- "\(=breakpoint-create,number=\"\[0-9\]+\")\r\n200\\^done" \
714+ "200\\^done,bkpt=\{number=\"\[0-9\]+\",type=\"breakpoint\",disp=\"keep\",enabled=\"y\",addr=\"$hex\",func=\"$func\",file=\".*\",line=\"\[0-9\]*\",times=\"0\"\}" \
715715 "breakpoint at $func"
716716
717717 if {![regexp {number="[0-9]+"} $expect_out(buffer) str]
--- a/gdb/thread.c
+++ b/gdb/thread.c
@@ -694,12 +694,10 @@ do_captured_thread_select (struct ui_out *uiout,
694694 void *tidstr)
695695 {
696696 int num;
697- ptid_t old_ptid;
698697 struct thread_info *tp;
699698
700699 num = value_as_long (parse_and_eval (tidstr));
701700
702- old_ptid = inferior_ptid;
703701 tp = find_thread_id (num);
704702
705703 if (!tp)
@@ -722,10 +720,6 @@ do_captured_thread_select (struct ui_out *uiout,
722720
723721 print_stack_frame (deprecated_selected_frame,
724722 frame_relative_level (deprecated_selected_frame), 1);
725-
726- if (!ptid_equal (old_ptid, inferior_ptid))
727- selected_thread_changed_event (pid_to_thread_id (inferior_ptid));
728-
729723 return GDB_RC_OK;
730724 }
731725
--- a/gdb/valops.c
+++ b/gdb/valops.c
@@ -727,8 +727,6 @@ value_assign (struct value *toval, struct value *fromval)
727727 error ("Attempt to assign to an unmodifiable value.");
728728 }
729729
730- if (regno > VALUE_FRAME_REGNUM (toval) + reg_offset)
731- regno = -1;
732730 if (register_changed_hook)
733731 register_changed_hook (-1);
734732 target_changed_event ();
--- a/gdb/version.in
+++ b/gdb/version.in
@@ -1 +1 @@
1-2003-02-03-cvs
1+2003-02-04-cvs
--- a/gdb/wrapper.c
+++ b/gdb/wrapper.c
@@ -20,7 +20,7 @@
2020 #include "value.h"
2121 #include "wrapper.h"
2222
23-/* use this struct to pass arguments to wrapper routines. We assume
23+/* Use this struct to pass arguments to wrapper routines. We assume
2424 (arbitrarily) that no gdb function takes more than ten arguments. */
2525 struct gdb_wrapper_arguments
2626 {
@@ -330,3 +330,4 @@ do_captured_value_struct_elt (struct ui_out *uiout, void *data)
330330 cargs->static_memfuncp, cargs->err);
331331 return GDB_RC_OK;
332332 }
333+
--- a/gdb/wrapper.h
+++ b/gdb/wrapper.h
@@ -21,10 +21,8 @@
2121 #include "gdb.h"
2222
2323 struct value;
24-struct block;
2524 struct expression;
26-struct ui_out;
27-struct type;
25+struct block;
2826
2927 /* Use this struct to pass arguments to wrapper routines. */
3028 struct gdb_wrapper_arguments;
@@ -49,4 +47,5 @@ extern enum gdb_rc gdb_value_struct_elt (struct ui_out *uiout, struct value **re
4947 extern int gdb_value_ind (struct value *val, struct value ** rval);
5048
5149 extern int gdb_parse_and_eval_type (char *, int, struct type **);
50+
5251 #endif /* WRAPPER_H */