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. */ |