• R/O
  • HTTP
  • SSH
  • HTTPS

コミット

タグ
未設定

よく使われているワード(クリックで追加)

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

GNU Binutils with patches for OS216


コミットメタ情報

リビジョン0e9073e4b86eb21485ebceb34a5242a0a74be407 (tree)
日時2002-11-05 08:27:32
作者Elena Zannoni <ezannoni@kwik...>
コミッターElena Zannoni

ログメッセージ

2002-11-04 Elena Zannoni <ezannoni@redhat.com>

* cli/cli-interp.c (_initialize_cli_interp): Call
gdb_interpreter_new and gdb_interpreter_add.
* top.c (gdb_init): Call gdb_interpreter_lookup.
(gdb_init): Call gdb_interpreter_set.
* interps.c (gdb_interpreter_new): Renamed from
gdb_new_interpreter.
(gdb_interpreter_add): Renamed from gdb_add_interpreter.
(gdb_interpreter_set): Renamed from gdb_set_interpreter.
(gdb_interpreter_lookup): Renamed from gdb_lookup_interpreter.
(gdb_interpreter_current): Renamed from gdb_current_interpreter.
Update all callers.
* interps.h: Ditto.

2002-11-04 Elena Zannoni <ezannoni@redhat.com>

* mi-interp.c (mi_interpreter_resume): Ditto.
(mi_cmd_interpreter_exec): Use gdb_interpreter_lookup.
(_initialize_mi_interp): Use gdb_interpreter_new,
gdb_interpreter_add.
* mi-cmd-break.c (mi_cmd_break_insert): Use
gdb_interpreter_current_is_named_p.
(mi_cmd_break_watch): Ditto.
* mi-events.c (mi_interp_stack_changed_hook): Ditto.
(event_notify): Ditto.
* mi-main.c (captured_mi_execute_command): Use
gdb_interpreter_current_is_named_p.
(mi_load_progress): Ditto.

変更サマリ

差分

