Commit Graph

99100 Commits

Author SHA1 Message Date
Nick Clifton 12234dfd5f Fix potential illegal memory access when disassembling corrupt RX binaries.
opcodes * rx-dis.c (get_register_name): New function.  Provides safe
	access to name array.
	(get_condition_name, get_flag_name, get_double_register_name)
	(get_double_register_high_name, get_double_register_low_name)
	(get_double_control_register_name, get_double_condition_name):
	Likewise.
	(print_insn_rx): Use the accessor functions.
2019-10-16 12:56:58 +01:00
Alan Modra dfde93ab8c genscripts comment tidy
Some of the comments in this file are ancient and no longer reflect
reality.  This patch removes those comments, and also the description
of ld options emitted to script files.  While describing what an
option does in the script file might help reinforce what the option
does, it's unnecessary and makes for overlong lines.  Also, some of
the descriptions did not mention all the options.

	* genscripts.sh: Correct comments.  Remove outdated comment block
	saying "Generate 5 or 6 script files..".  Remove description of
	ld options from comment emitted to script files, and order options
	as per comment block in genscripts.sh saying which scripts are
	generated.
2019-10-16 11:03:34 +10:30
Alan Modra 8ef6decbc1 qsort: tc-xtensa.c tidy
Not much to see here, just reduce the number of calls to S_GET_VALUE
and symbol_symbolS in the comparison functions.

	* config/tc-xtensa.c (xg_order_trampoline_chain_entry): Don't
	call S_GET_VALUE multiple times for a symbol.  Rearrange code
	so it is obvious what is the primary sort key.
	(xg_order_trampoline_chain): Similarly.
2019-10-16 11:03:34 +10:30
GDB Administrator d9f06fca19 Automatic date update in version.in 2019-10-16 00:00:20 +00:00
Andrew Burgess 00975ff6eb gdb/gdbserver: Remove reference to vec-ipa.o
This comit:

    commit 0dc327459b
    Date:   Mon Oct 7 16:38:53 2019 +0100

        gdb: Remove vec.{c,h} and update code to not include vec.h

Broke the GDB build due to leaving a reference to vec-ipa.o in the
Makefile.in, this file is built from vec.c which has been removed.

I got away with this as I had an old version of the vec-ipa.o file
still in my build tree.

With this commit in place a clean build now completed successfully.

gdb/ChangeLog:

	* Makefile.in: Remove references to vec-ipa.o.

Change-Id: I4cf55951158dd7ee8f60cd054311a7c367e1d7bf
2019-10-15 22:01:53 +01:00
Andrew Burgess 791b7405f4 gdb: Update comments that reference VEC or vec.h
With the removal of the old VEC mechanism from the code base, update
comments that still make reference to VECs.  There should be no user
visible changes after this commit.

gdb/ChangeLog:

	* linespec.c (decode_digits_ordinary): Update comment.
	* make-target-delegates: No longer need to handle VEC case.
	* memrange.c (normalize_mem_ranges): Update comment.
	* namespace.c (add_using_directive): Update comment.
	* objc-lang.c (uniquify_strings): Update comment.
	* ppc-linux-nat.c (struct thread_points): Update comment.
	* probe.h (find_probes_in_objfile): Update comment.
	* target.h (enum flash_preserve_mode): Update comment.
	* varobj.c (varobj_restrict_range): Update comment.
	* varobj.h (varobj_list_children): Update comment.

Change-Id: Iefd2e903705c3e79cd13b43395c7a1c167f9a088
2019-10-15 21:32:28 +01:00
Andrew Burgess 0dc327459b gdb: Remove vec.{c,h} and update code to not include vec.h
Removes vec.c and vec.h from the source tree, and remove all the
remaining includes of vec.h.  There should be no user visible changes
after this commit.

I did have a few issues rebuilding GDB after applying this patch due
to cached dependencies, I found that running this command in the build
directory resolved my build issues without requiring a 'make clean':

    rm -fr gdb/gdbserver/gdbsupport/.deps/

