Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 108496
Collapse All | Expand All

(-)gdb-6.3/gdb/main.c (+26 lines)
Lines 108-113 captured_command_loop (void *data) Link Here
108
static int
108
static int
109
captured_main (void *data)
109
captured_main (void *data)
110
{
110
{
111
  fprintf(stderr, "captured_main: start\n");
111
  struct captured_main_args *context = data;
112
  struct captured_main_args *context = data;
112
  int argc = context->argc;
113
  int argc = context->argc;
113
  char **argv = context->argv;
114
  char **argv = context->argv;
Lines 148-153 captured_main (void *data) Link Here
148
149
149
  long time_at_startup = get_run_time ();
150
  long time_at_startup = get_run_time ();
150
151
152
  fprintf(stderr, "captured_main: after variables\n");
153
151
#if defined (HAVE_SETLOCALE) && defined (HAVE_LC_MESSAGES)
154
#if defined (HAVE_SETLOCALE) && defined (HAVE_LC_MESSAGES)
152
  setlocale (LC_MESSAGES, "");
155
  setlocale (LC_MESSAGES, "");
153
#endif
156
#endif
Lines 157-162 captured_main (void *data) Link Here
157
  bindtextdomain (PACKAGE, LOCALEDIR);
160
  bindtextdomain (PACKAGE, LOCALEDIR);
158
  textdomain (PACKAGE);
161
  textdomain (PACKAGE);
159
162
163
  fprintf(stderr, "captured_main: after i18n\n");
164
160
#ifdef HAVE_SBRK
165
#ifdef HAVE_SBRK
161
  lim_at_start = (char *) sbrk (0);
166
  lim_at_start = (char *) sbrk (0);
162
#endif
167
#endif
Lines 190-197 captured_main (void *data) Link Here
190
  gdb_stdtargerr = gdb_stderr;	/* for moment */
195
  gdb_stdtargerr = gdb_stderr;	/* for moment */
191
  gdb_stdtargin = gdb_stdin;	/* for moment */
196
  gdb_stdtargin = gdb_stdin;	/* for moment */
192
197
198
  fprintf(stderr, "captured_main: after variables 2\n");
199
193
  /* initialize error() */
200
  /* initialize error() */
194
  error_init ();
201
  error_init ();
202
  fprintf(stderr, "captured_main: after error_init()\n");
195
203
196
  /* Set the sysroot path.  */
204
  /* Set the sysroot path.  */
197
#ifdef TARGET_SYSTEM_ROOT_RELOCATABLE
205
#ifdef TARGET_SYSTEM_ROOT_RELOCATABLE
Lines 220-225 captured_main (void *data) Link Here
220
  gdb_sysroot = "";
228
  gdb_sysroot = "";
221
#endif
229
#endif
222
#endif
230
#endif
231
  fprintf(stderr, "captured_main: after setting sysroot path\n");
223
232
224
  /* There will always be an interpreter.  Either the one passed into
233
  /* There will always be an interpreter.  Either the one passed into
225
     this captured main, or one specified by the user at start up, or
234
     this captured main, or one specified by the user at start up, or
Lines 514-523 extern int gdbtk_test (char *); Link Here
514
    if (batch)
523
    if (batch)
515
      quiet = 1;
524
      quiet = 1;
516
  }
525
  }
526
  fprintf(stderr, "captured_main: after argument parsing\n");
517
527
518
  /* Initialize all files.  Give the interpreter a chance to take
528
  /* Initialize all files.  Give the interpreter a chance to take
519
     control of the console via the deprecated_init_ui_hook().  */
529
     control of the console via the deprecated_init_ui_hook().  */
520
  gdb_init (argv[0]);
530
  gdb_init (argv[0]);
531
  fprintf(stderr, "captured_main: after gdb_init()\n");
521
532
522
  /* Do these (and anything which might call wrap_here or *_filtered)
533
  /* Do these (and anything which might call wrap_here or *_filtered)
523
     after initialize_all_files() but before the interpreter has been
534
     after initialize_all_files() but before the interpreter has been
Lines 554-559 extern int gdbtk_test (char *); Link Here
554
      gdb_flush (gdb_stdout);	/* Force to screen during slow operations */
565
      gdb_flush (gdb_stdout);	/* Force to screen during slow operations */
555
    }
566
    }
556
567
568
  fprintf(stderr, "captured_main: after printing general information\n");
557
569
558
  /* Install the default UI.  All the interpreters should have had a
570
  /* Install the default UI.  All the interpreters should have had a
559
     look at things by now.  Initialize the default interpreter. */
571
     look at things by now.  Initialize the default interpreter. */
