aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
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.
2019-08-15Replace write_inferior_memory with target_write_memoryTom Tromey12-68/+89
target_write_memory is just a simple wrapper for write_inferior_memory. Because target_write_memory is needed for gdbsupport, and because gdb uses the name "target_write_memory" everywhere, this patch renames write_inferior_memory and removes the wrapper. I think this brings gdb and gdbserver slightly more in sync. gdb/gdbserver/ChangeLog 2019-08-15 Tom Tromey <tromey@adacore.com> * tracepoint.c (write_inferior_data_pointer) (write_inferior_integer, write_inferior_int8) (write_inferior_uinteger, m_tracepoint_action_download) (r_tracepoint_action_download, x_tracepoint_action_download) (l_tracepoint_action_download, clear_inferior_trace_buffer) (download_agent_expr, download_tracepoint_1) (download_trace_state_variables, upload_fast_traceframes): Update. * server.c (gdb_write_memory): Update. * remote-utils.c (relocate_instruction): Update. * proc-service.c (ps_pdwrite): Update. * mem-break.c (remove_memory_breakpoint) (delete_fast_tracepoint_jump, set_fast_tracepoint_jump) (uninsert_fast_tracepoint_jumps_at) (reinsert_fast_tracepoint_jumps_at): Update. * linux-x86-low.c (append_insns) (i386_install_fast_tracepoint_jump_pad) (amd64_write_goto_address, i386_write_goto_address): Update. * linux-s390-low.c (append_insns, s390_write_goto_address): Update. * linux-ppc-low.c (ppc_relocate_instruction) (ppc_install_fast_tracepoint_jump_pad, emit_insns) (ppc_write_goto_address): Update. * linux-aarch64-low.c (append_insns): Update. * target.h (struct target_ops): Update. (write_inferior_memory): Don't declare. * target.c (target_write_memory): Rename from write_inferior_memory. Remove old target_write_memory.
2019-08-15Simplify write_inferior_memoryTom Tromey2-17/+9
gdbserver's write_inferior_memory uses a static variable to avoid memory leaks, and has a comment referring to the lack of cleanups. This patch removes this comment and the code in favor of a straightforward use of std::vector. gdb/gdbserver/ChangeLog 2019-08-15 Tom Tromey <tromey@adacore.com> * target.c (write_inferior_memory): Use std::vector.
2019-08-15Correct a typo in the documentation for the disassembler.Christophe Vidal2-1/+6
* docs/binutils.texi: Fixed notice message disassembler options section of the man page.
2019-08-15Fix CU overrun in scan_unit_for_symbolsTom Tromey2-1/+6
A customer program had a DWARF CU that consisted of just a CU DIE, without any children. In this situation, scan_unit_for_symbols will try to read past the end of the current CU, and will take use the first bytes of the next CU as an abbrev, printing an error message. This patch fixes the bug by changing scan_unit_for_symbols to stop at the end of the CU rather than the end of the .debug_info section. bfd/ChangeLog 2019-08-15 Tom Tromey <tromey@adacore.com> * dwarf2.c (scan_unit_for_symbols): Check for end of CU, not end of section.
2019-08-15Updatesd Swdish translation for the gas sub-directory.Nick Clifton2-872/+466
* po/sv.po: Updated Swedish translation.
2019-08-15[gdb] Fix gdb build on mips64-linuxTom de Vries2-0/+5
When compiling for mips64-linux, we get: ... src/gdb/linux-nat-trad.c:139:12: error: ‘gdbarch_num_regs’ was not declared \ in this scope 139 | regnum < gdbarch_num_regs (regcache->arch ()); ... Fix this by including gdbarch.h in linux-nat-trad.c, similar to commit b1c896b365 "Fix gdb build on macOS". Build on mips64-linux. gdb/ChangeLog: 2019-08-15 Tom de Vries <tdevries@suse.de> * linux-nat-trad.c: Include gdbarch.h.
2019-08-15Automatic date update in version.inGDB Administrator1-1/+1
2019-08-14AArch64: Allow additional sizes in prologueAlan Hayward5-22/+139
When saving registers to the stack at the start of a function, not all state needs to be saved. For example, only the first 64bits of float registers need saving. However, a program may choose to store extra state if it wishes, there is nothing preventing it doing so. The aarch64_analyze_prologue will error if it detects extra state being stored. Relex this restriction. Tested via aarch64-prologue test. gdb/ChangeLog: * aarch64-tdep.c (aarch64_analyze_prologue): Allow any valid register sizes. gdb/testsuite/ChangeLog: * gdb.arch/aarch64-prologue.c: New test. * gdb.arch/aarch64-prologue.exp: New file.
2019-08-14Fix gdb build on macOSTom Tromey3-0/+7
Internal testing showed that the macOS port did not build. The breakage was caused by the patch to remove the gdbarch.h include from defs.h. This patch fixes the problem. gdb/ChangeLog 2019-08-14 Tom Tromey <tromey@adacore.com> * darwin-nat.c: Include gdbarch.h. * darwin-nat-info.c: Include gdbarch.h.
2019-08-14PR24623, DWARF errorsAlan Modra2-110/+139
PR 24623 * dwarf2.c (stash_comp_unit): New function, extracted from.. (_bfd_dwarf2_find_nearest_line): ..here. (find_abstract_instance): Parse comp units and decode line info as needed.
2019-08-14Use comp_unit_maybe_decode_line_info in more placesAlan Modra2-32/+11
* dwarf2.c (comp_unit_maybe_decode_line_info): Declare. (comp_unit_find_nearest_line): Use it here.. (_bfd_dwarf2_find_symbol_bias): ..and here.
2019-08-14Remove _bfd_dwarf2_find_nearest_line addr_size parameterAlan Modra11-24/+26
This parameter might appear to be used to set up offset_size, but since git commit 024b2372f5 offset_size is either set from the debug_info data or is set to 4. * dwarf2.c (_bfd_dwarf2_find_nearest_line): Remove addr_size parameter. * libbfd-in.h (_bfd_dwarf2_find_nearest_line): Update prototype. * coffgen.c (coff_find_nearest_line_with_names): Adjust _bfd_dwarf2_find_nearest_line calls. * elf.c (_bfd_elf_find_nearest_line, _bfd_elf_find_line): Likewise. * elf32-arm.c (elf32_arm_find_nearest_line): Likewise. * elf64-alpha.c (elf64_alpha_find_nearest_line): Likewise. * elfnn-aarch64.c (elfNN_aarch64_find_nearest_line): Likewise. * elfxx-mips.c (_bfd_mips_elf_find_nearest_line): Likewise. * mach-o.c (bfd_mach_o_find_nearest_line): Likewise. * libbfd.h: Regenerate.
2019-08-14Automatic date update in version.inGDB Administrator1-1/+1
2019-08-13Remove tui_gen_win_info::last_visible_lineTom Tromey3-4/+7
The last_visible_line field of tui_gen_win_info is not used, so remove it. gdb/ChangeLog 2019-08-13 Tom Tromey <tom@tromey.com> * tui/tui-data.h (struct tui_gen_win_info) <last_visible_line>: Remove. * tui/tui-data.c (tui_initialize_static_data): Update.
2019-08-13Don't track the contents of the execution info windowTom Tromey3-70/+22
The curses library keeps track of the contents of each window, and can redraw the screen as needed. This means that in most cases is no need for the TUI windows to also keep track of their contents. This patch removes content tracking from the execution window, leaving that to curses. gdb/ChangeLog 2019-08-13 Tom Tromey <tom@tromey.com> * tui/tui-winsource.h (struct tui_exec_info_window) <~tui_exec_info_window, maybe_allocate_content, get_content, m_content>: Remove. (struct tui_source_window_base) <set_exec_info_content, show_exec_info_content>: Don't declare. * tui/tui-winsource.c (tui_exec_info_window::maybe_allocate_content): Remove. (tui_source_window_base::update_exec_info): Rename from set_exec_info_content. (tui_source_window_base::show_exec_info_content) (tui_source_window_base::update_exec_info): Remove.
2019-08-13Remove tui_clear_exec_info_contentTom Tromey3-18/+16
After the previous patch, all calls to tui_clear_exec_info_content come just after a call to tui_clear_source_content. Because these two windows are linked, I think it makes sense to have tui_clear_source_content simply do the work. So, this patch removes tui_clear_exec_info_content. gdb/ChangeLog 2019-08-13 Tom Tromey <tom@tromey.com> * tui/tui-winsource.h (tui_clear_exec_info_content): Don't declare. * tui/tui-winsource.c (tui_update_source_window_as_is) (tui_update_source_windows_with_addr, tui_erase_source_content): Update. (tui_clear_exec_info_content): Remove.
2019-08-13Remove tui_erase_exec_info_contentTom Tromey3-9/+11
One call to tui_erase_exec_info_content can be removed. This call is not needed because the function in question then immediately sets the execution info window contents. Once this is done, tui_clear_exec_info_content is just a wrapper for the only call to tui_erase_exec_info_content, so tui_erase_exec_info_content can be renamed and the wrapper function removed. gdb/ChangeLog 2019-08-13 Tom Tromey <tom@tromey.com> * tui/tui-winsource.h (tui_erase_exec_info_content): Don't declare. * tui/tui-winsource.c (tui_source_window_base::refresh_all): Don't call tui_erase_exec_info_content. (tui_clear_exec_info_content): Rename from tui_erase_exec_info_content. (tui_clear_exec_info_content): Delete.
2019-08-13Turn tui_show_exec_info_content into a methodTom Tromey3-7/+19
This changes tui_show_exec_info_content to be a method on tui_source_window_base. As it is only called by other methods on this class, it can be private. gdb/ChangeLog 2019-08-13 Tom Tromey <tom@tromey.com> * tui/tui-winsource.h (struct tui_source_window_base) <show_exec_info_content>: Declare. (tui_show_exec_info_content): Don't declare. * tui/tui-winsource.c (tui_source_window_base::show_exec_info_content): Rename from tui_show_exec_info_content. (tui_source_window_base::update_exec_info): Update.
2019-08-13Move code to tui-winsource.hTom Tromey3-41/+51
This moves code related to the execution info window from tui-data.h to tui-winsource.h. It fits better here because the execution info is conceptually part of the source and disassembly windows, and tui-winsource.h is where this common class lives. gdb/ChangeLog 2019-08-13 Tom Tromey <tom@tromey.com> * tui/tui-data.h (enum tui_bp_flag, tui_bp_flags, struct tui_source_element) (TUI_BP_HIT_POS, TUI_BP_BREAK_POS, TUI_EXEC_POS) (TUI_EXECINFO_SIZE, tui_exec_info_content): Move ... * tui/tui-winsource.h (enum tui_bp_flag, tui_bp_flags, struct tui_source_element, TUI_BP_HIT_POS, TUI_BP_BREAK_POS) (TUI_EXEC_POS, TUI_EXECINFO_SIZE, tui_exec_info_content): ... here.
2019-08-13Change tui_update_exec_info to be a methodTom Tromey4-9/+21
This changes tui_update_exec_info to be a method on tui_source_window_base. gdb/ChangeLog 2019-08-13 Tom Tromey <tom@tromey.com> * tui/tui-winsource.h (struct tui_source_window_base) <update_exec_info>: Declare. (tui_update_exec_info): Don't declare. * tui/tui-winsource.c (tui_update_source_window_as_is) (tui_source_window_base::refresh_all) (tui_update_all_breakpoint_info): Update. (tui_source_window_base::update_exec_info): Rename from tui_update_exec_info. * tui/tui-stack.c (tui_show_frame_info): Update.