gdb/ChangeLog:

	* Makefile.in: Remove references to vec.h and vec.c.
	* aarch64-tdep.c: No longer include vec.h.
	* ada-lang.c: Likewise.
	* ada-lang.h: Likewise.
	* arm-tdep.c: Likewise.
	* ax.h: Likewise.
	* breakpoint.h: Likewise.
	* charset.c: Likewise.
	* cp-support.h: Likewise.
	* dtrace-probe.c: Likewise.
	* dwarf2read.c: Likewise.
	* extension.h: Likewise.
	* gdb_bfd.c: Likewise.
	* gdbsupport/gdb_vecs.h: Likewise.
	* gdbsupport/vec.c: Remove.
	* gdbsupport/vec.h: Remove.
	* gdbthread.h: Likewise.
	* guile/scm-type.c: Likewise.
	* inline-frame.c: Likewise.
	* machoread.c: Likewise.
	* memattr.c: Likewise.
	* memrange.h: Likewise.
	* namespace.h: Likewise.
	* nat/linux-btrace.h: Likewise.
	* osdata.c: Likewise.
	* parser-defs.h: Likewise.
	* progspace.h: Likewise.
	* python/py-type.c: Likewise.
	* record-btrace.c: Likewise.
	* rust-exp.y: Likewise.
	* solib-target.c: Likewise.
	* stap-probe.c: Likewise.
	* target-descriptions.c: Likewise.
	* target-memory.c: Likewise.
	* target.h: Likewise.
	* varobj.c: Likewise.
	* varobj.h: Likewise.
	* xml-support.h: Likewise.

gdb/gdbserver/ChangeLog:

	* Makefile.in: Remove references to vec.c.

Change-Id: I0c91d7170bf1b5e992a387fcd9fe4f2abe343bb5
2019-10-15 21:31:55 +01:00
Andrew Burgess ae6400219c gdb: Remove use of VEC from dwarf2read.c
This removes a use of VEC from GDB, from dwarf2read.c.  This removal
is not very clean, and would probably benefit from additional
refactoring in the future.

The problem here is that the VEC is contained within struct
dwarf2_per_cu_data, which is treated as POD in dwarf2read.c.  As such
it is actually a VEC pointer.  When converting this to a std::vector
in an ideal world we would not use a std::vector pointer, and use the
std::vector directly.  Sadly, to do that would require some rewriting
in dwarf2read.c - my concern would be introducing bugs during this
rewrite.

If we move to a std::vector pointer then we need to take care to
handle the case where the pointer is null.  The old VEC library would
handle null for us, making the VEC interface very clean.  With
std::vector we need to handle the null pointer case ourselves.

The achieve this then I've added a small number of function that wrap
up access to the std::vector, hopefully hiding the null pointer
management.

The final ugliness with this conversion is that, ideally, when
wrapping a data member behind an interface I would make the data
member private, however, treating the structure as POD once again
prevents this, so we are left with the data member being public, but
access (ideally) being through the published interface functions.

There should be no user visible changes after this commit.

gdb/ChangeLog:

	* gdb/dwarf2read.c (dwarf2_per_objfile::~dwarf2_per_objfile):
	Update for new std::vector based implementation.
	(process_psymtab_comp_unit_reader): Likewise.
	(scan_partial_symbols): Likewise.
	(recursively_compute_inclusions): Likewise.
	(compute_compunit_symtab_includes): Likewise.
	(process_imported_unit_die): Likewise.
	(queue_and_load_dwo_tu): Likewise.
	(follow_die_sig_1): Likewise.
	* gdb/dwarf2read.h: Remove DEF_VEC_P.
	(typedef dwarf2_per_cu_ptr): Remove.
	(struct dwarf2_per_cu_data) <imported_symtabs_empty>: New
	function.
	(struct dwarf2_per_cu_data) <imported_symtabs_push>: New function.
	(struct dwarf2_per_cu_data) <imported_symtabs_size>: New function.
	(struct dwarf2_per_cu_data) <imported_symtabs_free>: New function.
	(struct dwarf2_per_cu_data) <imported_symtabs>: Change to
	std::vector.

Change-Id: Id0f4bda977c9dd83b0ba3d7fb42f7e5e2b6869c8
2019-10-15 20:12:25 +01:00
Tom Tromey 55dfc88f7e Use %x when printing the TID
One spot in windows-nat.c uses %ld to print the TID, but all other
spots use %x, as does the infrun logging.  This makes it unnecessarily
hard to tell which other log messages correspond to this one.  This
patch changes the one outlier to use %x.

gdb/ChangeLog
2019-10-15  Tom Tromey  <tromey@adacore.com>

	* windows-nat.c (windows_nat_target::resume): Use %x when logging
	TID.

