This is the mail archive of the gdb-patches@sources.redhat.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]
Other format: [Raw text]

[RFA] top.c whitespace tweaks


OK?

2005-01-13  Michael Snyder  <msnyder@redhat.com>

	* top.c: Whitespace tweaks.

Index: top.c
===================================================================
RCS file: /cvs/src/src/gdb/top.c,v
retrieving revision 1.95
diff -p -r1.95 top.c
*** top.c	12 Jan 2005 18:31:33 -0000	1.95
--- top.c	14 Jan 2005 05:03:16 -0000
***************
*** 63,75 ****
  #include "ui-out.h"
  #include "cli-out.h"
  
! /* 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
  #define	GDBINIT_FILENAME	".gdbinit"
--- 63,77 ----
  #include "ui-out.h"
  #include "cli-out.h"
  
! /* 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
  #define	GDBINIT_FILENAME	".gdbinit"
*************** extern char lang_frame_mismatch_warn[];	
*** 87,97 ****
  
  /* Flag for whether we want all the "from_tty" gubbish printed.  */
  
! int caution = 1;		/* Default is yes, sigh. */
  
! /* stdio stream that command input is being read from.  Set to stdin normally.
!    Set by source_command to the file we are sourcing.  Set to NULL if we are
!    executing a user-defined command or interacting via a GUI.  */
  
  FILE *instream;
  
--- 89,100 ----
  
  /* Flag for whether we want all the "from_tty" gubbish printed.  */
  
! int caution = 1;		/* Default is yes, sigh.  */
  
! /* stdio stream that command input is being read from.  Set to stdin
!    normally.  Set by source_command to the file we are sourcing.  Set
!    to NULL if we are executing a user-defined command or interacting
!    via a GUI.  */
  
  FILE *instream;
  
*************** void (*window_hook) (FILE *, char *);
*** 111,118 ****
  int epoch_interface;
  int xgdb_verbose;
  
! /* gdb prints this when reading a command interactively */
! static char *gdb_prompt_string;	/* the global prompt string */
  
  /* Buffer used for reading command lines, and the size
     allocated for it so far.  */
--- 114,121 ----
  int epoch_interface;
  int xgdb_verbose;
  
! /* gdb prints this when reading a command interactively.  */
! static char *gdb_prompt_string;	/* The global prompt string.  */
  
  /* Buffer used for reading command lines, and the size
     allocated for it so far.  */
*************** int server_command;
*** 130,141 ****
  
  /* Baud rate specified for talking to serial target systems.  Default
     is left as -1, so targets can choose their own defaults.  */
! /* FIXME: This means that "show remotebaud" and gr_files_info can print -1
!    or (unsigned int)-1.  This is a Bad User Interface.  */
  
  int baud_rate = -1;
  
! /* Timeout limit for response from target. */
  
  /* The default value has been changed many times over the years.  It 
     was originally 5 seconds.  But that was thought to be a long time 
--- 133,144 ----
  
  /* Baud rate specified for talking to serial target systems.  Default
     is left as -1, so targets can choose their own defaults.  */
! /* FIXME: This means that "show remotebaud" and gr_files_info can
!    print -1 or (unsigned int) -1.  This is a Bad User Interface.  */
  
  int baud_rate = -1;
  
! /* Timeout limit for response from target.  */
  
  /* The default value has been changed many times over the years.  It 
     was originally 5 seconds.  But that was thought to be a long time 
*************** int baud_rate = -1;
*** 153,159 ****
     a single variable for all protocol timeouts.
  
     As remote.c is used much more than remote-e7000.c, it was changed 
!    back to 2 seconds in 1999. */
  
  int remote_timeout = 2;
  
--- 156,162 ----
     a single variable for all protocol timeouts.
  
     As remote.c is used much more than remote-e7000.c, it was changed 
!    back to 2 seconds in 1999.  */
  
  int remote_timeout = 2;
  
*************** int remote_debug = 0;
*** 164,170 ****
  /* Non-zero means the target is running. Note: this is different from
     saying that there is an active target and we are stopped at a
     breakpoint, for instance. This is a real indicator whether the
!    target is off and running, which gdb is doing something else. */
  int target_executing = 0;
  
  /* Level of control structure.  */
--- 167,173 ----
  /* Non-zero means the target is running. Note: this is different from
     saying that there is an active target and we are stopped at a
     breakpoint, for instance. This is a real indicator whether the
!    target is off and running, which gdb is doing something else.  */
  int target_executing = 0;
  
  /* Level of control structure.  */
*************** static int control_level;
*** 175,181 ****
  char *lim_at_start;
  #endif
  
! /* Signal to catch ^Z typed while reading a command: SIGTSTP or SIGCONT.  */
  
  #ifndef STOP_SIGNAL
  #ifdef SIGTSTP