--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,5 +1,20 @@
11 2002-11-04 Elena Zannoni <ezannoni@redhat.com>
22
3+ * cli/cli-interp.c (_initialize_cli_interp): Call
4+ gdb_interpreter_new and gdb_interpreter_add.
5+ * top.c (gdb_init): Call gdb_interpreter_lookup.
6+ (gdb_init): Call gdb_interpreter_set.
7+ * interps.c (gdb_interpreter_new): Renamed from
8+ gdb_new_interpreter.
9+ (gdb_interpreter_add): Renamed from gdb_add_interpreter.
10+ (gdb_interpreter_set): Renamed from gdb_set_interpreter.
11+ (gdb_interpreter_lookup): Renamed from gdb_lookup_interpreter.
12+ (gdb_interpreter_current): Renamed from gdb_current_interpreter.
13+ Update all callers.
14+ * interps.h: Ditto.
15+
16+2002-11-04 Elena Zannoni <ezannoni@redhat.com>
17+
318 * interps.h (gdb_interpreter_is_quiet_p): Rename from
419 gdb_interpreter_is_quiet.
520 * cli/cli-interp.c (cli_interpreter_display_prompt_p): Call
--- a/gdb/cli/cli-interp.c
+++ b/gdb/cli/cli-interp.c
@@ -131,7 +131,7 @@ _initialize_cli_interp (void)
131131
132132 /* Create a default uiout builder for the CLI. */
133133 cli_uiout = cli_out_new (gdb_stdout);
134- cli_interp = gdb_new_interpreter (GDB_INTERPRETER_CONSOLE, NULL, cli_uiout,
134+ cli_interp = gdb_interpreter_new (GDB_INTERPRETER_CONSOLE, NULL, cli_uiout,
135135 &procs);
136- gdb_add_interpreter (cli_interp);
136+ gdb_interpreter_add (cli_interp);
137137 }
--- a/gdb/interps.c
+++ b/gdb/interps.c
@@ -79,11 +79,11 @@ static struct gdb_interpreter *current_interpreter = NULL;
7979
8080 static int interpreter_initialized = 0;
8181
82-/* gdb_new_interpreter - This allocates space for a new interpreter,
82+/* gdb_interpreter_new - This allocates space for a new interpreter,
8383 fills the fields from the inputs, and returns a pointer to the
8484 interpreter. */
8585 struct gdb_interpreter *
86-gdb_new_interpreter (char *name,
86+gdb_interpreter_new (char *name,
8787 void *data,
8888 struct ui_out *uiout,
8989 struct gdb_interpreter_procs *procs)
@@ -112,12 +112,12 @@ gdb_new_interpreter (char *name,
112112 the new one is NOT added, and the function returns 0. Otherwise
113113 it returns 1. */
114114 int
115-gdb_add_interpreter (struct gdb_interpreter *interp)
115+gdb_interpreter_add (struct gdb_interpreter *interp)
116116 {
117117 if (!interpreter_initialized)
118118 initialize_interps ();
119119
120- if (gdb_lookup_interpreter (interp->name) != NULL)
120+ if (gdb_interpreter_lookup (interp->name) != NULL)
121121 return 0;
122122
123123 interp->next = interp_list;
@@ -133,7 +133,7 @@ gdb_add_interpreter (struct gdb_interpreter *interp)
133133 old interpreter, then raise an internal error, since we are in
134134 pretty bad shape at this point. */
135135 int
136-gdb_set_interpreter (struct gdb_interpreter *interp)
136+gdb_interpreter_set (struct gdb_interpreter *interp)
137137 {
138138 struct gdb_interpreter *old_interp = current_interpreter;
139139 int first_time = 0;
@@ -180,7 +180,7 @@ gdb_set_interpreter (struct gdb_interpreter *interp)
180180 {
181181 if (!interp->procs.init_proc (interp->data))
182182 {
183- if (!gdb_set_interpreter (old_interp))
183+ if (!gdb_interpreter_set (old_interp))
184184 internal_error (__FILE__, __LINE__,
185185 "Failed to initialize new interp \"%s\" %s",
186186 interp->name,
@@ -204,7 +204,7 @@ gdb_set_interpreter (struct gdb_interpreter *interp)
204204 if (interp->procs.resume_proc != NULL
205205 && (!interp->procs.resume_proc (interp->data)))
206206 {
207- if (!gdb_set_interpreter (old_interp))
207+ if (!gdb_interpreter_set (old_interp))
208208 internal_error (__FILE__, __LINE__,
209209 "Failed to initialize new interp \"%s\" %s",
210210 interp->name, "and could not restore old interp!\n");
@@ -229,11 +229,11 @@ gdb_set_interpreter (struct gdb_interpreter *interp)
229229 return 1;
230230 }
231231
232-/* gdb_lookup_interpreter - Looks up the interpreter for NAME. If no
232+/* gdb_interpreter_lookup - Looks up the interpreter for NAME. If no
233233 such interpreter exists, return NULL, otherwise return a pointer to
234234 the interpreter. */
235235 struct gdb_interpreter *
236-gdb_lookup_interpreter (char *name)
236+gdb_interpreter_lookup (char *name)
237237 {
238238 struct gdb_interpreter *interp;
239239
@@ -250,8 +250,8 @@ gdb_lookup_interpreter (char *name)
250250 }
251251
252252 /* Returns the current interpreter. */
253-struct gdb_interpreter *
254-gdb_current_interpreter ()
253+static struct gdb_interpreter *
254+gdb_interpreter_current (void)
255255 {
256256 return current_interpreter;
257257 }
@@ -267,9 +267,9 @@ gdb_interpreter_ui_out (struct gdb_interpreter *interp)
267267
268268 /* Returns true if the current interp is the passed in name. */
269269 int
270-gdb_current_interpreter_is_named (char *interp_name)
270+gdb_interpreter_current_is_named_p (char *interp_name)
271271 {
272- struct gdb_interpreter *current_interp = gdb_current_interpreter ();
272+ struct gdb_interpreter *current_interp = gdb_interpreter_current ();
273273
274274 if (current_interp)
275275 return (strcmp (current_interp->name, interp_name) == 0);
@@ -408,9 +408,9 @@ interpreter_exec_cmd (char *args, int from_tty)
408408 if (nrules < 2)
409409 error ("usage: interpreter-exec <interpreter> [ <command> ... ]");
410410
411- old_interp = gdb_current_interpreter ();
411+ old_interp = gdb_interpreter_current ();
412412
413- interp_to_use = gdb_lookup_interpreter (prules[0]);
413+ interp_to_use = gdb_interpreter_lookup (prules[0]);
414414 if (interp_to_use == NULL)
415415 error ("Could not find interpreter \"%s\".", prules[0]);
416416
@@ -418,21 +418,21 @@ interpreter_exec_cmd (char *args, int from_tty)
418418 old_quiet = gdb_interpreter_set_quiet (old_interp, 1);
419419 use_quiet = gdb_interpreter_set_quiet (interp_to_use, 1);
420420
421- if (!gdb_set_interpreter (interp_to_use))
421+ if (!gdb_interpreter_set (interp_to_use))
422422 error ("Could not switch to interpreter \"%s\".", prules[0]);
423423
424424 for (i = 1; i < nrules; i++)
425425 {
426426 if (!gdb_interpreter_exec (prules[i]))
427427 {
428- gdb_set_interpreter (old_interp);
428+ gdb_interpreter_set (old_interp);
429429 gdb_interpreter_set_quiet (interp_to_use, old_quiet);
430430 error ("error in command: \"%s\".", prules[i]);
431431 break;
432432 }
433433 }
434434
435- gdb_set_interpreter (old_interp);
435+ gdb_interpreter_set (old_interp);
436436 gdb_interpreter_set_quiet (interp_to_use, use_quiet);
437437 gdb_interpreter_set_quiet (old_interp, old_quiet);
438438 }
--- a/gdb/interps.h
+++ b/gdb/interps.h
@@ -41,20 +41,17 @@ struct gdb_interpreter_procs
4141 };
4242
4343 extern struct gdb_interpreter
44- *gdb_new_interpreter (char *name, void *data, struct ui_out *uiout,
44+ *gdb_interpreter_new (char *name, void *data, struct ui_out *uiout,
4545 struct gdb_interpreter_procs *procs);
4646
47-extern int gdb_add_interpreter (struct gdb_interpreter *interp);
48-extern int gdb_set_interpreter (struct gdb_interpreter *interp);
49-extern struct gdb_interpreter *gdb_lookup_interpreter (char *name);
50-extern struct gdb_interpreter *gdb_current_interpreter ();
47+extern int gdb_interpreter_set (struct gdb_interpreter *interp);
48+extern struct gdb_interpreter *gdb_interpreter_lookup (char *name);
5149 extern struct ui_out *gdb_interpreter_ui_out (struct gdb_interpreter *interp);
52-extern int gdb_current_interpreter_is_named (char *interp_name);
50+extern int gdb_interpreter_current_is_named_p (char *interp_name);
5351 extern int gdb_interpreter_exec (char *command_str);
5452 extern int gdb_interpreter_display_prompt_p (void);
55-extern int gdb_interpreter_set_quiet (struct gdb_interpreter *interp,
56- int quiet);
5753 extern int gdb_interpreter_is_quiet_p (struct gdb_interpreter *interp);
54+extern int gdb_interpreter_add (struct gdb_interpreter *interp);
5855 extern struct gdb_interpreter_procs *gdb_interpreter_get_procs (struct
5956 gdb_interpreter
6057 *interp);
--- a/gdb/mi/ChangeLog
+++ b/gdb/mi/ChangeLog
@@ -1,5 +1,20 @@
11 2002-11-04 Elena Zannoni <ezannoni@redhat.com>
22
3+ * mi-interp.c (mi_interpreter_resume): Ditto.
4+ (mi_cmd_interpreter_exec): Use gdb_interpreter_lookup.
5+ (_initialize_mi_interp): Use gdb_interpreter_new,
6+ gdb_interpreter_add.
7+ * mi-cmd-break.c (mi_cmd_break_insert): Use
8+ gdb_interpreter_current_is_named_p.
9+ (mi_cmd_break_watch): Ditto.
10+ * mi-events.c (mi_interp_stack_changed_hook): Ditto.
11+ (event_notify): Ditto.
12+ * mi-main.c (captured_mi_execute_command): Use
13+ gdb_interpreter_current_is_named_p.
14+ (mi_load_progress): Ditto.
15+
16+2002-11-04 Elena Zannoni <ezannoni@redhat.com>
17+
318 * mi-interp.c (_initialize_mi_interp): Use mi_interpreter_prompt_p
419 instead of mi_interpreter_prompt.
520 (mi_interpreter_prompt_p): Rename from mi_interpreter_prompt and
--- a/gdb/mi/mi-cmd-break.c
+++ b/gdb/mi/mi-cmd-break.c
@@ -141,8 +141,8 @@ mi_cmd_break_insert (char *command, char **argv, int argc)
141141 handlers, so we won't get any event notifications sent out to the
142142 client. MI3+ does NOT send breakpoint information with the -break-insert
143143 command for this reason. */
144- if (gdb_current_interpreter_is_named (GDB_INTERPRETER_MI2)
145- || gdb_current_interpreter_is_named (GDB_INTERPRETER_MI1))
144+ if (gdb_interpreter_current_is_named_p (GDB_INTERPRETER_MI2)
145+ || gdb_interpreter_current_is_named_p (GDB_INTERPRETER_MI1))
146146 old_hooks = set_gdb_event_hooks (&breakpoint_hooks);
147147
148148 /* Now we have what we need, let's insert the breakpoint! */
@@ -172,8 +172,8 @@ mi_cmd_break_insert (char *command, char **argv, int argc)
172172 "mi_cmd_break_insert: Bad switch.");
173173 }
174174
175- if (gdb_current_interpreter_is_named (GDB_INTERPRETER_MI2)
176- || gdb_current_interpreter_is_named (GDB_INTERPRETER_MI1))
175+ if (gdb_interpreter_current_is_named_p (GDB_INTERPRETER_MI2)
176+ || gdb_interpreter_current_is_named_p (GDB_INTERPRETER_MI1))
177177 set_gdb_event_hooks (old_hooks);
178178
179179 if (rc == GDB_RC_FAIL)
@@ -256,8 +256,8 @@ mi_cmd_break_watch (char *command, char **argv, int argc)
256256 cannot use the same printing mechanisms. So for MI3+, we simply
257257 rewind MI's uiout so that we can prevent GDB from printing
258258 any information about the watchpoint we just inserted. */
259- if (!gdb_current_interpreter_is_named (GDB_INTERPRETER_MI2)
260- && !gdb_current_interpreter_is_named (GDB_INTERPRETER_MI1))
259+ if (!gdb_interpreter_current_is_named_p (GDB_INTERPRETER_MI2)
260+ && !gdb_interpreter_current_is_named_p (GDB_INTERPRETER_MI1))
261261 mi_out_rewind (uiout);
262262
263263 return MI_CMD_DONE;
--- a/gdb/mi/mi-events.c
+++ b/gdb/mi/mi-events.c
@@ -32,7 +32,7 @@ mi_interp_stack_changed_hook (void)
3232 struct ui_out *saved_ui_out = uiout;
3333 struct mi_out *tmp_mi_out;
3434
35- if (gdb_current_interpreter_is_named (GDB_INTERPRETER_MI1))
35+ if (gdb_interpreter_current_is_named_p (GDB_INTERPRETER_MI1))
3636 uiout = gdb_interpreter_ui_out (mi1_interp);
3737 else
3838 uiout = gdb_interpreter_ui_out (mi_interp);
@@ -48,8 +48,8 @@ event_notify (const char *string, ...)
4848 {
4949 va_list args;
5050
51- if (!gdb_current_interpreter_is_named (GDB_INTERPRETER_MI1)
52- && !gdb_current_interpreter_is_named (GDB_INTERPRETER_MI2))
51+ if (!gdb_interpreter_current_is_named_p (GDB_INTERPRETER_MI1)
52+ && !gdb_interpreter_current_is_named_p (GDB_INTERPRETER_MI2))
5353 {
5454 va_start (args, string);
5555 vfprintf_unfiltered (mi_event_channel, string, args);
--- a/gdb/mi/mi-interp.c
+++ b/gdb/mi/mi-interp.c
@@ -139,19 +139,19 @@ mi_interpreter_resume (void *data)
139139 /* Route target output through the MI. */
140140 gdb_stdtarg = mi_stdtarg;
141141
142- /* Replace all the hooks that we know about. There really needs to be a better way
143- of doing this... */
142+ /* Replace all the hooks that we know about. There really needs to
143+ be a better way of doing this... */
144144 clear_interpreter_hooks ();
145145 set_gdb_event_hooks (&mi_event_handlers);
146146
147147 show_load_progress = mi_load_progress;
148148
149149 /* If we're _the_ interpreter, take control. */
150- if (gdb_current_interpreter_is_named (GDB_INTERPRETER_MI2))
150+ if (gdb_interpreter_current_is_named_p (GDB_INTERPRETER_MI2))
151151 command_loop_hook = mi2_command_loop;
152- else if (gdb_current_interpreter_is_named (GDB_INTERPRETER_MI1))
152+ else if (gdb_interpreter_current_is_named_p (GDB_INTERPRETER_MI1))
153153 command_loop_hook = mi1_command_loop;
154- else if (gdb_current_interpreter_is_named (GDB_INTERPRETER_MI))
154+ else if (gdb_interpreter_current_is_named_p (GDB_INTERPRETER_MI))
155155 command_loop_hook = mi2_command_loop;
156156 else
157157 return 0;
@@ -214,7 +214,7 @@ mi_cmd_interpreter_exec (char *command, char **argv, int argc)
214214 return MI_CMD_ERROR;
215215 }
216216
217- interp_to_use = gdb_lookup_interpreter (argv[0]);
217+ interp_to_use = gdb_interpreter_lookup (argv[0]);
218218 if (interp_to_use == NULL)
219219 {
220220 xasprintf (&mi_error_message,
@@ -426,12 +426,12 @@ _initialize_mi_interp (void)
426426 if (mi1_interp == NULL)
427427 {
428428 mi1_interp =
429- gdb_new_interpreter (GDB_INTERPRETER_MI1, NULL, mi_out_new (1),
429+ gdb_interpreter_new (GDB_INTERPRETER_MI1, NULL, mi_out_new (1),
430430 &procs);
431431 if (mi1_interp == NULL)
432432 error
433433 ("Couldn't allocate a new interpreter for the mi1 interpreter\n");
434- if (gdb_add_interpreter (mi1_interp) != 1)
434+ if (gdb_interpreter_add (mi1_interp) != 1)
435435 error ("Couldn't add the mi1 interpreter to gdb.\n");
436436 }
437437
@@ -439,12 +439,12 @@ _initialize_mi_interp (void)
439439 if (mi2_interp == NULL)
440440 {
441441 mi2_interp =
442- gdb_new_interpreter (GDB_INTERPRETER_MI2, NULL, mi_out_new (2),
442+ gdb_interpreter_new (GDB_INTERPRETER_MI2, NULL, mi_out_new (2),
443443 &procs);
444444 if (mi2_interp == NULL)
445445 error
446446 ("Couldn't allocate a new interpreter for the mi2 interpreter\n");
447- if (gdb_add_interpreter (mi2_interp) != 1)
447+ if (gdb_interpreter_add (mi2_interp) != 1)
448448 error ("Couldn't add the mi2 interpreter to gdb.\n");
449449 }
450450
@@ -452,12 +452,12 @@ _initialize_mi_interp (void)
452452 if (mi_interp == NULL)
453453 {
454454 mi_interp =
455- gdb_new_interpreter (GDB_INTERPRETER_MI, NULL, mi_out_new (3),
455+ gdb_interpreter_new (GDB_INTERPRETER_MI, NULL, mi_out_new (3),
456456 &procs);
457457 if (mi_interp == NULL)
458458 error
459459 ("Couldn't allocate a new interpreter for the mi interpreter\n");
460- if (gdb_add_interpreter (mi_interp) != 1)
460+ if (gdb_interpreter_add (mi_interp) != 1)
461461 error ("Couldn't add the mi interpreter to gdb.\n");
462462 }
463463 }
--- a/gdb/mi/mi-main.c
+++ b/gdb/mi/mi-main.c
@@ -1160,9 +1160,9 @@ captured_mi_execute_command (struct ui_out *uiout, void *data)
11601160 mi_execute_cli_command ("%s", context->command);
11611161
11621162 /* If we changed interpreters, DON'T print out anything. */
1163- if (gdb_current_interpreter_is_named (GDB_INTERPRETER_MI)
1164- || gdb_current_interpreter_is_named (GDB_INTERPRETER_MI1)
1165- || gdb_current_interpreter_is_named (GDB_INTERPRETER_MI2))
1163+ if (gdb_interpreter_current_is_named_p (GDB_INTERPRETER_MI)
1164+ || gdb_interpreter_current_is_named_p (GDB_INTERPRETER_MI2)
1165+ || gdb_interpreter_current_is_named_p (GDB_INTERPRETER_MI1))
11661166 {
11671167 /* print the result */
11681168 /* FIXME: Check for errors here. */
@@ -1410,9 +1410,9 @@ mi_load_progress (const char *section_name,
14101410 static char *previous_sect_name = NULL;
14111411 int new_section;
14121412
1413- if (!gdb_current_interpreter_is_named (GDB_INTERPRETER_MI)
1414- && !gdb_current_interpreter_is_named (GDB_INTERPRETER_MI1)
1415- && !gdb_current_interpreter_is_named (GDB_INTERPRETER_MI2))
1413+ if (!gdb_interpreter_current_is_named_p (GDB_INTERPRETER_MI)
1414+ && !gdb_interpreter_current_is_named_p (GDB_INTERPRETER_MI2)
1415+ && !gdb_interpreter_current_is_named_p (GDB_INTERPRETER_MI1))
14161416 return;
14171417
14181418 update_threshold.tv_sec = 0;
--- a/gdb/top.c
+++ b/gdb/top.c
@@ -2130,11 +2130,15 @@ gdb_init (char *argv0)
21302130 /* All the interpreters should have had a look at things by now.
21312131 Initialize the selected interpreter. */
21322132 {
2133+
2134+ /* There will always be an interpreter. Either the one specified
2135+ by the user at start up or the console. */
2136+
21332137 struct gdb_interpreter *interp;
21342138 if (interpreter_p == NULL)
21352139 interpreter_p = xstrdup (GDB_INTERPRETER_CONSOLE);
21362140
2137- interp = gdb_lookup_interpreter (interpreter_p);
2141+ interp = gdb_interpreter_lookup (interpreter_p);
21382142
21392143 if (interp == NULL)
21402144 {
@@ -2142,7 +2146,7 @@ gdb_init (char *argv0)
21422146 interpreter_p);
21432147 exit (1);
21442148 }
2145- if (!gdb_set_interpreter (interp))
2149+ if (!gdb_interpreter_set (interp))
21462150 {
21472151 fprintf_unfiltered (gdb_stderr, "Interpreter `%s' failed to initialize.\n",
21482152 interpreter_p);