Change-Id: Ic66efeb8a7ec08e7fb007320318f51acbf976734
2019-10-15 11:42:35 -06:00
Tom Tromey 96b49c5ec0 Rename pid -> tid in windows-nat.c
A couple of spots in windows-nat.c used the name "pid" to refer to the
thread ID.  I found this confusing, so this patch changes the names.

gdb/ChangeLog
2019-10-15  Tom Tromey  <tromey@adacore.com>

	* windows-nat.c (windows_nat_target::fetch_registers)
	(windows_nat_target::store_registers): Rename "pid" to "tid".

Change-Id: Ia1a447e8da822d01ad94a5ca3760342bbdc0e66c
2019-10-15 11:42:35 -06:00
Tom Tromey 953cff5630 Change gcc_target_options to return std::string
This patch was inspired by a recent review that recommended using
std::string in a new implementation of the gcc_target_options gdbarch
function.  It changes this function to return std::string rather than
an ordinary xmalloc'd string.

I believe this caught a latent memory leak in compile.c:get_args.

Tested on x86-64 Fedora 29.

gdb/ChangeLog
2019-10-15  Tom Tromey  <tromey@adacore.com>

	* gdbarch.h, gdbarch.c: Rebuild.
	* gdbarch.sh (gcc_target_options): Change return type to
	std::string.
	* compile/compile.c (get_args): Update.
	* nios2-tdep.c (nios2_gcc_target_options): Return std::string.
	* arm-linux-tdep.c (arm_linux_gcc_target_options): Return
	std::string.
	* aarch64-linux-tdep.c (aarch64_linux_gcc_target_options): Return
	std::string.
	* arch-utils.c (default_gcc_target_options): Return std::string.
	* arch-utils.h (default_gcc_target_options): Return std::string.
	* s390-tdep.c (s390_gcc_target_options): Return std::string.

Change-Id: I51f61703426a323089e646da8f22320a2cafbc1f
2019-10-15 11:03:57 -06:00
Christian Biesinger 81e6b8eb20 Make tui-winsource not use breakpoint_chain
That's an internal variable of breakpoint.c. Insted, use
iterate_over_breakpoints to update the breakpoint list.

gdb/ChangeLog:

2019-10-15  Christian Biesinger  <cbiesinger@google.com>

	* breakpoint.c (breakpoint_chain): Make static.
	* tui/tui-winsource.c: Call iterate_over_breakpoints instead
	of accessing breakpoint_chain.

Change-Id: Ic259b2c3a4c1f5a47f34cfd7fccbdcf274417429
2019-10-15 15:30:00 +02:00
Christian Biesinger 95da600f40 Change iterate_over_breakpoints to take a function_view
This allows callers to pass in capturing lambdas.  Also changes the return
type to bool.

gdb/ChangeLog:

2019-10-15  Christian Biesinger  <cbiesinger@google.com>

	* breakpoint.c (iterate_over_breakpoints): Change function pointer
	to a gdb::function_view and return value to bool.
	* breakpoint.h (iterate_over_breakpoints): Likewise.
	* dummy-frame.c (pop_dummy_frame_bpt): Update.
	(pop_dummy_frame): Update.
	* guile/scm-breakpoint.c (bpscm_build_bp_list): Update.
	(gdbscm_breakpoints): Update.
	* python/py-breakpoint.c (build_bp_list): Update.
	(gdbpy_breakpoints): Update.
	* python/py-finishbreakpoint.c (bpfinishpy_detect_out_scope_cb):
	Update.
	(bpfinishpy_handle_stop): Update.
	(bpfinishpy_handle_exit): Update.
	* solib-svr4.c (svr4_update_solib_event_breakpoint): Update.
	(svr4_update_solib_event_breakpoints): Update.

Change-Id: Ia9de4deecae562a70a40f5cd49f5a74d64570251
2019-10-15 15:29:55 +02:00
Alan Modra 9b142ddb4a m68hc1x: better arg checking for reloc_warning
* elf32-m68hc1x.c (reloc_warning): Add printf attribute.
	(elf32_m68hc11_relocate_section): Don't use a variable for format
	strings.  Delete some unnecessary xgettext:c-format comments.
2019-10-15 23:25:11 +10:30
Andreas Arnez ba18312d8f s390: Fix infcalls passing a single-field struct with static members
The infcall-nested-structs test case yields 36 FAILs on s390x because GCC
and GDB disagree on how to pass a C++ struct like this as an argument to a
function:

  struct s { float x; static float y; };

