@@ -147,22 +147,22 @@ int server_command;
147147
148148/* Timeout limit for response from target. */
149149
150- /* The default value has been changed many times over the years. It
151- was originally 5 seconds. But that was thought to be a long time
150+ /* The default value has been changed many times over the years. It
151+ was originally 5 seconds. But that was thought to be a long time
152152 to sit and wait, so it was changed to 2 seconds. That was thought
153- to be plenty unless the connection was going through some terminal
153+ to be plenty unless the connection was going through some terminal
154154 server or multiplexer or other form of hairy serial connection.
155155
156- In mid-1996, remote_timeout was moved from remote.c to top.c and
156+ In mid-1996, remote_timeout was moved from remote.c to top.c and
157157 it began being used in other remote-* targets. It appears that the
158158 default was changed to 20 seconds at that time, perhaps because the
159159 Renesas E7000 ICE didn't always respond in a timely manner.
160160
161161 But if 5 seconds is a long time to sit and wait for retransmissions,
162- 20 seconds is far worse. This demonstrates the difficulty of using
162+ 20 seconds is far worse. This demonstrates the difficulty of using
163163 a single variable for all protocol timeouts.
164164
165- As remote.c is used much more than remote-e7000.c, it was changed
165+ As remote.c is used much more than remote-e7000.c, it was changed
166166 back to 2 seconds in 1999. */
167167
168168int remote_timeout = 2 ;
@@ -188,9 +188,9 @@ int (*deprecated_ui_loop_hook) (int);
188188
189189/* Called from print_frame_info to list the line we stopped in. */
190190
191- void (* deprecated_print_frame_info_listing_hook ) (struct symtab * s ,
191+ void (* deprecated_print_frame_info_listing_hook ) (struct symtab * s ,
192192 int line ,
193- int stopline ,
193+ int stopline ,
194194 int noerror );
195195/* Replaces most of query. */
196196
@@ -237,7 +237,7 @@ ptid_t (*deprecated_target_wait_hook) (ptid_t ptid,
237237/* Used by UI as a wrapper around command execution. May do various
238238 things like enabling/disabling buttons, etc... */
239239
240- void (* deprecated_call_command_hook ) (struct cmd_list_element * c ,
240+ void (* deprecated_call_command_hook ) (struct cmd_list_element * c ,
241241 const char * cmd , int from_tty );
242242
243243/* Called when the current thread changes. Argument is thread id. */
@@ -1339,8 +1339,9 @@ There is NO WARRANTY, to the extent permitted by law.");
13391339resources online at:\n <http://www.gnu.org/software/gdb/documentation/>." ));
13401340 fprintf_filtered (stream , "\n\n" );
13411341 fprintf_filtered (stream , _ ("For help, type \"help\".\n" ));
1342- fprintf_filtered (stream , _ ("Type \"apropos word\" to search for \
1343- commands related to \"word\"." ));
1342+ fprintf_filtered (stream ,
1343+ _ ("Type \"apropos word\" to search for commands \
1344+ related to \"word\"." ));
13441345}
13451346
13461347/* Print the details of GDB build-time configuration. */
@@ -1608,7 +1609,7 @@ quit_force (int *exit_arg, int from_tty)
16081609
16091610 undo_terminal_modifications_before_exit ();
16101611
1611- /* An optional expression may be used to cause gdb to terminate with the
1612+ /* An optional expression may be used to cause gdb to terminate with the
16121613 value of that expression. */
16131614 if (exit_arg )
16141615 exit_code = * exit_arg ;
@@ -2002,6 +2003,17 @@ set_history_filename (const char *args,
20022003 history_filename , (char * ) NULL );
20032004}
20042005
2006+ static void
2007+ init_gdb_version_vars (void )
2008+ {
2009+ struct internalvar * major_version_var = create_internalvar ("_gdb_major" );
2010+ struct internalvar * minor_version_var = create_internalvar ("_gdb_minor" );
2011+ int vmajor = 0 , vminor = 0 , vrevision = 0 ;
2012+ sscanf (version , "%d.%d.%d" , & vmajor , & vminor , & vrevision );
2013+ set_internalvar_integer (major_version_var , vmajor );
2014+ set_internalvar_integer (minor_version_var , vminor + (vrevision > 0 ));
2015+ }
2016+
20052017static void
20062018init_main (void )
20072019{
@@ -2206,4 +2218,7 @@ gdb_init (char *argv0)
22062218 prefix to be installed. Keep things simple and just do final
22072219 script initialization here. */
22082220 finish_ext_lang_initialization ();
2221+
2222+ /* Create $_gdb_major and $_gdb_minor convenience variables. */
2223+ init_gdb_version_vars ();
22092224}
0 commit comments