aboutsummaryrefslogtreecommitdiff
path: root/gdb/tui
AgeCommit message (Collapse)AuthorFilesLines
2019-11-26Remove declaration of tui_set_var_cmd, make definition staticSimon Marchi2-4/+2
The declaration of tui_set_var_cmd is not in sync with the definition. Since tui_set_var_cmd is only used in the file where it's defined, remove the declaration and make the definition static. gdb/ChangeLog: * tui-win.h (tui_set_var_cmd): Remove. * tui-win.c (tui_set_var_cmd): Make static. Change-Id: If4bddbfb573347fb7254fb6f1a940052a72f464f
2019-11-19Fix the "winheight" commandTom Tromey3-27/+22
The "winheight" command is broken. I probably broke it in one of my TUI refactoring patches, though I didn't track down exactly which one. The bug is that the code does: *buf_ptr = '\0'; ... but then never advances buf_ptr past this point, so no window name is seen. This patch refactors the code a bit so that a copy of the argument string is not needed, also fixing the bug. A new test case is included. gdb/ChangeLog 2019-11-19 Tom Tromey <tom@tromey.com> * tui/tui-win.c (tui_partial_win_by_name): Move from tui-data.c. Now static. Change type of "name". (tui_set_win_height_command): Don't copy "arg". * tui/tui-data.h (tui_partial_win_by_name): Don't declare. * tui/tui-data.c (tui_partial_win_by_name): Move to tui-win.c. gdb/testsuite/ChangeLog 2019-11-19 Tom Tromey <tom@tromey.com> * gdb.tui/winheight.exp: New file. Change-Id: I0871e93777a70036dbec9c9543f862f42e3a81e5
2019-11-12Consolidate setting of current_layoutTom Tromey1-4/+1
Currently several functions in tui-layout.c set current_layout after their work is done. This moves this assignment to show_layout, instead. gdb/ChangeLog 2019-11-12 Tom Tromey <tom@tromey.com> * tui/tui-layout.c (show_layout): Set current_layout. (show_source_disasm_command, show_data) (show_source_or_disasm_and_command): Don't set current_layout. Change-Id: Id8b23797d68e607f0fcd6d29b8801869d40d1869
2019-11-12Move _initialize_tui_layout to end of fileTom Tromey1-25/+26
This moves _initialize_tui_layout to the end of the file, conforming to the typical gdb style. gdb/ChangeLog 2019-11-12 Tom Tromey <tom@tromey.com> * tui/tui-layout.c (_initialize_tui_layout): Move to end. Change-Id: I667f741b44b2bc470878a36f093a96d89fa31893
2019-11-12Make TUI resizing tests more robustTom Tromey1-0/+34
As Sergio pointed out, the TUI resizing tests are flaky. Debugging this showed three main problems. 1. expect's "stty" command processes its arguments one-by-one. So, rather than requesting a single resize, it sends two separate resize requests (one for rows and one for columns). This means gdb sees two SIGWINCH signals and resizes the terminal twice. I consider this a bug in expect, but I couldn't readily see how to report a bug; and anyway the fix wouldn't propagate very quickly. This patch works around this problem by explicitly doing two separate resizes (so it will be robust if expect ever does change); and then by waiting for each resize to complete before continuing. 2. gdb uses curses to drive the console rendering. Currently the test suite looks for terminal text insertion sequences to decide when a command has completed. However, it turns out that, sometimes, curses can output things in non-obvious ways. I didn't debug into curses but I guess this can happen due to output optimizations. No matter the reason, sometimes the current approach of only tracking text insertions is not enough to detect that gdb has finished rendering. This patch fixes this problem by arranging to detect the termination output after any curses command, not just insertion. 3. Detecting when a resize has completed is tricky. In fact, I could not find a way to reliably do this. This patch fixes this problem by adding a special maint "tui-resize-message" setting to gdb. When this is enabled, gdb will print a message after each SIGWINCH has been fully processed. The test suite enables this mode and then waits for the message in order to know when control can be returned to the calling test. This patch also adds a timeout, to avoid the situation where the terminal code fails to notice a change for some reason. This lets the test at least try to continue. gdb/ChangeLog 2019-11-12 Tom Tromey <tom@tromey.com> * tui/tui-win.c (resize_message): New global. (show_tui_resize_message): New function. (tui_async_resize_screen): Print message if requested. (_initialize_tui_win): Add tui-resize-message setting. * NEWS: Add entry for new commands. gdb/doc/ChangeLog 2019-11-12 Tom Tromey <tom@tromey.com> * gdb.texinfo (Maintenance Commands): Document new command. gdb/testsuite/ChangeLog 2019-11-12 Tom Tromey <tom@tromey.com> * lib/tuiterm.exp (_accept): Add wait_for parameter. Check output after any command. Expect prompt after WAIT_FOR is seen. (enter_tui): Enable resize messages. (command): Expect command in output. (get_line): Avoid error when cursor appears to be off-screen. (dump_screen): Include screen size in title. (_do_resize): New proc, from "resize". (resize): Rewrite. Do resize in two steps. * gdb.tui/empty.exp (layouts): Fix entries. (check_boxes): Remove xfail. (check_text): Dump screen on failure. Change-Id: I420e0259cb99b21adcd28f671b99161eefa7a51d
2019-11-11Document and extend readline-bindable functionsTom Tromey1-1/+3
This adds readline-bindable function names to a few gdb functions that already had key bindings. This lets users change the bindings. This also removes the gdb-command function. Due to how this function is implemented, it doesn't make sense to allow binding it. Finally, this updates the documentation to reflect these changes. gdb/ChangeLog 2019-11-11 Tom Tromey <tom@tromey.com> * tui/tui.c (tui_initialize_readline): Add new bindable readline functions. gdb/doc/ChangeLog 2019-11-11 Tom Tromey <tom@tromey.com> * gdb.texinfo (TUI Keys): Document readline function names. Change-Id: I2233779b7aefe372f19bd03c8f325733c3385e72
2019-11-10Remove can_highlight from TUI windowsTom Tromey3-7/+3
Each TUI window has a "can_highlight" member. However, this has the same meaning as "can_box" -- a window can be highlighted if and only if it can be boxed. So, this patch removes can_highlight in favor of simply using can_box. gdb/ChangeLog 2019-11-10 Tom Tromey <tom@tromey.com> * tui/tui-wingeneral.c (tui_unhighlight_win): Use can_box. (tui_highlight_win): Likewise. (tui_win_info::check_and_display_highlight_if_needed): Likewise. * tui/tui-data.h (struct tui_win_info) <can_highlight>: Remove. * tui/tui-command.h (struct tui_cmd_window) <tui_cmd_window>: Don't set can_highlight. Change-Id: I35916859070efcdfcc6e692c71cc6070956dcfce
2019-11-06Remove some includes of readline.hTom Tromey2-6/+0
I went through most of the spots that include readline.h and, when appropriate, either removed the include or changed it to include tilde.h. Note that remote-sim.c and bsd-kvm.c could probably include tilde.h instead, but I did not change these. I think I can't build the latter, and I didn't want to set up a sim build for the former. Tested by rebuilding. gdb/ChangeLog 2019-11-06 Tom Tromey <tom@tromey.com> * tui/tui-interp.c: Don't include readline.h. * tui/tui-hooks.c: Don't include readline.h. * symmisc.c: Include tilde.h, not readline.h. * symfile.c: Include tilde.h, not readline.h. * source.c: Include tilde.h, not readline.h. * solib.c: Include tilde.h, not readline.h. * psymtab.c: Include tilde.h, not readline.h. * exec.c: Include tilde.h, not readline.h. * corelow.c: Include tilde.h, not readline.h. * cli/cli-dump.c: Include tilde.h, not readline.h. * cli/cli-cmds.c: Don't include readline.h. Change-Id: I60487a190c43128b800ef77517d1ab42957571d7
2019-11-05Fix regression from TUI disassembly style patchTom Tromey1-2/+3
My previous patch to add styling to the TUI disassembly failed to correctly fix a bug that Simon had pointed out in review. This patch fixes the bug. gdb/ChangeLog 2019-11-05 Tom Tromey <tom@tromey.com> * tui/tui-disasm.c (struct tui_asm_line) <addr_size>: New member. (tui_disassemble): Set addr_size. (tui_disasm_window::set_contents): Use addr_size. Change-Id: Ic0152f3b82a2f79be28ae46d590096661f271580
2019-11-05Style disassembly in the TUITom Tromey5-142/+178
This patch changes the TUI disassembly window to style its contents. The styling should be identical to what is seen in the CLI. This involved a bit of rearrangement, so that the source and disassembly windows could share both the copy_source_line utility function, and the ability to react to changes in "set style enabled". This version introduces a new function to strip the styling from the address string when computing the length. As a byproduct, it also removes the unused "insn_size" computation from tui_disasm_window::set_contents. gdb/ChangeLog 2019-11-05 Tom Tromey <tom@tromey.com> * tui/tui-source.h (struct tui_source_window): Inline constructor. Remove destructor. <style_changed, m_observable>: Move to superclass. * tui/tui-winsource.h (tui_copy_source_line): Declare. (struct tui_source_window_base): Move private members to end. <style_changed, m_observable>: Move from tui_source_window. * tui/tui-winsource.c (tui_copy_source_line): Move from tui-source.c. Rename from copy_source_line. Add special handling for negative line number. (tui_source_window_base::style_changed): Move from tui_source_window. (tui_source_window_base): Register observer. (~tui_source_window_base): New. * tui/tui-source.c (copy_source_line): Move to tui-winsource.c; rename. (tui_source_window::set_contents): Use tui_copy_source_line. (tui_source_window::tui_source_window): Move to tui-source.h. (tui_source_window::~tui_source_window): Remove. (tui_source_window::style_changed): Move to superclass. * tui/tui-disasm.c (tui_disassemble): Create string file with styling, when possible. Add "addr_size" parameter. (tui_disasm_window::set_contents): Use tui_copy_source_line. Don't compute maximum size. (len_without_escapes): New function Change-Id: I8722635eeecbbb1633d943a65b856404c2d467b0
2019-11-05Change tui_source_element::line to have type std::stringTom Tromey4-6/+6
This changes tui_source_element::line to be of type std::string. This reduces the number of copies made. gdb/ChangeLog 2019-11-05 Tom Tromey <tom@tromey.com> * tui/tui-winsource.h (struct tui_source_element) <line>: Now a std::string. * tui/tui-winsource.c (tui_show_source_line): Update. * tui/tui-source.c (tui_source_window::set_contents): Update. * tui/tui-disasm.c (tui_disasm_window::set_contents): Update. Change-Id: Id600f3e1d386a2911f187366e05e2ec599068dd2
2019-10-26[gdb] Fix more typos in comments (2)Tom de Vries4-5/+5
Fix typos in comments. NFC. Tested on x86_64-linux. gdb/ChangeLog: 2019-10-26 Tom de Vries <tdevries@suse.de> * aarch64-linux-tdep.c: Fix typos in comments. * aarch64-tdep.c: Same. * ada-lang.c: Same. * amd64-nat.c: Same. * arc-tdep.c: Same. * arch/aarch64-insn.c: Same. * block.c: Same. * breakpoint.h: Same. * btrace.h: Same. * c-varobj.c: Same. * cli/cli-decode.c: Same. * cli/cli-script.c: Same. * cli/cli-utils.h: Same. * coff-pe-read.c: Same. * coffread.c: Same. * compile/compile-cplus-symbols.c: Same. * compile/compile-object-run.c: Same. * completer.c: Same. * corelow.c: Same. * cp-support.c: Same. * demangle.c: Same. * dwarf-index-write.c: Same. * dwarf2-frame.c: Same. * dwarf2-frame.h: Same. * eval.c: Same. * frame-base.h: Same. * frame.h: Same. * gdbcmd.h: Same. * gdbtypes.h: Same. * gnu-nat.c: Same. * guile/scm-objfile.c: Same. * i386-tdep.c: Same. * i386-tdep.h: Same. * infcall.c: Same. * infcall.h: Same. * linux-nat.c: Same. * m68k-tdep.c: Same. * macroexp.c: Same. * memattr.c: Same. * mi/mi-cmd-disas.c: Same. * mi/mi-getopt.h: Same. * mi/mi-main.c: Same. * minsyms.c: Same. * nat/aarch64-sve-linux-sigcontext.h: Same. * objfiles.h: Same. * ppc-linux-nat.c: Same. * ppc-linux-tdep.c: Same. * ppc-tdep.h: Same. * progspace.h: Same. * prologue-value.h: Same. * python/py-evtregistry.c: Same. * python/py-instruction.h: Same. * record-btrace.c: Same. * record-full.c: Same. * remote.c: Same. * rs6000-tdep.c: Same. * ser-tcp.c: Same. * sol-thread.c: Same. * sparc-sol2-tdep.c: Same. * sparc64-tdep.c: Same. * stabsread.c: Same. * symfile.c: Same. * symtab.h: Same. * target.c: Same. * tracepoint.c: Same. * tui/tui-data.h: Same. * tui/tui-io.c: Same. * tui/tui-win.c: Same. * tui/tui.c: Same. * unittests/rsp-low-selftests.c: Same. * user-regs.h: Same. * utils.c: Same. * utils.h: Same. * valarith.c: Same. * valops.c: Same. * valprint.c: Same. * valprint.h: Same. * value.c: Same. * value.h: Same. * varobj.c: Same. * x86-nat.h: Same. * xtensa-tdep.c: Same. gdb/gdbserver/ChangeLog: 2019-10-26 Tom de Vries <tdevries@suse.de> * linux-aarch64-low.c: Fix typos in comments. * linux-arm-low.c: Same. * linux-low.c: Same. * linux-ppc-low.c: Same. * proc-service.c: Same. * regcache.h: Same. * server.c: Same. * tracepoint.c: Same. * win32-low.c: Same. gdb/stubs/ChangeLog: 2019-10-26 Tom de Vries <tdevries@suse.de> * ia64vms-stub.c: Fix typos in comments. * m32r-stub.c: Same. * m68k-stub.c: Same. * sh-stub.c: Same. gdb/testsuite/ChangeLog: 2019-10-26 Tom de Vries <tdevries@suse.de> * gdb.base/bigcore.c: Fix typos in comments. * gdb.base/ctf-ptype.c: Same. * gdb.base/long_long.c: Same. * gdb.dwarf2/dw2-op-out-param.S: Same. * gdb.python/py-evthreads.c: Same. * gdb.reverse/i387-stack-reverse.c: Same. * gdb.trace/tfile.c: Same. * lib/compiler.c: Same. * lib/compiler.cc: Same. Change-Id: I8573d84a577894270179ae30f46c48d806fc1beb
2019-10-21Remove tui_exec_info_contentTom Tromey1-2/+0
I happened to notice that the tui_exec_info_content typedef is unused. This patch removes it. Tested by rebuilding. gdb/ChangeLog 2019-10-21 Tom Tromey <tom@tromey.com> * tui/tui-winsource.h (tui_exec_info_content): Remove typedef. Change-Id: I768edc482366e830eb4528c799686bb27518cdcb
2019-10-15Make tui-winsource not use breakpoint_chainChristian Biesinger1-7/+4
That's an internal variable of breakpoint.c. Insted, use iterate_over_breakpoints to update the breakpoint list. gdb/ChangeLog: 2019-10-15 Christian Biesinger <cbiesinger@google.com> * breakpoint.c (breakpoint_chain): Make static. * tui/tui-winsource.c: Call iterate_over_breakpoints instead of accessing breakpoint_chain. Change-Id: Ic259b2c3a4c1f5a47f34cfd7fccbdcf274417429
2019-10-09Don't call erase_data_content from tui_data_window::show_registersTom Tromey1-2/+3
tui_data_window::show_registers currently calls erase_data_content. However, I think it's better to have fewer calls to this (ideally just one would suffice). This refactors that function to remove this call. gdb/ChangeLog 2019-10-09 Tom Tromey <tom@tromey.com> * tui/tui-regs.c (tui_data_window::show_registers): Don't call erase_data_content.
2019-10-09Make TUI window handle a unique_ptrTom Tromey12-87/+73
This changes tui_gen_win_info::handle to be a specialization of unique_ptr. This is perhaps mildly uglier in some spots, due to the proliferation of "get"; but on the other hand it cleans up some manual management and it allows for the removal of tui_delete_win. gdb/ChangeLog 2019-10-09 Tom Tromey <tom@tromey.com> * tui/tui-wingeneral.h (tui_delete_win): Don't declare. * tui/tui-stack.c (tui_locator_window::rerender): Update. * tui/tui-command.c (tui_cmd_window::resize) (tui_refresh_cmd_win): Update. * tui/tui-win.c (tui_resize_all, tui_set_focus_command): Update. * tui/tui.c (tui_rl_other_window, tui_enable): Update. * tui/tui-data.c (~tui_gen_win_info): Remove. * tui/tui-layout.c (tui_gen_win_info::resize): Update. * tui/tui-io.c (update_cmdwin_start_line, tui_putc, tui_puts) (tui_redisplay_readline, tui_mld_flush) (tui_mld_erase_entire_line, tui_mld_getc, tui_getc): Update. * tui/tui-regs.c (tui_data_window::delete_data_content_windows) (tui_data_window::erase_data_content) (tui_data_item_window::rerender) (tui_data_item_window::refresh_window): Update. * tui/tui-wingeneral.c (tui_gen_win_info::refresh_window) (box_win, tui_gen_win_info::make_window) (tui_gen_win_info::make_visible): Update. (tui_delete_win): Remove. * tui/tui-winsource.c (tui_source_window_base::do_erase_source_content): Update. (tui_show_source_line, tui_source_window_base::update_tab_width) (tui_source_window_base::update_exec_info): Update. * tui/tui-data.h (struct curses_deleter): New. (struct tui_gen_win_info) <handle>: Now a unique_ptr. (struct tui_gen_win_info) <~tui_gen_win_info>: Define.
2019-10-09Remove declaration from tui-wingeneral.hTom Tromey1-1/+0
tui-wingeneral.h has an unused forward declaration. This removes it. gdb/ChangeLog 2019-10-09 Tom Tromey <tom@tromey.com> * tui/tui-wingeneral.h (struct tui_gen_win_info): Don't declare.
2019-10-09Remove tui_win_is_auxiliaryTom Tromey2-8/+0
tui_win_is_auxiliary is not used, so remove it. gdb/ChangeLog 2019-10-09 Tom Tromey <tom@tromey.com> * tui/tui-data.c (tui_win_is_auxiliary): Remove. * tui/tui-data.h (tui_win_is_auxiliary): Don't declare.
2019-10-09Remove tui_default_win_viewport_heightTom Tromey3-63/+9
tui_default_win_viewport_height was only called from a single spot, for a single type of window. This patch removes the function and moves the logic into the sole caller. gdb/ChangeLog 2019-10-09 Tom Tromey <tom@tromey.com> * tui/tui-disasm.c (tui_get_low_disassembly_address): Compute window height directly. * tui/tui-layout.h (tui_default_win_viewport_height): Don't declare. * tui/tui-layout.c (tui_default_win_height): Remove. (tui_default_win_viewport_height): Remove.
2019-10-09Remove two TUI commentsTom Tromey1-2/+0
This removes two comments from tui.h. These were not useful. gdb/ChangeLog 2019-10-09 Tom Tromey <tom@tromey.com> * tui/tui.h: Remove comments.
2019-10-01Introduce metadata styleTom Tromey2-5/+6
This introduces a new "metadata" style and changes many places in gdb to use it. The idea here is to let the user distinguish gdb output from output that (conceptually at least) comes directly from the inferior. The newly-styled category includes text that gdb traditionally surrounds in "<...>", like "<unavailable>". I only added a single test for this. In many cases this output is difficult to test. Also, while developing this errors in the implementation of the new printf formats showed up as regressions. gdb/ChangeLog 2019-10-01 Tom Tromey <tom@tromey.com> * p-lang.c (pascal_printstr): Use metadata style. * value.c (show_convenience): Use metadata style. * valprint.c (valprint_check_validity, val_print_optimized_out) (val_print_not_saved, val_print_unavailable) (val_print_invalid_address, generic_val_print, val_print) (value_check_printable, val_print_array_elements): Use metadata style. * ui-out.h (class ui_out) <field_fmt>: New overload. <do_field_fmt>: Add style parameter. * ui-out.c (ui_out::field_fmt): New overload. * typeprint.c (type_print_unknown_return_type) (val_print_not_allocated, val_print_not_associated): Use metadata style. * tui/tui-out.h (class tui_ui_out) <do_field_fmt>: Add style parameter. * tui/tui-out.c (tui_ui_out::do_field_fmt): Update. * tracepoint.c (tvariables_info_1): Use metadata style. * stack.c (print_frame_arg, print_frame_info, print_frame) (info_frame_command_core): Use metadata style. * skip.c (info_skip_command): Use metadata style. * rust-lang.c (rust_print_enum): Use metadata style. * python/py-prettyprint.c (print_stack_unless_memory_error): Use metadata style. * python/py-framefilter.c (py_print_single_arg): Use metadata style. * printcmd.c (do_one_display, print_variable_and_value): Use metadata style. * p-valprint.c (pascal_val_print) (pascal_object_print_value_fields): Use metadata style. * p-typeprint.c (pascal_type_print_base): Use metadata style. * mi/mi-out.h (class mi_ui_out) <do_field_fmt>: Add style parameter. * mi/mi-out.c (mi_ui_out::do_field_fmt): Update. * m2-valprint.c (m2_print_long_set): Use metadata style. * m2-typeprint.c (m2_print_type): Use metadata style. * infcmd.c (print_return_value_1): Use metadata style. * gnu-v3-abi.c (print_one_vtable): Use metadata style. * f-valprint.c (info_common_command_for_block): Use metadata style. * f-typeprint.c (f_type_print_base): Use metadata style. * expprint.c (print_subexp_standard): Use metadata style. * cp-valprint.c (cp_print_value_fields): Use metadata style. * cli/cli-style.h (class cli_style_option): Add constructor. (metadata_style): Declare. * cli/cli-style.c (metadata_style): New global. (_initialize_cli_style): Register metadata style. * cli-out.h (class cli_ui_out) <do_field_fmt>: Add style parameter. * cli-out.c (cli_ui_out::do_field_fmt): Update. * c-typeprint.c (c_type_print_base_struct_union) (c_type_print_base_1): Use metadata style. * breakpoint.c (watchpoint_value_print) (print_one_breakpoint_location): Use metadata style. * break-catch-syscall.c (print_one_catch_syscall): Use metadata style. * break-catch-sig.c (signal_catchpoint_print_one): Use metadata style. * ada-valprint.c (val_print_packed_array_elements, printstr) (print_field_values, ada_val_print_ref, ada_val_print): Use metadata style. * ada-typeprint.c (print_array_type, ada_print_type): Use metadata style. * ada-tasks.c (print_ada_task_info, info_task): Use metadata style. * ada-lang.c (user_select_syms): Use metadata style. gdb/testsuite/ChangeLog 2019-10-01 Tom Tromey <tom@tromey.com> * lib/gdb-utils.exp (style): Handle "metadata" argument. * gdb.base/style.exp: Add metadata style test.
2019-10-01Remove the ui_out_style_kind enumTom Tromey2-2/+2
This removes the ui_out_style_kind enum, in favor of simply using ui_file_style references. This simplifies the code somewhat. gdb/ChangeLog 2019-10-01 Tom Tromey <tom@tromey.com> * ui-out.h (enum class ui_out_style_kind): Remove. (class ui_out) <field_string, field_stsream, do_field_string>: Change type of "style". * ui-out.c (ui_out::field_core_addr, ui_out::field_stream) (ui_out::field_string): Update. * tui/tui-out.h (class tui_ui_out) <do_field_string>: Change type of "style". * tui/tui-out.c (tui_ui_out::do_field_string): Update. * tracepoint.c (print_one_static_tracepoint_marker): Update. * stack.c (print_frame_arg, print_frame_info, print_frame): Update. * source.c (print_source_lines_base): Update. * solib.c (info_sharedlibrary_command): Update. * skip.c (info_skip_command): Update. * record-btrace.c (btrace_call_history_src_line) (btrace_call_history): Update. * python/py-framefilter.c (py_print_frame): Update. * mi/mi-out.h (class mi_ui_out) <do_field_string>: Change type of "style". * mi/mi-out.c (mi_ui_out::do_table_header) (mi_ui_out::do_field_signed, mi_ui_out::do_field_unsigned) (mi_ui_out::do_field_string): Update. * disasm.c (gdb_pretty_print_disassembler::pretty_print_insn): Update. * cli-out.h (class cli_ui_out) <do_field_string>: Change type of "style". * cli-out.c (cli_ui_out::do_table_header) (cli_ui_out::do_field_signed, cli_ui_out::do_field_unsigned) (cli_ui_out::do_field_skip, cli_ui_out::do_field_string) (cli_ui_out::do_field_fmt): Update. * breakpoint.c (print_breakpoint_location): Update. (update_static_tracepoint): Update.
2019-09-20Change TUI window commands to be case-sensitiveTom Tromey2-95/+67
The TUI window-related commands like "focus" are case insensitive. This is not the norm in gdb, and I don't see a good reason to have it here. This patch changes the TUI to be case sensitive, like the rest of gdb. gdb/ChangeLog 2019-09-20 Tom Tromey <tom@tromey.com> * NEWS: Mention case-sensitivity of TUI commands. * tui/tui-win.c (tui_set_focus_command): Now case-sensitive. (tui_set_win_height_command, parse_scrolling_args): Likewise. * tui/tui-layout.c (tui_layout_command): Now case-sensitive.
2019-09-20Use make_unique_xstrdup in TUITom Tromey2-2/+2
This changes a couple of spots in the TUI to use make_unique_xstrdup. This simplifies the code slightly. gdb/ChangeLog 2019-09-20 Tom Tromey <tom@tromey.com> * tui/tui-source.c (tui_source_window::set_contents): Use make_unique_xstrdup. * tui/tui-disasm.c (tui_disasm_window::set_contents): Use make_unique_xstrdup.
2019-09-20Remove separator comments from TUITom Tromey4-55/+0
This removes various separator comments from the TUI. These aren't used elsewhere in gdb, and they were incorrect in some cases as well. gdb/ChangeLog 2019-09-20 Tom Tromey <tom@tromey.com> * tui/tui-data.c: Remove separator comments. * tui/tui-layout.c: Remove separator comments. * tui/tui-win.c: Remove separator comments. * tui/tui-wingeneral.c: Remove separator comments.
2019-09-20Remove strcat_to_bufTom Tromey2-15/+0
An earlier patch in the series removed the last call to strcat_to_buf, so this patch removes the function entirely. gdb/ChangeLog 2019-09-20 Tom Tromey <tom@tromey.com> * tui/tui.h (strcat_to_buf): Don't declare. * tui/tui.c (strcat_to_buf): Remove.
2019-09-20Rename a private data member in tui_source_windowTom Tromey2-4/+4
This renames tui_source_window::fullname to add the "m_" prefix, as it is a private data member. gdb/ChangeLog 2019-09-20 Tom Tromey <tom@tromey.com> * tui/tui-source.h (struct tui_source_window) <m_fullname>: Rename from "fullname". * tui/tui-source.c (tui_source_window::set_contents) (tui_source_window::location_matches_p) (tui_source_window::maybe_update): Update.
2019-09-20Rename private data members of tui_data_windowTom Tromey2-36/+36
As Pedro suggested, this patch renames the private data members of tui_data_window to use the "m_" prefix. gdb/ChangeLog 2019-09-20 Tom Tromey <tom@tromey.com> * tui/tui-regs.h (struct tui_data_window) <get_current_group>: Update. <m_regs_content, m_regs_column_count, m_current_group>: Add "m_" prefix. * tui/tui-regs.c (tui_data_window::last_regs_line_no) (tui_data_window::line_from_reg_element_no) (tui_data_window::first_reg_element_no_inline) (tui_data_window::show_registers) (tui_data_window::show_register_group) (tui_data_window::display_registers_from) (tui_data_window::display_registers_from_line) (tui_data_window::first_data_item_displayed) (tui_data_window::delete_data_content_windows) (tui_data_window::erase_data_content) (tui_data_window::do_scroll_vertical) (tui_data_window::refresh_window) (tui_data_window::check_register_values): Update.
2019-09-20Change members of tui_locator_window to std::stringTom Tromey3-21/+11
This changes two members of tui_locator_window to have type std::string. This removes a static limit. gdb/ChangeLog 2019-09-20 Tom Tromey <tom@tromey.com> * tui/tui-stack.h (MAX_LOCATOR_ELEMENT_LEN): Remove define. (struct tui_locator_window) <full_name, proc_name>: Now std::string. * tui/tui-stack.c (tui_locator_window::make_status_line) (tui_locator_window::set_locator_fullname) (tui_locator_window::set_locator_info): Update. * tui/tui-source.c (tui_source_window::set_contents) (tui_source_window::showing_source_p): Update.
2019-09-20Remove a call to tui_locator_win_info_ptrTom Tromey1-4/+2
Commit e594a5d1 ("Turn two locator functions into methods") turned set_locator_fullname into a method on tui_locator_window. I missed it at the time, but this change allows for the removal of a call to tui_locator_win_info_ptr. gdb/ChangeLog 2019-09-20 Tom Tromey <tom@tromey.com> * tui/tui-stack.c (tui_locator_window::set_locator_fullname): Don't call tui_locator_win_info_ptr.
2019-09-20Don't call refresh in tui_resize_allTom Tromey1-1/+0
There's no reason to call refresh in tui_resize_all. This call flushes the curses window contents to the terminal -- but, because we're about the resize all the windows, we're going to be sending more data to the terminal momentarily. This patch removes the call. gdb/ChangeLog 2019-09-20 Tom Tromey <tom@tromey.com> * tui/tui-win.c (tui_resize_all): Don't call refresh.
2019-09-20Set TUI locator height to 1Tom Tromey3-17/+11
The TUI has long had code to resize the locator, using 2 as the height. However the code has "1" in a comment, like: locator->resize (2 /* 1 */ , This patch fixes the resizing code to set the height to 1. Doing this revealed what was probably the reason for setting the height to 2 in the first place: this caused the locator window to scroll. However, this is easily handled by calling scrollok on the locator window. gdb/ChangeLog 2019-09-20 Tom Tromey <tom@tromey.com> * tui/tui-win.c (tui_resize_all, tui_adjust_win_heights): Use 1 as height for locator. * tui/tui-stack.c (tui_locator_window::rerender): Call scrollok. * tui/tui-layout.c (show_source_disasm_command, show_data) (show_source_or_disasm_and_command): Use 1 as height for locator.
2019-09-20Change "win_resized" to boolTom Tromey4-9/+9
This changes the "win_resized" global to be a bool and then updates the uses. gdb/ChangeLog 2019-09-20 Tom Tromey <tom@tromey.com> * tui/tui.c (tui_enable): Update. * tui/tui-win.c (tui_sigwinch_handler, tui_async_resize_screen): Update. * tui/tui-data.h (tui_win_resized, tui_set_win_resized_to): Update. * tui/tui-data.c (win_resized): Now bool. (tui_win_resized): Return bool. (tui_set_win_resized_to): Accept a bool.
2019-09-20Use "bool" in tui_data_window::show_register_groupTom Tromey2-3/+3
This changes tui_data_window::show_register_group to use "bool" rather than "int". gdb/ChangeLog 2019-09-20 Tom Tromey <tom@tromey.com> * tui/tui-regs.h (struct tui_data_window) <show_register_group>: Change type of "refresh_values_only". * tui/tui-regs.c (tui_data_window::show_register_group): Change type of "refresh_values_only".
2019-09-20Simplify TUI disassemblyTom Tromey1-45/+26
This simplifies TUI disassembly somewhat, by removing manual memory management. gdb/ChangeLog 2019-09-20 Tom Tromey <tom@tromey.com> * tui/tui-disasm.c (struct tui_asm_line) <addr_string, insn>: Now std::string. (tui_disassemble): Add "pos" parameter. (tui_disasm_window::set_contents): Simplify.
2019-09-20Simplify tui_source_window_base::show_source_contentTom Tromey2-10/+6
tui_source_window_base::show_source_content is not used outside the class any more, so this makes it private. Examining the callers shows that it can't be called without source contents, so it can be simplified as well. gdb/ChangeLog 2019-09-20 Tom Tromey <tom@tromey.com> * tui/tui-winsource.h (struct tui_source_window_base) <show_source_content>: Now private. * tui/tui-winsource.c (tui_source_window_base::show_source_content): Don't handle empty content case.
2019-09-20Remove some explicit re-rendering from the TUITom Tromey1-4/+0
A couple of spots in tui-layout.c still call the show_source_content method. However, now that re-rendering is done by the resize method, these calls are no longer needed. gdb/ChangeLog 2019-09-20 Tom Tromey <tom@tromey.com> * tui/tui-layout.c (show_source_disasm_command) (show_source_or_disasm_and_command): Don't call show_source_content.
2019-09-20Change tui_make_status_line to be a methodTom Tromey2-18/+20
This changes tui_make_status_line to be a method on tui_locator_window. This is a minor cleanup. This also changes the new method to use the locator's width, rather than the terminal width. This is important if we ever want to allow windows to be made more narrow. gdb/ChangeLog 2019-09-20 Tom Tromey <tom@tromey.com> * tui/tui-stack.h (struct tui_locator_window) <make_status_line>: Declare. * tui/tui-stack.c (tui_locator_window::make_status_line): Rename from tui_make_status_line. (tui_locator_window::rerender): Update.
2019-09-20Change tui_make_status_line to return std::stringTom Tromey1-44/+25
This changes tui_make_status_line to return std::string. This cleans it up a bit, and removes some explicit memory management. gdb/ChangeLog 2019-09-20 Tom Tromey <tom@tromey.com> * tui/tui-stack.c (tui_make_status_line): Return std::string. (tui_locator_window::rerender): Update.
2019-09-20Move "fullname" to tui_source_windowTom Tromey4-13/+7
The "fullname" field in tui_source_window_base is only used by one subclass. This patch moves the field to that subclass, and changes it to be a unique_xmalloc_ptr. gdb/ChangeLog 2019-09-20 Tom Tromey <tom@tromey.com> * tui/tui-winsource.h (struct tui_source_window_base) <~tui_source_window_base>: Don't declare. <fullname>: Remove. * tui/tui-winsource.c (~tui_source_window_base): Remove. * tui/tui-source.h (struct tui_source_window) <fullname>: New member. * tui/tui-source.c (tui_source_window::set_contents): Update. (tui_source_window::location_matches_p) (tui_source_window::maybe_update): Update.
2019-09-20Change tui_source_element::line to be a unique_xmalloc_ptrTom Tromey4-16/+6
This changes tui_source_element::line to be a unique_xmalloc_ptr, removing some manual memory management. gdb/ChangeLog 2019-09-20 Tom Tromey <tom@tromey.com> * tui/tui-winsource.h (~tui_source_element): Remove. (tui_source_element): Update. (struct tui_source_element) <line>: Now a unique_xmalloc_ptr. * tui/tui-winsource.c (tui_show_source_line): Update. * tui/tui-source.c (tui_source_window::set_contents): Update. * tui/tui-disasm.c (tui_disasm_window::set_contents): Update.
2019-09-20Remove tui_clear_source_windows_detailTom Tromey5-25/+0
The calls to tui_clear_source_windows_detail in tui_add_win_to_layout aren't needed, because (after the resize unification) resizing will update the window contents. Removing these calls lets us remove several other things as well. gdb/ChangeLog 2019-09-20 Tom Tromey <tom@tromey.com> * tui/tui-data.h (tui_clear_source_windows_detail): Don't declare. * tui/tui-layout.c (tui_add_win_to_layout): Don't call tui_clear_source_windows_detail. * tui/tui-winsource.h (struct tui_source_window_base) <clear_detail>: Don't declare. * tui/tui-winsource.c (tui_source_window_base::clear_detail): Remove. * tui/tui-data.c (tui_clear_source_windows_detail): Remove.
2019-09-18Give a name to the TUI SingleKey keymapTom Tromey1-3/+6
Readline 8.0 has a feature that lets an application name a keymap. This in turn makes it simpler for users to bind keys in keymaps in their .inputrc. This patch gives a name to the TUI SingleKey keymap, so that additional bindings can be made there. For example: $if gdb set keymap SingleKey "X": "echo hello\\n\n" $endif The call to rl_initialize, in tui_initialize_readline, had to be removed so that .inputrc was not read too early. Note that Readline explicitly documents that this call is not needed. gdb/ChangeLog 2019-09-18 Tom Tromey <tom@tromey.com> * NEWS: Add entry. * tui/tui.c (tui_initialize_readline): Set name of keymap. Do not call rl_initialize. (tui_enable): Do not call rl_initialize. gdb/doc/ChangeLog 2019-09-18 Tom Tromey <tom@tromey.com> * gdb.texinfo (Editing): Document readline application name. (TUI Single Key Mode): Document TUI SingleKey keymap name.
2019-09-09Use ui_out for "info win"Tom Tromey1-6/+14
This changes the "info win" command to use ui-out. This yields somewhat nicer table output. gdb/ChangeLog 2019-09-09 Tom Tromey <tom@tromey.com> * tui/tui-win.c (tui_all_windows_info): Use ui_out.
2019-09-08Truncate long TUI window titlesTom Tromey1-1/+15
If a TUI window has a long title, it can overflow the title line. This changes the TUI to use just the tail part of the title in this case. gdb/ChangeLog 2019-09-08 Tom Tromey <tom@tromey.com> * tui/tui-wingeneral.c (box_win): Truncate long window titles. gdb/testsuite/ChangeLog 2019-09-08 Tom Tromey <tom@tromey.com> * gdb.tui/resize.exp: Remove setup_xfail. * gdb.tui/regs.exp: Remove setup_xfail. * gdb.tui/basic.exp: Remove setup_xfail.
2019-08-30Remove tui_win_info::refresh_allTom Tromey6-49/+0
The TUI has two duplicate "re-render this window" methods, "rerender" and "refresh_all". They differ only slightly in semantics, so I wanted to see if they could be unified. After looking into this, I decided that refresh_all was not needed. There are 4 calls to tui_refresh_all_win (the only caller of this method): 1. tui_enable. This sets the layout, which renders the windows. 2. tui_cont_sig. Here, I think it's sufficient to simply redraw the current window contents from the curses backing store, because gdb state didn't change while it was suspended 3. tui_dispatch_ctrl_char. This is the C-l handler, and here it's explicitly enough to just refresh the screen (as above). 4. tui_refresh_all_command. This is the command equivalent of C-l. So, this patch removes this method entirely and simplifies tui_refresh_all_win. gdb/ChangeLog 2019-08-30 Tom Tromey <tom@tromey.com> * tui/tui-winsource.h (struct tui_source_window_base) <refresh_all>: Don't declare. * tui/tui-winsource.c (tui_source_window_base::refresh_all): Remove. * tui/tui-win.c (tui_refresh_all_win): Don't call refresh_all or tui_show_locator_content. * tui/tui-regs.h (struct tui_data_window) <refresh_all>: Don't declare. * tui/tui-regs.c (tui_data_window::refresh_all): Remove. * tui/tui-data.h (struct tui_win_info) <refresh_all>: Don't declare.
2019-08-30Don't call wrefresh from tui_cont_sigTom Tromey1-2/+0
tui_cont_sig does not need to call wrefresh, because this is already done by tui_refresh_all_win. gdb/ChangeLog 2019-08-30 Tom Tromey <tom@tromey.com> * tui/tui-io.c (tui_cont_sig): Don't call wrefresh.
2019-08-30Minor rearrangement of tui-stack.cTom Tromey1-13/+7
This move _initialize_tui_stack to the end of tui-stack.c, per the gdb style; and then removes two unnecessary forward declarations. gdb/ChangeLog 2019-08-30 Tom Tromey <tom@tromey.com> * tui/tui-stack.c (_initialize_tui_stack): Move later. Remove unnecessary forward declarations.
2019-08-30Make tui_locator_window::set_locator_fullname re-renderTom Tromey1-3/+1
This changes tui_locator_window::set_locator_fullname to re-render the locator window, so that the callers don't need to do this. gdb/ChangeLog 2019-08-30 Tom Tromey <tom@tromey.com> * tui/tui-stack.c (tui_locator_window::set_locator_fullname): Call rerender. (tui_update_locator_fullname, tui_show_frame_info): Don't call tui_show_locator_content.
2019-08-30Swap tui_show_locator_content and tui_locator_window::rerenderTom Tromey1-21/+17
This swaps the bodies ot tui_show_locator_content and tui_locator_window::rerender, so that the latter does the work, and the former is now just an exported convenience wrapper. gdb/ChangeLog 2019-08-30 Tom Tromey <tom@tromey.com> * tui/tui-stack.c (tui_show_locator_content): Move lower. Rewrite. (tui_locator_window::rerender): Rewrite using body of previous tui_show_locator_content.