Tom Tromey [Fri, 12 Jul 2019 00:27:02 +0000 (18:27 -0600)]
Change tui_update_breakpoint_info to be a method
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.
Tom Tromey [Fri, 12 Jul 2019 00:24:07 +0000 (18:24 -0600)]
Change tui_update_source_window to be a method
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.
Tom Tromey [Fri, 12 Jul 2019 00:22:06 +0000 (18:22 -0600)]
Change tui_update_source_window_as_is to be a method
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.
Tom Tromey [Fri, 12 Jul 2019 00:19:28 +0000 (18:19 -0600)]
Remove "noerror" parameter from some TUI functions
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.
Tom Tromey [Fri, 12 Jul 2019 00:03:45 +0000 (18:03 -0600)]
Remove separate visibility flag
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.
Tom Tromey [Wed, 10 Jul 2019 03:22:38 +0000 (21:22 -0600)]
Remove m_has_locator
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.
Martin Liska [Fri, 16 Aug 2019 11:14:36 +0000 (13:14 +0200)]
Fix detection of missing plugin for LTO objects.
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.
Alan Hayward [Fri, 16 Aug 2019 09:19:18 +0000 (10:19 +0100)]
Move [PAC] into a new MI field addr_flags
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.
Christophe Lyon [Fri, 16 Aug 2019 08:26:45 +0000 (08:26 +0000)]
[ld] [arm] Add support for noinit section
2019-08-16 Christophe Lyon <christophe.lyon@linaro.org>
* emulparams/armelf.sh (OTHER_SECTIONS): Add support for noinit
section.
Change-Id: Ib293f28cc5f21e9e9a13abf4d4e37f0a0eec41c0
Alan Modra [Fri, 16 Aug 2019 05:47:23 +0000 (15:17 +0930)]
PR24909, Uninitialized use on stack in readelf
PR 24909
PR 23499
* readelf.c (get_symbol_version_string): Set sym_info earlier.
Alan Modra [Fri, 16 Aug 2019 03:50:28 +0000 (13:20 +0930)]
PowerPC gcc bootstrap fail with bss-plt
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.
Alan Modra [Wed, 14 Aug 2019 07:01:05 +0000 (16:31 +0930)]
Aligned vs. unaligned ppc32 relocs
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.
Sandra Loosemore [Fri, 16 Aug 2019 01:15:16 +0000 (18:15 -0700)]
Fix paste-o in examine-backward.exp.
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}".
GDB Administrator [Fri, 16 Aug 2019 00:00:20 +0000 (00:00 +0000)]
Automatic date update in version.in
Tom de Vries [Thu, 15 Aug 2019 22:25:14 +0000 (00:25 +0200)]
[gdb] Make maint info sections print relocated addresses
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.
Tom Tromey [Tue, 9 Jul 2019 23:29:13 +0000 (17:29 -0600)]
TUI resize unification
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.
Tom Tromey [Thu, 1 Aug 2019 17:41:32 +0000 (11:41 -0600)]
Fix bug with character enumeration literal
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 '+'.
Christian Biesinger [Thu, 15 Aug 2019 16:29:04 +0000 (11:29 -0500)]
Rename internal Python functions to start with an underscore
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.
Jim Wilson [Thu, 15 Aug 2019 19:01:13 +0000 (12:01 -0700)]
RISC-V: Fix lui relaxation issue with code at address 0.
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.
Tom Tromey [Tue, 9 Jul 2019 21:35:17 +0000 (15:35 -0600)]
TUI window resize should not need invisibility
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.
Tom Tromey [Sun, 7 Jul 2019 03:19:45 +0000 (21:19 -0600)]
Change TUI source window iteration
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.
Tom Tromey [Sat, 6 Jul 2019 23:32:45 +0000 (17:32 -0600)]
Rename the "reset" method to "resize"
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.
Tom Tromey [Sat, 6 Jul 2019 23:30:02 +0000 (17:30 -0600)]
Remove tui_initialize_static_data
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.
Tom Tromey [Sat, 6 Jul 2019 22:28:46 +0000 (16:28 -0600)]
Minor simplification in tui_default_win_viewport_height
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.
Tom Tromey [Sat, 6 Jul 2019 22:17:46 +0000 (16:17 -0600)]
Remove tui_clear_source_content
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.
Tom Tromey [Sat, 6 Jul 2019 21:57:53 +0000 (15:57 -0600)]
Turn tui_erase_source_content into a method
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.
Tom Tromey [Sat, 6 Jul 2019 21:52:13 +0000 (15:52 -0600)]
Remove tui_alloc_source_buffer
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.
Tom Tromey [Sat, 6 Jul 2019 21:09:01 +0000 (15:09 -0600)]
Change tui_line_is_displayed to be a method
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.
Tom Tromey [Sat, 6 Jul 2019 21:06:47 +0000 (15:06 -0600)]
Change tui_addr_is_displayed into a method
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.
Tom Tromey [Sat, 6 Jul 2019 21:04:12 +0000 (15:04 -0600)]
Move contents of tui_show_frame_info to new method
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.
Tom Tromey [Sat, 6 Jul 2019 19:52:08 +0000 (13:52 -0600)]
Avoid string_file in tui_make_status_line
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.
Tom Tromey [Sat, 6 Jul 2019 17:32:06 +0000 (11:32 -0600)]
Move locator code to tui-stack.c
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.
Tom Tromey [Sat, 6 Jul 2019 14:23:34 +0000 (08:23 -0600)]
Remove FIXMEs from tui-layout.c
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.
Tom Tromey [Sat, 6 Jul 2019 14:21:38 +0000 (08:21 -0600)]
Simplify TUI boxing
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.
Sandra Loosemore [Thu, 15 Aug 2019 17:23:18 +0000 (10:23 -0700)]
Disable dw2-dir-file-name.exp on remote and/or Windows host.
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.
Sandra Loosemore [Thu, 15 Aug 2019 17:17:54 +0000 (10:17 -0700)]
Skip batch-preserve-term-settings.exp tests that cannot work on Windows.
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.
Tom Tromey [Thu, 15 Aug 2019 17:23:13 +0000 (11:23 -0600)]
Use gdb::byte_vector in target_write_memory
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.
Christian Biesinger [Wed, 14 Aug 2019 23:13:04 +0000 (18:13 -0500)]
[testsuite] Make the testsuite work on mingw
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:/.
Nick Clifton [Thu, 15 Aug 2019 14:23:18 +0000 (15:23 +0100)]
Add a description of the 'n' symbol type displayed by nm.
PR 24767
* doc/binutils.texi (nm): Document the 'n' symbol type.
Tom Tromey [Wed, 14 Aug 2019 15:18:21 +0000 (09:18 -0600)]
Replace write_inferior_memory with target_write_memory
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.
Tom Tromey [Wed, 14 Aug 2019 15:11:28 +0000 (09:11 -0600)]
Simplify write_inferior_memory
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.
Christophe Vidal [Thu, 15 Aug 2019 13:38:31 +0000 (14:38 +0100)]
Correct a typo in the documentation for the disassembler.
* docs/binutils.texi: Fixed notice message disassembler options
section of the man page.
Tom Tromey [Wed, 14 Aug 2019 20:01:57 +0000 (14:01 -0600)]
Fix CU overrun in scan_unit_for_symbols
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.
Nick Clifton [Thu, 15 Aug 2019 11:41:24 +0000 (12:41 +0100)]
Updatesd Swdish translation for the gas sub-directory.
* po/sv.po: Updated Swedish translation.
Tom de Vries [Thu, 15 Aug 2019 06:14:31 +0000 (08:14 +0200)]
[gdb] Fix gdb build on mips64-linux
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.
GDB Administrator [Thu, 15 Aug 2019 00:00:21 +0000 (00:00 +0000)]
Automatic date update in version.in
Alan Hayward [Wed, 14 Aug 2019 14:47:05 +0000 (15:47 +0100)]
AArch64: Allow additional sizes in prologue
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.
Tom Tromey [Wed, 14 Aug 2019 14:40:18 +0000 (08:40 -0600)]
Fix gdb build on macOS
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.
Alan Modra [Wed, 14 Aug 2019 01:21:22 +0000 (10:51 +0930)]
PR24623, DWARF errors
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.
Alan Modra [Wed, 14 Aug 2019 01:56:48 +0000 (11:26 +0930)]
Use comp_unit_maybe_decode_line_info in more places
* dwarf2.c (comp_unit_maybe_decode_line_info): Declare.
(comp_unit_find_nearest_line): Use it here..
(_bfd_dwarf2_find_symbol_bias): ..and here.
Alan Modra [Wed, 14 Aug 2019 01:10:20 +0000 (10:40 +0930)]
Remove _bfd_dwarf2_find_nearest_line addr_size parameter
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.
GDB Administrator [Wed, 14 Aug 2019 00:00:22 +0000 (00:00 +0000)]
Automatic date update in version.in
Tom Tromey [Sat, 6 Jul 2019 14:18:27 +0000 (08:18 -0600)]
Remove tui_gen_win_info::last_visible_line
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.
Tom Tromey [Sat, 6 Jul 2019 14:10:50 +0000 (08:10 -0600)]
Don't track the contents of the execution info window
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.
Tom Tromey [Sat, 6 Jul 2019 13:37:39 +0000 (07:37 -0600)]
Remove tui_clear_exec_info_content
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.
Tom Tromey [Fri, 5 Jul 2019 23:36:16 +0000 (17:36 -0600)]
Remove tui_erase_exec_info_content
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.
Tom Tromey [Fri, 5 Jul 2019 23:35:13 +0000 (17:35 -0600)]
Turn tui_show_exec_info_content into a method
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.
Tom Tromey [Fri, 5 Jul 2019 23:32:19 +0000 (17:32 -0600)]
Move code to tui-winsource.h
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.
Tom Tromey [Fri, 5 Jul 2019 23:24:07 +0000 (17:24 -0600)]
Change tui_update_exec_info to be a method
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.
Tom Tromey [Fri, 5 Jul 2019 23:22:05 +0000 (17:22 -0600)]
Change tui_set_exec_info_content to be a method
This changes tui_set_exec_info_content to bea 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)
<set_exec_info_content>: Declare.
(tui_set_exec_info_content): Don't declare.
* tui/tui-winsource.c
(tui_source_window_base::set_exec_info_content): Rename from
tui_set_exec_info_content.
(tui_update_exec_info): Update.
Tom Tromey [Fri, 5 Jul 2019 23:18:18 +0000 (17:18 -0600)]
Change tui_show_source_content to be a method
This changes tui_show_source_content 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)
<show_source_content>: Declare.
(tui_show_source_content): Don't declare.
* tui/tui-winsource.c (tui_update_source_window_as_is): Update.
(tui_source_window_base::show_source_content): Rename from
tui_show_source_content.
(tui_source_window_base::refresh_all): Update.
* tui/tui-layout.c (show_source_disasm_command)
(show_source_or_disasm_and_command): Update.
Tom Tromey [Fri, 5 Jul 2019 23:14:46 +0000 (17:14 -0600)]
Change tui_check_and_display_highlight_if_needed to be a method
This changes tui_check_and_display_highlight_if_needed to be a method
on tui_win_info. This makes it clear that the NULL check in that
function is not needed, so it is removed here.
gdb/ChangeLog
2019-08-13 Tom Tromey <tom@tromey.com>
* tui/tui-winsource.c (tui_erase_source_content)
(tui_show_source_content, tui_source_window_base::refresh_all):
Update.
* tui/tui-wingeneral.h
(tui_check_and_display_highlight_if_needed): Don't declare.
* tui/tui-wingeneral.c
(tui_win_info::check_and_display_highlight_if_needed): Rename from
check_and_display_highlight_if_needed.
* tui/tui-win.c (tui_rehighlight_all)
(tui_win_info::make_visible_with_new_height): Update.
* tui/tui-regs.c (tui_data_window::display_registers_from_line)
(tui_data_window::erase_data_content)
(tui_data_window::display_all_data): Update.
* tui/tui-data.h (struct tui_win_info)
<check_and_display_highlight_if_needed>: Declare.
Tom Tromey [Fri, 5 Jul 2019 18:46:23 +0000 (12:46 -0600)]
Delete invisible TUI windows
This changes the TUI so that when the layout changes, any windows that
are invisible are now deleted. This makes it simpler to understand
window lifetimes.
gdb/ChangeLog
2019-08-13 Tom Tromey <tom@tromey.com>
* tui/tui-win.c (tui_resize_all): Call
tui_delete_invisible_windows.
* tui/tui-layout.c (show_layout): Call
tui_delete_invisible_windows.
* tui/tui-data.h (tui_delete_invisible_windows): Declare.
* tui/tui-data.c (tui_delete_invisible_windows): New function.
Tom Tromey [Fri, 5 Jul 2019 18:38:44 +0000 (12:38 -0600)]
Simplify tui_show_disassem
tui_show_disassem does not need to call tui_add_win_to_layout, because
the callers that could change the layout have already ensured that it
exists.
gdb/ChangeLog
2019-08-13 Tom Tromey <tom@tromey.com>
* tui/tui-disasm.c (tui_show_disassem): Add assertion. Don't call
tui_add_win_to_layout.
Tom Tromey [Fri, 5 Jul 2019 18:35:08 +0000 (12:35 -0600)]
Make tui_default_win_height static
tui_default_win_height is only used in tui-layout.c, so make it static.
gdb/ChangeLog
2019-08-13 Tom Tromey <tom@tromey.com>
* tui/tui-layout.h (tui_default_win_height): Don't declare.
* tui/tui-layout.c (tui_default_win_height): Now static.
Tom Tromey [Fri, 5 Jul 2019 18:34:31 +0000 (12:34 -0600)]
Two simplifications in tui-layout.c
This patch simplifies some code in tui-layout.c.
In show_layout, all the layout settings can be handled by a single
switch statement. In show_source_disasm_command and
show_source_or_disasm_and_command, there is no need to check the
current layout, as the caller has already done so.
gdb/ChangeLog
2019-08-13 Tom Tromey <tom@tromey.com>
* tui/tui-layout.c (show_layout): Unify all layout cases into a
single switch.
(show_source_disasm_command, show_source_or_disasm_and_command):
Don't check current layout.
Tom Tromey [Fri, 5 Jul 2019 18:29:18 +0000 (12:29 -0600)]
Simplify tui_make_all_invisible
This simplifies the implementation of tui_make_all_invisible. Also,
because show_data is only called by show_layout, this hoists the call
to tui_make_all_invisible and removes the call from show_data.
gdb/ChangeLog
2019-08-13 Tom Tromey <tom@tromey.com>
* tui/tui-wingeneral.c (make_all_visible): Remove.
(tui_make_all_invisible): Simplify.
* tui/tui-layout.c (tui_make_all_invisible): Move from
tui-wingeneral.c; simplify.
(show_layout): Hoist call to tui_make_all_invisible.
(show_data): Don't call tui_make_all_invisible.
Tom Tromey [Fri, 5 Jul 2019 18:27:08 +0000 (12:27 -0600)]
Remove tui_make_all_visible
The function tui_make_all_visible is not used, so remove it.
gdb/ChangeLog
2019-08-13 Tom Tromey <tom@tromey.com>
* tui/tui-wingeneral.h (tui_make_all_visible): Don't declare.
* tui/tui-wingeneral.c (tui_make_all_visible): Remove.
Tom Tromey [Fri, 5 Jul 2019 18:13:40 +0000 (12:13 -0600)]
Move current_layout to tui-layout.c
This moves the current_layout global to tui-layout.c. This allows for
the removal of an accessor function; but also it just seems clearer to
have it here.
gdb/ChangeLog
2019-08-13 Tom Tromey <tom@tromey.com>
* tui/tui-layout.c (current_layout, tui_current_layout): Move from
tui-data.c.
(show_source_disasm_command, show_data)
(show_source_or_disasm_and_command): Don't use
tui_set_current_layout_to.
* tui/tui-data.h (tui_set_current_layout_to): Don't declare.
* tui/tui-data.c (current_layout, tui_current_layout): Move to
tui-layout.c.
(tui_set_current_layout_to): Remove.
Tom Tromey [Fri, 5 Jul 2019 18:11:52 +0000 (12:11 -0600)]
Remove struct tui_layout_def
"layout_def" isn't actually used in the TUI, so remove it.
gdb/ChangeLog
2019-08-13 Tom Tromey <tom@tromey.com>
* tui/tui-layout.c (tui_set_layout): Update.
* tui/tui-data.h (struct tui_layout_def): Remove.
(tui_layout_def): Don't declare.
* tui/tui-data.c (layout_def): Remove.
(tui_layout_def): Remove.
Tom Tromey [Fri, 5 Jul 2019 18:00:06 +0000 (12:00 -0600)]
clear_detail can only be called on TUI source windows
The clear_detail method can only be called on source windows, so
remove definitions from the base of the class hierarchy, leaving only
a single non-virtual method.
gdb/ChangeLog
2019-08-13 Tom Tromey <tom@tromey.com>
* tui/tui-winsource.h (struct tui_source_window_base)
<clear_detail>: No longer "override".
* tui/tui-regs.h (struct tui_data_window) <clear_detail>: Remove.
* tui/tui-regs.c (tui_data_window::clear_detail): Remove.
* tui/tui-data.h (struct tui_win_info) <clear_detail>: Remove.
* tui/tui-command.h (struct tui_cmd_window) <clear_detail>:
Remove.
* tui/tui-command.c (tui_cmd_window::clear_detail): Remove.
Christian Biesinger [Tue, 13 Aug 2019 19:00:58 +0000 (14:00 -0500)]
[readline] Fix compilation on MinGW
S_ISLNK should not be called outside of an #ifdef.
However, this specific call is actually unnecessary, because
linkok can only be 0 if S_ISLNK is true, per the code above.
I have sent a bug report to bug-readline, though it does not show
up in the online archive yet.
2019-08-13 Christian Biesinger <cbiesinger@google.com>
* colors.c (_rl_print_color_indicator): Remove unnecessary
S_ISLNK check to fix compilation on MinGW.
Tom Tromey [Mon, 12 Aug 2019 18:06:20 +0000 (12:06 -0600)]
Don't include readline headers from tracepoint.c
I was curious why updating readline caused so much to be to rebuilt,
so I look at all the uses of the readline headers. Most are included
for valid reasons (either readline directory or for tilde_expand); but
the includes in tracepoint.c didn't seem to be used.
This patch removes them. Tested by rebuilding.
gdb/ChangeLog
2019-08-13 Tom Tromey <tromey@adacore.com>
* tracepoint.c: Don't include readline.h or history.h.
Tom de Vries [Tue, 13 Aug 2019 16:57:50 +0000 (18:57 +0200)]
[gdb/testsuite] Fix gdb.gdb/selftest.exp regexp
With gdb.gdb/selftest.exp, we get:
...
(xgdb) PASS: gdb.gdb/selftest.exp: send SIGINT signal to child process
^M
Thread 1 "xgdb" received signal SIGINT, Interrupt.^M
0x00007ffff5bf01db in poll () from /lib64/libc.so.6^M
(gdb) FAIL: gdb.gdb/selftest.exp: send ^C to child process again
...
The failure is due to gdb printing 'Thread 1 "xgdb" received signal SIGINT',
but the regexp in the test-case expecting 'Program received signal SIGINT'.
Fix this by updating the regexp, similar to how that is done earlier in the
test-case.
gdb/testsuite/ChangeLog:
2019-08-13 Tom de Vries <tdevries@suse.de>
* gdb.gdb/selftest.exp (send ^C to child process again): Accept also
Thread.
Sandra Loosemore [Tue, 13 Aug 2019 16:09:30 +0000 (09:09 -0700)]
Fixes for gdb.python tests on remote Windows host.
This patch fixes several test ERRORs and FAILs seen from running
gdb.python tests on a remote Windows host. The problems fixed
generally fall into these categories:
- Failure to copy the .py script to the host.
- Confusion between build and host pathnames.
- Assuming pathnames printed on the host include "/" as a directory
separator.
- Tests that need to be conditionally disabled due to missing features
on the host, etc.
2019-08-13 Sandra Loosemore <sandra@codesourcery.com>
gdb/testsuite/
* gdb.python/py-completion.exp: Download the .py file to the host
and use its host pathname. Conditionalize tests that use
tab completion and manipulate files on the build machine.
* gdb.python/py-events.exp: Download the .py file to the host
and use its host pathname.
* gdb.python/py-evsignal.exp: Likewise.
* gdb.python/py-evthreads.exp: Likewise.
* gdb.python/py-framefilter-invalidarg.exp: Match Windows
pathname syntax.
* gdb.python/py-framefilter.exp: Download the .py file to the right
place on the host. Match Windows pathname syntax.
* gdb.python/py-mi-var-info-path-expression.exp: Download the
.py file to the host and use its host pathname.
* gdb.python/py-objfile-script.exp: Match Windows pathname syntax.
* gdb.python/py-objfile.exp: Expect a host pathname, not a
build pathname. Skip symlink test on Windows host. Add missing
newline at end of file.
* gdb.python/py-pp-maint.exp: Download the .py file to the host
and use its host pathname.
* gdb.python/py-pp-registration.exp: Match Windows pathname syntax.
* gdb.python/py-section-script.exp: Use host location of binfile
on safe-path. Use correct path separator on Windows host.
Reorder alternatives in gdb_test_multiple to prevent matching
the wrong alternative on success.
* gdb.python/py-symtab.exp: Match Windows pathname syntax.
GDB Administrator [Tue, 13 Aug 2019 00:00:26 +0000 (00:00 +0000)]
Automatic date update in version.in
Tom Tromey [Sun, 21 Apr 2019 19:58:49 +0000 (13:58 -0600)]
Require readline 7 or newer
This changes gdb to require readline 7 or newer at build time.
gdb/ChangeLog
2019-08-12 Tom Tromey <tom@tromey.com>
* configure: Rebuild.
* configure.ac: Check for readline 7.
* NEWS: Mention readline 7 requirement.
* README: Update.
gdb/doc/ChangeLog
2019-08-12 Tom Tromey <tom@tromey.com>
* gdb.texinfo (Configure Options): Document minimum version of
readline.
Tom Tromey [Sun, 4 Aug 2019 23:39:27 +0000 (17:39 -0600)]
Remove readline hack from gdb_select
As discussed on gdb-patches, this removes the readline hack from the
mingw-hdep.c version of gdb_select. It's believed that this is not
needed any more. See:
https://sourceware.org/ml/gdb-patches/2019-03/msg00465.html
gdb/ChangeLog
2019-08-12 Tom Tromey <tom@tromey.com>
* mingw-hdep.c (gdb_select): Remove readline hack.
Tom Tromey [Mon, 12 Aug 2019 16:24:03 +0000 (10:24 -0600)]
Import readline 8.0
This imports readline 8.0.
readline/ChangeLog.gdb
2019-08-12 Tom Tromey <tom@tromey.com>
* Imported readline 8.0.
Patrick Palka [Sun, 17 Mar 2019 14:32:16 +0000 (08:32 -0600)]
Fix gdb's selftest.exp after readline import
After the sync there is one testsuite regression, the test
"signal SIGINT" in gdb.gdb/selftest.exp which now FAILs. Previously,
the readline 6.2 SIGINT handler would temporarily reinstall the
underlying application's SIGINT handler and immediately re-raise SIGINT
so that the orginal handler gets invoked. But now (since readline 6.3)
its SIGINT handler does not re-raise SIGINT or directly invoke the
original handler; it now sets a flag marking that SIGINT was raised, and
waits until readline explicitly has control to call the application's
SIGINT handler. Anyway, because SIGINT is no longer re-raised from
within readline's SIGINT handler, doing "signal SIGINT" with a stopped
inferior gdb process will no longer resume and then immediately stop the
process (since there is no 2nd SIGINT to immediately catch). Instead,
the inferior gdb process will now just print "Quit" and continue to run.
So with this commit, this particular test case is adjusted to reflect
this change in behavior (we now have to send a 2nd SIGINT manually to
stop it).
gdb/testsuite/ChangeLog
2019-08-12 Patrick Palka <patrick@parcs.ath.cx>
* gdb.gdb/selftest.exp (test_with_self): Update test to now
expect the GDB inferior to no longer immediately stop after
being resumed with "signal SIGINT".
Tom Tromey [Sun, 7 Oct 2018 21:29:57 +0000 (15:29 -0600)]
Remove gdb workaround from readline/xfree.c
There is a gdb-local patch to deal with interrupts during completion.
The original thread adding this patch is here:
https://sourceware.org/ml/gdb-patches/2011-06/msg00147.html
I believe readline now implements the approach suggested by
Chet Ramey:
https://sourceware.org/ml/gdb-patches/2011-06/msg00493.html
So, I believe this patch can be removed.
readline/ChangeLog.gdb
2018-10-07 Tom Tromey <tom@tromey.com>
* Makefile.in (xfree.o): Don't depend on readline.h.
* xfree.c (xfree): Remove gdb workaround.
* xmalloc.h (xfree): Remove #define.
Tom Tromey [Sun, 7 Oct 2018 21:25:44 +0000 (15:25 -0600)]
Remove gdb workaround from readline/emacs_keymap.c
There is a gdb-local patch in readline/emacs_keymap.c that says:
/* Temporary - this is a bug in readline 5.1 that should be fixed in
readline 5.2. */
So, I think this can be removed now. I have no way to test this, as
the patch was specific to mingw.
readline/ChangeLog.gdb
2018-10-07 Tom Tromey <tom@tromey.com>
* emacs_keymap.c: Remove gdb workaround.
Tom Tromey [Sun, 7 Oct 2018 21:24:12 +0000 (15:24 -0600)]
Remove gdb workaround from readline/complete.c
This removes a gdb-local patch from readline's get_y_or_n. The code
references a gdb test that continues to work when I remove this patch.
So, I think it is not needed any more.
readline/ChangeLog.gdb
2018-10-07 Tom Tromey <tom@tromey.com>
* complete.c (get_y_or_n): Remove gdb workaround.
Tom Tromey [Sun, 7 Oct 2018 18:52:13 +0000 (12:52 -0600)]
Import readline 7.0 (patch 5)
This imports readline 7.0 (up to patch 5) while preserving all
gdb-local changes.
This was done by checking out the readline git repository, making a
branch based on the gdb baseline revision, applying the gdb changes to
that branch, and then merging from readline 7.
readline/ChangeLog.gdb
2019-08-12 Tom Tromey <tom@tromey.com>
* Imported readline 7.0 patch 5.
Srinath Parvathaneni [Mon, 12 Aug 2019 16:17:18 +0000 (17:17 +0100)]
Modify the ARM encoding and decoding of SQRSHRL and UQRSHLL MVE instructions.
This is a change to the first published specifications [1][a] but since there is no hardware
out there that uses the old instructions we do not want to support the old variant.
This changes are done based on the latest published specifications [1][b].
[1] https://developer.arm.com/architectures/cpu-architecture/m-profile/docs/ddi0553/latest/armv81-m-architecture-reference-manual
[a] version bf
[b] version bh
gas * config/tc-arm.c (enum operand_parse_code): Add the entry OP_I48_I64.
(po_imm1_or_imm2_or_fail): Marco to check the immediate is either of
48 or 64.
(parse_operands): Add case OP_I48_I64.
(do_mve_scalar_shift1): Add function to encode the MVE shift
instructions with 4 arguments.
* testsuite/gas/arm/mve-shift-bad.l: Modify.
* testsuite/gas/arm/mve-shift-bad.s: Likewise.
* testsuite/gas/arm/mve-shift.d: Likewise.
* testsuite/gas/arm/mve-shift.s: Likewise.
opcodes * arm-dis.c (struct mopcode32 mve_opcodes): Modify the mask for
cases MVE_SQRSHRL and MVE_UQRSHLL.
(print_insn_mve): Add case for specifier 'k' to check
specific bit of the instruction.
Barnaby Wilks [Mon, 12 Aug 2019 10:08:36 +0000 (11:08 +0100)]
Add generic and ARM specific support for half-precision IEEE 754 floating point numbers to the assembler.
Half precision floating point numbers will be encoded using the IEEE 754
half precision floating point format - 16 bits in total, 1 for sign, 5
for exponent and 10 bits of mantissa.
This patch implements the float16 directive for both the IEEE 754 format
and the Arm alternative format for the Arm backend.
The syntax of the directive is:
.float16 <0-n decimal numbers>
e.g.
.float16 12.0
.float16 0.23, 433.1, 0.06
The Arm alternative format is almost identical to the IEEE 754 format,
except that it doesn't encode for NaNs or Infinity (instead an exponent
of 0x1F represents a normalized number in the range 65536 to 131008).
The alternative format is documented in the reference manual:
https://static.docs.arm.com/ddi0487/db/DDI0487D_b_armv8_arm.pdf?_ga=2.
72318806.
49764181.
1561632697-
999473562.
1560847439
Which format is used is controlled by the .float16_format <format>
directive, where if <format> = ieee, then use the IEEE 754
half-precision format else if <format> = alternative, then use the
Arm alternative format
Or the format can be set on the command line via the -mfp16-format
option that has a similar syntax. -mfp16-format=<ieee|alternative>.
This also fixes the format and it cannot be changed by any directives.
Once the format has been set (either by the command line option or a directive) it cannot be changed,
and any attempts to change it (i.e. with the float16_format directive) will result in a warning and the
line being ignored.
For ELF targets the appropriate EABI attribute will be written out at the end of assembling
if the format has been explicitly specified. If no format has been explicitly specified then no
EABI attributes will be written.
If the format is not explicitly specified then any float16 directives are encoding using the IEEE 754-2008
format by default until the format is fixed or changed with the float16_format directive.
gas * config/tc-arm.c (enum fp_16bit_format): Add enum to represent the 2 float16 encodings.
(md_atof): Set precision for float16 type.
(arm_is_largest_exponent_ok): Check for whether to encode with the IEEE or alternative
format.
(set_fp16_format): Parse a float16_format directive.
(arm_parse_fp16_opt): Parse the fp16-format command line option.
(aeabi_set_public_attributes): For ELF encode the FP16 format EABI attribute.
* config/tc-arm.h (TC_LARGEST_EXPONENT_IS_NORMAL): Macro that expands to
arm_is_largest_exponent_ok.
(arm_is_largest_exponent_ok): Add prototype for arm_is_largest_exponent_ok function.
* doc/c-arm.texi: Add documentation for .float16, .float16_format and -mfp16-format=
* testsuite/gas/arm/float16-bad.d: New test.
* testsuite/gas/arm/float16-bad.l: New test.
* testsuite/gas/arm/float16-bad.s: New test.
* testsuite/gas/arm/float16-be.d: New test.
* testsuite/gas/arm/float16-format-bad.d: New test.
* testsuite/gas/arm/float16-format-bad.l: New test.
* testsuite/gas/arm/float16-format-bad.s: New test.
* testsuite/gas/arm/float16-format-opt-bad.d: New test.
* testsuite/gas/arm/float16-format-opt-bad.l: New test.
* testsuite/gas/arm/float16-le.d: New test.
* testsuite/gas/arm/float16.s: New test.
* testsuite/gas/arm/float16-eabi-alternative-format.d: New test.
* testsuite/gas/arm/float16-eabi-ieee-format.d: New test.
* testsuite/gas/arm/float16-eabi-no-format.d: New test.
* testsuite/gas/arm/float16-eabi.s: New test.
* config/atof-ieee.c (H_PRECISION): Macro for precision of float16
type.
(atof_ieee): Set precision and exponent bits for encoding float16
types.
(gen_to_words): NaN and Infinity encoding for float16.
(ieee_md_atof): Set precision for encoding float16 type.
Alan Modra [Mon, 12 Aug 2019 01:45:19 +0000 (11:15 +0930)]
PR24851, gas/testsuite/gas/epiphany/badrelax.s failure with MALLOC_PERTURB_=1
PR 24851
* config/tc-epiphany.c (md_estimate_size_before_relax): Clear
extra opcode bytes when changing from a 2-byte to a 4-byte insn.
GDB Administrator [Mon, 12 Aug 2019 00:00:22 +0000 (00:00 +0000)]
Automatic date update in version.in
GDB Administrator [Sun, 11 Aug 2019 00:00:54 +0000 (00:00 +0000)]
Automatic date update in version.in
Alan Modra [Sat, 10 Aug 2019 03:32:49 +0000 (13:02 +0930)]
Sort statement_enum and lang_statement_union
To make comparing the two easier.
* ldlang.h (enum statement_enum): Sort.
(union lang_statement_union): Sort.
Alan Modra [Sat, 10 Aug 2019 03:05:20 +0000 (12:35 +0930)]
Delete unused ldlang.h structs
* ldlang.h (lang_common_statement_type): Delete.
(lang_object_symbols_statement_type): Delete.
(union lang_statement_union): Remove common_statement and
object_symbols_statement.
Alan Modra [Sat, 10 Aug 2019 02:58:31 +0000 (12:28 +0930)]
stat_alloc casts
Casts from a void* just clutter the source.
* ldexp.c (exp_intop, exp_bigintop, exp_relop, exp_binop, exp_trinop),
(exp_unop, exp_nameop, exp_assop, exp_assert): Remove casts of
stat_alloc return value.
* ldlang.c (new_statement, new_afile, sort_def_symbol),
(lang_memory_region_lookup, lang_memory_region_alias),
(ldlang_add_undef, ldlang_add_require_defined, insert_pad),
(lang_add_gc_name, lang_new_phdr): Likewise.
* lexsup.c (set_segment_start): Likewise.
Alan Modra [Sat, 10 Aug 2019 01:00:19 +0000 (10:30 +0930)]
lang_input_statement_type next pointers
"next" and "next_real_file" in lang_input_statement_type always point
to another lang_input_statement_type, so it makes sense for these to
not be the generic lang_statement_union_type. This patch also updates
a number of variables in ldlang.c for the same reason, and modifies
lang_statement_append to reduce the need for casts.
* ldlang.h (lang_input_statement_type): Make next
and next_real_file a lang_input_statement_type pointer.
(lang_statement_append): Delete prototype.
(LANG_FOR_EACH_INPUT_STATEMENT): Update for lang_input_statement_type
change.
* ldmain.c (add_archive_element): Likewise.
* ldlang.c: Likewise throughout.
(lang_statement_append): Make static. Make element and field
void pointers. Remove casts in calls.
(lang_check): Use a lang_input_statement_type pointer for "file".
(find_rescan_insertion): Similarly for "iter" and return value.
(lang_process): Similarly for "insert", "iter" and "temp".
* emultempl/spuelf.em (embedded_spu_file): Likewise.
* emultempl/aix.em (gld${EMULATION_NAME}_before_allocation): Expand
lang_statment_append call.
GDB Administrator [Sat, 10 Aug 2019 00:00:29 +0000 (00:00 +0000)]
Automatic date update in version.in
Sandra Loosemore [Fri, 9 Aug 2019 20:45:44 +0000 (13:45 -0700)]
Match Windows pathnames in gdb.linespec/break-ask.exp.
2019-08-09 Sandra Loosemore <sandra@codesourcery.com>
gdb/testsuite/
* gdb.linespec/break-ask.exp: Generalize regexps to match
Windows pathnames too.
Pedro Franco de Carvalho [Fri, 9 Aug 2019 19:49:46 +0000 (16:49 -0300)]
Fix access to uninitialized variable in fill_in_stop_func
This patch changes find_pc_partial_function so that *block is set to
nullptr when it fails, so that fill_in_stop_func won't access an
uninitialized variable.
gdb/ChangeLog:
2019-08-09 Pedro Franco de Carvalho <pedromfc@linux.ibm.com>
* blockframe.c (find_pc_partial_function): Set *block to nullptr
when the function fails.
Andreas Arnez [Fri, 9 Aug 2019 18:27:03 +0000 (20:27 +0200)]
s390: Implement 'type_align' gdbarch method
The align.exp test case yields many FAILs on s390x, since GDB's _Alignoff
doesn't always agree with the compiler's. On s390x, the maximum alignment
is 8, but GDB returns an alignment of 16 for 16-byte data types such as
"long double".
This is fixed by implementing the type_align gdbarch method. The new
method returns an alignment of 8 for all integer, floating-point, and
vector types larger than 8 bytes. With this change, all align.exp tests
pass.
gdb/ChangeLog:
* s390-tdep.c (s390_type_align): New function.
(s390_gdbarch_init): Set it as type_align gdbarch method.
Nick Clifton [Fri, 9 Aug 2019 15:16:18 +0000 (16:16 +0100)]
Synchronize libiberty sources with gcc mainline.
* libiberty: Sync with gcc. Bring in:
2019-08-08 Martin Liska <mliska@suse.cz>
PR bootstrap/91352
* lrealpath.c (is_valid_fd): New function.
2019-07-24 Martin Liska <mliska@suse.cz>
PR lto/91228
* simple-object-elf.c (simple_object_elf_copy_lto_debug_sections):
Find first '\0' starting from gnu_lto + 1.
2019-07-12 Ren Kimura <rkx1209dev@gmail.com>
* simple-object-elf.c (simple_object_elf_match): Check zero value shstrndx.
This fixes a Bug 90924.
2019-07-22 Martin Liska <mliska@suse.cz>
* simple-object-elf.c (simple_object_elf_copy_lto_debug_sections):
Do not search for gnu_lto_v1, but search for first '\0'.
2019-07-18 Eduard-Mihai Burtescu <eddyb@lyken.rs>
* cplus-dem.c: Include rust-demangle.h.
* rust-demangle.c: Include rust-demangle.h.
* rust-demangle.h: New file.
2019-05-31 Michael Forney <mforney@mforney.org>
* cp-demangle.c: Don't define CP_DYNAMIC_ARRAYS if __STDC_NO_VLA__
is non-zero.
2019-04-30 Ben L <bobsayshilol@live.co.uk>
* d-demangle.c (dlang_parse_assocarray): Correctly handle error result.
* testsuite/d-demangle-expected: Add testcase.
* d-demangle.c (dlang_parse_tuple): Correctly handle error result.
* testsuite/d-demangle-expected: Add testcase.
* d-demangle.c (dlang_parse_structlit): Correctly handle error result.
* testsuite/d-demangle-expected: Add testcase.
* d-demangle.c (dlang_parse_arrayliteral): Correctly handle error result.
* testsuite/d-demangle-expected: Add testcase.
* d-demangle.c (dlang_parse_integer): Fix stack underflow.
* testsuite/d-demangle-expected: Add testcase.
* cp-demangle (d_print_comp_inner): Guard against a NULL 'typed_name'.
* testsuite/demangle-expected: Add testcase.
* cp-demangle.c (d_encoding): Guard against NULL return values from
d_right (dc).
* testsuite/demangle-expected: Add testcase.
2019-04-29 Ben L <bobsayshilol@live.co.uk>
* cp-demangle.c (d_expression_1): Don't peek ahead unless the current
char is valid.
* testsuite/demangle-expected: Add testcase.
2019-04-10 Nick Clifton <nickc@redhat.com>
PR 89394
* cp-demangle.c (cplus_demangle_fill_name): Reject negative
lengths.
(d_count_templates_scopes): Replace num_templates and num_scopes
parameters with a struct d_print_info pointer parameter. Adjust
body of the function accordingly. Add recursion counter and check
that the recursion limit is not reached.
(d_print_init): Pass dpi parameter to d_count_templates_scopes.
Reset recursion counter afterwards, unless the recursion limit was
reached.
Mihailo Stojanovic [Fri, 9 Aug 2019 10:06:37 +0000 (11:06 +0100)]
Add support for a MIPS specific .MIPS.xhash section.
This patch is a reimplementation of [1] which was submitted in 2015 by
Neil Schellenberger. Copyright issue was sorted out [2] last year.
It proposed a new section (.gnu.xhash) and related dynamic tag
(DT_GNU_XHASH). The new section would be virtually identical to the
existing .gnu.hash except for the translation table (xlat) which would
contain correct MIPS .dynsym indexes corresponding to the hashvals in
chains. This is because MIPS ABI imposes a different ordering on the
dynsyms than the one expected by the .gnu.hash section. Another addition
would be a leading word (ngnusyms) which would contain the number of
entries in the translation table.
In this patch, the new section name and dynamic tag are changed to
reflect the fact that the section should be treated as MIPS-specific
(.MIPS.xhash and DT_MIPS_XHASH).
This patch addresses the alignment issue as reported in [3], which is
caused by the leading word added to the .MIPS.xhash section. Leading word
is removed in this patch, and the number of entries in the translation
table is now calculated using DT_MIPS_SYMTABNO dynamic tag (this is
addressed by the corresponding glibc patch).
Suggestions on coding style in [4] were taken into account. Existing
GNU hash testcase was covered, and another one was added in the MIPS
part of the testsuite.
The other major change is reserving MIPS ABI version 5 for .MIPS.xhash,
marking the need of support for .MIPS.xhash in the dynamic linker (again,
addressed in the corresponding glibc patch). This is something which I
am not sure of, especially after reading [5]. I am confused on whether
this ABI version is reserved for IFUNC, or it can be used for this
purpose.
Already mentioned glibc patch is submitted at:
https://sourceware.org/ml/libc-alpha/2019-06/msg00456.html
[1] https://sourceware.org/ml/binutils/2015-10/msg00057.html
[2] https://sourceware.org/ml/binutils/2018-03/msg00025.html
[3] https://sourceware.org/ml/binutils/2016-01/msg00006.html
[4] https://sourceware.org/ml/binutils/2016-02/msg00097.html
[5] https://sourceware.org/ml/libc-alpha/2016-12/msg00853.html
ld * emulparams/elf32bmip.sh: Add .MIPS.xhash section.
* emulparams/elf32bmipn32-defs.sh: Add .MIPS.xhash section.
* emulparams/elf64bmip-defs.sh: Add .MIPS.xhash section.
* emultempl/mipself.em: Remove mips_after_parse function.
* testsuite/ld-elf/hash.d: Update comment.
* testsuite/ld-mips-elf/hash1.d: New test.
* testsuite/ld-mips-elf/hash1.s: Ditto.
* testsuite/ld-mips-elf/hash1a.d: Remove.
* testsuite/ld-mips-elf/hash1b.d: Ditto.
* testsuite/ld-mips-elf/hash1c.d: Ditto
* testsuite/ld-mips-elf/hash2.d: New test.
* testsuite/ld-mips-elf/mips-elf.exp: New tests.
* testsuite/ld-mips-elf/start.s: New test.
bfd * elf-bfd.h (struct elf_backend_data): New members.
* elflink.c (_bfd_elf_link_create_dynamic_sections): Create
.gnu.hash section if necessary.
(struct collect_gnu_hash_codes): New member.
(elf_gnu_hash_process_symidx): New function name.
(elf_renumber_gnu_hash_syms): Ignore local and undefined
symbols. Record xlat location for every symbol which should have
a .MIPS.xhash entry.
(bfd_elf_size_dynamic_sections): Add DT_GNU_HASH dynamic tag to
dynamic section if necessary.
(GNU_HASH_SECTION_NAME): New define.
(bfd_elf_size_dynsym_hash_dynstr): Get .MIPS.xhash section.
Update the section size info.
* elfxx-mips.c (struct mips_elf_hash_sort_data): New members.
(struct mips_elf_link_hash_entry): New member.
(mips_elf_link_hash_newfunc): Initialize .MIPS.xhash translation
table location.
(mips_elf_sort_hash_table): Initialize the pointer to the
.MIPS.xhash section.
(mips_elf_sort_hash_table_f): Populate the .MIPS.xhash
translation table entry with the symbol dynindx.
(_bfd_mips_elf_section_from_shdr): Add SHT_MIPS_XHASH.
(_bfd_mips_elf_fake_sections): Initialize .MIPS.xhash section
info.
(_bfd_mips_elf_create_dynamic_sections): Create .MIPS.xhash
section.
(_bfd_mips_elf_size_dynamic_sections): Add DT_MIPS_XHASH tag to
dynamic section.
(_bfd_mips_elf_finish_synamic_sections): Add DT_MIPS_XHASH.
(_bfd_mips_elf_final_write_processing): Set .MIPS.xhash section
sh_link info.
(_bfd_mips_elf_get_target_dtag): Get DT_MIPS_XHASH tag.
(MIPS_LIBC_ABI_XHASH): New ABI version enum value.
(_bfd_mips_post_process_headers): Mark the ABI version as
MIPS_LIBC_ABI_XHASH if there exists a .MIPS.xhash section,
but not a .hash section.
(_bfd_mips_elf_record_xhash_symbol): New function. Record a
position in the translation table, associated with the hash
entry.
* elfxx-mips.h (literal_reloc_p): Define
elf_backend_record_xhash_symbol backend hook.
* elfxx-target.h: Initialize elf_backend_record_xhash_symbol
backend hook.
include * elf/mips.h (SHT_GNU_XHASH): New define.
(DT_GNU_XHASH): New define.
binutils * readelf.c (get_mips_dynamic_type): Return MIPS_XHASH dynamic type.
(get_mips_section_type_name): Return MI{S_XHASH name string.
(dynamic_section_mips_val): Initialize the .MIPS.xhash dynamic
info.
(process_symbol_table): Initialize the .MIPS.xhash section
pointer. Adjust the readelf output to support the new section.
(process_object): Set the .MIPS.xhash dynamic info to zero.
Alan Hayward [Thu, 8 Aug 2019 08:01:12 +0000 (09:01 +0100)]
doc: fix PAC typo
gdb/doc/ChangeLog:
* gdb.texinfo (AArch64 Pointer Authentication): Fix typo.