For the purpose of argument passing, GCC ignores static fields, while GDB
does not.  Thus GCC passes the argument in a floating-point register and
GDB passes it via memory.

Fix this by explicitly ignoring static fields when detecting single-field
structs.

gdb/ChangeLog:

	* s390-tdep.c (s390_effective_inner_type): Ignore static fields
	when unwrapping single-field structs.
2019-10-15 14:20:14 +02:00
Alan Modra 9a73315161 remove more xmalloc in bfd
Also fixes m68hc1x printf arguments which would have bombed when
compiling on a 32-bit host with --enable-64-bit-bfd.

bfd/
	PR 24955
	* elf32-arm.c (set_cmse_veneer_addr_from_implib): Use bfd_malloc
	rather than xmalloc.
	* elf32-m68hc1x.c (reloc_warning): New function.
	(elf32_m68hc11_relocate_section): Use it here.  Cast bfd_vma values
	corresponding to %lx in format strings.
	* elf32-nds32.c (nds32_insertion_sort): Use a stack temporary.
gas/
	* config/tc-nds32.c (nds32_set_section_relocs): Use relocs and n
	parameters rather than equivalent sec->orelocation and
	sec->reloc_count.  Don't sort for n <= 1.  Tidy.
2019-10-15 16:50:32 +10:30
Alan Modra 779f2ae733 PR25100, Compile fails in elf64-ppc.c because of single equal sign instead of double equal for comparison
PR 25100
	* elf64-ppc.c (sfpr_define): Delete dead code that triggered a warning.
2019-10-15 16:01:05 +10:30
Alan Modra ed481f9799 Simplify power of two test
* bfd.c (bfd_check_compression_header): Check for powers of two
	with x == (x & -x).
2019-10-15 16:00:54 +10:30
Tom de Vries b7be2d03fb [gdb/testsuite] Fix gdb.ada/mi_task_arg.exp
On openSUSE Leap 15.1, we have:
...
FAIL: gdb.ada/mi_task_arg.exp: -stack-list-arguments 1 (unexpected output)
...

