Tom Tromey [Tue, 13 Aug 2019 17:39:58 +0000 (11:39 -0600)]
Fix Fortran regression with variables in nested functions
Sergio pointed out that commit commit
aa3b6533 ("Allow nested function
displays") regressed a few gdb.fortran tests. I was able to reproduce
these failures with gcc head.
The bug is that some spots calling contained_in will in fact do the
wrong thing if nested functions are considered as contained. In the
particular case of the Fortran regression, it was the call in
block_innermost_frame, being called from get_hosting_frame -- in this
case, the caller is specifically trying to avoid the nested case.
This patch fixes the problem by adding an "allow_nested" parameter to
contained_in, essentially reverting the change for most callers.
gdb/ChangeLog
2019-08-19 Tom Tromey <tromey@adacore.com>
* printcmd.c (do_one_display, info_display_command): Update.
* block.h (contained_in): Return bool. Add allow_nested
parameter.
* block.c (contained_in): Return bool. Add allow_nested
parameter.
Tom Tromey [Mon, 24 Jun 2019 22:02:47 +0000 (16:02 -0600)]
Add Rust support to source highlighting
Currently, no release of GNU Source Highlight supports Rust. However,
I've checked in a patch to do so there, and I plan to make a new
release sometime this summer.
This patch prepares gdb for that by adding support for Rust to the
source highlighting code.
Because Source Highlight will throw an exception if the language is
unrecognized, this also changes gdb to ignore exceptions here. This
will cause gdb to fall back to un-highlighted source text.
This updates gdb's configure script to reject the combination of
Source Highlight and -static-libstdc++. This is done because it's not
possible to use -static-libstdc++ and then catch exceptions from a
shared library.
Tested with the current and development versions of Source Highlight.
gdb/ChangeLog
2019-08-19 Tom Tromey <tom@tromey.com>
* configure: Rebuild.
* configure.ac: Disallow the combination of -static-libstdc++ and
source highlight.
* source-cache.c (get_language_name): Handle rust.
(source_cache::get_source_lines): Ignore highlighting exceptions.
Tom Tromey [Fri, 26 Jul 2019 21:42:25 +0000 (15:42 -0600)]
Add --with-static-standard-libraries to the top level
gdb should normally not be linked with -static-libstdc++. Currently
this has not caused problems, but it's incompatible with catching an
exception thrown from a shared library -- and a subsequent patch
changes gdb to do just this.
This patch adds a new --with-static-standard-libraries flag to the
top-level configure. It defaults to "auto", which means enabled if
gcc is being built, and disabled otherwise.
ChangeLog
2019-08-19 Tom Tromey <tom@tromey.com>
* configure: Rebuild.
* configure.ac: Add --with-static-standard-libraries.
Tom Tromey [Thu, 15 Aug 2019 13:33:20 +0000 (07:33 -0600)]
Fix N^2 behavior in _bfd_dwarf2_find_symbol_bias
A customer reported a case where addr2line was very slow. We tracked
this down to some N^2 behavior in _bfd_dwarf2_find_symbol_bias in the
unusual case where no function can be found.
This patch fixes the bug, and reduces the runtime for a particular
request from 127 seconds to 1 second.
bfd/ChangeLog
2019-08-19 Tom Tromey <tromey@adacore.com>
* dwarf2.c (_bfd_dwarf2_find_symbol_bias): Create hash table
holding symbols.
Alan Modra [Mon, 19 Aug 2019 10:54:35 +0000 (20:24 +0930)]
PR24898, An out-of-bounds read occured in display_data
Given 32-bit pointers and a 64-bit bfd_size_type, it is relatively
easy to construct a value of augmentation_data_len (eg. 0x100000000)
that won't fail pointer checks but will print without bounds.
PR 24898
* dwarf.c (display_debug_frames): Use the read_cie check and error
for augmentation data length.
Alan Modra [Mon, 19 Aug 2019 08:04:03 +0000 (17:34 +0930)]
PowerPC64 ha/lo insn checks
These are done in ppc64_elf_edit_toc, which now also garbage collects
unused GOT entries. The checks for legitimate instructions weren't
being done for the GOT relocs, unless the file also happened to have a
toc section.
* elf64-ppc.c (struct ppc64_elf_obj_tdata): Rename has_gotrel
to has_optrel.
(struct _ppc64_elf_section_data): Likewise.
(ppc64_elf_check_relocs): Set has_optrel for more relocs.
(ppc64_elf_edit_toc): Do ha/lo insn checks in GOT loop rather
than TOC loop. Check PLT16 insns too.
Barnaby Wilks [Thu, 15 Aug 2019 16:21:59 +0000 (16:21 +0000)]
Float16: Fix test failures for non ELF targets
The tests were failing due to md_atof trying to do word-wise endian
switching on the float16 (for little-endian targets sometimes
multi word values have their word order changed).
However since a float16 is only 1 word wide, it would end up writing
incorrect data, as you cannot switch the word order of just one word.
* config/tc-arm.c (md_atof): Add precision check. Formatting.
GDB Administrator [Mon, 19 Aug 2019 00:00:34 +0000 (00:00 +0000)]
Automatic date update in version.in
GDB Administrator [Sun, 18 Aug 2019 00:01:39 +0000 (00:01 +0000)]
Automatic date update in version.in
Alan Modra [Sat, 17 Aug 2019 08:31:05 +0000 (18:01 +0930)]
PR24911, Heap overflow issue in qsort_r, dwarf.c
The actual args to this function are "pointers to pointers to
debug_info".
PR 24911
* dwarf.c (comp_addr_base): Dereference args.
GDB Administrator [Sat, 17 Aug 2019 00:00:22 +0000 (00:00 +0000)]
Automatic date update in version.in
Tom de Vries [Fri, 16 Aug 2019 21:48:28 +0000 (23:48 +0200)]
[gdb/testsuite] Fix compare-sections.exp with -fPIE/-pie
When running gdb.base/compare-sections.exp with target board -fPIE/-pie, we
get:
...
FAIL: gdb.base/compare-sections.exp: after run to main: compare-sections -r
...
The test expects the read-only sections to have the same contents as in the
file:
...
# Assume startup code doesn't change read-only sections.
compare_sections "-r"
...
but that's not the case for PIE executables.
Fix this by allowing mismatched read-only sections for PIE executables.
Tested on x86_64-linux.
gdb/testsuite/ChangeLog:
2019-08-16 Tom de Vries <tdevries@suse.de>
* gdb.base/compare-sections.exp ("after run to main"): Allow
mismatched read-only sections for PIE executables.
H.J. Lu [Fri, 16 Aug 2019 21:25:15 +0000 (14:25 -0700)]
x86-64: Move PIC check for PC-relative relocations back
commit
83924b3846361f2f76f9a6e7b5afa01c0eebbd4f
Author: H.J. Lu <hjl.tools@gmail.com>
Date: Tue Feb 5 18:45:23 2019 -0800
x86-64: Restore PIC check for PCREL reloc against protected symbol
moved PIC check for PC-relative relocations to elf_x86_64_check_relocs.
Since linker defined symbols may not be processed at the time, we need
to move the check back to elf_x86_64_relocate_section.
bfd/
PR ld/24905
* elf64-x86-64.c (elf_x86_64_check_relocs): Move PIC check for
PC-relative relocations back to ...
(elf_x86_64_relocate_section): Here.
ld/
PR ld/24905
* testsuite/ld-x86-64/pr24905-x32.d: New file.
* testsuite/ld-x86-64/pr24905.d: Likewise.
* testsuite/ld-x86-64/pr24905.s: Likewise.
* testsuite/ld-x86-64/pr24905.t: Likewise.
* testsuite/ld-x86-64/x86-64.exp: Run pr24905 and pr24905-x32.
Tom Tromey [Sat, 13 Jul 2019 00:18:10 +0000 (18:18 -0600)]
Remove the TUI execution info window
The TUI execution info window is unusual in that it is always linked
to a source or disassembly window. Even updates of its content are
handled by the source window, so it really has no life of its own.
This patch removes this window entirely and puts its functionality
directly into the source window. This simplifies the code somewhat.
This is a user-visible change, because now the box around the source
(or disassembly) window encloses the execution info as well. I
consider this an improvement as well, though.
Note that this patch caused ncurses to start emitting the "CSI Z"
sequence, so I've added this to the test suite terminal
implementation.
gdb/ChangeLog
2019-08-16 Tom Tromey <tom@tromey.com>
* tui/tui.h (enum tui_win_type) <EXEC_INFO_WIN>: Remove.
* tui/tui-winsource.h (struct tui_exec_info_window): Remove.
(struct tui_source_window_base) <make_visible, refresh_window,
resize>: Remove methods.
<execution_info>: Remove field.
* tui/tui-winsource.c (tui_source_window_base::do_erase_source_content)
(tui_show_source_line, tui_source_window_base)
(~tui_source_window_base): Update.
(tui_source_window_base::resize)
(tui_source_window_base::make_visible)
(tui_source_window_base::refresh_window): Remove.
(tui_source_window_base::update_exec_info): Update.
* tui/tui-source.c (tui_source_window::set_contents): Update.
* tui/tui-disasm.c (tui_disasm_window::set_contents): Update.
gdb/testsuite/ChangeLog
2019-08-16 Tom Tromey <tom@tromey.com>
* lib/tuiterm.exp (_csi_Z): New proc.
* gdb.tui/basic.exp: Update window positions.
* gdb.tui/empty.exp: Update window positions.
Tom Tromey [Fri, 12 Jul 2019 05:24:03 +0000 (23:24 -0600)]
Remove useless assignment from tui_remove_hooks
tui_remove_hooks clears deprecated_query_hook, but nothing in the TUI
ever sets it; so remove the assignment.
gdb/ChangeLog
2019-08-16 Tom Tromey <tom@tromey.com>
* tui/tui-hooks.c (tui_remove_hooks): Don't set
deprecated_query_hook.
Tom Tromey [Fri, 12 Jul 2019 02:00:07 +0000 (20:00 -0600)]
Change tui_show_symtab_source to be a method
This changes tui_show_symtab_source to be a method on
tui_source_window.
gdb/ChangeLog
2019-08-16 Tom Tromey <tom@tromey.com>
* tui/tui-winsource.c (tui_update_source_windows_with_addr)
(tui_update_source_windows_with_line): Update.
* tui/tui-source.h (struct tui_source_window)
<show_symtab_source>: Declare.
(tui_show_symtab_source): Don't declare.
* tui/tui-source.c (tui_show_symtab_source): Rename from
tui_show_symtab_source.
Tom Tromey [Fri, 12 Jul 2019 00:42:20 +0000 (18:42 -0600)]
Introduce tui_source_window_base::set_contents method
This introduces the tui_source_window_base::set_contents method and
implements it in the subclasses. This removes a check of the window
type.
gdb/ChangeLog
2019-08-16 Tom Tromey <tom@tromey.com>
* tui/tui-winsource.h (struct tui_source_window_base)
<set_contents>: Declare.
* tui/tui-winsource.c
(tui_source_window_base::update_source_window_as_is): Update.
* tui/tui-source.h (struct tui_source_window) <set_contents>:
Declare.
(tui_set_source_content): Don't declare.
* tui/tui-source.c (tui_source_window::set_contents): Rename from
tui_set_source_content.
* tui/tui-disasm.h (struct tui_disasm_window) <set_contents>:
Declare.
(tui_set_disassem_content): Don't declare.
* tui/tui-disasm.c (tui_disasm_window::set_contents): Rename from
tui_set_disassem_content.
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.