Lines 594-599 extern int gdbtk_test (char *); Link Here
594
  /* We may get more than one warning, don't double space all of them... */
606
  /* We may get more than one warning, don't double space all of them... */
595
  warning_pre_print = _("\nwarning: ");
607
  warning_pre_print = _("\nwarning: ");
596
608
609
  fprintf(stderr, "captured_main: after getting interpreter\n");
610
597
  /* Read and execute $HOME/.gdbinit file, if it exists.  This is done
611
  /* Read and execute $HOME/.gdbinit file, if it exists.  This is done
598
     *before* all the command line arguments are processed; it sets
612
     *before* all the command line arguments are processed; it sets
599
     global parameters, which are independent of what file you are
613
     global parameters, which are independent of what file you are
Lines 624-629 extern int gdbtk_test (char *); Link Here
624
      stat (gdbinit, &cwdbuf);	/* We'll only need this if
638
      stat (gdbinit, &cwdbuf);	/* We'll only need this if
625
				   homedir was set.  */
639
				   homedir was set.  */
626
    }
640
    }
641
  fprintf(stderr, "captured_main: after reading $HOME/.gdbinit\n");
627
642
628
  /* Now perform all the actions indicated by the arguments.  */
643
  /* Now perform all the actions indicated by the arguments.  */
629
  if (cdarg != NULL)
644
  if (cdarg != NULL)
Lines 683-688 extern int gdbtk_test (char *); Link Here
683
  if (ttyarg != NULL)
698
  if (ttyarg != NULL)
684
    catch_command_errors (tty_command, ttyarg, !batch, RETURN_MASK_ALL);
699
    catch_command_errors (tty_command, ttyarg, !batch, RETURN_MASK_ALL);
685
700
701
  fprintf(stderr, "captured_main: after performing command-line actions\n");
702
686
  /* Error messages should no longer be distinguished with extra output. */
703
  /* Error messages should no longer be distinguished with extra output. */
687
  error_pre_print = NULL;
704
  error_pre_print = NULL;
688
  quit_pre_print = NULL;
705
  quit_pre_print = NULL;
Lines 721-726 extern int gdbtk_test (char *); Link Here
721
    }
738
    }
722
  xfree (cmdarg);
739
  xfree (cmdarg);
723
740
741
  fprintf(stderr, "captured_main: after cleaning arguments\n");
742
724
  /* Read in the old history after all the command files have been read. */
743
  /* Read in the old history after all the command files have been read. */
725
  init_history ();
744
  init_history ();
726
745
Lines 740-745 extern int gdbtk_test (char *); Link Here
740
  /* Do any host- or target-specific hacks.  This is used for i960 targets
759
  /* Do any host- or target-specific hacks.  This is used for i960 targets
741
     to force the user to set a nindy target and spec its parameters.  */
760
     to force the user to set a nindy target and spec its parameters.  */
742
761
762
  fprintf(stderr, "captured_main: after history init\n");
763
  fprintf(stderr, "captured_main: BEFORE_MAIN_LOOP_HOOK\n");
764
743
#ifdef BEFORE_MAIN_LOOP_HOOK
765
#ifdef BEFORE_MAIN_LOOP_HOOK
744
  BEFORE_MAIN_LOOP_HOOK;
766
  BEFORE_MAIN_LOOP_HOOK;
745
#endif
767
#endif
Lines 765-770 extern int gdbtk_test (char *); Link Here
765
#endif
787
#endif
766
    }
788
    }
767
789
790
  fprintf(stderr, "captured_main: after showing time and space\n");
791
768
#if 0
792
#if 0
769
  /* FIXME: cagney/1999-11-06: The original main loop was like: */
793
  /* FIXME: cagney/1999-11-06: The original main loop was like: */
770
  while (1)
794
  while (1)
Lines 796-801 extern int gdbtk_test (char *); Link Here
796
     moving this loop and the code found in captured_command_loop()
820
     moving this loop and the code found in captured_command_loop()
797
     into the command_loop() proper.  The main thing holding back that
821
     into the command_loop() proper.  The main thing holding back that
798
     change - SET_TOP_LEVEL() - has been eliminated. */
822
     change - SET_TOP_LEVEL() - has been eliminated. */
823
824
  fprintf(stderr, "captured_main: before main loop\n");
799
  while (1)
825
  while (1)
