diff -urp --ignore-space-change gdb-6.3/gdb/main.c gdb-6.3.main/gdb/main.c --- gdb-6.3/gdb/main.c 2004-08-10 17:36:39 -0500 +++ gdb-6.3.main/gdb/main.c 2005-10-30 07:03:13 -0600 @@ -108,6 +108,7 @@ captured_command_loop (void *data) static int captured_main (void *data) { + fprintf(stderr, "captured_main: start\n"); struct captured_main_args *context = data; int argc = context->argc; char **argv = context->argv; @@ -148,6 +149,8 @@ captured_main (void *data) long time_at_startup = get_run_time (); + fprintf(stderr, "captured_main: after variables\n"); + #if defined (HAVE_SETLOCALE) && defined (HAVE_LC_MESSAGES) setlocale (LC_MESSAGES, ""); #endif @@ -157,6 +160,8 @@ captured_main (void *data) bindtextdomain (PACKAGE, LOCALEDIR); textdomain (PACKAGE); + fprintf(stderr, "captured_main: after i18n\n"); + #ifdef HAVE_SBRK lim_at_start = (char *) sbrk (0); #endif @@ -190,8 +195,11 @@ captured_main (void *data) gdb_stdtargerr = gdb_stderr; /* for moment */ gdb_stdtargin = gdb_stdin; /* for moment */ + fprintf(stderr, "captured_main: after variables 2\n"); + /* initialize error() */ error_init (); + fprintf(stderr, "captured_main: after error_init()\n"); /* Set the sysroot path. */ #ifdef TARGET_SYSTEM_ROOT_RELOCATABLE @@ -220,6 +228,7 @@ captured_main (void *data) gdb_sysroot = ""; #endif #endif + fprintf(stderr, "captured_main: after setting sysroot path\n"); /* There will always be an interpreter. Either the one passed into this captured main, or one specified by the user at start up, or @@ -514,10 +523,12 @@ extern int gdbtk_test (char *); if (batch) quiet = 1; } + fprintf(stderr, "captured_main: after argument parsing\n"); /* Initialize all files. Give the interpreter a chance to take control of the console via the deprecated_init_ui_hook(). */ gdb_init (argv[0]); + fprintf(stderr, "captured_main: after gdb_init()\n"); /* Do these (and anything which might call wrap_here or *_filtered) after initialize_all_files() but before the interpreter has been @@ -554,6 +565,7 @@ extern int gdbtk_test (char *); gdb_flush (gdb_stdout); /* Force to screen during slow operations */ } + fprintf(stderr, "captured_main: after printing general information\n"); /* Install the default UI. All the interpreters should have had a look at things by now. Initialize the default interpreter. */ @@ -594,6 +606,8 @@ extern int gdbtk_test (char *); /* We may get more than one warning, don't double space all of them... */ warning_pre_print = _("\nwarning: "); + fprintf(stderr, "captured_main: after getting interpreter\n"); + /* Read and execute $HOME/.gdbinit file, if it exists. This is done *before* all the command line arguments are processed; it sets global parameters, which are independent of what file you are @@ -624,6 +638,7 @@ extern int gdbtk_test (char *); stat (gdbinit, &cwdbuf); /* We'll only need this if homedir was set. */ } + fprintf(stderr, "captured_main: after reading $HOME/.gdbinit\n"); /* Now perform all the actions indicated by the arguments. */ if (cdarg != NULL) @@ -683,6 +698,8 @@ extern int gdbtk_test (char *); if (ttyarg != NULL) catch_command_errors (tty_command, ttyarg, !batch, RETURN_MASK_ALL); + fprintf(stderr, "captured_main: after performing command-line actions\n"); + /* Error messages should no longer be distinguished with extra output. */ error_pre_print = NULL; quit_pre_print = NULL; @@ -721,6 +738,8 @@ extern int gdbtk_test (char *); } xfree (cmdarg); + fprintf(stderr, "captured_main: after cleaning arguments\n"); + /* Read in the old history after all the command files have been read. */ init_history (); @@ -740,6 +759,9 @@ extern int gdbtk_test (char *); /* Do any host- or target-specific hacks. This is used for i960 targets to force the user to set a nindy target and spec its parameters. */ + fprintf(stderr, "captured_main: after history init\n"); + fprintf(stderr, "captured_main: BEFORE_MAIN_LOOP_HOOK\n"); + #ifdef BEFORE_MAIN_LOOP_HOOK BEFORE_MAIN_LOOP_HOOK; #endif @@ -765,6 +787,8 @@ extern int gdbtk_test (char *); #endif } + fprintf(stderr, "captured_main: after showing time and space\n"); + #if 0 /* FIXME: cagney/1999-11-06: The original main loop was like: */ while (1) @@ -796,6 +820,8 @@ extern int gdbtk_test (char *); moving this loop and the code found in captured_command_loop() into the command_loop() proper. The main thing holding back that change - SET_TOP_LEVEL() - has been eliminated. */ + + fprintf(stderr, "captured_main: before main loop\n"); while (1) { catch_errors (captured_command_loop, 0, "", RETURN_MASK_ALL); diff -urp --ignore-space-change gdb-6.3/gdb/top.c gdb-6.3.main/gdb/top.c --- gdb-6.3/gdb/top.c 2004-10-14 07:44:23 -0500 +++ gdb-6.3.main/gdb/top.c 2005-10-30 09:06:41 -0600 @@ -1745,13 +1745,16 @@ Use \"on\" to enable the notification, a void gdb_init (char *argv0) { + fprintf(stderr, "gdb_init: start\n"); if (pre_init_ui_hook) pre_init_ui_hook (); + fprintf(stderr, "gdb_init: after pre_init_ui_hook()\n"); /* Run the init function of each source file */ getcwd (gdb_dirbuf, sizeof (gdb_dirbuf)); current_directory = gdb_dirbuf; + fprintf(stderr, "gdb_init: after getting current directory\n"); #ifdef __MSDOS__ /* Make sure we return to the original directory upon exit, come @@ -1760,24 +1763,34 @@ gdb_init (char *argv0) #endif init_cmd_lists (); /* This needs to be done first */ + fprintf(stderr, "gdb_init: after init_cmd_lists()\n"); initialize_targets (); /* Setup target_terminal macros for utils.c */ + fprintf(stderr, "gdb_init: after initialize_targets()\n"); initialize_utils (); /* Make errors and warnings possible */ + fprintf(stderr, "gdb_init: after initialize_utils()\n"); initialize_all_files (); + fprintf(stderr, "gdb_init: after initialize_all_files()\n"); initialize_current_architecture (); + fprintf(stderr, "gdb_init: after initialize_current_architecture()\n"); init_cli_cmds(); + fprintf(stderr, "gdb_init: after init_cli_cmds()\n"); init_main (); /* But that omits this file! Do it now */ + fprintf(stderr, "gdb_init: after init_main()\n"); async_init_signals (); + fprintf(stderr, "gdb_init: after async_init_signals()\n"); /* 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. */ + fprintf(stderr, "gdb_init: after setting fallback language\n"); /* Allow another UI to initialize. If the UI fails to initialize, and it wants GDB to revert to the CLI, it should clear deprecated_init_ui_hook. */ if (deprecated_init_ui_hook) deprecated_init_ui_hook (argv0); + fprintf(stderr, "gdb_init: after deprecated_init_ui_hook()\n"); } diff -urp --ignore-space-change gdb-6.3/gdb/utils.c gdb-6.3.main/gdb/utils.c --- gdb-6.3/gdb/utils.c 2004-09-30 14:57:54 -0500 +++ gdb-6.3.main/gdb/utils.c 2005-10-30 10:48:43 -0600 @@ -1649,25 +1649,32 @@ static int wrap_column; void init_page_info (void) { + fprintf(stderr, "init_page_info: start\n"); #if defined(TUI) if (!tui_get_command_dimension (&chars_per_line, &lines_per_page)) #endif { + fprintf(stderr, "init_page_info: inside block\n"); int rows, cols; #if defined(__GO32__) + fprintf(stderr, "init_page_info: before __GO32__ code\n"); rows = ScreenRows (); cols = ScreenCols (); lines_per_page = rows; chars_per_line = cols; + fprintf(stderr, "init_page_info: after __GO32__ code\n"); #else + fprintf(stderr, "init_page_info: before readline code\n"); /* Make sure Readline has initialized its terminal settings. */ rl_reset_terminal (NULL); + fprintf(stderr, "init_page_info: after rl_reset_terminal()\n"); /* Get the screen size from Readline. */ rl_get_screen_size (&rows, &cols); lines_per_page = rows; chars_per_line = cols; + fprintf(stderr, "init_page_info: after rl_get_screen_size()\n"); /* Readline should have fetched the termcap entry for us. */ if (tgetnum ("li") < 0 || getenv ("EMACS")) @@ -1677,20 +1684,26 @@ init_page_info (void) not useful (e.g. emacs shell window), so disable paging. */ lines_per_page = UINT_MAX; } + fprintf(stderr, "init_page_info: after bad terminfo correction\n"); /* FIXME: Get rid of this junk. */ #if defined(SIGWINCH) && defined(SIGWINCH_HANDLER) SIGWINCH_HANDLER (SIGWINCH); + fprintf(stderr, "init_page_info: after SIGWINCH_HANDLER\n"); #endif /* If the output is not a terminal, don't paginate it. */ if (!ui_file_isatty (gdb_stdout)) lines_per_page = UINT_MAX; + fprintf(stderr, "init_page_info: after unpagination if not a tty\n"); #endif } + fprintf(stderr, "init_page_info: outside block\n"); set_screen_size (); + fprintf(stderr, "init_page_info: after set_screen_size()\n"); set_width (); + fprintf(stderr, "init_page_info: after set_width()\n"); } /* Set the screen size based on LINES_PER_PAGE and CHARS_PER_LINE. */ @@ -2531,6 +2544,7 @@ pagination_off_command (char *arg, int f void initialize_utils (void) { + fprintf(stderr, "initialize_utils: start\n"); struct cmd_list_element *c; c = add_set_cmd ("width", class_support, var_uinteger, &chars_per_line, @@ -2538,24 +2552,29 @@ initialize_utils (void) &setlist); deprecated_add_show_from_set (c, &showlist); set_cmd_sfunc (c, set_width_command); + fprintf(stderr, "initialize_utils: after setting width\n"); c = add_set_cmd ("height", class_support, var_uinteger, &lines_per_page, "Set number of lines gdb thinks are in a page.", &setlist); deprecated_add_show_from_set (c, &showlist); set_cmd_sfunc (c, set_height_command); + fprintf(stderr, "initialize_utils: after setting height\n"); init_page_info (); + fprintf(stderr, "initialize_utils: after init_page_info()\n"); deprecated_add_show_from_set (add_set_cmd ("demangle", class_support, var_boolean, (char *) &demangle, "Set demangling of encoded C++/ObjC names when displaying symbols.", &setprintlist), &showprintlist); + fprintf(stderr, "initialize_utils: after setting demangle\n"); deprecated_add_show_from_set (add_set_cmd ("pagination", class_support, var_boolean, (char *) &pagination_enabled, "Set state of pagination.", &setlist), &showlist); + fprintf(stderr, "initialize_utils: after setting pagination\n"); if (xdb_commands) { @@ -2564,18 +2583,21 @@ initialize_utils (void) add_com ("sm", class_support, pagination_off_command, "Disable pagination"); } + fprintf(stderr, "initialize_utils: after if (xdb_commands)\n"); deprecated_add_show_from_set (add_set_cmd ("sevenbit-strings", class_support, var_boolean, (char *) &sevenbit_strings, "Set printing of 8-bit characters in strings as \\nnn.", &setprintlist), &showprintlist); + fprintf(stderr, "initialize_utils: after setting sevenbit-strings\n"); deprecated_add_show_from_set (add_set_cmd ("asm-demangle", class_support, var_boolean, (char *) &asm_demangle, "Set demangling of C++/ObjC names in disassembly listings.", &setprintlist), &showprintlist); + fprintf(stderr, "initialize_utils: after setting asm-demangle\n"); } /* Machine specific function to handle SIGWINCH signal. */