The problem is that the stack-list-arguments command prints a frame argument
'self_id' for function system.tasking.stages.task_wrapper:
...
frame={level="2",args=[{name="self_id",value="0x12345678"}]
...
where none (args=[]) is expected.

The frame argument is in fact correct.  The FAIL does not show for say, fedora
30, because there the executable uses the system.tasking.stages.task_wrapper
from /lib64/libgnarl-9.so.  Adding "additional_flags=-bargs
additional_flags=-shared additional_flags=-largs" to the flags argument of
gdb_compile_ada gives us the same PASS, but installing libada7-debuginfo gets
us the same FAIL again.

Fix the FAIL by allowing the 'self_id' argument.

Tested on x86_64-linux.

Change-Id: I5aee5856fa6aeb0cc78aa4fe69deecba5b00b77a
2019-10-15 02:21:37 +02:00
GDB Administrator 22cc288441 Automatic date update in version.in 2019-10-15 00:00:20 +00:00
Simon Marchi 9223170f68 gdb.mi/list-thread-groups-available.exp: read entries one by one instead of increasing timeout
Commit 580f1034 ("Increase timeout in
gdb.mi/list-thread-groups-available.exp") changed
gdb.mi/list-thread-groups-available.exp to significantly increase the
timeout, which was necessary for when running with make check-read1.

Pedro suggested a better alternative, which is to use gdb_test_multiple
and consume one entry at a time.  This patch does that.

gdb/testsuite/ChangeLog:

	* gdb.mi/list-thread-groups-available.exp: Read entries one by
	one instead of increasing timeout.

Change-Id: I51b689458503240f24e401f054e6583d9172ebdf
2019-10-14 12:12:24 -04:00
Simon Marchi 6acc1a0b9d gdb: remove unused includes from dwarf2read.c
include-what-you-use says:

../../../src/binutils-gdb/gdb/dwarf2read.c should remove these lines:
- #include <ctype.h>  // lines 67-67
- #include <sys/stat.h>  // lines 59-59
- #include <sys/types.h>  // lines 83-83
- #include <cmath>  // lines 88-88
- #include <forward_list>  // lines 90-90
- #include <set>  // lines 89-89
- #include <unordered_set>  // lines 85-85
- #include "completer.h"  // lines 60-60
- #include "expression.h"  // lines 44-44
- #include "gdbsupport/byte-vector.h"  // lines 78-78
- #include "gdbsupport/filestuff.h"  // lines 71-71
- #include "gdbsupport/gdb_unlinker.h"  // lines 74-74

After a quick glance, that makes sense, so this patch removes them.

gdb/ChangeLog:

	* dwarf2read.c: Remove includes.

Change-Id: I13cfcb2f1d747144fddba7f66b329630b79dae90
2019-10-14 10:15:51 -04:00
Alan Modra 3d9ee7d24b qsort: ldctor.c CONSTRUCTORS
ctor_cmp had an ineffective comparison of addresses in an attempt to
ensure sort stability.  Comparing the addresses passed to the
comparison function can't work since those addresses may be from an
array that is already perturbed by qsort.

	* ldctor.h (struct set_element): Make next field a union, adding
	idx field.
	* ldctor.c (ctor_cmp): Dereference pointer and lose unnecessary
	const.  Replace final sort on pointer value with final sort on idx.
	(ldctor_add_set_entry): Adjust next field access.
	(ldctor_build_sets): Likewise.  Set u.idx field for sort.
2019-10-14 16:47:13 +10:30
Alan Modra 08dec09d8a qsort: pe-dll.c reloc sorting
* pe-dll.c (reloc_data_type): Add idx field.
	(reloc_sort): Perform final sort by idx.
	(generate_reloc): Set idx.
2019-10-14 16:47:13 +10:30
Alan Modra 6ce9ba7afc qsort: objcopy.c section sort
* objcopy.c (compare_section_lma): Correct comment.  Dereference
	section pointer earlier and lose unnecessary const.  Style fixes.
	Add final sort by id.
2019-10-14 16:47:13 +10:30
Alan Modra 47f6ff2f9e qsort: syms.c stab sorting
* syms.c (struct indexentry): Add idx field.
	(cmpindexentry): Final sort on idx.
	(_bfd_stab_section_find_nearest_line): Set idx.
2019-10-14 16:47:13 +10:30
Alan Modra 8025b0554c qsort: dwarf2.c
This patch ensures qsort stability in line and function sorting done
in dwarf2.c.  For the line sequences we make use of an existing field
that isn't used until later, as a monotonic counter for the qsort.

	* dwarf2.c (struct lookup_funcinfo): Add idx field.
	(compare_lookup_funcinfos): Perform final sort on idx.
	(build_lookup_funcinfo_table): Set idx.
	(compare_sequences): Perform final sort on num_lines.
	(build_line_info_table): Set num_lines and line_info_lookup earlier.
	(sort_line_sequences): Set num_lines for sort.
2019-10-14 16:47:13 +10:30
Alan Modra 3a3f4bf76a qsort: elf_link_add_object_symbols weak aliases
This particular sort almost certainly does not need to be stable for
the ELF linker to work correctly.  However it is conceivable that an
unstable sort could affect linker output, and thus different output be
seen with differing qsort implementations.  The argument goes like
this:  Given more than one strong alias symbol of equal section, value,
and size, the aliases will compare equal by elf_sort_symbol and thus
which one is chosen as the "real" symbol to be made dynamic depends on
qsort.  Why would anyone define two symbols at the same address?
Well, sometimes the fact that there are more than one strong alias
symbol is due to linker script symbols like __bss_start being made
dynamic.  This will match the first symbol defined in .bss if it
doesn't have correct size, and forgetting to properly set size and
type of symbols isn't as rare as it should be.

This patch adds some more heuristics to elf_sort_symbol.

	* elflink.c (elf_sort_symbol): Sort on type and name as well.
	(elf_link_add_object_symbols): Style fix.
2019-10-14 16:47:13 +10:30
Alan Modra 48db329734 qsort: elf_sort_sections use of target_index
elf_sort_sections tried to ensure a stable qsort by using target_index
as the final comparison, but target_index hasn't been set by anything
at the time elf_sort_sections was run.  This patch arrange to have
target_index set.

	* elf.c (_bfd_elf_map_sections_to_segments): Init target_index
	for sections about to be sorted.
	(assign_file_positions_for_load_sections): Likewise.
	(elf_sort_sections): Don't bother optimising both TOEND case.
	* elflink.c (bfd_elf_final_link): Reset target_index.
2019-10-14 16:47:13 +10:30
Alan Modra 8c1c5e5de4 qsort: SHF_LINK_ORDER section sort
The linker SHF_LINK_ORDER section sorting had a number of defects.
1) The ordering was by VMA, which won't work with overlays.  LMA is
   better.
2) Zero size sections can result in two sections at the same LMA/VMA.
   When only one of the two sections at the same LMA is zero size,
   that one must be first.
