]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
2002-11-04 Elena Zannoni <ezannoni@redhat.com>
authorElena Zannoni <ezannoni@kwikemart.cygnus.com>
Mon, 4 Nov 2002 22:47:26 +0000 (22:47 +0000)
committerElena Zannoni <ezannoni@kwikemart.cygnus.com>
Mon, 4 Nov 2002 22:47:26 +0000 (22:47 +0000)
* event-top.c (display_gdb_prompt): Use
gdb_interpreter_display_prompt_p.
* cli/cli-interp.c (cli_interpreter_display_prompt_p): Rename from
cli_interpreter_display_prompt and rewrite.
(_initialize_cli_interp): New proc name is
cli_interpreter_display_prompt_p.
* interps.c (gdb_new_interpreter): Initialize prompt_proc_p
instead of prompt_proc.
(gdb_interpreter_display_prompt_p): Rewrite as a predicate.
* interps.h (interp_prompt_ftype): Update typedef.
(struct gdb_interpreter_procs): Rename prompt_proc to
prompt_proc_p.
(gdb_interpreter_display_prompt_p): Export this instead of old
function.

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

* mi-interp.c (_initialize_mi_interp): Use mi_interpreter_prompt_p
instead of mi_interpreter_prompt.
(mi_interpreter_prompt_p): Rename from mi_interpreter_prompt and
rewrite.

gdb/ChangeLog
gdb/cli/cli-interp.c
gdb/event-top.c
gdb/interps.c
gdb/interps.h
gdb/mi/ChangeLog
gdb/mi/mi-interp.c

index 5b1f4607b5a695af6e5d35859262639434eb64e1..084e45f7e77ee0ae854c50b433571380d0c99de2 100644 (file)
@@ -1,3 +1,20 @@
+2002-11-04  Elena Zannoni  <ezannoni@redhat.com>
+
+       * event-top.c (display_gdb_prompt): Use
+       gdb_interpreter_display_prompt_p.
+       * cli/cli-interp.c (cli_interpreter_display_prompt_p): Rename from
+       cli_interpreter_display_prompt and rewrite.
+       (_initialize_cli_interp): New proc name is
+       cli_interpreter_display_prompt_p.
+       * interps.c (gdb_new_interpreter): Initialize prompt_proc_p
+       instead of prompt_proc.
+       (gdb_interpreter_display_prompt_p): Rewrite as a predicate.
+       * interps.h (interp_prompt_ftype): Update typedef.
+       (struct gdb_interpreter_procs): Rename prompt_proc to
+       prompt_proc_p.
+       (gdb_interpreter_display_prompt_p): Export this instead of old
+       function.
+
 2002-11-04  Elena Zannoni  <ezannoni@redhat.com>
 
        * interps.c (list_interpreter_cmd, do_set_interpreter): Remove
index 33245cdb9d3590c10c3fc358ed0e889cb030b568..cb53608d9752750b16789a1824b1cec6b6ab2ce5 100644 (file)
@@ -31,7 +31,7 @@ static int cli_interpreter_init (void *data);
 static int cli_interpreter_resume (void *data);
 static int cli_interpreter_suspend (void *data);
 static int cli_interpreter_exec (void *data, char *command_str);
-static int cli_interpreter_display_prompt (void *data, char *new_prompt);
+static int cli_interpreter_display_prompt_p (void);
 
 /* These are the ui_out and the interpreter for the console interpreter. */
 static struct ui_out *cli_uiout;
@@ -70,17 +70,14 @@ cli_interpreter_suspend (void *data)
   return 1;
 }
 
+/* Don't display the prompt if we are set quiet.  */
 static int
-cli_interpreter_display_prompt (void *data, char *new_prompt)
+cli_interpreter_display_prompt_p (void)
 {
   if (gdb_interpreter_is_quiet (NULL))
-    {
-      return 1;
-    }
+    return 0;
   else
-    {
-      return 0;
-    }
+    return 1;
 }
 
 static int
@@ -129,7 +126,7 @@ _initialize_cli_interp (void)
     cli_interpreter_resume,    /* resume_proc */
     cli_interpreter_suspend,   /* suspend_proc */
     cli_interpreter_exec,      /* exec_proc */
-    cli_interpreter_display_prompt /* prompt_proc */
+    cli_interpreter_display_prompt_p /* prompt_proc_p */
   };
 
   /* Create a default uiout builder for the CLI. */
index 591e0be7b4361ae3702bb49df7df7e56b0242367..1b54e5ff0731fb2b95f64d15f9f6e2a4b4bf44ae 100644 (file)
@@ -251,9 +251,9 @@ display_gdb_prompt (char *new_prompt)
   int prompt_length = 0;
   char *gdb_prompt = get_prompt ();
 
-  /* When an alternative interpreter has been installed, do not
-     display the comand prompt. */
-  if (gdb_interpreter_display_prompt (new_prompt))
+  /* Each interpreter has its own rules on wether or not display the
+     command prompt. */
+  if (!gdb_interpreter_display_prompt_p ())
     return;
 
   if (target_executing && sync_execution)