--- 178,185 ----
  char *lim_at_start;
  #endif
  
! /* Signal to catch ^Z typed while reading a command: SIGTSTP or
!    SIGCONT.  */
  
  #ifndef STOP_SIGNAL
  #ifdef SIGTSTP
*************** static void stop_sig (int);
*** 186,202 ****
  
  /* Hooks for alternate command interfaces.  */
  
! /* Called after most modules have been initialized, but before taking users
!    command file.
  
!    If the UI fails to initialize and it wants GDB to continue
!    using the default UI, then it should clear this hook before returning. */
  
  void (*deprecated_init_ui_hook) (char *argv0);
  
! /* This hook is called from within gdb's many mini-event loops which could
!    steal control from a real user interface's event loop. It returns
!    non-zero if the user is requesting a detach, zero otherwise. */
  
  int (*deprecated_ui_loop_hook) (int);
  
--- 190,207 ----
  
  /* Hooks for alternate command interfaces.  */
  
! /* Called after most modules have been initialized, but before taking
!    users command file.
  
!    If the UI fails to initialize and it wants GDB to continue using
!    the default UI, then it should clear this hook before returning.  */
  
  void (*deprecated_init_ui_hook) (char *argv0);
  
! /* This hook is called from within gdb's many mini-event loops which
!    could steal control from a real user interface's event loop. It
!    returns non-zero if the user is requesting a detach, zero
!    otherwise.  */
  
  int (*deprecated_ui_loop_hook) (int);
  
