aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2019-08-19Float16: Fix test failures for non ELF targetsBarnaby Wilks2-27/+26
The tests were failing due to md_atof trying to do word-wise endian switching on the float16 (for little-endian targets sometimes multi word values have their word order changed). However since a float16 is only 1 word wide, it would end up writing incorrect data, as you cannot switch the word order of just one word. * config/tc-arm.c (md_atof): Add precision check. Formatting.
2019-08-19Automatic date update in version.inGDB Administrator1-1/+1
2019-08-18Automatic date update in version.inGDB Administrator1-1/+1
2019-08-17PR24911, Heap overflow issue in qsort_r, dwarf.cAlan Modra2-2/+7
The actual args to this function are "pointers to pointers to debug_info". PR 24911 * dwarf.c (comp_addr_base): Dereference args.
2019-08-17Automatic date update in version.inGDB Administrator1-1/+1
2019-08-16[gdb/testsuite] Fix compare-sections.exp with -fPIE/-pieTom de Vries2-2/+14
When running gdb.base/compare-sections.exp with target board -fPIE/-pie, we get: ... FAIL: gdb.base/compare-sections.exp: after run to main: compare-sections -r ... The test expects the read-only sections to have the same contents as in the file: ... # Assume startup code doesn't change read-only sections. compare_sections "-r" ... but that's not the case for PIE executables. Fix this by allowing mismatched read-only sections for PIE executables. Tested on x86_64-linux. gdb/testsuite/ChangeLog: 2019-08-16 Tom de Vries <tdevries@suse.de> * gdb.base/compare-sections.exp ("after run to main"): Allow mismatched read-only sections for PIE executables.
2019-08-16x86-64: Move PIC check for PC-relative relocations backH.J. Lu8-79/+110
commit 83924b3846361f2f76f9a6e7b5afa01c0eebbd4f Author: H.J. Lu <hjl.tools@gmail.com> Date: Tue Feb 5 18:45:23 2019 -0800 x86-64: Restore PIC check for PCREL reloc against protected symbol moved PIC check for PC-relative relocations to elf_x86_64_check_relocs. Since linker defined symbols may not be processed at the time, we need to move the check back to elf_x86_64_relocate_section. bfd/ PR ld/24905 * elf64-x86-64.c (elf_x86_64_check_relocs): Move PIC check for PC-relative relocations back to ... (elf_x86_64_relocate_section): Here. ld/ PR ld/24905 * testsuite/ld-x86-64/pr24905-x32.d: New file. * testsuite/ld-x86-64/pr24905.d: Likewise. * testsuite/ld-x86-64/pr24905.s: Likewise. * testsuite/ld-x86-64/pr24905.t: Likewise. * testsuite/ld-x86-64/x86-64.exp: Run pr24905 and pr24905-x32.
2019-08-16Remove the TUI execution info windowTom Tromey10-67/+46
The TUI execution info window is unusual in that it is always linked to a source or disassembly window. Even updates of its content are handled by the source window, so it really has no life of its own. This patch removes this window entirely and puts its functionality directly into the source window. This simplifies the code somewhat. This is a user-visible change, because now the box around the source (or disassembly) window encloses the execution info as well. I consider this an improvement as well, though. Note that this patch caused ncurses to start emitting the "CSI Z" sequence, so I've added this to the test suite terminal implementation. gdb/ChangeLog 2019-08-16 Tom Tromey <tom@tromey.com> * tui/tui.h (enum tui_win_type) <EXEC_INFO_WIN>: Remove. * tui/tui-winsource.h (struct tui_exec_info_window): Remove. (struct tui_source_window_base) <make_visible, refresh_window, resize>: Remove methods. <execution_info>: Remove field. * tui/tui-winsource.c (tui_source_window_base::do_erase_source_content) (tui_show_source_line, tui_source_window_base) (~tui_source_window_base): Update. (tui_source_window_base::resize) (tui_source_window_base::make_visible) (tui_source_window_base::refresh_window): Remove. (tui_source_window_base::update_exec_info): Update. * tui/tui-source.c (tui_source_window::set_contents): Update. * tui/tui-disasm.c (tui_disasm_window::set_contents): Update. gdb/testsuite/ChangeLog 2019-08-16 Tom Tromey <tom@tromey.com> * lib/tuiterm.exp (_csi_Z): New proc. * gdb.tui/basic.exp: Update window positions. * gdb.tui/empty.exp: Update window positions.
2019-08-16Remove useless assignment from tui_remove_hooksTom Tromey2-1/+5
tui_remove_hooks clears deprecated_query_hook, but nothing in the TUI ever sets it; so remove the assignment. gdb/ChangeLog 2019-08-16 Tom Tromey <tom@tromey.com> * tui/tui-hooks.c (tui_remove_hooks): Don't set deprecated_query_hook.
2019-08-16Change tui_show_symtab_source to be a methodTom Tromey4-11/+20
This changes tui_show_symtab_source to be a method on tui_source_window. gdb/ChangeLog 2019-08-16 Tom Tromey <tom@tromey.com> * tui/tui-winsource.c (tui_update_source_windows_with_addr) (tui_update_source_windows_with_line): Update. * tui/tui-source.h (struct tui_source_window) <show_symtab_source>: Declare. (tui_show_symtab_source): Don't declare. * tui/tui-source.c (tui_show_symtab_source): Rename from tui_show_symtab_source.
2019-08-16Introduce tui_source_window_base::set_contents methodTom Tromey7-39/+67
This introduces the tui_source_window_base::set_contents method and implements it in the subclasses. This removes a check of the window type. gdb/ChangeLog 2019-08-16 Tom Tromey <tom@tromey.com> * tui/tui-winsource.h (struct tui_source_window_base) <set_contents>: Declare. * tui/tui-winsource.c (tui_source_window_base::update_source_window_as_is): Update. * tui/tui-source.h (struct tui_source_window) <set_contents>: Declare. (tui_set_source_content): Don't declare. * tui/tui-source.c (tui_source_window::set_contents): Rename from tui_set_source_content. * tui/tui-disasm.h (struct tui_disasm_window) <set_contents>: Declare. (tui_set_disassem_content): Don't declare. * tui/tui-disasm.c (tui_disasm_window::set_contents): Rename from tui_set_disassem_content.
2019-08-16Change tui_update_breakpoint_info to be a methodTom Tromey3-21/+28
This changes tui_update_breakpoint_info to be a method on tui_source_window_base. gdb/ChangeLog 2019-08-16 Tom Tromey <tom@tromey.com> * tui/tui-winsource.h (struct tui_source_window_base) <update_breakpoint_info>: Declare. (tui_update_breakpoint_info): Don't declare. * tui/tui-winsource.c (tui_source_window_base::update_source_window_as_is) (tui_update_all_breakpoint_info): Update. (tui_source_window_base::update_breakpoint_info): Rename from tui_update_breakpoint_info. (tui_source_window_base::update_exec_info): Update.
2019-08-16Change tui_update_source_window to be a methodTom Tromey5-18/+29
This changes tui_update_source_window to be a method on tui_source_window_base. gdb/ChangeLog 2019-08-16 Tom Tromey <tom@tromey.com> * tui/tui-winsource.h (struct tui_source_window_base) <update_source_window>: Declare. (tui_update_source_window): Don't declare. * tui/tui-winsource.c (tui_source_window_base::update_source_window): Rename from tui_update_source_window. (tui_source_window_base::rerender): Update. * tui/tui-source.c (tui_source_window::maybe_update): Update. * tui/tui-disasm.c (tui_show_disassem) (tui_show_disassem_and_update_source) (tui_disasm_window::maybe_update): Update.
2019-08-16Change tui_update_source_window_as_is to be a methodTom Tromey5-24/+35
This changes tui_update_source_window_as_is to be a method on tui_source_window_base. gdb/ChangeLog 2019-08-16 Tom Tromey <tom@tromey.com> * tui/tui-winsource.h (struct tui_source_window_base) <update_source_window_as_is>: Declare. (tui_update_source_window_as_is): Don't declare. * tui/tui-winsource.c (tui_update_source_window): Update (tui_source_window_base::update_source_window_as_is): Rename from tui_update_source_window_as_is. (tui_source_window_base::refill): Update. * tui/tui-source.c (tui_show_symtab_source): Update. * tui/tui-disasm.c (tui_disasm_window::do_scroll_vertical): Update.
2019-08-16Remove "noerror" parameter from some TUI functionsTom Tromey6-41/+43
A few TUI functions take a "noerror" parameter. This is only checked in one spot: in tui_set_source_content, if noerror is false, and if an error occurs, then the function will call print_sys_errmsg. This seems misguided to me, so this patch removes that code and this parameter. gdb/ChangeLog 2019-08-16 Tom Tromey <tom@tromey.com> * tui/tui-winsource.h (tui_update_source_window) (tui_update_source_window_as_is): Remove "noerror" parameter. * tui/tui-winsource.c (tui_update_source_window) (tui_update_source_window_as_is): Remove "noerror" parameter. (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 (tui_set_source_content) (tui_show_symtab_source): Remove "noerror" parameter. * tui/tui-source.c (tui_set_source_content): Remove "noerror" parameter. (tui_show_symtab_source): Likewise. (tui_source_window::maybe_update): Update. * tui/tui-disasm.c (tui_show_disassem) (tui_show_disassem_and_update_source) (tui_disasm_window::do_scroll_vertical) (tui_disasm_window::maybe_update): Update.
2019-08-16Remove separate visibility flagTom Tromey9-25/+46
TUI windows keep track of their visibility in a boolean field. However, this is not needed, because a window is visible if and only if it has an underlying curses handle. So, we can remove this separate field. gdb/ChangeLog 2019-08-16 Tom Tromey <tom@tromey.com> * tui/tui.c (tui_is_window_visible): Update. * tui/tui-wingeneral.c (tui_make_window) (tui_gen_win_info::make_visible, tui_refresh_all): Update. * tui/tui-win.c (window_name_completer, tui_refresh_all_win) (tui_set_focus_command, tui_all_windows_info, update_tab_width) (tui_set_win_height_command, parse_scrolling_args): Update. * tui/tui-source.c (tui_source_window::style_changed): Update. * tui/tui-regs.c (tui_show_registers) (tui_data_window::first_data_item_displayed) (tui_data_window::delete_data_content_windows) (tui_check_register_values, tui_reg_command): Update. * tui/tui-disasm.c (tui_show_disassem): Update. * tui/tui-data.h (struct tui_gen_win_info) <is_visible>: New method. <is_visible>: Remove field. * tui/tui-data.c (tui_next_win, tui_prev_win) (tui_delete_invisible_windows): Update.
2019-08-16Remove m_has_locatorTom Tromey3-9/+7
The previous patch removed the only use of m_has_locator, so this member can now be removed. gdb/ChangeLog 2019-08-16 Tom Tromey <tom@tromey.com> * tui/tui-winsource.h (struct tui_source_window_base) <m_has_locator>: Remove. * tui/tui-layout.c (show_source_disasm_command, show_data) (show_source_or_disasm_and_command): Update.
2019-08-16Fix detection of missing plugin for LTO objects.Martin Liska5-22/+26
2019-08-16 Martin Liska <mliska@suse.cz> PR ld/24912 * elflink.c: Report error only for not relocatable. * linker.c (_bfd_generic_link_add_one_symbol): Do not handle here lto_slim_object as it's handled in caller. 2019-08-16 Martin Liska <mliska@suse.cz> PR ld/24912 * object.cc (big_endian>::do_layout): Do not report error, but only set a flag. (big_endian>::do_add_symbols): Report error only for when relocatable.
2019-08-16Move [PAC] into a new MI field addr_flagsAlan Hayward11-10/+120
Add a new print_pc which prints both the PC and a new field addr_flags. Call this wherever the PC is printed in stack.c. Add a new gdbarch method get_pc_address_flags to obtain the addr_flag contents. By default returns an empty string, on AArch64 this returns PAC if the address has been masked in the frame. Document this in the manual and NEWS file. gdb/ChangeLog: * NEWS (Other MI changes): New subsection. * aarch64-tdep.c (aarch64_get_pc_address_flags): New function. (aarch64_gdbarch_init): Add aarch64_get_pc_address_flags. * arch-utils.c (default_get_pc_address_flags): New function. * arch-utils.h (default_get_pc_address_flags): New declaration. * gdbarch.sh: Add get_pc_address_flags. * gdbarch.c: Regenerate. * gdbarch.h: Likewise. * stack.c (print_pc): New function. (print_frame_info) (print_frame): Call print_pc. gdb/doc/ChangeLog: * gdb.texinfo (AArch64 Pointer Authentication) (GDB/MI Breakpoint Information) (Frame Information): Document addr_field.
2019-08-16[ld] [arm] Add support for noinit sectionChristophe Lyon2-1/+18
2019-08-16 Christophe Lyon <christophe.lyon@linaro.org> * emulparams/armelf.sh (OTHER_SECTIONS): Add support for noinit section. Change-Id: Ib293f28cc5f21e9e9a13abf4d4e37f0a0eec41c0
2019-08-16PR24909, Uninitialized use on stack in readelfAlan Modra2-6/+9
PR 24909 PR 23499 * readelf.c (get_symbol_version_string): Set sym_info earlier.
2019-08-16PowerPC gcc bootstrap fail with bss-pltAlan Modra2-1/+12
git commit 3e04d7655b introduced a bug by sizing output sections earlier in ppc_before_allocation. That meant PLT (and GOT) sizes were not included when calculating total executable section sizes. * emultempl/ppc32elf.em (ppc_before_allocation): Force running prelim_size_sections before deciding whether branch trampolines might be needed.
2019-08-16Aligned vs. unaligned ppc32 relocsAlan Modra2-0/+12
Given R_PPC_ADDR32 or R_PPC_UADDR32 relocs, this patch generates R_PPC_ADDR32 or R_PPC_UADDR32 dynamic relocs from either type depending on whether r_offset is 4-byte aligned, and similarly for R_PPC_ADDR16/R_PPC_UADDR16. * elf32-ppc.c (ppc_elf_relocate_section): Optimize unaligned relocs.
2019-08-15Fix paste-o in examine-backward.exp.Sandra Loosemore2-1/+6
This patch fixes a paste-o that was introduced in commit c8ad9b9a31aa3e6039567fc1f152dd454c946d5f. Previously the regexp for the "examine 3 bytes backward from ${address_zero}" test correctly matched 3 "${byte}" patterns, but in that commit the 6-byte regexp from the previous test was mistakenly repeated here instead. 2019-08-15 Sandra Loosemore <sandra@codesourcery.com> gdb/testsuite/ * gdb.base/examine-backward.exp: Correct regexp for "examine 3 bytes backward from ${address_zero}".
2019-08-16Automatic date update in version.inGDB Administrator1-1/+1
2019-08-16[gdb] Make maint info sections print relocated addressesTom de Vries2-18/+26
When running gdb.base/compare-sections.exp with -fPIE/-pie, we get: ... print /u *(unsigned char *) 0x00000238^M Cannot access memory at address 0x238^M (gdb) FAIL: gdb.base/compare-sections.exp: read-only: get value of read-only section ... The problem is that that "maint info sections" prints an unrelocated address: ... [0] 0x00000238->0x00000254 at 0x00000238: .interp ALLOC LOAD READONLY \ DATA HAS_CONTENTS ... while the test expects a relocated address. Given that the documentation states that the command displays "the section information displayed by info files", and that info files shows relocated addresses: ... 0x0000555555554238 - 0x0000555555554254 is .interp ... fix this by showing relocated addresses for maint info sections as well. Build and tested on x86_64-linux. gdb/ChangeLog: 2019-08-16 Tom de Vries <tdevries@suse.de> * maint.c (maintenance_info_sections): Also handle !ALLOBJ case using print_objfile_section_info.
2019-08-15TUI resize unificationTom Tromey16-183/+139
The TUI currently has two different ways to resize a window: the resize method, and the methods make_invisible_and_set_new_height and make_visible_with_new_height. There's no deep reason to have two different ways to resize a window, so this patch unifies them, leaving just the "resize" method. This also changes the locator to be handled more like an ordinary window and less like an adjunct of the associated source window. gdb/ChangeLog 2019-08-15 Tom Tromey <tom@tromey.com> * tui/tui-io.c (tui_puts_internal): Check TUI_CMD_WIN before calling update_cmdwin_start_line. * tui/tui-winsource.h (struct tui_source_window_base) <do_make_visible_with_new_height, set_new_height>: Don't declare. <rerender>: Declare. * tui/tui-winsource.c (tui_source_window_base::update_tab_width): Call rerender. (tui_source_window_base::set_new_height): Remove. (tui_source_window_base::rerender): Rename from do_make_visible_with_new_height. * tui/tui-win.c (tui_resize_all, tui_adjust_win_heights): Use resize method. (tui_win_info::make_invisible_and_set_new_height) (tui_win_info::make_visible_with_new_height): Remove. * tui/tui-stack.h (struct tui_locator_window) <rerender>: Declare. * tui/tui-stack.c (tui_locator_window::rerender): New method. * tui/tui-regs.h (struct tui_data_window) <set_new_height, do_make_visible_with_new_height>: Don't declare. <rerender>: Declare. * tui/tui-regs.c (tui_data_window::rerender): Rename from set_new_height. (tui_data_window::do_make_visible_with_new_height): Remove. * tui/tui-layout.c (show_source_disasm_command, show_data): Don't call tui_show_locator_content. (tui_gen_win_info::resize): Call rerender. (show_source_or_disasm_and_command): Don't call tui_show_locator_content. * tui/tui-data.h (struct tui_gen_win_info) <rerender>: New method. (struct tui_win_info) <rerender>: Declare. <set_new_height, make_invisible_and_set_new_height, make_visible_with_new_height>: Don't declare. * tui/tui-data.c (tui_win_list::rerender): New method. * tui/tui-command.h (struct tui_cmd_window) <do_make_visible_with_new_height>: Don't declare. * tui/tui-command.c (tui_cmd_window::do_make_visible_with_new_height): Remove. gdb/testsuite/ChangeLog 2019-08-15 Tom Tromey <tom@tromey.com> * gdb.tui/empty.exp: Enable resizing tests.
2019-08-15Fix bug with character enumeration literalTom Tromey7-5/+35
gnat encodes character enumeration literals using a few different schemes. The gnat compiler documented the "QU" and "QW" encodings, but failed to document that a simpler encoding was used for certain characters. This patch updates gdb to handle this simple Q encoding. Note that wide character literals are still not handled. gdb/ChangeLog 2019-08-15 Tom Tromey <tromey@adacore.com> * ada-exp.y (convert_char_literal): Handle "Q%c" encoding. * ada-lang.c (ada_enum_name): Likewise. gdb/testsuite/ChangeLog 2019-08-15 Tom Tromey <tromey@adacore.com> * gdb.ada/char_enum.exp: Add regression tests. * gdb.ada/char_enum/foo.adb (Char_Enum_Type): Use '_' and '0'. (Char, Gchar): Update. * gdb.ada/char_enum/pck.ads (Global_Enum_Type): Use '+'.
2019-08-15Rename internal Python functions to start with an underscoreChristian Biesinger5-13/+32
I could not tell if GdbSetPythonDirectory is internal or not because I could not find any references to it, so I left it as-is. Tested by running the testsuite on gdb.python/*.exp; everything still passes. 2019-08-15 Christian Biesinger <cbiesinger@google.com> * python/lib/gdb/__init__.py (GdbOutputFile): Rename to have a leading underscore. (GdbOutputErrorFile): Likewise. (global scope): Adjust constructor calls to GdbOutput{,Error}File accordingly. (execute_unwinders): Rename to have a leading underscore. (auto_load_packages): Likewise. (global scope): Adjust call to auto_load_packages accordingly. (GdbSetPythonDirectory): Likewise. * python/py-unwind.c (pyuw_sniffer): Call _execute_unwinders instead of execute_unwinders. gdb/testsuite/ChangeLog: 2019-08-15 Christian Biesinger <cbiesinger@google.com> * gdb.python/python.exp: Expect a leading underscore on GdbOutput{,Error}File.
2019-08-15RISC-V: Fix lui relaxation issue with code at address 0.Jim Wilson7-2/+65
This fixes a problem originally reported at https://github.com/riscv/riscv-binutils-gdb/issues/173 If you have code linked at address zero, you can have a lui instruction loading a value 0x800 which gets relaxed to a c.lui which is valid (c.lui 0x1 followed by addi -0x800). Relaxation can reduce the value below 0x800 at which point the c.lui 0x0 is no longer valid. We can fix this by converting the c.lui to a c.li which can load 0. bfd/ * elfnn-riscv.c (perform_relocation) <R_RISCV_RVC_LUI>: If RISCV_CONST_HIGH_PART (value) is zero, then convert c.lui instruction to c.li instruction, and use ENCODE_RVC_IMM to set value. ld/ * testsuite/ld-riscv-elf/c-lui-2.d: New. * testsuite/ld-riscv-elf/c-lui-2.ld: New. * testsuite/ld-riscv-elf/c-lui-2.s: New. * testsuite/ld-riscv-elf/ld-riscv-elf.exp: Run the c-lui-2 test.
2019-08-15TUI window resize should not need invisibilityTom Tromey4-23/+75
When resizing a window, the TUI currently first makes it invisible, then changes the size, and then restores its visibility. I think this is done because curses doesn't truly support resizing a window -- there is a "wresize" extension, but the man page says it isn't available in all versions of curses. First, this is probably not a major problem any more. I imagine most of those old systems are gone now. Second, I think it's a better API to have this detail hidden inside of the resize method. This patch changes the code to follow this idea, and changes the ordinary resize method to use wresize when it is available. The special case for the command window is also moved to methods on the command window. gdb/ChangeLog 2019-08-15 Tom Tromey <tom@tromey.com> * tui/tui-layout.c (show_layout, show_source_disasm_command) (show_data): Don't change window visibility. (tui_gen_win_info::resize): Remove special case for command window. Use wresize, when available. (show_source_or_disasm_and_command): Don't change window visibility. * tui/tui-command.h (struct tui_cmd_window) <resize>: Declare. <make_visible>: New method. * tui/tui-command.c (tui_cmd_window::resize): New method.
2019-08-15Change TUI source window iterationTom Tromey7-51/+92
Currently the TUI does separate bookkeeping to track which source windows exist. It seems better to me to just refer to the list of windows for this, so this patch removes the special handling and instead adds a new iterator. gdb/ChangeLog 2019-08-15 Tom Tromey <tom@tromey.com> * tui/tui-winsource.h (struct tui_source_window_iterator): New. (struct tui_source_windows): New. * tui/tui-winsource.c (tui_display_main): Update. * tui/tui-win.c (tui_resize_all, tui_adjust_win_heights) (new_height_ok, parse_scrolling_args): Update. * tui/tui-layout.c (show_layout, show_data): Update. * tui/tui-data.h (tui_source_windows, tui_clear_source_windows) (tui_add_to_source_windows): Don't declare. * tui/tui-data.c (source_windows, tui_source_windows) (tui_clear_source_windows, tui_add_to_source_windows): Remove.
2019-08-15Rename the "reset" method to "resize"Tom Tromey5-47/+59
tui_gen_win_info::reset really just resizes the window. This patch renames it to reflect this. gdb/ChangeLog 2019-08-15 Tom Tromey <tom@tromey.com> * tui/tui-winsource.h (struct tui_source_window_base) <resize>: Rename from reset. * tui/tui-winsource.c (tui_source_window_base::resize): Rename. * tui/tui-layout.c (show_source_disasm_command, show_data): Update. (tui_gen_win_info::resize): Rename. (show_source_or_disasm_and_command): Update. * tui/tui-data.h (struct tui_gen_win_info) <resize>: Rename from reset.
2019-08-15Remove tui_initialize_static_dataTom Tromey4-18/+7
tui_initialize_static_data is not needed, because locator moving and resizing is already handled in the layout code. gdb/ChangeLog 2019-08-15 Tom Tromey <tom@tromey.com> * tui/tui-stack.c (tui_initialize_static_data): Remove. * tui/tui-interp.c (tui_interp::init): Don't call tui_initialize_static_data. * tui/tui-data.h (tui_initialize_static_data): Don't declare.
2019-08-15Minor simplification in tui_default_win_viewport_heightTom Tromey2-1/+6
tui_default_win_viewport_height doesn't need to look at tui_win_list; it can simply check the type directly. gdb/ChangeLog 2019-08-15 Tom Tromey <tom@tromey.com> * tui/tui-layout.c (tui_default_win_viewport_height): Don't examine tui_win_list.
2019-08-15Remove tui_clear_source_contentTom Tromey4-24/+15
tui_clear_source_content is not needed. Instead, the callers can call erase_source_content, which is also changed to clear the content vector. gdb/ChangeLog 2019-08-15 Tom Tromey <tom@tromey.com> * tui/tui-winsource.h (tui_clear_source_content): Don't declare. * tui/tui-winsource.c (tui_update_source_window_as_is): Don't call tui_clear_source_content. (tui_clear_source_content): Remove. (tui_source_window_base::do_erase_source_content): Hoist call to content.clear(). * tui/tui-stack.c (tui_show_frame_info): Don't call tui_clear_source_content.
2019-08-15Turn tui_erase_source_content into a methodTom Tromey6-30/+53
This changes tui_erase_source_content into a method on tui_source_window_base. The bulk of the work is moved into a helper method, so that the callers can each pass the string appropriate to the particular window class. gdb/ChangeLog 2019-08-15 Tom Tromey <tom@tromey.com> * tui/tui-winsource.h (struct tui_source_window_base) <do_erase_source_content>: New method. <erase_source_content>: New method. (tui_erase_source_content): Don't declare. * tui/tui-winsource.c (tui_clear_source_content): Update. (tui_source_window_base::do_erase_source_content): Rename from tui_erase_source_content. (tui_source_window_base::show_source_content): Update. * tui/tui-win.c (tui_resize_all, tui_adjust_win_heights): Update. * tui/tui-source.h (struct tui_source_window) <erase_source_content>: New method. * tui/tui-disasm.h (struct tui_disasm_window) <erase_source_content>: New method.
2019-08-15Remove tui_alloc_source_bufferTom Tromey5-26/+20
There is no longer any need for tui_alloc_source_buffer. The two callers of this function immediately change the contents of the window, undoing the work done by this function. This required adding a move constructor to tui_source_element -- a mildly surprising find, but without this, resizing the vector will cause crashes. This issue was masked earlier because tui_alloc_source_buffer handled this. Note that a patch for this bug was submitted here: https://sourceware.org/ml/gdb-patches/2019-08/msg00094.html That patch is better, IMO, but the author as yet hasn't responded to a request for a ChangeLog entry. gdb/ChangeLog 2019-08-15 Tom Tromey <tom@tromey.com> * tui/tui-winsource.h (tui_alloc_source_buffer): Don't declare. (struct tui_source_element): Add DISABLE_COPY_AND_ASSIGN, and move constructor. * tui/tui-winsource.c (tui_alloc_source_buffer): Remove. * tui/tui-source.c (tui_set_source_content): Update. * tui/tui-disasm.c (tui_set_disassem_content): Update.
2019-08-15Change tui_line_is_displayed to be a methodTom Tromey5-32/+35
This changes tui_line_is_displayed to be a method on tui_source_window, now that it is obvious that it can only be called for this type. gdb/ChangeLog 2019-08-15 Tom Tromey <tom@tromey.com> * tui/tui-winsource.h (tui_line_is_displayed): Don't declare. * tui/tui-winsource.c (tui_line_is_displayed): Move to tui-source.c. * tui/tui-source.h (struct tui_source_window) <line_is_displayed>: Declare. * tui/tui-source.c (tui_source_window::line_is_displayed): New method. (tui_source_window::maybe_update): Update.
2019-08-15Change tui_addr_is_displayed into a methodTom Tromey5-32/+35
This changes tui_addr_is_displayed to be a method on tui_disasm_window, now that it is obvious that it can only be called for this type. gdb/ChangeLog 2019-08-15 Tom Tromey <tom@tromey.com> * tui/tui-winsource.h (tui_addr_is_displayed): Don't declare. * tui/tui-winsource.c (tui_addr_is_displayed): Move to tui-disasm.c. * tui/tui-disasm.h (struct tui_disasm_window) <addr_is_displayed>: Declare. * tui/tui-disasm.c (tui_disasm_window::addr_is_displayed): New method. (tui_disasm_window::maybe_update): Update.
2019-08-15Move contents of tui_show_frame_info to new methodTom Tromey7-57/+85
This moves much of the body of tui_show_frame_info to a new method on tui_source_window_base. This removes a check for the type of a window. gdb/ChangeLog 2019-08-15 Tom Tromey <tom@tromey.com> * tui/tui-winsource.h (struct tui_source_window_base) <maybe_update>: Declare. * tui/tui-stack.c (tui_show_frame_info): Call maybe_update method. * tui/tui-source.h (struct tui_source_window) <maybe_update>: Declare. * tui/tui-source.c (tui_source_window::maybe_update): New method. * tui/tui-disasm.h (struct tui_disasm_window) <maybe_update>: Declare. * tui/tui-disasm.c (tui_disasm_window::maybe_update): New method.
2019-08-15Avoid string_file in tui_make_status_lineTom Tromey2-5/+7
tui_make_status_line uses string_file where a simple std::string constructor would do. This makes this change. gdb/ChangeLog 2019-08-15 Tom Tromey <tom@tromey.com> * tui/tui-stack.c (tui_make_status_line): Use string constructor.
2019-08-15Move locator code to tui-stack.cTom Tromey6-50/+65
The locator is mostly implemented in tui-stack.c. This moves the remaining bits to tui-stack.c and tui-stack.h, as appropriate. gdb/ChangeLog 2019-08-15 Tom Tromey <tom@tromey.com> * tui/tui-wingeneral.c: Include tui-stack.h. * tui/tui-stack.h (MAX_LOCATOR_ELEMENT_LEN) (struct tui_locator_window): Move from tui-data.h. * tui/tui-stack.c (_locator, tui_locator_win_info_ptr) (tui_initialize_static_data): Move from tui-data.c. * tui/tui-data.h (MAX_LOCATOR_ELEMENT_LEN) (struct tui_locator_window): Move to tui-stack.c. * tui/tui-data.c (_locator, tui_locator_win_info_ptr) (tui_initialize_static_data): Move to tui-stack.c.
2019-08-15Remove FIXMEs from tui-layout.cTom Tromey3-10/+10
An earlier patch added a couple of FIXME comments to tui-layout.c. This removes them. This is possible due to the previous patch that changed how boxing works in the TUI -- now, no special case for the command window is needed in box_win. gdb/ChangeLog 2019-08-15 Tom Tromey <tom@tromey.com> * tui/tui-layout.c (show_source_disasm_command) (show_source_or_disasm_and_command): Use make_visible method, not tui_make_window. * tui/tui-command.h (struct tui_cmd_window) <make_visible>: Remove.
2019-08-15Simplify TUI boxingTom Tromey7-15/+39
In the TUI, whether or not a window can be boxed is a property of the window's type. This adds a can_box method to the window classes, and changes tui_make_window to defer to this, removing the "box_it" paramter. This also lets us remove "enum tui_box", as it is no longer used. gdb/ChangeLog 2019-08-15 Tom Tromey <tom@tromey.com> * tui/tui-wingeneral.h (tui_make_window): Update. * tui/tui-wingeneral.c (tui_make_window): Remove "box_it" parameter. (tui_gen_win_info::make_visible): Update. * tui/tui-regs.c (tui_data_window::display_registers_from): Update. * tui/tui-layout.c (show_source_disasm_command) (show_source_or_disasm_and_command): Update. * tui/tui-data.h (struct tui_gen_win_info) <can_box>: New method. (enum tui_box): Remove. (struct tui_win_info) <can_box>: New method. * tui/tui-command.h (struct tui_cmd_window) <can_box>: New method.
2019-08-15Disable dw2-dir-file-name.exp on remote and/or Windows host.Sandra Loosemore2-0/+12
This test has many hardwired assumptions that pathnames on build and host are the same, and that POSIX pathname syntax is used. This results in dozens of failures on a remote Windows host. Fixing these assumptions would involve nontrivial rewrites; meanwhile, let's make the test results reflect the reality that this testcase isn't supported on remote host. 2019-08-15 Sandra Loosemore <sandra@codesourcery.com> gdb/testsuite/ * gdb.dwarf2/dw2-dir-file-name.exp: Skip on remote or Windows host.
2019-08-15Skip batch-preserve-term-settings.exp tests that cannot work on Windows.Sandra Loosemore2-0/+12
This group of tests assume that the gdb "shell" command launches a POSIX-compliant shell supporting the PPID environment variable, which is used to get gdb's pid for killing it from a remote_exec shell. But on Windows host "shell" launches cmd.exe, which doesn't have an equivalent query. 2019-08-15 Sandra Loosemore <sandra@codesourcery.com> gdb/testsuite/ * gdb.base/batch-preserve-term-settings.exp (test_terminal_settings_preserved_after_sigterm): Skip on Windows.
2019-08-15Use gdb::byte_vector in target_write_memoryTom Tromey2-1/+6
Pedro pointed out that target_write_memory should use gdb::byte_vector rather than std::vector<unsigned char>. gdb/gdbserver/ChangeLog 2019-08-15 Tom Tromey <tromey@adacore.com> * target.c (target_write_memory): Use gdb::byte_vector.
2019-08-15[testsuite] Make the testsuite work on mingwChristian Biesinger2-0/+9
Dejagnu produces an objdir like /c/, but GDB expects something like c:/. So fix it up in lib/gdb.exp. gdb/testsuite/ChangeLog: 2019-08-14 Christian Biesinger <cbiesinger@google.com> * lib/gdb.exp: When running on a mingw target, replace /x/ with x:/.
2019-08-15Add a description of the 'n' symbol type displayed by nm.Nick Clifton2-1/+9
PR 24767 * doc/binutils.texi (nm): Document the 'n' symbol type.