index 53ff28844bd4d6d3770589ab8b3681732b37140a..b3327802c785c47e110e72b94828e8822c159f25 100644 (file)
@@ -101,7 +101,7 @@ gdb_new_interpreter (char *name,
   new_interp->procs.resume_proc = procs->resume_proc;
   new_interp->procs.suspend_proc = procs->suspend_proc;
   new_interp->procs.exec_proc = procs->exec_proc;
-  new_interp->procs.prompt_proc = procs->prompt_proc;
+  new_interp->procs.prompt_proc_p = procs->prompt_proc_p;
   new_interp->inited = 0;
 
   return new_interp;
@@ -278,17 +278,15 @@ gdb_current_interpreter_is_named (char *interp_name)
 }
 
 /* This is called in display_gdb_prompt.
-   If the current interpreter defines a prompt_proc, then that proc is 
-   run.  If the proc returns a non-zero value, display_gdb_prompt will
-   return without itself displaying the prompt. */
+   If the proc returns a zero value, display_gdb_prompt will
+   return without displaying the prompt.  */
 int
-gdb_interpreter_display_prompt (char *new_prompt)
+gdb_interpreter_display_prompt_p (void)
 {
-  if (current_interpreter->procs.prompt_proc == NULL)
+  if (current_interpreter->procs.prompt_proc_p == NULL)
     return 0;
   else
-    return current_interpreter->procs.prompt_proc (current_interpreter->data,
-                                                  new_prompt);
+    return current_interpreter->procs.prompt_proc_p ();
 }
 
 int
index 0d8820c6471293680ae1b8996f3e6bae1e8d197c..40ba7145134d75ca446c556154d30cdb1d661af3 100644 (file)
@@ -25,7 +25,7 @@
 typedef int (*interp_init_ftype) (void *data);
 typedef int (*interp_resume_ftype) (void *data);
 typedef int (*interp_suspend_ftype) (void *data);
-typedef int (*interp_prompt_ftype) (void *data, char *new_prompt);
+typedef int (*interp_prompt_ftype) (void);
 typedef int (*interp_exec_ftype) (void *data, char *command);
 
 struct ui_out;
@@ -37,7 +37,7 @@ struct gdb_interpreter_procs
   interp_resume_ftype resume_proc;
   interp_suspend_ftype suspend_proc;
   interp_exec_ftype exec_proc;
-  interp_prompt_ftype prompt_proc;
+  interp_prompt_ftype prompt_proc_p;
 };
 
 extern struct gdb_interpreter
@@ -51,7 +51,7 @@ extern struct gdb_interpreter *gdb_current_interpreter ();
 extern struct ui_out *gdb_interpreter_ui_out (struct gdb_interpreter *interp);
 extern int gdb_current_interpreter_is_named (char *interp_name);
 extern int gdb_interpreter_exec (char *command_str);
-extern int gdb_interpreter_display_prompt (char *new_prompt);
+extern int gdb_interpreter_display_prompt_p (void);
 extern int gdb_interpreter_set_quiet (struct gdb_interpreter *interp,
                                      int quiet);
 extern int gdb_interpreter_is_quiet (struct gdb_interpreter *interp);
index 9765df1fddaeea9e44238f21a3b911b08794011d..d15ef620c7a58c3900a261ac70d2b80a6b366a94 100644 (file)
@@ -1,3 +1,10 @@
+2002-11-04  Elena Zannoni  <ezannoni@redhat.com>
+
+       * mi-interp.c (_initialize_mi_interp): Use mi_interpreter_prompt_p
+       instead of mi_interpreter_prompt.
+       (mi_interpreter_prompt_p): Rename from mi_interpreter_prompt and
+       rewrite.
+
 2002-11-04  Elena Zannoni  <ezannoni@redhat.com>
 
        * mi-interp.c mi_interpreter_delete): Remove.
index 6146b9c692e5efb7d8e0f2d4652d70bde9dd8bfa..1d1c5b96554f582b8faad80b45d00c290cbb9b40 100644 (file)
@@ -48,7 +48,7 @@ static int mi_interpreter_init (void *data);
 static int mi_interpreter_resume (void *data);
 static int mi_interpreter_suspend (void *data);
 static int mi_interpreter_exec (void *data, char *command);
-static int mi_interpreter_prompt (void *data, char *new_prompt);
+static int mi_interpreter_prompt_p (void);
 
 static void mi_execute_command_wrapper (char *cmd);
 static void mi_command_loop (int mi_version);
@@ -173,10 +173,11 @@ mi_interpreter_exec (void *data, char *command)
   return 1;
 }
 
+/* Never display the default gdb prompt in mi case.  */
 static int
-mi_interpreter_prompt (void *data, char *new_prompt)
+mi_interpreter_prompt_p (void)
 {
-  return 1;
+  return 0;
 }
 
 static void
@@ -418,7 +419,7 @@ _initialize_mi_interp (void)
       mi_interpreter_resume,   /* resume_proc */
       mi_interpreter_suspend,  /* suspend_proc */
       mi_interpreter_exec,     /* exec_proc */
-      mi_interpreter_prompt    /* prompt_proc */
+      mi_interpreter_prompt_p  /* prompt_proc_p */
     };
 
   /* Create MI1 interpreter */