3) Warnings given by elf_get_linked_section_vma won't ever be emitted
   since elf_object_p warns and excludes objects with zero sh_link on
   a SHF_LINK_ORDER section.
4) Section offset was adjusted down rather than up by section
   alignment, possibly creating overlapping sections.
5) Finding the linked section did so the hard way, rather than simply
   using elf_linked_to_section.

	* elflink.c (elf_get_linked_section_vma): Delete.
	(compare_link_order): Use elf_linked_to_section and sort by lma,
	size, and id.
	(elf_fixup_link_order): Use size_t variables where appropriate.
	Make use of elf_linked_to_section.  Formatting.  Properly align
	sections.
2019-10-14 16:47:13 +10:30
Alan Modra dcea6a95d7 qsort issues
qsort isn't guaranteed to be a stable sort, that is, elements
comparing equal according to the comparison function may be reordered
relative to their original ordering.  Of course sometimes you may not
care, but even in those cases it is good to force some ordering
(ie. not have the comparison function return 0) so that linker output
is reproducible over different libc qsort implementations.

One way to make qsort stable (which the glibc manual incorrectly says
is the only way) is to augment the elements being sorted with a
monotonic counter of some kind, and use that counter as the final
arbiter of ordering in the comparison function.

Another way is to set up an array of pointers into the array of
elements, first pointer to first element, second pointer to second
element and so so, and sort the pointer array rather than the element
array.  Final arbiter in the comparison function then is the pointer
difference.  This works well with, for example, the symbol pointers
returned by _bfd_elf_canonicalize_symtab which point into a symbol
array.

This patch fixes a few places where sorting by symbol pointers is
appropriate, and adds comments where qsort stability is a non-issue.

	* elf-strtab.c (strrevcmp): Comment.
	* merge.c (strrevcmp): Likewise.
	* elf64-ppc.c (compare_symbols): Correct final pointer comparison.
	Comment on why comparing pointers ensures a stable sort.
	* elflink.c (struct elf_symbol): Add void* to union.
	(elf_sort_elf_symbol): Ensure a stable sort with pointer comparison.
	(elf_sym_name_compare): Likewise.
	(bfd_elf_match_symbols_in_sections): Style fix.
	(elf_link_sort_cmp1): Comment.
2019-10-14 16:47:12 +10:30
Alan Modra ec9bd0a22d PR24955, libbfd terminating program on out of memory (part2)
PR 24955
	* elflink.c (elf_output_implib): Don't use xmalloc.  Don't ignore
	return value of bfd_alloc2.
	* peXXigen.c (_bfd_XXi_write_codeview_record): Don't use xmalloc.
	* pef.c (bfd_pef_print_symbol): Likewise.  Don't ignore return
	value of bfd_get_section_contents.
	* som.c (som_write_space_strings): Don't use xmalloc.
	(som_write_symbol_strings): Likewise.
2019-10-14 16:47:12 +10:30
GDB Administrator 03f04b53b2 Automatic date update in version.in 2019-10-14 00:00:24 +00:00
Simon Marchi 284782de07 gdb: Silence -Wformat-nonliteral warning with clang
We get this warning when building with clang:

      CXX    ui-out.o
    /home/smarchi/src/binutils-gdb/gdb/ui-out.c:590:22: error: format string is not a string literal [-Werror,-Wformat-nonliteral]
      do_message (style, format, args);
                         ^~~~~~

This can be considered a legitimate warning, as call_do_message's format
parameter is not marked as a format string.  Therefore, we should
normally mark the call_do_message method with the `format` attribute.
However, doing so just moves (and multiplies) the problem, as all the
uses of call_do_message in the vmessage method now warn.  If we wanted
to continue on that path, we should silence the warning for each of
them, as a way of telling the compiler "it's ok, we know what we are
doing".

But since call_do_message is really just vmessage's little helper, it's
simpler to just silence the warning at that single point.

gdb/ChangeLog:

	* ui-out.c (ui_out::call_do_message): Silence
	-Wformat-nonliteral warning.

