This is the mail archive of the gdb-patches@sourceware.cygnus.com mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

patch to top.c: DEFAULT_PROMPT


While browsing through top.c, I saw that the default prompt was set to
"(gdb)" if DEFAULT_PROMPT was not defined, otherwise to DEFAULT_PROMPT.
As this is done in different ways depending on async_p, it seems a bit
cleaner to me if DEFAULT_PROMPT is set to "(gdb)" if not overriden by
target/host config files --- similar to how GDBINIT_FILENAME is done
today.

        --jtc

1999-08-20  J.T. Conklin  <jtc@redback.com>

	* top.c (DEFAULT_PROMPT): Set to "(gdb)" if not already defined.
	(init_main): Always use DEFAULT_PROMPT.

Index: top.c
===================================================================
RCS file: /home/jtc/CVSROOT/gdb/gdb/top.c,v
retrieving revision 1.1.1.10
diff -c -r1.1.1.10 top.c
*** top.c	1999/08/11 04:08:18	1.1.1.10
--- top.c	1999/08/20 23:51:11
***************
*** 158,163 ****
--- 158,169 ----
  #define ISATTY(FP)	(isatty (fileno (FP)))
  #endif
  
+ /* Default command line prompt.  This is overriden in some configs. */
+ 
+ #ifndef DEFAULT_PROMPT
+ #define DEFAULT_PROMPT	"(gdb)"
+ #endif
+ 
  /* Initialization file name for gdb.  This is overridden in some configs.  */
  
  #ifndef	GDBINIT_FILENAME
***************
*** 3807,3817 ****
       we initialize the prompts differently. */
    if (!async_p)
      {
- #ifdef DEFAULT_PROMPT
        gdb_prompt_string = savestring (DEFAULT_PROMPT, strlen (DEFAULT_PROMPT));
- #else
-       gdb_prompt_string = savestring ("(gdb) ", 6);
- #endif
      }
    else
      {
--- 3813,3819 ----
***************
*** 3819,3829 ****
           whatever the DEFAULT_PROMPT is. */
        the_prompts.top = 0;
        PREFIX (0) = "";
- #ifdef DEFAULT_PROMPT
        PROMPT (0) = savestring (DEFAULT_PROMPT, strlen (DEFAULT_PROMPT));
- #else
-       PROMPT (0) = savestring ("(gdb) ", 6);
- #endif
        SUFFIX (0) = "";
        /* Set things up for annotation_level > 1, if the user ever decides
           to use it. */
--- 3821,3827 ----


-- 
J.T. Conklin
RedBack Networks

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]