*************** void (*deprecated_command_loop_hook) (vo
*** 208,215 ****
  
  /* Called from print_frame_info to list the line we stopped in.  */
  
! void (*deprecated_print_frame_info_listing_hook) (struct symtab * s, int line,
! 						  int stopline, int noerror);
  /* Replaces most of query.  */
  
  int (*deprecated_query_hook) (const char *, va_list);
--- 213,222 ----
  
  /* Called from print_frame_info to list the line we stopped in.  */
  
! void (*deprecated_print_frame_info_listing_hook) (struct symtab * s, 
! 						  int line,
! 						  int stopline, 
! 						  int noerror);
  /* Replaces most of query.  */
  
  int (*deprecated_query_hook) (const char *, va_list);
*************** void (*deprecated_readline_begin_hook) (
*** 234,281 ****
  char *(*deprecated_readline_hook) (char *);
  void (*deprecated_readline_end_hook) (void);
  
! /* Called as appropriate to notify the interface of the specified breakpoint
!    conditions.  */
  
  void (*deprecated_create_breakpoint_hook) (struct breakpoint * bpt);
  void (*deprecated_delete_breakpoint_hook) (struct breakpoint * bpt);
  void (*deprecated_modify_breakpoint_hook) (struct breakpoint * bpt);
  
  /* Called as appropriate to notify the interface that we have attached
!    to or detached from an already running process. */
  
  void (*deprecated_attach_hook) (void);
  void (*deprecated_detach_hook) (void);
  
! /* Called during long calculations to allow GUI to repair window damage, and to
!    check for stop buttons, etc... */
  
  void (*deprecated_interactive_hook) (void);
  
  /* Called when the registers have changed, as a hint to a GUI
!    to minimize window update. */
  
  void (*deprecated_registers_changed_hook) (void);
  
  /* Tell the GUI someone changed the register REGNO. -1 means
     that the caller does not know which register changed or
!    that several registers have changed (see value_assign). */
  void (*deprecated_register_changed_hook) (int regno);
  
  /* Tell the GUI someone changed LEN bytes of memory at ADDR */
  void (*deprecated_memory_changed_hook) (CORE_ADDR addr, int len);
  
! /* Called when going to wait for the target.  Usually allows the GUI to run
!    while waiting for target events.  */
  
  ptid_t (*deprecated_target_wait_hook) (ptid_t ptid,
! 				       struct target_waitstatus * status);
  
! /* Used by UI as a wrapper around command execution.  May do various things
!    like enabling/disabling buttons, etc...  */
  
! void (*deprecated_call_command_hook) (struct cmd_list_element * c, char *cmd,
! 				      int from_tty);
  
  /* Called after a `set' command has finished.  Is only run if the
     `set' command succeeded.  */
--- 241,288 ----
  char *(*deprecated_readline_hook) (char *);
  void (*deprecated_readline_end_hook) (void);
  
! /* Called as appropriate to notify the interface of the specified
!    breakpoint conditions.  */
  
  void (*deprecated_create_breakpoint_hook) (struct breakpoint * bpt);
  void (*deprecated_delete_breakpoint_hook) (struct breakpoint * bpt);
  void (*deprecated_modify_breakpoint_hook) (struct breakpoint * bpt);
  
  /* Called as appropriate to notify the interface that we have attached
!    to or detached from an already running process.  */
  
  void (*deprecated_attach_hook) (void);
  void (*deprecated_detach_hook) (void);
  
! /* Called during long calculations to allow GUI to repair window
!    damage, and to check for stop buttons, etc...  */
  
  void (*deprecated_interactive_hook) (void);
  
  /* Called when the registers have changed, as a hint to a GUI
!    to minimize window update.  */
  
  void (*deprecated_registers_changed_hook) (void);
  
  /* Tell the GUI someone changed the register REGNO. -1 means
     that the caller does not know which register changed or
!    that several registers have changed (see value_assign).  */
  void (*deprecated_register_changed_hook) (int regno);
  
  /* Tell the GUI someone changed LEN bytes of memory at ADDR */
  void (*deprecated_memory_changed_hook) (CORE_ADDR addr, int len);
  
! /* Called when going to wait for the target.  Usually allows the GUI
!    to run while waiting for target events.  */
  
  ptid_t (*deprecated_target_wait_hook) (ptid_t ptid,
! 				       struct target_waitstatus *status);
  
! /* Used by UI as a wrapper around command execution.  May do various
!    things like enabling/disabling buttons, etc...  */
  
! void (*deprecated_call_command_hook) (struct cmd_list_element * c, 
! 				      char *cmd, int from_tty);
  
  /* Called after a `set' command has finished.  Is only run if the
     `set' command succeeded.  */
*************** void (*deprecated_set_hook) (struct cmd_
*** 286,293 ****
  
  void (*deprecated_context_hook) (int id);
  
! /* Takes control from error ().  Typically used to prevent longjmps out of the
!    middle of the GUI.  Usually used in conjunction with a catch routine.  */
  
  void (*deprecated_error_hook) (void);
  
--- 293,301 ----
  
  void (*deprecated_context_hook) (int id);
  
! /* Takes control from error ().  Typically used to prevent longjmps
!    out of the middle of the GUI.  Usually used in conjunction with a
!    catch routine.  */
  
  void (*deprecated_error_hook) (void);
  
*************** void (*deprecated_error_hook) (void);
*** 300,307 ****
  /* static */ int
  quit_cover (void *s)
  {
!   caution = 0;			/* Throw caution to the wind -- we're exiting.
! 				   This prevents asking the user dumb questions.  */
    quit_command ((char *) 0, 0);
    return 0;
  }
--- 308,315 ----
  /* static */ int
  quit_cover (void *s)
  {
!   caution = 0;	/* Throw caution to the wind -- we're exiting.
! 		   This prevents asking the user dumb questions.  */
    quit_command ((char *) 0, 0);
    return 0;
  }
*************** quit_cover (void *s)
*** 327,334 ****
  /* static */ char *source_error;
  static int source_error_allocated;
  
! /* Something to glom on to the start of error_pre_print if source_file_name
!    is set.  */
  /* NOTE 1999-04-29: This variable will be static again, once we modify
     gdb to use the event loop as the default command loop and we merge
     event-top.c into this file, top.c */
--- 335,342 ----
  /* static */ char *source_error;
  static int source_error_allocated;
  
! /* Something to glom on to the start of error_pre_print if
!    source_file_name is set.  */
  /* NOTE 1999-04-29: This variable will be static again, once we modify
     gdb to use the event loop as the default command loop and we merge
     event-top.c into this file, top.c */
*************** execute_command (char *p, int from_tty)
*** 400,406 ****
        c = lookup_cmd (&p, cmdlist, "", 0, 1);
  
        /* If the target is running, we allow only a limited set of
!          commands. */
        if (target_can_async_p () && target_executing)
  	if (strcmp (c->name, "help") != 0
  	    && strcmp (c->name, "pwd") != 0
--- 408,414 ----
        c = lookup_cmd (&p, cmdlist, "", 0, 1);
  
        /* If the target is running, we allow only a limited set of
!          commands.  */
        if (target_can_async_p () && target_executing)
  	if (strcmp (c->name, "help") != 0
  	    && strcmp (c->name, "pwd") != 0
*************** execute_command (char *p, int from_tty)
*** 431,437 ****
  	  *(p + 1) = '\0';
  	}
  
!       /* If this command has been pre-hooked, run the hook first. */
        execute_cmd_pre_hook (c);
  
        if (c->flags & DEPRECATED_WARN_USER)
--- 439,445 ----
  	  *(p + 1) = '\0';
  	}
  
!       /* If this command has been pre-hooked, run the hook first.  */
        execute_cmd_pre_hook (c);
  
        if (c->flags & DEPRECATED_WARN_USER)
*************** execute_command (char *p, int from_tty)
*** 448,454 ****
        else
  	cmd_func (c, arg, from_tty & caution);
         
!       /* If this command has been post-hooked, run the hook last. */
        execute_cmd_post_hook (c);
  
      }
--- 456,462 ----
        else
  	cmd_func (c, arg, from_tty & caution);
         
!       /* If this command has been post-hooked, run the hook last.  */
        execute_cmd_post_hook (c);
  
      }
*************** execute_command (char *p, int from_tty)
*** 463,472 ****
        warned = 0;
      }
  