800
    {
826
    {
801
      catch_errors (captured_command_loop, 0, "", RETURN_MASK_ALL);
827
      catch_errors (captured_command_loop, 0, "", RETURN_MASK_ALL);
(-)gdb-6.3/gdb/top.c (+13 lines)
Lines 1745-1757 Use \"on\" to enable the notification, a Link Here
1745
void
1745
void
1746
gdb_init (char *argv0)
1746
gdb_init (char *argv0)
1747
{
1747
{
1748
  fprintf(stderr, "gdb_init: start\n");
1748
  if (pre_init_ui_hook)
1749
  if (pre_init_ui_hook)
1749
    pre_init_ui_hook ();
1750
    pre_init_ui_hook ();
1751
  fprintf(stderr, "gdb_init: after pre_init_ui_hook()\n");
1750
1752
1751
  /* Run the init function of each source file */
1753
  /* Run the init function of each source file */
1752
1754
1753
  getcwd (gdb_dirbuf, sizeof (gdb_dirbuf));
1755
  getcwd (gdb_dirbuf, sizeof (gdb_dirbuf));
1754
  current_directory = gdb_dirbuf;
1756
  current_directory = gdb_dirbuf;
1757
  fprintf(stderr, "gdb_init: after getting current directory\n");
1755
1758
1756
#ifdef __MSDOS__
1759
#ifdef __MSDOS__
1757
  /* Make sure we return to the original directory upon exit, come
1760
  /* Make sure we return to the original directory upon exit, come
Lines 1760-1783 gdb_init (char *argv0) Link Here
1760
#endif
1763
#endif
1761
1764
1762
  init_cmd_lists ();		/* This needs to be done first */
1765
  init_cmd_lists ();		/* This needs to be done first */
1766
  fprintf(stderr, "gdb_init: after init_cmd_lists()\n");
1763
  initialize_targets ();	/* Setup target_terminal macros for utils.c */
1767
  initialize_targets ();	/* Setup target_terminal macros for utils.c */
1768
  fprintf(stderr, "gdb_init: after initialize_targets()\n");
1764
  initialize_utils ();		/* Make errors and warnings possible */
1769
  initialize_utils ();		/* Make errors and warnings possible */
1770
  fprintf(stderr, "gdb_init: after initialize_utils()\n");
1765
  initialize_all_files ();
1771
  initialize_all_files ();
1772
  fprintf(stderr, "gdb_init: after initialize_all_files()\n");
1766
  initialize_current_architecture ();
1773
  initialize_current_architecture ();
1774
  fprintf(stderr, "gdb_init: after initialize_current_architecture()\n");
1767
  init_cli_cmds();
1775
  init_cli_cmds();
1776
  fprintf(stderr, "gdb_init: after init_cli_cmds()\n");
1768
  init_main ();			/* But that omits this file!  Do it now */
1777
  init_main ();			/* But that omits this file!  Do it now */
1778
  fprintf(stderr, "gdb_init: after init_main()\n");
1769
1779
1770
  async_init_signals ();
1780
  async_init_signals ();
1781
  fprintf(stderr, "gdb_init: after async_init_signals()\n");
1771
1782
1772
  /* We need a default language for parsing expressions, so simple things like
1783
  /* We need a default language for parsing expressions, so simple things like
1773
     "set width 0" won't fail if no language is explicitly set in a config file
1784
     "set width 0" won't fail if no language is explicitly set in a config file
1774
     or implicitly set by reading an executable during startup. */
1785
     or implicitly set by reading an executable during startup. */
1775
  set_language (language_c);
1786
  set_language (language_c);
1776
  expected_language = current_language;		/* don't warn about the change.  */
1787
  expected_language = current_language;		/* don't warn about the change.  */
1788
  fprintf(stderr, "gdb_init: after setting fallback language\n");
1777
1789
1778
  /* Allow another UI to initialize. If the UI fails to initialize,
1790
  /* Allow another UI to initialize. If the UI fails to initialize,
1779
     and it wants GDB to revert to the CLI, it should clear
1791
     and it wants GDB to revert to the CLI, it should clear
1780
     deprecated_init_ui_hook.  */
1792
     deprecated_init_ui_hook.  */
1781
  if (deprecated_init_ui_hook)
1793
  if (deprecated_init_ui_hook)
1782
    deprecated_init_ui_hook (argv0);
1794
    deprecated_init_ui_hook (argv0);
1795
  fprintf(stderr, "gdb_init: after deprecated_init_ui_hook()\n");
1783
}
1796
}
(-)gdb-6.3/gdb/utils.c (+22 lines)
Lines 1649-1673 static int wrap_column; Link Here
1649
void
1649
void
1650
init_page_info (void)
1650
init_page_info (void)
1651
{
1651
{
1652
  fprintf(stderr, "init_page_info: start\n");
1652
#if defined(TUI)
1653
#if defined(TUI)
1653
  if (!tui_get_command_dimension (&chars_per_line, &lines_per_page))
1654
  if (!tui_get_command_dimension (&chars_per_line, &lines_per_page))
1654
#endif
1655
#endif
1655
    {
1656
    {
1657
      fprintf(stderr, "init_page_info: inside block\n");
1656
      int rows, cols;
1658
      int rows, cols;
1657
1659
1658
#if defined(__GO32__)
1660
#if defined(__GO32__)
1661
      fprintf(stderr, "init_page_info: before __GO32__ code\n");
1659
      rows = ScreenRows ();
1662
      rows = ScreenRows ();
1660
      cols = ScreenCols ();
1663
      cols = ScreenCols ();
1661
      lines_per_page = rows;
1664
      lines_per_page = rows;
1662
      chars_per_line = cols;
1665
      chars_per_line = cols;
1666
      fprintf(stderr, "init_page_info: after __GO32__ code\n");
1663
#else
1667
#else
1668
      fprintf(stderr, "init_page_info: before readline code\n");
1664
      /* Make sure Readline has initialized its terminal settings.  */
1669
      /* Make sure Readline has initialized its terminal settings.  */
1665
      rl_reset_terminal (NULL);
1670
      rl_reset_terminal (NULL);
1671
      fprintf(stderr, "init_page_info: after rl_reset_terminal()\n");
1666
1672
1667
      /* Get the screen size from Readline.  */
1673
      /* Get the screen size from Readline.  */
1668
      rl_get_screen_size (&rows, &cols);
1674
      rl_get_screen_size (&rows, &cols);
1669
      lines_per_page = rows;
1675
      lines_per_page = rows;
1670
      chars_per_line = cols;
1676
      chars_per_line = cols;
1677
      fprintf(stderr, "init_page_info: after rl_get_screen_size()\n");
1671
1678
1672
      /* Readline should have fetched the termcap entry for us.  */
1679
      /* Readline should have fetched the termcap entry for us.  */
1673
      if (tgetnum ("li") < 0 || getenv ("EMACS"))
1680
      if (tgetnum ("li") < 0 || getenv ("EMACS"))
Lines 1677-1696 init_page_info (void) Link Here
1677
	     not useful (e.g. emacs shell window), so disable paging.  */
1684
	     not useful (e.g. emacs shell window), so disable paging.  */
1678
	  lines_per_page = UINT_MAX;
1685
	  lines_per_page = UINT_MAX;
1679
	}
1686
	}
1687
      fprintf(stderr, "init_page_info: after bad terminfo correction\n");
1680
1688
1681
      /* FIXME: Get rid of this junk.  */
1689
      /* FIXME: Get rid of this junk.  */
1682
#if defined(SIGWINCH) && defined(SIGWINCH_HANDLER)
1690
#if defined(SIGWINCH) && defined(SIGWINCH_HANDLER)
1683
      SIGWINCH_HANDLER (SIGWINCH);
1691
      SIGWINCH_HANDLER (SIGWINCH);
1692
      fprintf(stderr, "init_page_info: after SIGWINCH_HANDLER\n");
1684
#endif
1693
#endif
1685
1694
1686
      /* If the output is not a terminal, don't paginate it.  */
1695
      /* If the output is not a terminal, don't paginate it.  */
1687
      if (!ui_file_isatty (gdb_stdout))
1696
      if (!ui_file_isatty (gdb_stdout))
1688
	lines_per_page = UINT_MAX;
1697
	lines_per_page = UINT_MAX;
1698
      fprintf(stderr, "init_page_info: after unpagination if not a tty\n");
1689
#endif
1699
#endif
1690
    }
1700
    }
1691
1701
1702
  fprintf(stderr, "init_page_info: outside block\n");
1692
  set_screen_size ();
1703
  set_screen_size ();
1704
  fprintf(stderr, "init_page_info: after set_screen_size()\n");
1693
  set_width ();
1705
  set_width ();
1706
  fprintf(stderr, "init_page_info: after set_width()\n");
1694
}
1707
}
1695
1708
1696
/* Set the screen size based on LINES_PER_PAGE and CHARS_PER_LINE.  */
1709
/* Set the screen size based on LINES_PER_PAGE and CHARS_PER_LINE.  */
Lines 2531-2536 pagination_off_command (char *arg, int f Link Here
2531
void
2544
void
2532
initialize_utils (void)
2545
initialize_utils (void)
2533
{
2546
{
2547
  fprintf(stderr, "initialize_utils: start\n");
2534
  struct cmd_list_element *c;
2548
  struct cmd_list_element *c;
2535
2549
2536
  c = add_set_cmd ("width", class_support, var_uinteger, &chars_per_line,
2550
  c = add_set_cmd ("width", class_support, var_uinteger, &chars_per_line,
Lines 2538-2561 initialize_utils (void) Link Here
2538
		   &setlist);
2552
		   &setlist);
2539
  deprecated_add_show_from_set (c, &showlist);
2553
  deprecated_add_show_from_set (c, &showlist);
2540
  set_cmd_sfunc (c, set_width_command);
2554
  set_cmd_sfunc (c, set_width_command);
2555
  fprintf(stderr, "initialize_utils: after setting width\n");
2541
2556
2542
  c = add_set_cmd ("height", class_support, var_uinteger, &lines_per_page,
2557
  c = add_set_cmd ("height", class_support, var_uinteger, &lines_per_page,
2543
		   "Set number of lines gdb thinks are in a page.", &setlist);
2558
		   "Set number of lines gdb thinks are in a page.", &setlist);
2544
  deprecated_add_show_from_set (c, &showlist);
2559
  deprecated_add_show_from_set (c, &showlist);
2545
  set_cmd_sfunc (c, set_height_command);
2560
  set_cmd_sfunc (c, set_height_command);
2561
  fprintf(stderr, "initialize_utils: after setting height\n");
2546
2562
2547
  init_page_info ();
2563
  init_page_info ();
2564
  fprintf(stderr, "initialize_utils: after init_page_info()\n");
2548
2565
2549
  deprecated_add_show_from_set
2566
  deprecated_add_show_from_set
2550
    (add_set_cmd ("demangle", class_support, var_boolean,
2567
    (add_set_cmd ("demangle", class_support, var_boolean,
2551
		  (char *) &demangle,
2568
		  (char *) &demangle,
2552
		  "Set demangling of encoded C++/ObjC names when displaying symbols.",
2569
		  "Set demangling of encoded C++/ObjC names when displaying symbols.",
2553
		  &setprintlist), &showprintlist);
2570
		  &setprintlist), &showprintlist);
2571
  fprintf(stderr, "initialize_utils: after setting demangle\n");
2554
2572
2555
  deprecated_add_show_from_set
2573
  deprecated_add_show_from_set
2556
    (add_set_cmd ("pagination", class_support,
2574
    (add_set_cmd ("pagination", class_support,
2557
		  var_boolean, (char *) &pagination_enabled,
2575
		  var_boolean, (char *) &pagination_enabled,
2558
		  "Set state of pagination.", &setlist), &showlist);
2576
		  "Set state of pagination.", &setlist), &showlist);
2577
  fprintf(stderr, "initialize_utils: after setting pagination\n");
2559
2578
2560
  if (xdb_commands)
2579
  if (xdb_commands)
2561
    {
2580
    {
Lines 2564-2581 initialize_utils (void) Link Here
2564
      add_com ("sm", class_support, pagination_off_command,
2583
      add_com ("sm", class_support, pagination_off_command,
2565
	       "Disable pagination");
2584
	       "Disable pagination");
2566
    }
2585
    }
2586
  fprintf(stderr, "initialize_utils: after if (xdb_commands)\n");
2567
2587
2568
  deprecated_add_show_from_set
2588
  deprecated_add_show_from_set
2569
    (add_set_cmd ("sevenbit-strings", class_support, var_boolean,
2589
    (add_set_cmd ("sevenbit-strings", class_support, var_boolean,
2570
		  (char *) &sevenbit_strings,
2590
		  (char *) &sevenbit_strings,
2571
		  "Set printing of 8-bit characters in strings as \\nnn.",
2591
		  "Set printing of 8-bit characters in strings as \\nnn.",
2572
		  &setprintlist), &showprintlist);
2592
		  &setprintlist), &showprintlist);
2593
  fprintf(stderr, "initialize_utils: after setting sevenbit-strings\n");
2573
2594
2574
  deprecated_add_show_from_set
2595
  deprecated_add_show_from_set
2575
    (add_set_cmd ("asm-demangle", class_support, var_boolean,
2596
    (add_set_cmd ("asm-demangle", class_support, var_boolean,
2576
		  (char *) &asm_demangle,
2597
		  (char *) &asm_demangle,
2577
		  "Set demangling of C++/ObjC names in disassembly listings.",
2598
		  "Set demangling of C++/ObjC names in disassembly listings.",
2578
		  &setprintlist), &showprintlist);
2599
		  &setprintlist), &showprintlist);
2600
  fprintf(stderr, "initialize_utils: after setting asm-demangle\n");
2579
}
2601
}
2580
2602
2581
/* Machine specific function to handle SIGWINCH signal. */
2603
/* Machine specific function to handle SIGWINCH signal. */

Return to bug 108496