Change-Id: I58ad41793448f38835c5d6ba7b9e5c4dd8df260f
2019-10-13 19:53:40 -04:00
Tom de Vries d039f01465 Mention PR c++/20020 in ChangeLog entry
[ Port of gdb-8.3-branch commit 59047affb0a "Update ChangeLog entry of commit
98c90f8028 and mention PR c++/20020". ]
2019-10-13 15:09:09 +02:00
Tom de Vries 34a7f2a4e3 Mention PR testsuite/25016 in ChangeLog entry
[ Port of gdb-8.3-branch commit 3d80b2e754f "Update ChangeLog entry of commit
3b752ac2e6 and mention PR testsuite/25016". ]
2019-10-13 15:09:09 +02:00
Tom de Vries 5862c886a2 Mention PR breakpoints/25011 in ChangeLog entry
[ Port of gdb-8.3-branch commit 88f07f28d5b "Update ChangeLog entry of commit
7e38ddcb2e and mention PR breakpoints/25011". ]
2019-10-13 15:09:09 +02:00
Tom de Vries 68255adc03 Mention PR gdb/25010 in ChangeLog entry
[ Port of gdb-8.3-branch commit 5ca0b868fa7 "Update ChangeLog entry of commit
8ac39635f6 and mention PR gdb/25010". ]
2019-10-13 15:09:09 +02:00
Nick Clifton 4786fbf372 Update the README-how-to-make-a-release file with a note to reset the development flag back to true after making a point release. Aldo fix a typo in the ld/NEWS file.
binutils* README-how-to-make-a-release: Add a note to reset the
	development flag back to true after making a point release.

ld	* NEWS: Delete superflous "Changes in 2.33" comment.
2019-10-13 13:33:27 +01:00
Simon Marchi 073bbbb058 gdb: small cleanup in breakpoint.c's includes
In an attempt to reduce the number of files re-build when some headers
are touched, I ran include-what-you-use with breakpoint.c as a guinea
pig.  It revealed a few files that were unnecessary to include, which
this patch removes.

breakpoint.c uses tilde_expand from readline, hence the necessity to
include tilde.h.  AFAIK, it's fine to include just that, and not the
whole readline headers.

include-what-you-use also reported many header files that should be
included but aren't, I suppose that breakpoint.c currently includes them
indirectly.  For now I'll pretend I didn't see that :).

gdb/ChangeLog:

	* breakpoint.c: Remove some includes: continuations.h, skip.h,
	mi/mi-main.h, readline/readline.h, readline/history.h.  Add
	include: readline/tilde.h.

-#include "skip.h"
 #include "ax-gdb.h"
 #include "dummy-frame.h"
 #include "interps.h"
@@ -69,11 +67,9 @@
 #include "thread-fsm.h"
 #include "tid-parse.h"
 #include "cli/cli-style.h"
-#include "mi/mi-main.h"

 /* readline include files */
-#include "readline/readline.h"
-#include "readline/history.h"
+#include "readline/tilde.h"

 /* readline defines this.  */
 #undef savestring

Change-Id: I88bfe9071f2f973fd84caaf04b95c33a4dfb33de
2019-10-12 23:46:16 -04:00
Tom de Vries d6e7631356 [gdb/testsuite] Add KFAIL for missing support of reverse-debugging xsave
Normally the gdb.reverse/*.exp test-cases pass on my system (apart from the
record/23188 KFAIL for gdb.reverse/step-precsave.exp).  But when specifying
GLIBC_TUNABLES=glibc.tune.hwcaps=-XSAVEC_Usable to force glibc to use
_dl_runtime_resolve_xsave instead of _dl_runtime_resolve_xsavec, we run into
1054 FAILs like this:
...
(gdb) PASS: gdb.reverse/sigall-reverse.exp: b gen_HUP
continue^M
Continuing.^M
Process record does not support instruction 0xfae64 at address \
  0x7ffff7ded958.^M
Process record: failed to record execution log.^M
^M
Program stopped.^M
0x00007ffff7ded958 in _dl_runtime_resolve_xsave () from \
  /lib64/ld-linux-x86-64.so.2^M
(gdb) FAIL: gdb.reverse/sigall-reverse.exp: get signal ABRT
...

The problem is that the xsave instruction is not supported in
reverse-debugging (PR record/25038).

Add KFAILs for this PR.

Tested on x86_64-linux.

gdb/testsuite/ChangeLog:

2019-10-13  Tom de Vries  <tdevries@suse.de>

	PR record/25038
	* gdb.reverse/sigall-precsave.exp: Add PR record/25038 KFAIL.
	* gdb.reverse/sigall-reverse.exp: Same.
	* gdb.reverse/solib-precsave.exp: Same.
	* gdb.reverse/solib-reverse.exp: Same.
	* gdb.reverse/step-precsave.exp: Same.
	* gdb.reverse/until-precsave.exp: Same.
	* gdb.reverse/until-reverse.exp: Same.
	* lib/gdb.exp (gdb_continue_to_breakpoint): Same.
2019-10-13 02:40:57 +02:00
GDB Administrator d5082b3251 Automatic date update in version.in 2019-10-13 00:01:15 +00:00
Christian Biesinger 7b9a15e1ee Remove unnecessary declaration of trace_regblock_size
This variable is declared in tracepoint.h, which is already included
by remote.c.

gdb/ChangeLog:

2019-10-12  Christian Biesinger  <cbiesinger@google.com>

	* remote.c (remote_target::get_trace_status): Remove declaration of
	trace_regblock_size.
2019-10-12 19:36:18 -04:00
Christian Biesinger cc8dee1f1c Move declaration of max_user_call_depth to header
Also removes an unnecessary declaration of cmdlist in cli-cmds.c.
I don't understand why it is there, the definition of cmdlist is
at the top of the same file.

gdb/ChangeLog:

2019-10-12  Christian Biesinger  <cbiesinger@google.com>

	* cli/cli-cmds.c (max_user_call_depth): Move comment to header.
	(show_user): Remove declaration of cmdlist.
	* cli/cli-cmds.h (max_user_call_depth): Declare.
	* cli/cli-script.c (execute_user_command): Remove declaration
	of max_user_call_depth.
2019-10-12 14:31:26 -05:00
Nick Clifton 03d0d46a0e Tweak the 'how to make a release' document 2019-10-12 16:05:35 +01:00
GDB Administrator bbcfc6249a Automatic date update in version.in 2019-10-12 00:00:24 +00:00
Jim Wilson 5f93c5a6d5 Improve comments in print-utils.h.
Since I had to look at these function comments to fix the RISC-V ARI warnings,
I noticed that they make no sense.  The pulongest and plongest comments are
swapped.  phex is missing a comment.  And phex_nz doesn't mention how it is
different from phex.

	* gdbsupport/print-utils.h (pulongest): Fix comment.
	(plongest): Likewise.
	(phex): Add missing comment, mention leading zeros.
	(phex_nz): Add mention of no leading zeros to comment.
2019-10-11 11:28:35 -07:00
Jim Wilson a83d4ef693 RISC-V: Fix two ARI warnings.
> gdb/riscv-tdep.c:1657: code: %ll: Do not use printf(%ll), instead use printf(%s,phex()) to dump a 'long long' value
gdb/riscv-tdep.c:1657:                  "Writing %lld-byte nop instruction to %s: %s\n",
> gdb/riscv-tdep.c:1658: code: long long: Do not use 'long long', instead use LONGEST
gdb/riscv-tdep.c:1658:                  ((unsigned long long) sizeof (nop_insn)),

fprintf_unfiltered doesn't support z (or j for that matter), and fixing that
is a larger patch than I'd like to write, so this does basically what the
ARI warnings recommends.  We don't need the cast as there is a prototype for
plongest.

	* riscv-tdep.c (riscv_push_dummy_code): Change %lld to %s and use
	plongest instead of unsigned long long cast.
2019-10-11 11:26:29 -07:00
Max Filippov e168da45a2 bfd/dwarf2.c: fix assertion failure in comp_unit_hash_info
stash_maybe_enable_info_hash_tables sets
stash->info_hash_status = STASH_INFO_HASH_ON;
regardless of the result of stash_maybe_update_info_hash_tables call. In
case it fails this results in repeated invocation of comp_unit_hash_info
for the same comp unit and assertion failure in this function.

Only set stash->info_hash_status = STASH_INFO_HASH_ON; when
stash_maybe_update_info_hash_tables is successful.

bfd/
2019-10-11  Max Filippov  <jcmvbkbc@gmail.com>

	* dwarf2.c (stash_maybe_enable_info_hash_tables): Only set
	stash->info_hash_status = STASH_INFO_HASH_ON when
	stash_maybe_update_info_hash_tables succeeds.
2019-10-11 09:02:37 -07:00
Nick Clifton b0531efe2e Updated traditional Chinese translation for the binutils/ subdirectory 2019-10-11 11:58:22 +01:00