aboutsummaryrefslogtreecommitdiff
path: root/gdb/tui
AgeCommit message (Collapse)AuthorFilesLines
2020-02-22Add the "tui new-layout" commandTom Tromey2-3/+109
This adds a new command, "tui new-layout". This command can be used to define a new TUI window layout. The command is used like: (gdb) tui new-layout name src 1 regs 1 status 0 cmd 1 The first argument is the name of the layout. In this example, it is "name", so the new layout could be seen by "layout name". Subsequent arguments come in pairs, where the first item in a pair is the name of a window, and the second item in a pair is the window's weight. A weight is just an integer -- a window's allocated size is proportional to the total of the weights given. So, in the above example, all windows will have the same size (the status windows's weight does not matter, because it has fixed height). gdb/ChangeLog 2020-02-22 Tom Tromey <tom@tromey.com> * NEWS: Add "tui new-layout" item. * tui/tui-layout.c (add_layout_command): Return cmd_list_element. Add new-layout command to help text. (validate_window_name): New function. (tui_new_layout_command): New function. (_initialize_tui_layout): Register "new-layout". (tui_layout_window::specification): New method. (tui_layout_window::specification): New method. * tui/tui-layout.h (class tui_layout_base) <specification>: New method. (class tui_layout_window) <specification>: New method. (class tui_layout_split) <specification>: New method. gdb/doc/ChangeLog 2020-02-22 Tom Tromey <tom@tromey.com> * gdb.texinfo (TUI Overview): Mention user layouts. (TUI Commands): Document "tui new-layout". gdb/testsuite/ChangeLog 2020-02-22 Tom Tromey <tom@tromey.com> * gdb.tui/new-layout.exp: New file. Change-Id: Id7c3ace20ab1e8924f8f4ad788f40210f58a5c05
2020-02-22Remove hard-coded TUI layoutsTom Tromey5-292/+234
This changes the TUI so that the available layouts are no longer completely hard-coded. "enum tui_layout_type" is removed, and then all the fallout from this is fixed up. This patch also reimplements the "layout" command to be a prefix command. The concrete layouts are simply sub-commands now. This provides completion and correct abbreviation behavior for free. Finally, this also changes the name of the locator window to "status". This matches the documentation and will be exposed to the user in a subsequent patch. gdb/ChangeLog 2020-02-22 Tom Tromey <tom@tromey.com> * tui/tui.c (tui_enable): Call tui_set_initial_layout. * tui/tui-win.c (window_name_completer): Update comment. * tui/tui-layout.h (class tui_layout_base) <replace_window>: Declare method. (class tui_layout_window) <replace_window>: Likewise. (class tui_layout_split) <replace_window>: Likewise. (tui_set_layout): Don't declare. (tui_set_initial_layout): Declare function. * tui/tui-layout.c (layouts, applied_skeleton, src_regs_layout) (asm_regs_layout): New globals. (tui_current_layout, show_layout): Remove. (tui_set_layout, tui_add_win_to_layout): Rewrite. (find_layout, tui_apply_layout): New function. (layout_completer): Remove. (tui_next_layout): Reimplement. (tui_next_layout_command): New function. (tui_set_initial_layout, tui_prev_layout_command): New functions. (tui_regs_layout): Reimplement. (tui_regs_layout_command): New function. (extract_display_start_addr): Rewrite. (next_layout, prev_layout): Remove. (tui_layout_window::replace_window): New method. (tui_layout_split::replace_window): New method. (destroy_layout): New function. (layout_list): New global. (add_layout_command): New function. (initialize_layouts): Update. (tui_layout_command): New function. (_initialize_tui_layout): Install "layout" commands. * tui/tui-data.h (enum tui_layout_type): Remove. (tui_current_layout): Don't declare. Change-Id: I9b5f7ab3ce838d6b340b8c373ef649a8e0a74b73
2020-02-22Reimplement "tui reg" commandTom Tromey3-16/+12
This reimplements the low-level layout function that is used by the "tui reg" command. Now it simply calls into the existing "layout" command, though this will be changed again in a subsequent patch. The rationale for this patch is that it makes it simpler to remove "enum tui_layout_type". gdb/ChangeLog 2020-02-22 Tom Tromey <tom@tromey.com> * tui/tui-regs.c (tui_reg_layout): Remove. (tui_reg_command): Use tui_regs_layout. * tui/tui-layout.h (tui_reg_command): Declare. * tui/tui-layout.c (tui_reg_command): New function. Change-Id: I0ca6884e2967005e7d3fbf5f13a0ac8f9c3298cf
2020-02-22Reimplement TUI "C-x 1" bindingTom Tromey3-21/+61
The TUI "C-x 1" key binding removes TUI windows, based on the current layout. With user-defined layouts, this is no longer easy to do. This patch changes "C-x 1" to simply delete windows, leaving just the focus window, the locator, and the command window. gdb/ChangeLog 2020-02-22 Tom Tromey <tom@tromey.com> * tui/tui.c (tui_rl_delete_other_windows): Call tui_remove_some_windows. * tui/tui-layout.h (class tui_layout_base) <remove_windows>: Declare method. (class tui_layout_window) <remove_windows>: New method. (class tui_layout_split) <remove_windows>: Declare. (tui_remove_some_windows): Declare. * tui/tui-layout.c (tui_remove_some_windows): New function. (tui_layout_split::remove_windows): New method. Change-Id: If186f9c3f263913e963b965204481d1b4385c6d4
2020-02-22Simplify TUI C-x 2 bindingTom Tromey3-36/+12
The TUI "C-x 2" binding tries to switch to a different layout based on the current layout. Once user-defined layouts are available, this won't really make sense. I wasn't entirely sure how to handle this. This patch changes the binding to simply cycle through the existing layouts. I considered this a reasonable, though not ideal, compromise. gdb/ChangeLog 2020-02-22 Tom Tromey <tom@tromey.com> * tui/tui.c (tui_rl_change_windows): Call tui_next_layout. * tui/tui-layout.h (tui_next_layout): Declare. * tui/tui-layout.c (tui_next_layout): New function. Change-Id: Ic101f0e3831a4235a048b3090ef60f025f7449bb
2020-02-22Fix latent display bug in tui_data_windowTom Tromey1-1/+1
tui_data_window creates new curses windows, but does not pass in coordinates relative to the data window's origin. This means that the data window could only ever be displayed as the topmost window in a layout. This is not a currently problem, because all the existing layouts do this; but a subsequent patch will add user-defined layouts, which could do otherwise. gdb/ChangeLog 2020-02-22 Tom Tromey <tom@tromey.com> * tui/tui-regs.c (tui_data_window::display_registers_from): Use correct coordinates. Change-Id: I5101f2b2869557b87381ebdeebd9b7fd28687831
2020-02-22Simplify tui_add_win_to_layoutTom Tromey2-15/+9
tui_add_win_to_layout is only ever called for the source or assembly windows. This simplifies the function by removing the DATA_WIN case. gdb/ChangeLog 2020-02-22 Tom Tromey <tom@tromey.com> * tui/tui-layout.h (tui_add_win_to_layout): Add comment. * tui/tui-layout.c (tui_add_win_to_layout): Add assert. Remove DATA_WIN case. Change-Id: Idfca902c6c90153acc5d19af4c33aa74bc3caf31
2020-02-22Use TUI_DISASM_WIN instead of tui_win_list arrayTom Tromey1-2/+2
This is a minor cleanup to change tui_get_low_disassembly_address to use TUI_DISASM_WIN, rather than the tui_win_list array. This is more in line with what the rest of the TUI code does. gdb/ChangeLog 2020-02-22 Tom Tromey <tom@tromey.com> * tui/tui-disasm.c (tui_get_low_disassembly_address): Use TUI_DISASM_WIN, not tui_win_list. Change-Id: I999335ee3f63a4b570e84f320236b78f2bd5b780
2020-02-11Remove some ui_file_* functionsTom Tromey2-2/+2
This removes ui_file_isatty, ui_file_read, ui_file_write, ui_file_write_async_safe, ui_file_flush, and ui_file_puts, replacing them with calls to the appropriate method instead. gdb/ChangeLog 2020-02-11 Tom Tromey <tromey@adacore.com> * remote.c (remote_console_output): Update. * printcmd.c (printf_command): Update. * event-loop.c (gdb_wait_for_event): Update. * linux-nat.c (sigchld_handler): Update. * remote-sim.c (gdb_os_write_stdout): Update. (gdb_os_flush_stdout): Update. (gdb_os_flush_stderr): Update. (gdb_os_write_stderr): Update. * exceptions.c (print_exception): Update. * remote-fileio.c (remote_fileio_func_read): Update. (remote_fileio_func_write): Update. * tui/tui.c (tui_enable): Update. * tui/tui-interp.c (tui_interp::init): Update. * utils.c (init_page_info): Update. (putchar_unfiltered, fputc_unfiltered): Update. (gdb_flush): Update. (emit_style_escape): Update. (flush_wrap_buffer, fputs_maybe_filtered): Update. * ui-file.c (ui_file_isatty, ui_file_read, ui_file_write) (ui_file_write_async_safe, ui_file_flush, ui_file_puts): Remove. (stderr_file::write): Update. (stderr_file::puts): Update. * ui-file.h (ui_file_isatty, ui_file_write) (ui_file_write_async_safe, ui_file_read, ui_file_flush) (ui_file_puts): Don't declare. Change-Id: I3ca9b36e9107f6adbc41e014f5078b41d6bcec4d
2020-02-06gdb: Catch exceptions if the source file is not foundShahab Vahedi1-1/+1
The source_cache::ensure method may throw an exception through the invocation of source_cache::get_plain_source_lines. This happens when the source file is not found. The expected behaviour of "ensure" is only returning "true" or "false" according to the documentation in the header file. So far, if gdb is in source layout and a file is missing, you see some outputs like below: ,---------------------------------------------. | test.c file is loaded in the source window. | | | | int main() | | ... | |---------------------------------------------| | Remote debugging using :1234 | | __start () at /path/to/crt0.S:141 | | /path/to/crt0.S: No such file or directory. | | (gdb) p/x $pc | | $1 = 0x124 | | (gdb) n | | /path/to/crt0.S: No such file or directory. | | (gdb) p/x $pc | | $2 = 0x128 | | (gdb) [pressing arrow-down key] | | (gdb) terminate called after throwing an | | instance of 'gdb_exception_error' | `---------------------------------------------' Other issues have been encountered as well [1]. The patch from Pedro [2] which is about preventing exceptions from crossing the "readline" mitigates the situation by not causing gdb crash, but still there are lots of errors printed: ,---------------------------------------------. | test.c file is loaded in the source window. | | | | int main() | | ... | |---------------------------------------------| | Remote debugging using :1234 | | __start () at /path/to/crt0.S:141 | | /path/to/crt0.S: No such file or directory. | | (gdb) [pressing arrow-down key] | | /path/to/crt0.S: No such file or directory. | | (gdb) [pressing arrow-down key] | | /path/to/crt0.S: No such file or directory. | | (gdb) [pressing arrow-up key] | | /path/to/crt0.S: No such file or directory. | `---------------------------------------------' With the changes of this patch, the behavior is like: ,---------------------------------------------. | initially, source window is empty because | | crt0.S is not found and according to the | | program counter that is the piece of code | | being executed. | | | | later, when we break at main (see commands | | below), this window will be filled with the | | the contents of test.c file. | |---------------------------------------------| | Remote debugging using :1234 | | __start () at /path/to/crt0.S:141 | | (gdb) p/x $pc | | $1 = 0x124 | | (gdb) n | | (gdb) p/x $pc | | $2 = 0x128 | | (gdb) b main | | Breakpoint 1 at 0x334: file test.c, line 8. | | (gdb) cont | | Continuing. | | Breakpoint 1, main () at hello.c:8 | | (gdb) n | | (gdb) | `---------------------------------------------' There is no crash and the error message is completely gone. Maybe it is good practice that the error is shown inside the source window. I tested this change against gdb.base/list-missing-source.exp and there was no regression. [1] It has also been observed in the past that the register values are not transferred from qemu's gdb stub, see: https://github.com/foss-for-synopsys-dwc-arc-processors/toolchain/issues/226 [2] https://sourceware.org/git/?p=binutils-gdb.git;a=commit;h=2f267673f0fdee9287e6d404ecd4f2d29da0d2f2 gdb/ChangeLog: * source-cache.c (source_cache::ensure): Surround get_plain_source_lines with a try/catch. (source_cache::get_line_charpos): Get rid of try/catch and only check for the return value of "ensure". * tui/tui-source.c (tui_source_window::set_contents): Simplify "nlines" calculation. gdb/testsuite/ChangeLog: * gdb.tui/tui-missing-src.exp: Add the "missing source file" test for the TUI.
2020-01-31gdb/tui: Disassembler scrolling of very small programsAndrew Burgess1-1/+1
In TUI mode, if the disassembly output for the program is less than one screen long, then currently if the user scrolls down until on the last assembly instruction is displayed and then tries to scroll up using Page-Up, the display doesn't update - they are stuck viewing the last line. If the user tries to scroll up using the Up-Arrow, then the display scrolls normally. What is happening is on the Page-Up we ask GDB to scroll backward the same number of lines as the height of the TUI ASM window. The back scanner, which looks for a good place to start disassembling, fails to find a starting address which will provide the requested number of new lines before we get back to the original starting address (which is not surprising, our whole program contains less than a screen height of instructions), as a result the back scanner gives up and returns the original starting address. When we scroll with Up-Arrow we only ask the back scanner to find 1 new instruction, which it manages to do, so this scroll works. The solution here is, when we fail to find enough instructions, to return the lowest address we did manage to find. This will ensure we jump to the lowest possible address in the disassembly output. gdb/ChangeLog: PR tui/9765 * tui/tui-disasm.c (tui_find_disassembly_address): If we don't have enough lines to fill the screen, still return the lowest address we found. gdb/testsuite/ChangeLog: PR tui/9765 * gdb.tui/tui-layout-asm-short-prog.S: New file. * gdb.tui/tui-layout-asm-short-prog.exp: New file. Change-Id: I6a6a7972c68a0559e9717fd8d82870b669a40af3
2020-01-31gdb/tui: Update help text for scroll commandsAndrew Burgess1-4/+12
GDB has some commands ('+', '-', '<', and '>') for scrolling the SRC and ASM TUI windows from the CMD window, however the help text for these commands lists the arguments in the wrong order. This commit updates the help text to match how GDB actually works, and also extends the text to describe what the arguments mean, and what the defaults are. There should be no change in GDBs functionality after this commit. gdb/ChangeLog: * tui/tui-win.c (_initialize_tui_win): Update help text for '+', '-', '<', and '>' commands. Change-Id: Ib2624891de1f4ba983838822206304e4c3ed982e
2020-01-24gdb/tui: asm window handles invalid memory and scrolls betterAndrew Burgess1-60/+183
This started as a patch to enable the asm window to handle attempts to disassemble invalid memory, but it ended up expanding into a significant rewrite of how the asm window handles scrolling. These two things ended up being tied together as it was impossible to correctly test scrolling into invalid memory when the asm window would randomly behave weirdly while scrolling. Things that should work nicely now; scrolling to the bottom or top of the listing with PageUp, PageDown, Up Arrow, Down Arrow and we should be able to scroll past small areas of memory that don't have symbols associated with them. It should also be possible to scroll to the start of a section even if there's no symbol at the start of the section. Adding tests for this scrolling was a little bit of a problem. First I would have liked to add tests for PageUp / PageDown, but the tuiterm library we use doesn't support these commands right now due to only emulating a basic ascii terminal. Changing this to emulate a more complex terminal would require adding support for more escape sequence control codes, so I've not tried to tackle that in this patch. Next, I would have liked to test scrolling to the start or end of the assembler listing and then trying to scroll even more, however, this is a problem because in a well behaving GDB a scroll at the start/end has no effect. What we need to do is: - Move to start of assembler listing, - Send scroll up command, - Wait for all curses output, - Ensure the assembler listing is unchanged, we're still at the start of the listing. The problem is that there is no curses output, so how long do we wait at step 3? The same problem exists for scrolling to the bottom of the assembler listing. However, when scrolling down you can at least see the end coming, so I added a test for this case, however, this feels like an area of code that is massively under tested. gdb/ChangeLog: PR tui/9765 * minsyms.c (lookup_minimal_symbol_by_pc_section): Update header comment, add extra parameter, and update to store previous symbol when appropriate. * minsyms.h (lookup_minimal_symbol_by_pc_section): Update comment, add extra parameter. * tui/tui-disasm.c (tui_disassemble): Update header comment, remove unneeded parameter, add try/catch around gdb_print_insn, rewrite to add items to asm_lines vector. (tui_find_backward_disassembly_start_address): New function. (tui_find_disassembly_address): Updated throughout. (tui_disasm_window::set_contents): Update for changes to tui_disassemble. (tui_disasm_window::do_scroll_vertical): No need to adjust the number of lines to scroll. gdb/testsuite/ChangeLog: PR tui/9765 * gdb.tui/tui-layout-asm.exp: Add scrolling test for asm window. Change-Id: I323987c8fd316962c937e73c17d952ccd3cfa66c
2020-01-24gdb/tui: Prevent exceptions from trying to cross readlinePedro Alves1-3/+28
This is triggered by simply scrolling off the end of the dissasembly window. This commit doesn't fix the actual exception that is being thrown, which will still need to be fixed, but makes sure that we don't ever throw an exception out to readline. gdb/ChangeLog: yyyy-mm-dd Pedro Alves <palves@redhat.com> PR tui/9765 * tui/tui-io.c (tui_getc): Rename to ... (tui_getc_1): ... this. (tui_get): New, reimplent as try/catch wrapper around tui_getc_1. Change-Id: I2e32a401ab34404b2132ec82a3e1c17b9b723e41
2020-01-19Remove flickering from the TUITom Tromey8-5/+93
In some cases, the TUI flickers when redrawing. This can be seen mostly easily when switching layouts. This patch fixes the problem by exploiting the double buffering that curses already does. In some spots, the TUI will now disable flushing the curses buffers to the screen; and then flush them all at once when the rendering is complete. gdb/ChangeLog 2020-01-19 Tom Tromey <tom@tromey.com> * tui/tui.c (tui_show_assembly): Use tui_suppress_output. * tui/tui-wingeneral.h (class tui_suppress_output): New. (tui_wrefresh): Declare. * tui/tui-wingeneral.c (suppress_output): New global. (tui_suppress_output, ~tui_suppress_output): New constructor and destructor. (tui_wrefresh): New function. (tui_gen_win_info::refresh_window): Use tui_wrefresh. (tui_gen_win_info::make_window): Call wnoutrefresh when needed. * tui/tui-regs.h (struct tui_data_window) <no_refresh>: Declare method. * tui/tui-regs.c (tui_data_window::erase_data_content): Call tui_wrefresh. (tui_data_window::no_refresh): New method. (tui_data_item_window::refresh_window): Call tui_wrefresh. (tui_reg_command): Use tui_suppress_output * tui/tui-layout.c (tui_set_layout): Use tui_suppress_output. * tui/tui-data.h (struct tui_gen_win_info) <no_refresh>: New method. * tui/tui-command.c (tui_refresh_cmd_win): Call tui_wrefresh. Change-Id: Icb832ae100b861de3af3307488e636fa928d5c9f
2020-01-19Make "file" clear TUI source windowTom Tromey1-5/+6
I noticed that a plain "file" will leave the current source file in the TUI source window. Instead, I think, it should clear the source window. This patch implements this. gdb/ChangeLog 2020-01-19 Tom Tromey <tom@tromey.com> * tui/tui-winsource.c (tui_update_source_windows_with_line): Handle case where symtab is null. gdb/testsuite/ChangeLog 2020-01-19 Tom Tromey <tom@tromey.com> * gdb.tui/main.exp: Add check for plain "file". Change-Id: I8424acf837f1a47f75bc6a833d1e917d4c10b51e
2020-01-13gdb/tui: Place window titles in the center of the borderAndrew Burgess1-2/+2
In tui-wingeneral.c:box_win () a comment suggest we should display titles like this: +-WINDOW TITLE GOES HERE-+ However, we actually display them like this: +--WINDOW TITLE GOES HERE+ The former seems nicer to me, so that's what this commit does. Short titles will appear as: +-SHORT TITLE------------+ We previously didn't test the horizontal windows borders in the test suite, however, I've updated things so that we do now check for the '+-' and '-+' on the upper border, this will give us some protection. gdb/ChangeLog: * tui/tui-wingeneral.c (box_win): Position the title in the center of the border. gdb/testsuite/ChangeLog: * lib/tuiterm.exp (Term::_check_box): Check some parts of the top border. Change-Id: Iead6910e3b4e68bdf6871f861f23d2efd699faf0
2020-01-13gdb: add back declarations for _initialize functionsSimon Marchi7-7/+14
I'd like to enable the -Wmissing-declarations warning. However, it warns for every _initialize function, for example: CXX dcache.o /home/smarchi/src/binutils-gdb/gdb/dcache.c: In function ‘void _initialize_dcache()’: /home/smarchi/src/binutils-gdb/gdb/dcache.c:688:1: error: no previous declaration for ‘void _initialize_dcache()’ [-Werror=missing-declarations] _initialize_dcache (void) ^~~~~~~~~~~~~~~~~~ The only practical way forward I found is to add back the declarations, which were removed by this commit: commit 481695ed5f6e0a8a9c9c50bfac1cdd2b3151e6c9 Author: John Baldwin <jhb@FreeBSD.org> Date: Sat Sep 9 11:02:37 2017 -0700 Remove unnecessary function prototypes. I don't think it's a big problem to have the declarations for these functions, but if anybody has a better solution for this, I'll be happy to use it. gdb/ChangeLog: * aarch64-fbsd-nat.c (_initialize_aarch64_fbsd_nat): Add declaration. * aarch64-fbsd-tdep.c (_initialize_aarch64_fbsd_tdep): Add declaration. * aarch64-linux-nat.c (_initialize_aarch64_linux_nat): Add declaration. * aarch64-linux-tdep.c (_initialize_aarch64_linux_tdep): Add declaration. * aarch64-newlib-tdep.c (_initialize_aarch64_newlib_tdep): Add declaration. * aarch64-tdep.c (_initialize_aarch64_tdep): Add declaration. * ada-exp.y (_initialize_ada_exp): Add declaration. * ada-lang.c (_initialize_ada_language): Add declaration. * ada-tasks.c (_initialize_tasks): Add declaration. * agent.c (_initialize_agent): Add declaration. * aix-thread.c (_initialize_aix_thread): Add declaration. * alpha-bsd-nat.c (_initialize_alphabsd_nat): Add declaration. * alpha-linux-nat.c (_initialize_alpha_linux_nat): Add declaration. * alpha-linux-tdep.c (_initialize_alpha_linux_tdep): Add declaration. * alpha-nbsd-tdep.c (_initialize_alphanbsd_tdep): Add declaration. * alpha-obsd-tdep.c (_initialize_alphaobsd_tdep): Add declaration. * alpha-tdep.c (_initialize_alpha_tdep): Add declaration. * amd64-darwin-tdep.c (_initialize_amd64_darwin_tdep): Add declaration. * amd64-dicos-tdep.c (_initialize_amd64_dicos_tdep): Add declaration. * amd64-fbsd-nat.c (_initialize_amd64fbsd_nat): Add declaration. * amd64-fbsd-tdep.c (_initialize_amd64fbsd_tdep): Add declaration. * amd64-linux-nat.c (_initialize_amd64_linux_nat): Add declaration. * amd64-linux-tdep.c (_initialize_amd64_linux_tdep): Add declaration. * amd64-nbsd-nat.c (_initialize_amd64nbsd_nat): Add declaration. * amd64-nbsd-tdep.c (_initialize_amd64nbsd_tdep): Add declaration. * amd64-obsd-nat.c (_initialize_amd64obsd_nat): Add declaration. * amd64-obsd-tdep.c (_initialize_amd64obsd_tdep): Add declaration. * amd64-sol2-tdep.c (_initialize_amd64_sol2_tdep): Add declaration. * amd64-tdep.c (_initialize_amd64_tdep): Add declaration. * amd64-windows-nat.c (_initialize_amd64_windows_nat): Add declaration. * amd64-windows-tdep.c (_initialize_amd64_windows_tdep): Add declaration. * annotate.c (_initialize_annotate): Add declaration. * arc-newlib-tdep.c (_initialize_arc_newlib_tdep): Add declaration. * arc-tdep.c (_initialize_arc_tdep): Add declaration. * arch-utils.c (_initialize_gdbarch_utils): Add declaration. * arm-fbsd-nat.c (_initialize_arm_fbsd_nat): Add declaration. * arm-fbsd-tdep.c (_initialize_arm_fbsd_tdep): Add declaration. * arm-linux-nat.c (_initialize_arm_linux_nat): Add declaration. * arm-linux-tdep.c (_initialize_arm_linux_tdep): Add declaration. * arm-nbsd-nat.c (_initialize_arm_netbsd_nat): Add declaration. * arm-nbsd-tdep.c (_initialize_arm_netbsd_tdep): Add declaration. * arm-obsd-tdep.c (_initialize_armobsd_tdep): Add declaration. * arm-pikeos-tdep.c (_initialize_arm_pikeos_tdep): Add declaration. * arm-symbian-tdep.c (_initialize_arm_symbian_tdep): Add declaration. * arm-tdep.c (_initialize_arm_tdep): Add declaration. * arm-wince-tdep.c (_initialize_arm_wince_tdep): Add declaration. * auto-load.c (_initialize_auto_load): Add declaration. * auxv.c (_initialize_auxv): Add declaration. * avr-tdep.c (_initialize_avr_tdep): Add declaration. * ax-gdb.c (_initialize_ax_gdb): Add declaration. * bfin-linux-tdep.c (_initialize_bfin_linux_tdep): Add declaration. * bfin-tdep.c (_initialize_bfin_tdep): Add declaration. * break-catch-sig.c (_initialize_break_catch_sig): Add declaration. * break-catch-syscall.c (_initialize_break_catch_syscall): Add declaration. * break-catch-throw.c (_initialize_break_catch_throw): Add declaration. * breakpoint.c (_initialize_breakpoint): Add declaration. * bsd-uthread.c (_initialize_bsd_uthread): Add declaration. * btrace.c (_initialize_btrace): Add declaration. * charset.c (_initialize_charset): Add declaration. * cli/cli-cmds.c (_initialize_cli_cmds): Add declaration. * cli/cli-dump.c (_initialize_cli_dump): Add declaration. * cli/cli-interp.c (_initialize_cli_interp): Add declaration. * cli/cli-logging.c (_initialize_cli_logging): Add declaration. * cli/cli-script.c (_initialize_cli_script): Add declaration. * cli/cli-style.c (_initialize_cli_style): Add declaration. * coff-pe-read.c (_initialize_coff_pe_read): Add declaration. * coffread.c (_initialize_coffread): Add declaration. * compile/compile-cplus-types.c (_initialize_compile_cplus_types): Add declaration. * compile/compile.c (_initialize_compile): Add declaration. * complaints.c (_initialize_complaints): Add declaration. * completer.c (_initialize_completer): Add declaration. * copying.c (_initialize_copying): Add declaration. * corefile.c (_initialize_core): Add declaration. * corelow.c (_initialize_corelow): Add declaration. * cp-abi.c (_initialize_cp_abi): Add declaration. * cp-namespace.c (_initialize_cp_namespace): Add declaration. * cp-support.c (_initialize_cp_support): Add declaration. * cp-valprint.c (_initialize_cp_valprint): Add declaration. * cris-linux-tdep.c (_initialize_cris_linux_tdep): Add declaration. * cris-tdep.c (_initialize_cris_tdep): Add declaration. * csky-linux-tdep.c (_initialize_csky_linux_tdep): Add declaration. * csky-tdep.c (_initialize_csky_tdep): Add declaration. * ctfread.c (_initialize_ctfread): Add declaration. * d-lang.c (_initialize_d_language): Add declaration. * darwin-nat-info.c (_initialize_darwin_info_commands): Add declaration. * darwin-nat.c (_initialize_darwin_nat): Add declaration. * dbxread.c (_initialize_dbxread): Add declaration. * dcache.c (_initialize_dcache): Add declaration. * disasm-selftests.c (_initialize_disasm_selftests): Add declaration. * disasm.c (_initialize_disasm): Add declaration. * dtrace-probe.c (_initialize_dtrace_probe): Add declaration. * dummy-frame.c (_initialize_dummy_frame): Add declaration. * dwarf-index-cache.c (_initialize_index_cache): Add declaration. * dwarf-index-write.c (_initialize_dwarf_index_write): Add declaration. * dwarf2-frame-tailcall.c (_initialize_tailcall_frame): Add declaration. * dwarf2-frame.c (_initialize_dwarf2_frame): Add declaration. * dwarf2expr.c (_initialize_dwarf2expr): Add declaration. * dwarf2loc.c (_initialize_dwarf2loc): Add declaration. * dwarf2read.c (_initialize_dwarf2_read): Add declaration. * elfread.c (_initialize_elfread): Add declaration. * exec.c (_initialize_exec): Add declaration. * extension.c (_initialize_extension): Add declaration. * f-lang.c (_initialize_f_language): Add declaration. * f-valprint.c (_initialize_f_valprint): Add declaration. * fbsd-nat.c (_initialize_fbsd_nat): Add declaration. * fbsd-tdep.c (_initialize_fbsd_tdep): Add declaration. * filesystem.c (_initialize_filesystem): Add declaration. * findcmd.c (_initialize_mem_search): Add declaration. * findvar.c (_initialize_findvar): Add declaration. * fork-child.c (_initialize_fork_child): Add declaration. * frame-base.c (_initialize_frame_base): Add declaration. * frame-unwind.c (_initialize_frame_unwind): Add declaration. * frame.c (_initialize_frame): Add declaration. * frv-linux-tdep.c (_initialize_frv_linux_tdep): Add declaration. * frv-tdep.c (_initialize_frv_tdep): Add declaration. * ft32-tdep.c (_initialize_ft32_tdep): Add declaration. * gcore.c (_initialize_gcore): Add declaration. * gdb-demangle.c (_initialize_gdb_demangle): Add declaration. * gdb_bfd.c (_initialize_gdb_bfd): Add declaration. * gdbarch-selftests.c (_initialize_gdbarch_selftests): Add declaration. * gdbarch.c (_initialize_gdbarch): Add declaration. * gdbtypes.c (_initialize_gdbtypes): Add declaration. * gnu-nat.c (_initialize_gnu_nat): Add declaration. * gnu-v2-abi.c (_initialize_gnu_v2_abi): Add declaration. * gnu-v3-abi.c (_initialize_gnu_v3_abi): Add declaration. * go-lang.c (_initialize_go_language): Add declaration. * go32-nat.c (_initialize_go32_nat): Add declaration. * guile/guile.c (_initialize_guile): Add declaration. * h8300-tdep.c (_initialize_h8300_tdep): Add declaration. * hppa-linux-nat.c (_initialize_hppa_linux_nat): Add declaration. * hppa-linux-tdep.c (_initialize_hppa_linux_tdep): Add declaration. * hppa-nbsd-nat.c (_initialize_hppanbsd_nat): Add declaration. * hppa-nbsd-tdep.c (_initialize_hppanbsd_tdep): Add declaration. * hppa-obsd-nat.c (_initialize_hppaobsd_nat): Add declaration. * hppa-obsd-tdep.c (_initialize_hppabsd_tdep): Add declaration. * hppa-tdep.c (_initialize_hppa_tdep): Add declaration. * i386-bsd-nat.c (_initialize_i386bsd_nat): Add declaration. * i386-cygwin-tdep.c (_initialize_i386_cygwin_tdep): Add declaration. * i386-darwin-nat.c (_initialize_i386_darwin_nat): Add declaration. * i386-darwin-tdep.c (_initialize_i386_darwin_tdep): Add declaration. * i386-dicos-tdep.c (_initialize_i386_dicos_tdep): Add declaration. * i386-fbsd-nat.c (_initialize_i386fbsd_nat): Add declaration. * i386-fbsd-tdep.c (_initialize_i386fbsd_tdep): Add declaration. * i386-gnu-nat.c (_initialize_i386gnu_nat): Add declaration. * i386-gnu-tdep.c (_initialize_i386gnu_tdep): Add declaration. * i386-go32-tdep.c (_initialize_i386_go32_tdep): Add declaration. * i386-linux-nat.c (_initialize_i386_linux_nat): Add declaration. * i386-linux-tdep.c (_initialize_i386_linux_tdep): Add declaration. * i386-nbsd-nat.c (_initialize_i386nbsd_nat): Add declaration. * i386-nbsd-tdep.c (_initialize_i386nbsd_tdep): Add declaration. * i386-nto-tdep.c (_initialize_i386nto_tdep): Add declaration. * i386-obsd-nat.c (_initialize_i386obsd_nat): Add declaration. * i386-obsd-tdep.c (_initialize_i386obsd_tdep): Add declaration. * i386-sol2-nat.c (_initialize_amd64_sol2_nat): Add declaration. * i386-sol2-tdep.c (_initialize_i386_sol2_tdep): Add declaration. * i386-tdep.c (_initialize_i386_tdep): Add declaration. * i386-windows-nat.c (_initialize_i386_windows_nat): Add declaration. * ia64-libunwind-tdep.c (_initialize_libunwind_frame): Add declaration. * ia64-linux-nat.c (_initialize_ia64_linux_nat): Add declaration. * ia64-linux-tdep.c (_initialize_ia64_linux_tdep): Add declaration. * ia64-tdep.c (_initialize_ia64_tdep): Add declaration. * ia64-vms-tdep.c (_initialize_ia64_vms_tdep): Add declaration. * infcall.c (_initialize_infcall): Add declaration. * infcmd.c (_initialize_infcmd): Add declaration. * inflow.c (_initialize_inflow): Add declaration. * infrun.c (_initialize_infrun): Add declaration. * interps.c (_initialize_interpreter): Add declaration. * iq2000-tdep.c (_initialize_iq2000_tdep): Add declaration. * jit.c (_initialize_jit): Add declaration. * language.c (_initialize_language): Add declaration. * linux-fork.c (_initialize_linux_fork): Add declaration. * linux-nat.c (_initialize_linux_nat): Add declaration. * linux-tdep.c (_initialize_linux_tdep): Add declaration. * linux-thread-db.c (_initialize_thread_db): Add declaration. * lm32-tdep.c (_initialize_lm32_tdep): Add declaration. * m2-lang.c (_initialize_m2_language): Add declaration. * m32c-tdep.c (_initialize_m32c_tdep): Add declaration. * m32r-linux-nat.c (_initialize_m32r_linux_nat): Add declaration. * m32r-linux-tdep.c (_initialize_m32r_linux_tdep): Add declaration. * m32r-tdep.c (_initialize_m32r_tdep): Add declaration. * m68hc11-tdep.c (_initialize_m68hc11_tdep): Add declaration. * m68k-bsd-nat.c (_initialize_m68kbsd_nat): Add declaration. * m68k-bsd-tdep.c (_initialize_m68kbsd_tdep): Add declaration. * m68k-linux-nat.c (_initialize_m68k_linux_nat): Add declaration. * m68k-linux-tdep.c (_initialize_m68k_linux_tdep): Add declaration. * m68k-tdep.c (_initialize_m68k_tdep): Add declaration. * machoread.c (_initialize_machoread): Add declaration. * macrocmd.c (_initialize_macrocmd): Add declaration. * macroscope.c (_initialize_macroscope): Add declaration. * maint-test-options.c (_initialize_maint_test_options): Add declaration. * maint-test-settings.c (_initialize_maint_test_settings): Add declaration. * maint.c (_initialize_maint_cmds): Add declaration. * mdebugread.c (_initialize_mdebugread): Add declaration. * memattr.c (_initialize_mem): Add declaration. * mep-tdep.c (_initialize_mep_tdep): Add declaration. * mi/mi-cmd-env.c (_initialize_mi_cmd_env): Add declaration. * mi/mi-cmds.c (_initialize_mi_cmds): Add declaration. * mi/mi-interp.c (_initialize_mi_interp): Add declaration. * mi/mi-main.c (_initialize_mi_main): Add declaration. * microblaze-linux-tdep.c (_initialize_microblaze_linux_tdep): Add declaration. * microblaze-tdep.c (_initialize_microblaze_tdep): Add declaration. * mips-fbsd-nat.c (_initialize_mips_fbsd_nat): Add declaration. * mips-fbsd-tdep.c (_initialize_mips_fbsd_tdep): Add declaration. * mips-linux-nat.c (_initialize_mips_linux_nat): Add declaration. * mips-linux-tdep.c (_initialize_mips_linux_tdep): Add declaration. * mips-nbsd-nat.c (_initialize_mipsnbsd_nat): Add declaration. * mips-nbsd-tdep.c (_initialize_mipsnbsd_tdep): Add declaration. * mips-sde-tdep.c (_initialize_mips_sde_tdep): Add declaration. * mips-tdep.c (_initialize_mips_tdep): Add declaration. * mips64-obsd-nat.c (_initialize_mips64obsd_nat): Add declaration. * mips64-obsd-tdep.c (_initialize_mips64obsd_tdep): Add declaration. * mipsread.c (_initialize_mipsread): Add declaration. * mn10300-linux-tdep.c (_initialize_mn10300_linux_tdep): Add declaration. * mn10300-tdep.c (_initialize_mn10300_tdep): Add declaration. * moxie-tdep.c (_initialize_moxie_tdep): Add declaration. * msp430-tdep.c (_initialize_msp430_tdep): Add declaration. * nds32-tdep.c (_initialize_nds32_tdep): Add declaration. * nios2-linux-tdep.c (_initialize_nios2_linux_tdep): Add declaration. * nios2-tdep.c (_initialize_nios2_tdep): Add declaration. * nto-procfs.c (_initialize_procfs): Add declaration. * objc-lang.c (_initialize_objc_language): Add declaration. * observable.c (_initialize_observer): Add declaration. * opencl-lang.c (_initialize_opencl_language): Add declaration. * or1k-linux-tdep.c (_initialize_or1k_linux_tdep): Add declaration. * or1k-tdep.c (_initialize_or1k_tdep): Add declaration. * osabi.c (_initialize_gdb_osabi): Add declaration. * osdata.c (_initialize_osdata): Add declaration. * p-valprint.c (_initialize_pascal_valprint): Add declaration. * parse.c (_initialize_parse): Add declaration. * ppc-fbsd-nat.c (_initialize_ppcfbsd_nat): Add declaration. * ppc-fbsd-tdep.c (_initialize_ppcfbsd_tdep): Add declaration. * ppc-linux-nat.c (_initialize_ppc_linux_nat): Add declaration. * ppc-linux-tdep.c (_initialize_ppc_linux_tdep): Add declaration. * ppc-nbsd-nat.c (_initialize_ppcnbsd_nat): Add declaration. * ppc-nbsd-tdep.c (_initialize_ppcnbsd_tdep): Add declaration. * ppc-obsd-nat.c (_initialize_ppcobsd_nat): Add declaration. * ppc-obsd-tdep.c (_initialize_ppcobsd_tdep): Add declaration. * printcmd.c (_initialize_printcmd): Add declaration. * probe.c (_initialize_probe): Add declaration. * proc-api.c (_initialize_proc_api): Add declaration. * proc-events.c (_initialize_proc_events): Add declaration. * proc-service.c (_initialize_proc_service): Add declaration. * procfs.c (_initialize_procfs): Add declaration. * producer.c (_initialize_producer): Add declaration. * psymtab.c (_initialize_psymtab): Add declaration. * python/python.c (_initialize_python): Add declaration. * ravenscar-thread.c (_initialize_ravenscar): Add declaration. * record-btrace.c (_initialize_record_btrace): Add declaration. * record-full.c (_initialize_record_full): Add declaration. * record.c (_initialize_record): Add declaration. * regcache-dump.c (_initialize_regcache_dump): Add declaration. * regcache.c (_initialize_regcache): Add declaration. * reggroups.c (_initialize_reggroup): Add declaration. * remote-notif.c (_initialize_notif): Add declaration. * remote-sim.c (_initialize_remote_sim): Add declaration. * remote.c (_initialize_remote): Add declaration. * reverse.c (_initialize_reverse): Add declaration. * riscv-fbsd-nat.c (_initialize_riscv_fbsd_nat): Add declaration. * riscv-fbsd-tdep.c (_initialize_riscv_fbsd_tdep): Add declaration. * riscv-linux-nat.c (_initialize_riscv_linux_nat): Add declaration. * riscv-linux-tdep.c (_initialize_riscv_linux_tdep): Add declaration. * riscv-tdep.c (_initialize_riscv_tdep): Add declaration. * rl78-tdep.c (_initialize_rl78_tdep): Add declaration. * rs6000-aix-tdep.c (_initialize_rs6000_aix_tdep): Add declaration. * rs6000-lynx178-tdep.c (_initialize_rs6000_lynx178_tdep): Add declaration. * rs6000-nat.c (_initialize_rs6000_nat): Add declaration. * rs6000-tdep.c (_initialize_rs6000_tdep): Add declaration. * run-on-main-thread.c (_initialize_run_on_main_thread): Add declaration. * rust-exp.y (_initialize_rust_exp): Add declaration. * rx-tdep.c (_initialize_rx_tdep): Add declaration. * s12z-tdep.c (_initialize_s12z_tdep): Add declaration. * s390-linux-nat.c (_initialize_s390_nat): Add declaration. * s390-linux-tdep.c (_initialize_s390_linux_tdep): Add declaration. * s390-tdep.c (_initialize_s390_tdep): Add declaration. * score-tdep.c (_initialize_score_tdep): Add declaration. * ser-go32.c (_initialize_ser_dos): Add declaration. * ser-mingw.c (_initialize_ser_windows): Add declaration. * ser-pipe.c (_initialize_ser_pipe): Add declaration. * ser-tcp.c (_initialize_ser_tcp): Add declaration. * ser-uds.c (_initialize_ser_socket): Add declaration. * ser-unix.c (_initialize_ser_hardwire): Add declaration. * serial.c (_initialize_serial): Add declaration. * sh-linux-tdep.c (_initialize_sh_linux_tdep): Add declaration. * sh-nbsd-nat.c (_initialize_shnbsd_nat): Add declaration. * sh-nbsd-tdep.c (_initialize_shnbsd_tdep): Add declaration. * sh-tdep.c (_initialize_sh_tdep): Add declaration. * skip.c (_initialize_step_skip): Add declaration. * sol-thread.c (_initialize_sol_thread): Add declaration. * solib-aix.c (_initialize_solib_aix): Add declaration. * solib-darwin.c (_initialize_darwin_solib): Add declaration. * solib-dsbt.c (_initialize_dsbt_solib): Add declaration. * solib-frv.c (_initialize_frv_solib): Add declaration. * solib-svr4.c (_initialize_svr4_solib): Add declaration. * solib-target.c (_initialize_solib_target): Add declaration. * solib.c (_initialize_solib): Add declaration. * source-cache.c (_initialize_source_cache): Add declaration. * source.c (_initialize_source): Add declaration. * sparc-linux-nat.c (_initialize_sparc_linux_nat): Add declaration. * sparc-linux-tdep.c (_initialize_sparc_linux_tdep): Add declaration. * sparc-nat.c (_initialize_sparc_nat): Add declaration. * sparc-nbsd-nat.c (_initialize_sparcnbsd_nat): Add declaration. * sparc-nbsd-tdep.c (_initialize_sparcnbsd_tdep): Add declaration. * sparc-obsd-tdep.c (_initialize_sparc32obsd_tdep): Add declaration. * sparc-sol2-tdep.c (_initialize_sparc_sol2_tdep): Add declaration. * sparc-tdep.c (_initialize_sparc_tdep): Add declaration. * sparc64-fbsd-nat.c (_initialize_sparc64fbsd_nat): Add declaration. * sparc64-fbsd-tdep.c (_initialize_sparc64fbsd_tdep): Add declaration. * sparc64-linux-nat.c (_initialize_sparc64_linux_nat): Add declaration. * sparc64-linux-tdep.c (_initialize_sparc64_linux_tdep): Add declaration. * sparc64-nat.c (_initialize_sparc64_nat): Add declaration. * sparc64-nbsd-nat.c (_initialize_sparc64nbsd_nat): Add declaration. * sparc64-nbsd-tdep.c (_initialize_sparc64nbsd_tdep): Add declaration. * sparc64-obsd-nat.c (_initialize_sparc64obsd_nat): Add declaration. * sparc64-obsd-tdep.c (_initialize_sparc64obsd_tdep): Add declaration. * sparc64-sol2-tdep.c (_initialize_sparc64_sol2_tdep): Add declaration. * sparc64-tdep.c (_initialize_sparc64_adi_tdep): Add declaration. * stabsread.c (_initialize_stabsread): Add declaration. * stack.c (_initialize_stack): Add declaration. * stap-probe.c (_initialize_stap_probe): Add declaration. * std-regs.c (_initialize_frame_reg): Add declaration. * symfile-debug.c (_initialize_symfile_debug): Add declaration. * symfile-mem.c (_initialize_symfile_mem): Add declaration. * symfile.c (_initialize_symfile): Add declaration. * symmisc.c (_initialize_symmisc): Add declaration. * symtab.c (_initialize_symtab): Add declaration. * target.c (_initialize_target): Add declaration. * target-connection.c (_initialize_target_connection): Add declaration. * target-dcache.c (_initialize_target_dcache): Add declaration. * target-descriptions.c (_initialize_target_descriptions): Add declaration. * thread.c (_initialize_thread): Add declaration. * tic6x-linux-tdep.c (_initialize_tic6x_linux_tdep): Add declaration. * tic6x-tdep.c (_initialize_tic6x_tdep): Add declaration. * tilegx-linux-nat.c (_initialize_tile_linux_nat): Add declaration. * tilegx-linux-tdep.c (_initialize_tilegx_linux_tdep): Add declaration. * tilegx-tdep.c (_initialize_tilegx_tdep): Add declaration. * tracectf.c (_initialize_ctf): Add declaration. * tracefile-tfile.c (_initialize_tracefile_tfile): Add declaration. * tracefile.c (_initialize_tracefile): Add declaration. * tracepoint.c (_initialize_tracepoint): Add declaration. * tui/tui-hooks.c (_initialize_tui_hooks): Add declaration. * tui/tui-interp.c (_initialize_tui_interp): Add declaration. * tui/tui-layout.c (_initialize_tui_layout): Add declaration. * tui/tui-regs.c (_initialize_tui_regs): Add declaration. * tui/tui-stack.c (_initialize_tui_stack): Add declaration. * tui/tui-win.c (_initialize_tui_win): Add declaration. * tui/tui.c (_initialize_tui): Add declaration. * typeprint.c (_initialize_typeprint): Add declaration. * ui-style.c (_initialize_ui_style): Add declaration. * unittests/array-view-selftests.c (_initialize_array_view_selftests): Add declaration. * unittests/child-path-selftests.c (_initialize_child_path_selftests): Add declaration. * unittests/cli-utils-selftests.c (_initialize_cli_utils_selftests): Add declaration. * unittests/common-utils-selftests.c (_initialize_common_utils_selftests): Add declaration. * unittests/copy_bitwise-selftests.c (_initialize_copy_bitwise_utils_selftests): Add declaration. * unittests/environ-selftests.c (_initialize_environ_selftests): Add declaration. * unittests/filtered_iterator-selftests.c (_initialize_filtered_iterator_selftests): Add declaration. * unittests/format_pieces-selftests.c (_initialize_format_pieces_selftests): Add declaration. * unittests/function-view-selftests.c (_initialize_function_view_selftests): Add declaration. * unittests/help-doc-selftests.c (_initialize_help_doc_selftests): Add declaration. * unittests/lookup_name_info-selftests.c (_initialize_lookup_name_info_selftests): Add declaration. * unittests/main-thread-selftests.c (_initialize_main_thread_selftests): Add declaration. * unittests/memory-map-selftests.c (_initialize_memory_map_selftests): Add declaration. * unittests/memrange-selftests.c (_initialize_memrange_selftests): Add declaration. * unittests/mkdir-recursive-selftests.c (_initialize_mkdir_recursive_selftests): Add declaration. * unittests/observable-selftests.c (_initialize_observer_selftest): Add declaration. * unittests/offset-type-selftests.c (_initialize_offset_type_selftests): Add declaration. * unittests/optional-selftests.c (_initialize_optional_selftests): Add declaration. * unittests/parse-connection-spec-selftests.c (_initialize_parse_connection_spec_selftests): Add declaration. * unittests/rsp-low-selftests.c (_initialize_rsp_low_selftests): Add declaration. * unittests/scoped_fd-selftests.c (_initialize_scoped_fd_selftests): Add declaration. * unittests/scoped_mmap-selftests.c (_initialize_scoped_mmap_selftests): Add declaration. * unittests/scoped_restore-selftests.c (_initialize_scoped_restore_selftests): Add declaration. * unittests/string_view-selftests.c (_initialize_string_view_selftests): Add declaration. * unittests/style-selftests.c (_initialize_style_selftest): Add declaration. * unittests/tracepoint-selftests.c (_initialize_tracepoint_selftests): Add declaration. * unittests/tui-selftests.c (_initialize_tui_selftest): Add declaration. * unittests/unpack-selftests.c (_initialize_unpack_selftests): Add declaration. * unittests/utils-selftests.c (_initialize_utils_selftests): Add declaration. * unittests/vec-utils-selftests.c (_initialize_vec_utils_selftests): Add declaration. * unittests/xml-utils-selftests.c (_initialize_xml_utils): Add declaration. * user-regs.c (_initialize_user_regs): Add declaration. * utils.c (_initialize_utils): Add declaration. * v850-tdep.c (_initialize_v850_tdep): Add declaration. * valops.c (_initialize_valops): Add declaration. * valprint.c (_initialize_valprint): Add declaration. * value.c (_initialize_values): Add declaration. * varobj.c (_initialize_varobj): Add declaration. * vax-bsd-nat.c (_initialize_vaxbsd_nat): Add declaration. * vax-nbsd-tdep.c (_initialize_vaxnbsd_tdep): Add declaration. * vax-tdep.c (_initialize_vax_tdep): Add declaration. * windows-nat.c (_initialize_windows_nat): Add declaration. (_initialize_check_for_gdb_ini): Add declaration. (_initialize_loadable): Add declaration. * windows-tdep.c (_initialize_windows_tdep): Add declaration. * x86-bsd-nat.c (_initialize_x86_bsd_nat): Add declaration. * x86-linux-nat.c (_initialize_x86_linux_nat): Add declaration. * xcoffread.c (_initialize_xcoffread): Add declaration. * xml-support.c (_initialize_xml_support): Add declaration. * xstormy16-tdep.c (_initialize_xstormy16_tdep): Add declaration. * xtensa-linux-nat.c (_initialize_xtensa_linux_nat): Add declaration. * xtensa-linux-tdep.c (_initialize_xtensa_linux_tdep): Add declaration. * xtensa-tdep.c (_initialize_xtensa_tdep): Add declaration. Change-Id: I13eec7e0ed2b3c427377a7bdb055cf46da64def9
2020-01-11Make TUI borders respect "set style enabled"Tom Tromey2-4/+9
When adding support for styling the TUI borders, I neglected to have this code check cli_styling. As a result, "set style enabled off" does not affect the borders. This patch fixes this oversight. While doing this, I found that running gdb without an executable, enabling the TUI, and then trying "set style enabled off" would fail with the mysterious "No registers". The fix for this is to use deprecated_safe_get_selected_frame in tui_source_window_base::refill. gdb/ChangeLog 2020-01-11 Tom Tromey <tom@tromey.com> * tui/tui-wingeneral.c (box_win): Check cli_styling. * tui/tui-winsource.c (tui_source_window_base::refill): Use deprecated_safe_get_selected_frame. Change-Id: I36acda25dd9014d994d366b4a0e8faee9d95d0f8
2020-01-09gdb/tui: Link source and assembler scrolling .... againAndrew Burgess1-1/+3
Until recently when the source window was scrolled the assembler window would scroll in sync - keeping the disassembly for the current line in view. This was broken in commit: commit b4b49dcbff6b437fa8b4e2fc0c3f27b457f11310 Date: Wed Nov 13 16:47:58 2019 -0700 Don't call tui_show_source from tui_ui_out This commit restores the synchronised scrolling and also maintains the horizontal scroll within the source view when it is vertically scrolled, something that was broken before. This commit does not mean that scrolling the assembler view scrolls the source view. The connection this way never existed, though maybe it should, but I'll leave adding this feature for a separate commit. gdb/ChangeLog: * tui/tui-source.c (tui_source_window::do_scroll_vertical): Update all source windows, and maintain horizontal scroll status while doing so. gdb/testsuite/ChangeLog: * gdb.tui/basic.exp: Add more scrolling tests. Change-Id: I250114a3bc670040a6a759d41905776771b2f818
2020-01-09gdb: Fix scrolling in TUITom Tromey1-10/+13
Hannes Domani pointed out that my previous patch to fix the "list" command in the TUI instead broke vertical scrolling. While looking at this, I found that do_scroll_vertical calls print_source_lines, which seems like a very roundabout way to change the source window. This patch removes this oddity and fixes the bug at the same time. I've added a new test case. This is somewhat tricky, because the obvious approach of sending a dummy command after the scroll did not work -- due to how the TUI works, sennding a command causes the scroll to take effect. gdb/ChangeLog 2019-12-22 Tom Tromey <tom@tromey.com> PR tui/18932: * tui/tui-source.c (tui_source_window::do_scroll_vertical): Call update_source_window, not print_source_lines. gdb/testsuite/ChangeLog 2019-12-22 Tom Tromey <tom@tromey.com> PR tui/18932: * lib/tuiterm.exp (Term::wait_for): Rename from _accept. Return a meangingful value. (Term::command, Term::resize): Update. * gdb.tui/basic.exp: Add scrolling test. Change-Id: I9636a7c8a8cade37431c6165ee996a9d556ef1c8
2020-01-09gdb/tui: Fix 'layout asm' before the inferior has startedAndrew Burgess1-4/+6
Currently if a user starts the tui with 'layout asm' then they will be presented with the 'src' layout. What happens is: 1. Layout command enables TUI, selecting the SRC layout by default. 2. As part of tui_enable we call tui_display_main, which calls tui_get_begin_asm_address, which calls set_default_source_symtab_and_line. This changes core GDBs current symtab and line, which triggers a call to the symtab changed hook tui_symtab_changed, which sets the flag from_source_symtab. 3. Back in the layout command, the layout is changed from SRC to ASM. After this the layout command completes and we return to core GDB which prints the prompt, however... 4. The before prompt hook is called which sees the from_source_symtab flag is set and forces the SRC window to be displayed. This switches us back to SRC view. The solution I propose here is to delay installing the hooks into core GDB until after we have finished setting up the tui and selecting the default frame to view. In this way we effectively ignore the first symtab changed event triggered when making main the default symtab. gdb/ChangeLog: * tui/tui.c (tui_enable): Register tui hooks after calling tui_display_main. gdb/testsuite/ChangeLog: * gdb.tui/tui-layout-asm.exp: New file. Change-Id: I858ab81a17ffb4aa72deb3f36c3755228a9c9d9a
2020-01-06GDB: Fix the overflow in addr/line_is_displayed()Shahab Vahedi2-18/+15
In tui_disasm_window::addr_is_displayed(), there can be situations where "content" is empty. For instance, it can happen when the "content" was not filled in tui_disasm_window::set_contents(), because tui_disassemble() threw an exception. Usually this exception is the result of fetching invalid PC addresses like the ones beyond the end of the program. Having "content.size ()" zero leads to an overflow in this condition check inside tui_disasm_window::addr_is_displayed(): int i = 0; while (i < content.size () - threshold ...) { ... content[i] ... } "threshold" is 2 and there are times that "content.size ()" is 0. This results into an overflow and the loop is entered whereas it should have been skipped. Finally, "content[i]" access leads to a segmentation fault. Same problem applies to tui_source_window::line_is_displayed(). The issue has been discussed at length in bug 25345: https://sourceware.org/bugzilla/show_bug.cgi?id=25345 This commit avoids the segmentation faults with an early check: if (content.size () < SCROLL_THRESHOLD) return false; Moreover, those functions have been overhauled to a leaner code. gdb/ChangeLog: 2020-01-06 Shahab Vahedi <shahab@synopsys.com> * tui/tui-disasm.c (tui_disasm_window::addr_is_displayed): Avoid overflow by an early check of content vs threshold. * tui/tui-source.c (tui_source_window::line_is_displayed): Likewise.
2020-01-06GDB: Remove trailing spaces in tui-disasm.cShahab Vahedi1-3/+3
A few trailing spaces are removed. gdb/ChangeLog: 2020-01-06 Shahab Vahedi <shahab@synopsys.com> * tui/tui-disasm.c: Remove trailing spaces.
2020-01-05gdb: use tui_set_layout not show_layout to fix window focusAndrew Burgess1-6/+6
When calling tui_add_win_to_layout, use tui_set_layout not show_layout so that window focus is correctly updated. If the focus is not correctly maintained then GDB can be crashed like this: start tui enable layout asm list SOME_FUNCTION At this point GDB will have "popped up" the source window to display SOME_FUNCTION. Previously no window would have focus at this point, and so if the user now does 'focus next' or 'focus prev', then GDB would crash. Calling tui_set_layout ensures that focus is correctly calculated as the source window is "popped up", and this fixes the issue. gdb/ChangeLog: * tui/tui-layout.c (tui_add_win_to_layout): Use tui_set_layout not show_layout. gdb/testsuite/ChangeLog: * gdb.tui/list.exp: Test 'focus next' after 'list main'. Change-Id: Id0b13f99b0e889261efedfd0adabe82020202f44
2020-01-01Update copyright year range in all GDB files.Joel Brobecker31-31/+31
gdb/ChangeLog: Update copyright year range in all GDB files.
2019-12-30Make some TUI globals "static"Tom Tromey1-10/+10
This changes a few TUI globals to be "static". Tested by rebuilding. gdb/ChangeLog 2019-12-30 Tom Tromey <tom@tromey.com> * tui/tui-win.c (tui_border_mode_translate) (tui_border_kind_translate_vline, tui_border_kind_translate_hline) (tui_border_kind_translate_ulcorner) (tui_border_kind_translate_urcorner) (tui_border_kind_translate_llcorner) (tui_border_kind_translate_lrcorner, tui_active_border_mode) (tui_border_mode, tui_border_kind): Now static. Change-Id: Ibb49a0df195dfe780a5ba1f90e9125ab5f6b7ce1
2019-12-30Use "bool" in more spots in TUITom Tromey6-23/+21
This changes a few spots in the TUI to use "bool" rather than "int". Tested on x86-64 Fedora 28. gdb/ChangeLog 2019-12-30 Tom Tromey <tom@tromey.com> * tui/tui-interp.c (tui_start_enabled): Now bool. (_initialize_tui_interp): Update. * tui/tui-hooks.c (tui_refreshing_registers): Now bool. (tui_register_changed) (tui_refresh_frame_and_register_information): Update. * tui/tui-win.c (tui_update_variables): Return bool. * tui/tui-win.h (tui_update_variables): Return bool. * tui/tui.c (tui_get_command_dimension): Return bool. * tui/tui.h (tui_get_command_dimension): Return bool. Change-Id: I55b7f2d62d2ef88da3587dc914ada9f463ad8d2b
2019-12-27Remove dead code from TUITom Tromey2-58/+0
I found some dead code in the TUI -- some using #if 0, and some commented-out code. There's no reason to keep this, so this patch removes it. gdb/ChangeLog 2019-12-27 Tom Tromey <tom@tromey.com> * tui/tui-source.c (tui_source_window::do_scroll_vertical): Remove commented-out code. * tui/tui.c: Remove #if 0 code. Change-Id: Ie00933b2ba498417ce22e5da3f62f5a40c234f33
2019-12-27Change tui_active to boolTom Tromey2-7/+7
This changes tui_active and tui_finish_init to have type "bool". gdb/ChangeLog 2019-12-27 Tom Tromey <tom@tromey.com> * tui/tui.c (tui_active): Now bool. (tui_finish_init): Likewise. (tui_enable): Update. (tui_disable): Update. (tui_is_window_visible): Update. * tui/tui.h (tui_active): Now bool. Change-Id: Ia159ae9beb041137e34956b77f5bcf4e83eaf2b9
2019-12-27Remove tui_gen_win_info::viewport_heightTom Tromey5-17/+2
tui_gen_win_info::viewport_height is only used in a couple of spots, and is redundant with "height". This patch removes viewport_height. gdb/ChangeLog 2019-12-27 Tom Tromey <tom@tromey.com> * tui/tui-source.c (tui_source_window::maybe_update): Update. * tui/tui-regs.c (tui_data_window::display_registers_from): Update. * tui/tui-layout.c (tui_gen_win_info::resize): Update. * tui/tui-data.h (struct tui_gen_win_info) <viewport_height>: Remove. * tui/tui-command.c (tui_cmd_window::resize): Update. Change-Id: I020e026fbe289adda8e2fdfebca91bdbdbc312e8
2019-12-20Don't call tui_show_source from tui_ui_outTom Tromey3-18/+1
This removes the call to tui_show_source from tui_ui_out. This always seemed like a hack, and now that the TUI is using the proper observers, it seems not to be needed. The rest of the logic remains, unfortunately, because it is needed to suppress some gdb output in the TUI case. We could probably find a nicer way to do this (maybe a ui_out_flag), but I haven't attempted this. This was the last caller of tui_show_source, so this is removed as well. gdb/ChangeLog 2019-12-20 Tom Tromey <tom@tromey.com> * tui/tui.c (tui_show_source): Remove. * tui/tui.h (tui_show_source): Don't declare. * tui/tui-out.c (tui_ui_out::do_field_string): Don't call tui_show_source. Change-Id: Id71098e597ee4ebfef0429562baa45f537bd2c2b
2019-12-20Change tui_show_frame_info to return boolTom Tromey3-11/+9
This changes tui_show_frame_info to return bool. gdb/ChangeLog 2019-12-20 Tom Tromey <tom@tromey.com> * tui/tui-stack.h (tui_show_frame_info): Return bool. * tui/tui-stack.c (tui_show_frame_info): Return bool. * tui/tui-hooks.c (tui_refresh_frame_and_register_information): Update. Change-Id: Id1374f04f919c30a9f50c1beeb70cbc10b9a8f3b
2019-12-20Fix "list" command in the TUITom Tromey1-44/+58
PR tui/18932 notes that "list" no longer works in the TUI. At some point in the past, it switched the TUI source window to show the specified source; but now this source briefly flashes before the TUI reverts to showing the current stack frame's source. This patch fixes this bug by introducing a new observer that notices when the user selected context has changed. Then, the existing before-prompt observer is updated to request the correct update: either one based on the current stack frame, or one based on the user's source symtab_and_line. gdb/ChangeLog 2019-12-20 Tom Tromey <tom@tromey.com> PR tui/18932: * tui/tui-hooks.c (tui_refresh_frame_and_register_information): Rename parameters. Handle the not-from-stack-frame case. (from_stack, from_source_symtab): New globals. (tui_before_prompt, tui_normal_stop): Update. (tui_context_changed, tui_symtab_changed): New functions. (tui_attach_detach_observers): Attach new observers. gdb/testsuite/ChangeLog 2019-12-20 Tom Tromey <tom@tromey.com> * gdb.tui/list-before.exp: New file. Change-Id: I62013825f6c1afdd568a1c7a8c019b0c881131af
2019-12-20Use bool in tui_before_promptTom Tromey1-3/+3
This changes tui_before_prompt to take a bool rather than an int. gdb/ChangeLog 2019-12-20 Tom Tromey <tom@tromey.com> * tui/tui-hooks.c (tui_before_prompt): Change parameter to bool. (tui_before_prompt, tui_normal_stop): Update. Change-Id: I9c7f2b764748fe19621851dc4fed4775a6db211a
2019-12-20Don't call set_current_source_symtab_and_line from TUITom Tromey1-7/+0
update_source_window_as_is calls set_current_source_symtab_and_line, but I don't think there is any reason it should be doing this. This patch removes the call. gdb/ChangeLog 2019-12-20 Tom Tromey <tom@tromey.com> * tui/tui-winsource.c (tui_source_window_base::update_source_window_as_is): Don't call set_current_source_symtab_and_line. Change-Id: I1152fc7c78150974bd3d555b8568a6f88b65dbe6
2019-12-20Change set_locator_info to take a symtab_and_lineTom Tromey2-38/+24
This changes set_locator_info to take a symtab_and_line, rather than the individual components. gdb/ChangeLog 2019-12-20 Tom Tromey <tom@tromey.com> * tui/tui-stack.h (struct tui_locator_window) <set_locator_info>: Take a symtab_and_line. * tui/tui-stack.c (tui_locator_window::set_locator_info): Take a symtab_and_line. (tui_show_frame_info): Update. Change-Id: Icb58d67e6c5bdc034eede9e5bbe8c1d1e633fbb5
2019-12-20Remove a call to update_exec_infoTom Tromey1-4/+1
tui_show_frame_info calls update_exec_info after calling erase_source_content, but there's no need to do this, as erase_source_content already clears the exec info. gdb/ChangeLog 2019-12-20 Tom Tromey <tom@tromey.com> * tui/tui-stack.c (tui_show_frame_info): Don't call update_exec_info. Change-Id: I63d658561028ac1bc0a0a2b7ac17da1b9c6134fe
2019-12-20Display "main" on initial TUI startupTom Tromey1-0/+2
I noticed that even when there's a symbol file, "tui enable" won't show "main" by default. I think it should, and this patch fixes this. gdb/ChangeLog 2019-12-20 Tom Tromey <tom@tromey.com> * tui/tui.c (tui_enable): Call tui_display_main. gdb/testsuite/ChangeLog 2019-12-20 Tom Tromey <tom@tromey.com> * gdb.tui/list.exp: Check for source on initial listing. Change-Id: Ic7bfc930e1179f5b61111e30a2dae46a98b00064
2019-12-20Reimplement tui_get_begin_asm_addressTom Tromey1-14/+17
tui_get_begin_asm_address looks for the inferior's "main" to display it. I think this is incorrect in two ways. First, it should probably instead use the user's most recent source context, if one has been set. Second, it uses a hard-coded list of "main" names, but gdb already has a better approach to handling this. This patch fixes both of these problems. gdb/ChangeLog 2019-12-20 Tom Tromey <tom@tromey.com> * tui/tui-disasm.c (tui_get_begin_asm_address): Use get_current_source_symtab_and_line, and main_name. Change-Id: I77dc13d49148e8dec5aa3eeb357ce3968a68d0bd
2019-12-20Simplify tui_update_source_windows_with_lineTom Tromey3-31/+10
This changes tui_update_source_windows_with_line to take a symtab_and_line, rather than separate parameters, and then updates the caller. gdb/ChangeLog 2019-12-20 Tom Tromey <tom@tromey.com> * tui/tui.c (tui_show_source): Update. * tui/tui-winsource.h (tui_update_source_windows_with_line): Update. * tui/tui-winsource.c (tui_update_source_windows_with_line): Take a symtab_symbol_info, not a separate symtab and line. Simplify. Change-Id: I8803a0a6fd2938ceee859aea53a57ce582f3e80d
2019-12-20Simplify tui_update_source_windows_with_addrTom Tromey1-13/+4
After the previous changes, tui_update_source_windows_with_addr simply updates each source-like window separately, passing the same data to each. So, it can be simplified by using a loop instead. gdb/ChangeLog 2019-12-20 Tom Tromey <tom@tromey.com> * tui/tui-winsource.c (tui_update_source_windows_with_addr): Simplify. Change-Id: Id2ba6b3145ec005dbed1b1115118bd1ef4efb842
2019-12-20Use symtab_and_line when updating TUI windowsTom Tromey6-81/+64
This changes a few TUI source window methods to take a symtab_and_line rather than separate symtab and tui_line_or_address parameters. A symtab_and_line already incorporates the same information, so this seemed simpler. Also, it helps avoid the problem that the source and disassembly windows need different information -- both forms are present in the SAL. gdb/ChangeLog 2019-12-20 Tom Tromey <tom@tromey.com> * tui/tui-winsource.h (struct tui_source_window_base) <set_contents, update_source_window_as_is, update_source_window>: Take a sal, not a separate symtab and tui_line_or_address. * tui/tui-winsource.c (tui_source_window_base::update_source_window) (tui_source_window_base::update_source_window_as_is): Take a sal, not a separate symtab and tui_line_or_address. (tui_update_source_windows_with_addr) (tui_update_source_windows_with_line) (tui_source_window_base::rerender) (tui_source_window_base::refill): Update. * tui/tui-source.h (struct tui_source_window) <set_contents>: Take a sal, not a separate symtab and tui_line_or_address. * tui/tui-source.c (tui_source_window::set_contents): Take a sal, not a separate symtab and tui_line_or_address. (tui_source_window::maybe_update): Update. * tui/tui-disasm.h (struct tui_disasm_window) <set_contents>: Take a sal, not a separate symtab and tui_line_or_address. * tui/tui-disasm.c (tui_disasm_window::set_contents): Take a sal, not a separate symtab and tui_line_or_address. (tui_disasm_window::do_scroll_vertical) (tui_disasm_window::maybe_update): Update. Change-Id: I6974a03589930a0f910c657ef50b7f6f7397c87d
2019-12-20Use start_line_or_addr in TUI windowsTom Tromey3-4/+4
A few spots in the TUI source and disassembly windows referred to content[0], where start_line_or_addr is equivalent. This patch makes this substitution. gdb/ChangeLog 2019-12-20 Tom Tromey <tom@tromey.com> * tui/tui-winsource.c (tui_source_window_base::refill): Use start_line_or_addr. * tui/tui-source.c (tui_source_window::do_scroll_vertical): Use start_line_or_addr. * tui/tui-disasm.c (tui_disasm_window::do_scroll_vertical): Use start_line_or_addr. Change-Id: I1fa807321cd7ad88b3cc5e41cc50f4d4e2d46271
2019-12-20Change tui_source_window_base::set_contents to return boolTom Tromey6-89/+80
This changes tui_source_window_base::set_contents to return bool, rather than tui_status. It also changes one implementation of set_contents to use early returns rather than a variable, which IMO makes it easier to follow. gdb/ChangeLog 2019-12-20 Tom Tromey <tom@tromey.com> * tui/tui-winsource.h (struct tui_source_window_base) <set_contents>: Return bool. * tui/tui-winsource.c (tui_source_window_base::update_source_window_as_is): Update. * tui/tui-source.h (struct tui_source_window) <set_contents>: Return bool. * tui/tui-source.c (tui_source_window::set_contents): Return bool. Simplify. * tui/tui-disasm.h (struct tui_disasm_window) <set_contents>: Return bool. * tui/tui-disasm.c (tui_disasm_window::set_contents): Return bool. Change-Id: I8c5212400cd7aadf35760c22d5344cd3b9435674
2019-12-20Remove tui_source_window::show_symtab_sourceTom Tromey3-17/+2
tui_source_window::show_symtab_source is identical to update_source_window, so remove the former. gdb/ChangeLog 2019-12-20 Tom Tromey <tom@tromey.com> * tui/tui-winsource.c (tui_update_source_windows_with_addr) (tui_update_source_windows_with_line): Call update_source_window. * tui/tui-source.h (struct tui_source_window) <show_symtab_source>: Don't declare. * tui/tui-source.c (tui_source_window::show_symtab_source): Remove. Change-Id: I41781df2126e8bafad46d058532d52602a288e06
2019-12-20Remove tui_show_disassemTom Tromey3-19/+9
tui_show_disassem is just a wrapper for the update_source_window method, and it only has a single caller. This removes the function and inlines the logic into that caller. gdb/ChangeLog 2019-12-20 Tom Tromey <tom@tromey.com> * tui/tui-winsource.c (tui_update_source_windows_with_addr): Call update_source_window directly. * tui/tui-disasm.h (tui_show_disassem): Don't declare. * tui/tui-disasm.c (tui_show_disassem): Remove. Change-Id: I7ae7a3309f64a4a949c07a80c46e1664c7f12913
2019-12-20Remove some unnecessary focus switchesTom Tromey2-12/+0
A couple of lower-level utility functions can change the TUI focus. This seems incorrect to me -- focus switches should only be done either by explicit user request, or ass a side effect of changing the layout. gdb/ChangeLog 2019-12-20 Tom Tromey <tom@tromey.com> * tui/tui-winsource.c (tui_source_window_base::update_source_window_as_is): Don't switch focus. * tui/tui-disasm.c (tui_show_disassem): Don't switch focus. Change-Id: I0a5bb8a407cf8d52e2fd23b0598eb9bce56b1251
2019-12-20Simplify tui_source_window_base::maybe_update methodTom Tromey6-25/+21
tui_source_window_base::maybe_update takes a symtab_and_line, plus a separate line number and PC. Because a symtab_and_line already holds a line number and a PC, it is possible to remove these extra parameters. gdb/ChangeLog 2019-12-20 Tom Tromey <tom@tromey.com> * tui/tui-winsource.h (struct tui_source_window_base) <maybe_update>: Remove line_no and addr parameters. * tui/tui-stack.c (tui_show_frame_info): Set PC on sal. Update. * tui/tui-source.h (struct tui_source_window) <maybe_update>: Update. * tui/tui-source.c (tui_source_window::maybe_update): Remove line_no and addr parameters. * tui/tui-disasm.h (struct tui_disasm_window) <maybe_update>: Update. * tui/tui-disasm.c (tui_disasm_window::maybe_update): Remove line_no and addr parameters. Change-Id: I33d8e1a669a179544edb4197f5f7c5429dfc368e
2019-12-20Remove some TUI assertsTom Tromey1-6/+0
This removes a few asserts from the TUI. These asserts aren't useful, because they simply check an invariant that's already ensured by the type system. gdb/ChangeLog 2019-12-20 Tom Tromey <tom@tromey.com> * tui/tui-winsource.c (tui_source_window_base::set_is_exec_point_at) (tui_source_window_base::update_breakpoint_info): Remove asserts. Change-Id: I807e1e9bdb0cfa475e70375ceca3a5d4f2eb8d0b