!   /* Warn the user if the working language does not match the
       language of the current frame.  Only warn the user if we are
!      actually running the program, i.e. there is a stack. */
!   /* FIXME:  This should be cacheing the frame and only running when
       the frame changes.  */
  
    if (target_has_stack)
--- 471,480 ----
        warned = 0;
      }
  
!   /* Warn the user if the working language does not match the 
       language of the current frame.  Only warn the user if we are
!      actually running the program, i.e. there is a stack.  */
!   /* FIXME: This should be cacheing the frame and only running when
       the frame changes.  */
  
    if (target_has_stack)
*************** command_loop (void)
*** 508,514 ****
  	reinitialize_more_filter ();
        old_chain = make_cleanup (null_cleanup, 0);
  
!       /* Get a command-line. This calls the readline package. */
        command = command_line_input (instream == stdin ?
  				    get_prompt () : (char *) NULL,
  				    instream == stdin, "prompt");
--- 516,522 ----
  	reinitialize_more_filter ();
        old_chain = make_cleanup (null_cleanup, 0);
  
!       /* Get a command-line. This calls the readline package.  */
        command = command_line_input (instream == stdin ?
  				    get_prompt () : (char *) NULL,
  				    instream == stdin, "prompt");
*************** command_loop (void)
*** 557,563 ****
  /* Read commands from `instream' and execute them until end of file or
     error reading instream. This command loop doesnt care about any
     such things as displaying time and space usage. If the user asks
!    for those, they won't work. */
  void
  simplified_command_loop (char *(*read_input_func) (char *),
  			 void (*execute_command_func) (char *, int))
--- 565,571 ----
  /* Read commands from `instream' and execute them until end of file or
     error reading instream. This command loop doesnt care about any
     such things as displaying time and space usage. If the user asks
!    for those, they won't work.  */
  void
  simplified_command_loop (char *(*read_input_func) (char *),
  			 void (*execute_command_func) (char *, int))
*************** simplified_command_loop (char *(*read_in
*** 573,579 ****
  	reinitialize_more_filter ();
        old_chain = make_cleanup (null_cleanup, 0);
  
!       /* Get a command-line. */
        command = (*read_input_func) (instream == stdin ?
  				    get_prompt () : (char *) NULL);
  
--- 581,587 ----
  	reinitialize_more_filter ();
        old_chain = make_cleanup (null_cleanup, 0);
  
!       /* Get a command-line.  */
        command = (*read_input_func) (instream == stdin ?
  				    get_prompt () : (char *) NULL);
  
*************** dont_repeat (void)
*** 598,605 ****
      return;
  
    /* If we aren't reading from standard input, we are saving the last
!      thing read from stdin in line and don't want to delete it.  Null lines
!      won't repeat here in any case.  */
    if (instream == stdin)
      *line = 0;
  }
--- 606,613 ----
      return;
  
    /* If we aren't reading from standard input, we are saving the last
!      thing read from stdin in line and don't want to delete it.
!      Null lines won't repeat here in any case.  */
    if (instream == stdin)
      *line = 0;
  }
*************** dont_repeat (void)
*** 607,614 ****
  /* Read a line from the stream "instream" without command line editing.
  
     It prints PROMPT_ARG once at the start.
!    Action is compatible with "readline", e.g. space for the result is
!    malloc'd and should be freed by the caller.
  
     A NULL return means end of file.  */
  char *
--- 615,622 ----
  /* Read a line from the stream "instream" without command line editing.
  
     It prints PROMPT_ARG once at the start.
!    Action is compatible with "readline", e.g. space for the result
!    is malloc'd and should be freed by the caller.
  
     A NULL return means end of file.  */
  char *
*************** gdb_readline (char *prompt_arg)
*** 639,647 ****
        if (c == EOF)
  	{
  	  if (input_index > 0)
! 	    /* The last line does not end with a newline.  Return it, and
! 	       if we are called again fgetc will still return EOF and
! 	       we'll return NULL then.  */
  	    break;
  	  xfree (result);
  	  return NULL;
--- 647,655 ----
        if (c == EOF)
  	{
  	  if (input_index > 0)
! 	    /* The last line does not end with a newline.  Return it,
! 	       and if we are called again fgetc will still return EOF
! 	       and we'll return NULL then.  */
  	    break;
  	  xfree (result);
  	  return NULL;
*************** stop_sig (int signo)
*** 726,737 ****
    printf_unfiltered ("%s", get_prompt ());
    gdb_flush (gdb_stdout);
  
!   /* Forget about any previous command -- null line now will do nothing.  */
    dont_repeat ();
  }
  #endif /* STOP_SIGNAL */
  
! /* Initialize signal handlers. */
  static void
  float_handler (int signo)
  {
--- 734,746 ----
    printf_unfiltered ("%s", get_prompt ());
    gdb_flush (gdb_stdout);
  
!   /* Forget about any previous command -- null line now will do
!      nothing.  */
    dont_repeat ();
  }
  #endif /* STOP_SIGNAL */
  
! /* Initialize signal handlers.  */
  static void
  float_handler (int signo)
  {
*************** float_handler (int signo)
*** 744,755 ****
  static void
  do_nothing (int signo)
  {
!   /* Under System V the default disposition of a signal is reinstated after
!      the signal is caught and delivered to an application process.  On such
!      systems one must restore the replacement signal handler if one wishes
!      to continue handling the signal in one's program.  On BSD systems this
!      is not needed but it is harmless, and it simplifies the code to just do
!      it unconditionally. */
    signal (signo, do_nothing);
  }
  
--- 753,764 ----
  static void
  do_nothing (int signo)
  {
!   /* Under System V the default disposition of a signal is reinstated
!      after the signal is caught and delivered to an application
!      process.  On such systems one must restore the replacement signal
!      handler if one wishes to continue handling the signal in one's
!      program.  On BSD systems this is not needed but it is harmless,
!      and it simplifies the code to just do it unconditionally.  */
    signal (signo, do_nothing);
  }
  
*************** command_line_input (char *prompt_arg, in
*** 978,984 ****
  	  if (expanded < 0)
  	    {
  	      xfree (history_value);
! 	      return command_line_input (prompt_arg, repeat, annotation_suffix);
  	    }
  	  if (strlen (history_value) > linelength)
  	    {
--- 987,994 ----
  	  if (expanded < 0)
  	    {
  	      xfree (history_value);
! 	      return command_line_input (prompt_arg, repeat, 
! 					 annotation_suffix);
  	    }
  	  if (strlen (history_value) > linelength)
  	    {
*************** command_line_input (char *prompt_arg, in
*** 1007,1020 ****
        && ISATTY (stdin) && *linebuffer)
      add_history (linebuffer);
  
!   /* Note: lines consisting solely of comments are added to the command
!      history.  This is useful when you type a command, and then
!      realize you don't want to execute it quite yet.  You can comment
!      out the command and then later fetch it from the value history
!      and remove the '#'.  The kill ring is probably better, but some
!      people are in the habit of commenting things out.  */
    if (*p1 == '#')
!     *p1 = '\0';			/* Found a comment. */
  
    /* Save into global buffer if appropriate.  */
    if (repeat)
--- 1017,1030 ----
        && ISATTY (stdin) && *linebuffer)
      add_history (linebuffer);
  
!   /* Note: lines consisting solely of comments are added to the
!      command history.  This is useful when you type a command, and
!      then realize you don't want to execute it quite yet.  You can
!      comment out the command and then later fetch it from the value
!      history and remove the '#'.  The kill ring is probably better,
!      but some people are in the habit of commenting things out.  */
    if (*p1 == '#')
!     *p1 = '\0';			/* Found a comment.  */
  
    /* Save into global buffer if appropriate.  */
    if (repeat)
*************** command_line_input (char *prompt_arg, in
*** 1031,1054 ****
    return linebuffer;
  }
  
! /* Print the GDB banner. */
  void
  print_gdb_version (struct ui_file *stream)
  {
    /* From GNU coding standards, first line is meant to be easy for a
       program to parse, and is just canonical program name and version
!      number, which starts after last space. */
  
    fprintf_filtered (stream, "GNU gdb %s\n", version);
  
!   /* Second line is a copyright notice. */
  
!   fprintf_filtered (stream, "Copyright 2004 Free Software Foundation, Inc.\n");
  
    /* Following the copyright is a brief statement that the program is
       free software, that users are free to copy and change it on
       certain conditions, that it is covered by the GNU GPL, and that
!      there is no warranty. */
  
    fprintf_filtered (stream, "\
  GDB is free software, covered by the GNU General Public License, and you are\n\
--- 1041,1065 ----
    return linebuffer;
  }
  
! /* Print the GDB banner.  */
  void
  print_gdb_version (struct ui_file *stream)
  {
    /* From GNU coding standards, first line is meant to be easy for a
       program to parse, and is just canonical program name and version
!      number, which starts after last space.  */
  
    fprintf_filtered (stream, "GNU gdb %s\n", version);
  
!   /* Second line is a copyright notice.  */
  
!   fprintf_filtered (stream, 
! 		    "Copyright 2004 Free Software Foundation, Inc.\n");
  
    /* Following the copyright is a brief statement that the program is
       free software, that users are free to copy and change it on
       certain conditions, that it is covered by the GNU GPL, and that
!      there is no warranty.  */
  
    fprintf_filtered (stream, "\
  GDB is free software, covered by the GNU General Public License, and you are\n\
*************** welcome to change it and/or distribute c
*** 1056,1067 ****
  Type \"show copying\" to see the conditions.\n\
  There is absolutely no warranty for GDB.  Type \"show warranty\" for details.\n");
  
!   /* After the required info we print the configuration information. */
  
    fprintf_filtered (stream, "This GDB was configured as \"");
    if (strcmp (host_name, target_name) != 0)
      {
!       fprintf_filtered (stream, "--host=%s --target=%s", host_name, target_name);
      }
    else
      {
--- 1067,1079 ----
  Type \"show copying\" to see the conditions.\n\
  There is absolutely no warranty for GDB.  Type \"show warranty\" for details.\n");
  
!   /* After the required info we print the configuration information.  */
  
    fprintf_filtered (stream, "This GDB was configured as \"");
    if (strcmp (host_name, target_name) != 0)
      {
!       fprintf_filtered (stream, "--host=%s --target=%s", 
! 			host_name, target_name);
      }
    else
      {
*************** quit_confirm (void)
*** 1104,1110 ****
           see if a GUI is running.  The `use_windows' variable doesn't
           cut it.  */
        if (deprecated_init_ui_hook)
! 	s = "A debugging session is active.\nDo you still want to close the debugger?";
        else if (attach_flag)
  	s = "The program is running.  Quit anyway (and detach it)? ";
        else
--- 1116,1123 ----
           see if a GUI is running.  The `use_windows' variable doesn't
           cut it.  */
        if (deprecated_init_ui_hook)
! 	s = "A debugging session is active.\n\
! Do you still want to close the debugger?";
        else if (attach_flag)
  	s = "The program is running.  Quit anyway (and detach it)? ";
        else
*************** quit_target (void *arg)
*** 1145,1151 ****
    if (write_history_p && history_filename)
      write_history (history_filename);
  
!   do_final_cleanups (ALL_CLEANUPS);	/* Do any final cleanups before exiting */
  
    return 0;
  }
--- 1158,1165 ----
    if (write_history_p && history_filename)
      write_history (history_filename);
  
!   /* Do any final cleanups before exiting.  */
!   do_final_cleanups (ALL_CLEANUPS);
  
    return 0;
  }
*************** quit_force (char *args, int from_tty)
*** 1158,1165 ****
    int exit_code = 0;
    struct qt_args qt;
  
!   /* An optional expression may be used to cause gdb to terminate with the 
!      value of that expression. */
    if (args)
      {
        struct value *val = parse_and_eval (args);
--- 1172,1179 ----
    int exit_code = 0;
    struct qt_args qt;
  
!   /* An optional expression may be used to cause gdb to terminate with
!      the value of that expression.  */
    if (args)
      {
        struct value *val = parse_and_eval (args);
*************** input_from_terminal_p (void)
*** 1189,1196 ****
  static void
  dont_repeat_command (char *ignored, int from_tty)
  {
!   *line = 0;			/* Can't call dont_repeat here because we're not
! 				   necessarily reading from stdin.  */
  }
  
  /* Functions to manipulate command line editing control variables.  */
--- 1203,1210 ----
  static void
  dont_repeat_command (char *ignored, int from_tty)
  {
!   *line = 0;		/* Can't call dont_repeat here because we're
! 			   not necessarily reading from stdin.  */
  }
  
  /* Functions to manipulate command line editing control variables.  */
*************** show_commands (char *args, int from_tty)
*** 1207,1214 ****
       Relative to history_base.  */
    static int num = 0;
  
!   /* The first command in the history which doesn't exist (i.e. one more
!      than the number of the last command).  Relative to history_base.  */
    int hist_len;
  
    /* Print out some of the commands from the command history.  */
--- 1221,1229 ----
       Relative to history_base.  */
    static int num = 0;
  
!   /* The first command in the history which doesn't exist (i.e.
!      one more than the number of the last command).  Relative to
!      history_base.  */
    int hist_len;
  
    /* Print out some of the commands from the command history.  */
*************** show_commands (char *args, int from_tty)
*** 1241,1248 ****
    if (num < 0)
      num = 0;
  
!   /* If there are at least Hist_print commands, we want to display the last
!      Hist_print rather than, say, the last 6.  */
    if (hist_len - num < Hist_print)
      {
        num = hist_len - Hist_print;
--- 1256,1263 ----
    if (num < 0)
      num = 0;
  
!   /* If there are at least Hist_print commands, we want to display the
!      last Hist_print rather than, say, the last 6.  */
    if (hist_len - num < Hist_print)
      {
        num = hist_len - Hist_print;
*************** show_commands (char *args, int from_tty)
*** 1250,1256 ****
  	num = 0;
      }
  
!   for (offset = num; offset < num + Hist_print && offset < hist_len; offset++)
      {
        printf_filtered ("%5d  %s\n", history_base + offset,
  		       (history_get (history_base + offset))->line);
--- 1265,1273 ----
  	num = 0;
      }
  
!   for (offset = num; 
!        offset < num + Hist_print && offset < hist_len; 
!        offset++)
      {
        printf_filtered ("%5d  %s\n", history_base + offset,
  		       (history_get (history_base + offset))->line);
*************** show_commands (char *args, int from_tty)
*** 1272,1278 ****
  
  /* Called by do_setshow_command.  */
  static void
! set_history_size_command (char *args, int from_tty, struct cmd_list_element *c)
  {
    if (history_size == INT_MAX)
      unstifle_history ();
--- 1289,1296 ----
  
  /* Called by do_setshow_command.  */
  static void
! set_history_size_command (char *args, int from_tty, 
! 			  struct cmd_list_element *c)
  {
    if (history_size == INT_MAX)
      unstifle_history ();
*************** init_main (void)
*** 1363,1369 ****
  {
    struct cmd_list_element *c;
  
!   /* initialize the prompt stack to a simple "(gdb) " prompt or to
       whatever the DEFAULT_PROMPT is.  */
    the_prompts.top = 0;
    PREFIX (0) = "";
--- 1381,1387 ----
  {
    struct cmd_list_element *c;
  
!   /* Initialize the prompt stack to a simple "(gdb) " prompt or to
       whatever the DEFAULT_PROMPT is.  */
    the_prompts.top = 0;
    PREFIX (0) = "";
*************** init_main (void)
*** 1403,1413 ****
    deprecated_add_show_from_set (c, &showlist);
    set_cmd_sfunc (c, set_async_prompt);
  
!   add_com ("dont-repeat", class_support, dont_repeat_command, "Don't repeat this command.\n\
  Primarily used inside of user-defined commands that should not be repeated when\n\
  hitting return.");
  
!   c = add_set_cmd ("editing", class_support, var_boolean, (char *) &async_command_editing_p,
  		   "Set editing of command lines as they are typed.\n\
  Use \"on\" to enable the editing, and \"off\" to disable it.\n\
  Without an argument, command line editing is enabled.  To edit, use\n\
--- 1421,1433 ----
    deprecated_add_show_from_set (c, &showlist);
    set_cmd_sfunc (c, set_async_prompt);
  
!   add_com ("dont-repeat", class_support, 
! 	   dont_repeat_command, "Don't repeat this command.\n\
  Primarily used inside of user-defined commands that should not be repeated when\n\
  hitting return.");
  
!   c = add_set_cmd ("editing", class_support, var_boolean, 
! 		   (char *) &async_command_editing_p,
  		   "Set editing of command lines as they are typed.\n\
  Use \"on\" to enable the editing, and \"off\" to disable it.\n\
  Without an argument, command line editing is enabled.  To edit, use\n\
*************** EMACS-like or VI-like commands like cont
*** 1416,1427 ****
    deprecated_add_show_from_set (c, &showlist);
    set_cmd_sfunc (c, set_async_editing_command);
  
!   deprecated_add_show_from_set
!     (add_set_cmd ("save", no_class, var_boolean, (char *) &write_history_p,
! 		  "Set saving of the history record on exit.\n\
  Use \"on\" to enable the saving, and \"off\" to disable it.\n\
! Without an argument, saving is enabled.", &sethistlist),
!      &showhistlist);
  
    c = add_set_cmd ("size", no_class, var_integer, (char *) &history_size,
  		   "Set the size of the command history,\n\
--- 1436,1450 ----
    deprecated_add_show_from_set (c, &showlist);
    set_cmd_sfunc (c, set_async_editing_command);
  
!   deprecated_add_show_from_set (add_set_cmd ("save", no_class, 
! 					     var_boolean, 
! 					     (char *) &write_history_p,
! 					     "\
! Set saving of the history record on exit.\n\
  Use \"on\" to enable the saving, and \"off\" to disable it.\n\
! Without an argument, saving is enabled.", 
! 					     &sethistlist),
! 				&showhistlist);
  
    c = add_set_cmd ("size", no_class, var_integer, (char *) &history_size,
  		   "Set the size of the command history,\n\
*************** ie. the number of previous commands to k
*** 1436,1447 ****
    set_cmd_completer (c, filename_completer);
    deprecated_add_show_from_set (c, &showhistlist);
  
!   deprecated_add_show_from_set
!     (add_set_cmd ("confirm", class_support, var_boolean,
! 		  (char *) &caution,
! 		  "Set whether to confirm potentially dangerous operations.",
! 		  &setlist),
!      &showlist);
  
    c = add_set_cmd ("annotate", class_obscure, var_zinteger,
  		   (char *) &annotation_level, "Set annotation_level.\n\
--- 1459,1472 ----
    set_cmd_completer (c, filename_completer);
    deprecated_add_show_from_set (c, &showhistlist);
  
!   deprecated_add_show_from_set (add_set_cmd ("confirm", 
! 					     class_support, 
! 					     var_boolean,
! 					     (char *) &caution,
! 					     "\
! Set whether to confirm potentially dangerous operations.",
! 					     &setlist),
! 				&showlist);
  
    c = add_set_cmd ("annotate", class_obscure, var_zinteger,
  		   (char *) &annotation_level, "Set annotation_level.\n\
*************** ie. the number of previous commands to k
*** 1451,1461 ****
    deprecated_add_show_from_set (c, &showlist);
    set_cmd_sfunc (c, set_async_annotation_level);
  
!   deprecated_add_show_from_set
!     (add_set_cmd ("exec-done-display", class_support, var_boolean, (char *) &exec_done_display_p,
! 		  "Set notification of completion for asynchronous execution commands.\n\
! Use \"on\" to enable the notification, and \"off\" to disable it.", &setlist),
!      &showlist);
  }
  
  void
--- 1476,1490 ----
    deprecated_add_show_from_set (c, &showlist);
    set_cmd_sfunc (c, set_async_annotation_level);
  
!   deprecated_add_show_from_set (add_set_cmd ("exec-done-display", 
! 					     class_support, 
! 					     var_boolean, 
! 					     (char *) &exec_done_display_p,
! 					     "\
! Set notification of completion for asynchronous execution commands.\n\
! Use \"on\" to enable the notification, and \"off\" to disable it.", 
! 					     &setlist),
! 				&showlist);
  }
  
  void
*************** gdb_init (char *argv0)
*** 1464,1495 ****
    if (pre_init_ui_hook)
      pre_init_ui_hook ();
  
!   /* Run the init function of each source file */
  
    getcwd (gdb_dirbuf, sizeof (gdb_dirbuf));
    current_directory = gdb_dirbuf;
  
  #ifdef __MSDOS__
!   /* Make sure we return to the original directory upon exit, come
!      what may, since the OS doesn't do that for us.  */
    make_final_cleanup (do_chdir_cleanup, xstrdup (current_directory));
  #endif
  
!   init_cmd_lists ();		/* This needs to be done first */
    initialize_targets ();	/* Setup target_terminal macros for utils.c */
!   initialize_utils ();		/* Make errors and warnings possible */
    initialize_all_files ();
    initialize_current_architecture ();
    init_cli_cmds();
!   init_main ();			/* But that omits this file!  Do it now */
  
    async_init_signals ();
  
!   /* We need a default language for parsing expressions, so simple things like
!      "set width 0" won't fail if no language is explicitly set in a config file
!      or implicitly set by reading an executable during startup. */
    set_language (language_c);
!   expected_language = current_language;		/* don't warn about the change.  */
  
    /* Allow another UI to initialize. If the UI fails to initialize,
       and it wants GDB to revert to the CLI, it should clear
--- 1493,1525 ----
    if (pre_init_ui_hook)
      pre_init_ui_hook ();
  
!   /* Run the init function of each source file.  */
  
    getcwd (gdb_dirbuf, sizeof (gdb_dirbuf));
    current_directory = gdb_dirbuf;
  
  #ifdef __MSDOS__
!   /* Make sure we return to the original directory upon exit,
!      come what may, since the OS doesn't do that for us.  */
    make_final_cleanup (do_chdir_cleanup, xstrdup (current_directory));
  #endif
  
!   init_cmd_lists ();		/* This needs to be done first.  */
    initialize_targets ();	/* Setup target_terminal macros for utils.c */
!   initialize_utils ();		/* Make errors and warnings possible.  */
    initialize_all_files ();
    initialize_current_architecture ();
    init_cli_cmds();
!   init_main ();			/* But that omits this file!  Do it now.  */
  
    async_init_signals ();
  
!   /* We need a default language for parsing expressions, so simple
!      things like "set width 0" won't fail if no language is explicitly
!      set in a config file or implicitly set by reading an executable
!      during startup.  */
    set_language (language_c);
!   expected_language = current_language;	/* Don't warn about the change.  */
  
    /* Allow another UI to initialize. If the UI fails to initialize,
       and it wants GDB to revert to the CLI, it should clear

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