Commit Graph

97792 Commits

Author SHA1 Message Date
H.J. Lu 9186c494a3 Enable Intel AVX512_VP2INTERSECT insn
This patch enables support for VP2INTERSECT in binutils.  Please refer to

https://software.intel.com/sites/default/files/managed/c5/15/architecture-instruction-set-extensions-programming-reference.pdf

for VP2INTERSECT details.

Make check-gas is ok.

gas/

2019-06-04  Igor Tsimbalist  <igor.v.tsimbalist@intel.com>
	    Lili Cui  <lili.cui@intel.com>

	* config/tc-i386.c (cpu_arch): Add .avx512_vp2intersect.
	(cpu_noarch): Likewise.
	* doc/c-i386.texi: Document avx512_vp2intersect.
	* testsuite/gas/i386/i386.exp: Run vp2intersect tests.
	* testsuite/gas/i386/vp2intersect-intel.d: New test.
	* testsuite/gas/i386/vp2intersect.d: Likewise.
	* testsuite/gas/i386/vp2intersect.s: Likewise.
	* testsuite/gas/i386/vp2intersect-inval-bcast.l: Likewise.
	* testsuite/gas/i386/vp2intersect-inval-bcast.s: Likewise.
	* testsuite/gas/i386/x86-64-vp2intersect-intel.d: Likewise.
	* testsuite/gas/i386/x86-64-vp2intersect.d: Likewise.
	* testsuite/gas/i386/x86-64-vp2intersect.s: Likewise.
	* testsuite/gas/i386/x86-64-vp2intersect-inval-bcast.l: Likewise.
	* testsuite/gas/i386/x86-64-vp2intersect-inval-bcast.s: Likewise.

opcodes/

2019-06-04  Igor Tsimbalist  <igor.v.tsimbalist@intel.com>
	    Lili Cui  <lili.cui@intel.com>

	* i386-dis.c (enum): Add PREFIX_EVEX_0F3868, EVEX_W_0F3868_P_3.
	* i386-dis-evex.h (evex_table): Add AVX512_VP2INTERSECT
	instructions.
	* i386-gen.c (cpu_flag_init): Add CPU_AVX512_VP2INTERSECT_FLAGS,
	CPU_ANY_AVX512_VP2INTERSECT_FLAGS.
	(cpu_flags): Add CpuAVX512_VP2INTERSECT.
	* i386-opc.h (enum): Add CpuAVX512_VP2INTERSECT.
	(i386_cpu_flags): Add cpuavx512_vp2intersect.
	* i386-opc.tbl: Add AVX512_VP2INTERSECT insns.
	* i386-init.h: Regenerated.
	* i386-tbl.h: Likewise.
2019-06-04 08:58:31 -07:00
H.J. Lu 5d79adc4b2 Add support for Intel ENQCMD[S] instructions
This patch enables support for ENQCMD[S] in binutils.  Please refer to

https://software.intel.com/sites/default/files/managed/c5/15/architecture-instruction-set-extensions-programming-reference.pdf

for ENQCMD[S] details.

Make check-gas is ok.

gas/ChangeLog:

2019-06-04  Xuepeng Guo  <xuepeng.guo@intel.com>
	    Lili Cui  <lili.cui@intel.com>

	* doc/c-i386.texi: Document enqcmd.
	* testsuite/gas/i386/enqcmd-intel.d: New file.
	* testsuite/gas/i386/enqcmd-inval.l: Likewise.
	* testsuite/gas/i386/enqcmd-inval.s: Likewise.
	* testsuite/gas/i386/enqcmd.d: Likewise.
	* testsuite/gas/i386/enqcmd.s: Likewise.
	* testsuite/gas/i386/x86-64-enqcmd-intel.d: Likewise.
	* testsuite/gas/i386/x86-64-enqcmd-inval.l: Likewise.
	* testsuite/gas/i386/x86-64-enqcmd-inval.s: Likewise.
	* testsuite/gas/i386/x86-64-enqcmd.d: Likewise.
	* testsuite/gas/i386/x86-64-enqcmd.s: Likewise.
	* testsuite/gas/i386/i386.exp: Run enqcmd-intel, enqcmd-inval,
	enqcmd, x86-64-enqcmd-intel, x86-64-enqcmd-inval,
	and x86-64-enqcmd.

opcodes/ChangeLog:

2019-06-04  Xuepeng Guo  <xuepeng.guo@intel.com>
	    Lili Cui  <lili.cui@intel.com>

	* i386-dis.c (enum): Add MOD_0F38F8_PREFIX_1 and
	MOD_0F38F8_PREFIX_3.
	(prefix_table): New instructions (see prefix above).
	(mod_table): New instructions (see prefix above).
	* i386-gen.c (cpu_flag_init): Add entries for enqcmd.
	(cpu_flags): Add a bitfield for enqmcd.
	* i386-init.h: Regenerated.
	* i386-opc.h (enum): Add CpuENQCMD.
	(i386_cpu_flags): Add a bitfield for cpuenqcmd.
	* i386-opc.tbl: Add enqcmd and enqcmds instructions.
	* i386-init.h: Regenerated.
	* i386-tbl.h: Regenerated.
2019-06-04 08:50:46 -07:00
Christian Biesinger via gdb-patches e1f2e1a2da Add an objfile getter to gdb.Type
This allows users of the Python API to find the objfile where a type
was defined.

gdb/ChangeLog:

gdb/ChangeLog
2019-06-04  Christian Biesinger  <cbiesinger@google.com>

	Add objfile property to gdb.Type.
	* gdb/NEWS: Mention Python API addition.
	* gdb/python/py-type.c (typy_get_objfile): New method.

gdb/doc/ChangeLog
2019-06-04  Christian Biesinger  <cbiesinger@google.com>

	* gdb/doc/python.texi: Document new gdb.Type.objfile property.

gdb/testsuite/ChangeLog
2019-06-04  Christian Biesinger  <cbiesinger@google.com>

	* gdb/testsuite/gdb.python/py-type.exp: Test for new
	  gdb.Type.objfile property.
2019-06-04 09:46:06 -06:00
Alan Hayward a9d96ab97e Remove an unnecessary set of parentheses in the arm-dis.c source file.
* arm-dis.c (is_mve_unpredictable): Remove spurious paranthesis.
2019-06-04 14:25:08 +01:00
GDB Administrator 1ff30553d8 Automatic date update in version.in 2019-06-04 00:00:13 +00:00
Philippe Waroquiers e664d72803 Document in NEWS and gdb.texinfo the "help", "apropos" and "show style" changes. 2019-06-03 21:59:35 +02:00
Philippe Waroquiers 206584bdf1 Update tests following changes to "help" and "apropos"
Factorizes the testing of the help output, by having a single place
that defines the common help trailer and/or prefix messages.
2019-06-03 21:59:35 +02:00
Philippe Waroquiers 66d8c86285 Improve usability and/or readibility of help and apropos output.
The "help" command can output long list of command names or classes.
Use the title style to style the command names or classes to make
the output more readable.

Similarly, change "apropos" command to also style the command names.

It is sometimes unclear why "apropos REGEXP" lists some commands,
and then the user has to manually do 'help command' for all commands
listed by "apropos" to see more details about the matching commands.

=> Add an optional flag -v so that "apropos -v REGEXP":
  * outputs the full documentation of matching commands.
  * highlights the documentation parts matching REGEXP.
2019-06-03 21:59:18 +02:00
Philippe Waroquiers 9303eb2fb1 Add highlight style, title style, fputs_highlighted. Improve 'show style'
Have 'show style' and its subcommands using a style to style its output.
This allows the GDB user or developer to use 'show style' to visually see
with one command how all the current styles look like.

Add 2 new styles highlight style, title style and fputs_highlighted function.

Highlight style is used by fputs_highlighted to highlight the parts of
its char *STR argument that match a HIGHLIGHT regexp.
This (and the title style) will be used in a following patch.
2019-06-03 21:59:11 +02:00
Nick Clifton 79b377b3cf Revert patch that disables building libctf for non-ELF based targets.
Revert:
binutls	2019-05-29  Nick Clifton  <nickc@redhat.com>

	* configure.ac (LIBCTF): Export.  Set to empty for non-ELF based
	targets.
	(HAVE_LIBCTF): Define if libctf support is available.
	* Makefile.am (LIBCTF): Set value to @LIBCTF@.
	* objdump.c: Make CTF code conditional upon HAVE_LIBCTF being
	defined.
	* readelf.c: Likewise.
	* configure: Regenerate.
	* Makefile.in: Regenerate.
	* config.in: Regenerate.

top	2019-05-29  Nick Clifton  <nickc@redhat.com>

	* configure.ac (noconfigdirs): Add libctf if the target does not use
	the ELF file format.
	* configure: Regenerate.
2019-06-03 16:28:15 +01:00
Alan Modra 4f6d070adb Don't waste space in prefix_opcd_indices
* ppc-dis.c (prefix_opcd_indices): Correct size.
2019-06-03 11:50:51 +09:30
GDB Administrator 6187fc5364 Automatic date update in version.in 2019-06-03 00:00:54 +00:00
Tom Tromey 88ed7edbc6 Remove fromhex implementation from gdbreplay
gdbreplay had its own implementation of fromhex.  This patch changes
it to use the one in common/.

gdb/gdbserver/ChangeLog
2019-06-02  Tom Tromey  <tom@tromey.com>

	* gdbreplay.c (fromhex): Remove.
	* Makefile.in (GDBREPLAY_OBS): Add rsp-low.o.
2019-06-02 12:23:02 -06:00
GDB Administrator 9660559239 Automatic date update in version.in 2019-06-02 00:01:00 +00:00
GDB Administrator 0b62c71c08 Automatic date update in version.in 2019-06-01 00:00:23 +00:00
Philippe Waroquiers e2c52041c0 NEWS and documentation for | (pipe) command.
gdb/ChangeLog
	* NEWS: Mention new pipe command and new convenience variables.

gdb/doc/ChangeLog
	* gdb.texinfo (Shell Commands): Document pipe command.
	(Logging Output): Add a reference to pipe command.
	(Convenience Variables): Document $_shell_exitcode and
	$_shell_exitstatus.
2019-05-31 17:14:20 +02:00
Philippe Waroquiers 708dc93ed0 Test the | (pipe) command.
gdb/testsuite/ChangeLog
2019-05-31  Philippe Waroquiers  <philippe.waroquiers@skynet.be>

	* gdb.base/shell.exp: Test pipe command, $_shell_exitcode,
	$_shell_exitsignal.
	* gdb.base/default.exp: Update for new convenience variables.
2019-05-31 17:13:07 +02:00
Philippe Waroquiers 947d39462e Implement | (pipe) command.
The pipe command allows to run a GDB command, and pipe its output
to a shell command:
  (gdb) help pipe
  Send the output of a gdb command to a shell command.
  Usage: | [COMMAND] | SHELL_COMMAND
  Usage: | -d DELIM COMMAND DELIM SHELL_COMMAND
  Usage: pipe [COMMAND] | SHELL_COMMAND
  Usage: pipe -d DELIM COMMAND DELIM SHELL_COMMAND

  Executes COMMAND and sends its output to SHELL_COMMAND.

  The -d option indicates to use the string DELIM to separate COMMAND
  from SHELL_COMMAND, in alternative to |.  This is useful in
  case COMMAND contains a | character.

  With no COMMAND, repeat the last executed command
  and send its output to SHELL_COMMAND.
  (gdb)

For example:
  (gdb) pipe print some_data_structure | grep -B3 -A3 something

The pipe character is defined as an alias for pipe command, so that
the above can be typed as:
  (gdb) | print some_data_structure | grep -B3 -A3 something

If no GDB COMMAND is given, then the previous command is relaunched,
and its output is sent to the given SHELL_COMMAND.

This also defines convenience vars $_shell_exitcode and $_shell_exitsignal
to record the exit code and exit signal of the last shell command
launched by GDB e.g. by "shell", "pipe", ...

gdb/ChangeLog
2019-05-31  Philippe Waroquiers  <philippe.waroquiers@skynet.be>

	* cli/cli-cmds.c (pipe_command): New function.
	(_initialize_cli_cmds): Call add_com for pipe_command.
	Define | as an alias for pipe.
	(exit_status_set_internal_vars): New function.
	(shell_escape): Call exit_status_set_internal_vars.
	cli/cli-decode.c (find_command_name_length): Recognize | as
	a single character command.
2019-05-31 17:12:18 +02:00
Philippe Waroquiers b8fd091888 Add function execute_command_to_ui_file
2019-05-31  Philippe Waroquiers  <philippe.waroquiers@skynet.be>

	* gdbcmd.h (execute_command_to_ui_file): New declaration.
	top.c (execute_command_to_ui_file): New function, mostly a copy
	of execute_command_to_string.
	(execute_command_to_string): Implement by calling
	execute_command_to_ui_file.
2019-05-31 17:11:38 +02:00
Philippe Waroquiers 68bb5386b8 Add previous_saved_command_line to allow a command to repeat a previous command.
Currently, a previous command can be repeated when the user types an
empty line.  This is implemented in handle_line_of_input by
returning saved_command_line in case an empty line has been input.

If we want a command to repeat the previous command, we need to save
the previous saved_command_line, as when a command runs, the saved_command_line
already contains the current command line of the command being executed.

As suggested by Tom, the previous_saved_command_line is made static.
At the same time, saved_command_line is also made static.
The support functions/variables for the repeat command logic are now all
located inside top.c.

gdb/ChangeLog
2019-05-31  Philippe Waroquiers  <philippe.waroquiers@skynet.be>

	* top.h (saved_command_line): Remove declaration.
	* top.c (previous_saved_command_line, previous_repeat_arguments):
	New variables.
	(saved_command_line): Make static, define together with other
	'repeat variables'.
	(dont_repeat): Clear repeat_arguments.
	(repeat_previous, get_saved_command_line, save_command_line):
	New functions.
	(gdb_init): Initialize saved_command_line
	and previous_saved_command_line.
	* main.c (captured_main_1): Remove saved_command_line initialization.
	* event-top.c (handle_line_of_input): Update to use
	the new 'repeat' related functions instead of direct access to
	saved_command_line.
	* command.h (repeat_previous, get_saved_command_line,
	save_command_line): New declarations.
	(dont_repeat): Add comment.
2019-05-31 17:10:08 +02:00
Jose E. Marchesi a0486bac41 libctf: fix a number of build problems found on Solaris and NetBSD
- Use of nonportable <endian.h>
- Use of qsort_r
- Use of zlib without appropriate magic to pull in the binutils zlib
- Use of off64_t without checking (fixed by dropping the unused fields
  that need off64_t entirely)
- signedness problems due to long being too short a type on 32-bit
  platforms: ctf_id_t is now 'unsigned long', and CTF_ERR must be
  used only for functions that return ctf_id_t
- One lingering use of bzero() and of <sys/errno.h>

All fixed, using code from gnulib where possible.

Relatedly, set cts_size in a couple of places it was missed
(string table and symbol table loading upon ctf_bfdopen()).

binutils/
	* objdump.c (make_ctfsect): Drop cts_type, cts_flags, and
	cts_offset.
	* readelf.c (shdr_to_ctf_sect): Likewise.
include/
	* ctf-api.h (ctf_sect_t): Drop cts_type, cts_flags, and cts_offset.
	(ctf_id_t): This is now an unsigned type.
	(CTF_ERR): Cast it to ctf_id_t.  Note that it should only be used
	for ctf_id_t-returning functions.
libctf/
	* Makefile.am (ZLIB): New.
	(ZLIBINC): Likewise.
	(AM_CFLAGS): Use them.
	(libctf_a_LIBADD): New, for LIBOBJS.
	* configure.ac: Check for zlib, endian.h, and qsort_r.
	* ctf-endian.h: New, providing htole64 and le64toh.
	* swap.h: Code style fixes.
	(bswap_identity_64): New.
	* qsort_r.c: New, from gnulib (with one added #include).
	* ctf-decls.h: New, providing a conditional qsort_r declaration,
	and unconditional definitions of MIN and MAX.
	* ctf-impl.h: Use it.  Do not use <sys/errno.h>.
	(ctf_set_errno): Now returns unsigned long.
	* ctf-util.c (ctf_set_errno): Adjust here too.
	* ctf-archive.c: Use ctf-endian.h.
	(ctf_arc_open_by_offset): Use memset, not bzero.  Drop cts_type,
	cts_flags and cts_offset.
	(ctf_arc_write): Drop debugging dependent on the size of off_t.
	* ctf-create.c: Provide a definition of roundup if not defined.
	(ctf_create): Drop cts_type, cts_flags and cts_offset.
	(ctf_add_reftype): Do not check if type IDs are below zero.
	(ctf_add_slice): Likewise.
	(ctf_add_typedef): Likewise.
	(ctf_add_member_offset): Cast error-returning ssize_t's to size_t
	when known error-free.  Drop CTF_ERR usage for functions returning
	int.
	(ctf_add_member_encoded): Drop CTF_ERR usage for functions returning
	int.
	(ctf_add_variable): Likewise.
	(enumcmp): Likewise.
	(enumadd): Likewise.
	(membcmp): Likewise.
	(ctf_add_type): Likewise.  Cast error-returning ssize_t's to size_t
	when known error-free.
	* ctf-dump.c (ctf_is_slice): Drop CTF_ERR usage for functions
	returning int: use CTF_ERR for functions returning ctf_type_id.
	(ctf_dump_label): Likewise.
	(ctf_dump_objts): Likewise.
	* ctf-labels.c (ctf_label_topmost): Likewise.
	(ctf_label_iter): Likewise.
	(ctf_label_info): Likewise.
	* ctf-lookup.c (ctf_func_args): Likewise.
	* ctf-open.c (upgrade_types): Cast to size_t where appropriate.
	(ctf_bufopen): Likewise.  Use zlib types as needed.
	* ctf-types.c (ctf_member_iter): Drop CTF_ERR usage for functions
	returning int.
	(ctf_enum_iter): Likewise.
	(ctf_type_size): Likewise.
	(ctf_type_align): Likewise.  Cast to size_t where appropriate.
	(ctf_type_kind_unsliced): Likewise.
	(ctf_type_kind): Likewise.
	(ctf_type_encoding): Likewise.
	(ctf_member_info): Likewise.
	(ctf_array_info): Likewise.
	(ctf_enum_value): Likewise.
	(ctf_type_rvisit): Likewise.
	* ctf-open-bfd.c (ctf_bfdopen): Drop cts_type, cts_flags and
	cts_offset.
	(ctf_simple_open): Likewise.
	(ctf_bfdopen_ctfsect): Likewise.  Set cts_size properly.
	* Makefile.in: Regenerate.
	* aclocal.m4: Likewise.
	* config.h: Likewise.
	* configure: Likewise.
2019-05-31 11:10:51 +02:00
GDB Administrator ff4a4474eb Automatic date update in version.in 2019-05-31 00:00:14 +00:00
Jim Wilson 4288405d5e RISC-V: Fix lui argument parsing.
This fixes a bug reported on the riscv.org sw-dev mailing list.  This
rejects "lui x1,symbol", as a symbol should only be accepted here when
used inside %hi().  Without the fix, this gets assembled as "lui x1,0"
with no relocation which is clearly wrong.

	gas/
	* config/tc-riscv.c (riscv_ip) <'u'>: Move O_constant check inside if
	statement.  Delete O_symbol and O_constant check after if statement.
	* testsuite/gas/riscv/auipc-parsing.s: Test lui with missing %hi.
	* testsuite/gas/riscv/auipc-parsing.l: Update.
2019-05-30 15:23:10 -07:00
Tom Tromey bfcdb85206 Two comment fixes in gdbtypes.h
This fixes a couple of comments in gdbtypes.h.  One comment had a
typo; and another comment referred to "Moto", which is presumably some
long-gone Motorola-related project.

Tested by rebuilding.

gdb/ChangeLog
2019-05-30  Tom Tromey  <tromey@adacore.com>

	* gdbtypes.h (struct range_bounds) <flag_upper_bound_is_count>:
	Fix comment.
	(TYPE_ARRAY_UPPER_BOUND_IS_UNDEFINED): Rewrite comment.
2019-05-30 08:54:05 -06:00
Jan Vrany 0ef209f22c Initialize variable word in complete
The complete function should set parameter word to the end of the
word to complete. However, completion_find_completion_word may fail,
leaving word uninitialized.

To make sure word is always set, initialize it to the completion point
which is the end of the line parameter.

gdb/Changelog

	PR cli/24587
	* completer.c (complete): Initialize variable word.
2019-05-30 13:05:40 +01:00
Nick Clifton e3f56a99f6 Revert "Sync top level files with versions from gcc."
This reverts commit f948b2de97.
2019-05-30 11:17:19 +01:00
Nick Clifton ae9ac79e5e Harmonize readelf's output for version sections.
PR 24627
binutils * readelf.c (process_version_sections): Add 0x prefix to address
	display.  Correct indentation.

ld	* testsuite/ld-elf/ver_def.vd: Update expected output.
2019-05-30 10:17:29 +01:00
GDB Administrator 54a471e5fd Automatic date update in version.in 2019-05-30 00:00:14 +00:00
Sergio Durigan Junior 955b06fa57 Don't crash is dwarf_decode_macro_bytes's 'body' is NULL, even when '!is_define'
Ref.: https://bugzilla.redhat.com/show_bug.cgi?id=1715008

On commit 7bede82892 ("Don't crash if
dwarf_decode_macro_bytes's 'body' is NULL"), I was too strict when
checking if 'body' is NULL: the check only comprised the case when
'is_define' is true.  However, the corruption of .debug_macro by
rpmbuild's "debugedit" also affects the case when 'is_define' is
false, i.e., when the macro is being undefined.

This commit improves the check and covers both cases now.  This has
been tested on Fedora 30 with a problematic debuginfo, and I don't see
a segfault anymore.

OK to push?

gdb/ChangeLog:
2019-05-29  Sergio Durigan Junior  <sergiodj@redhat.com>

	Ref.: https://bugzilla.redhat.com/show_bug.cgi?id=1708192
	Ref.: https://bugzilla.redhat.com/show_bug.cgi?id=1715008
	* dwarf2read.c (dwarf_decode_macro_bytes): Move check to see if
	'body' is NULL to the outter 'if', protecting the '!is_define'
	situation as well.
2019-05-29 16:14:50 -04:00
Tom Tromey f49055a52f Fix failure in gdb.ada/complete.exp
I noticed a failure in gdb.ada/complete.exp when testing locally:

    FAIL: gdb.ada/complete.exp: complete break ada

This failed due to this output:

    [...]
    break ada/generated/gnatvsn.ads
    break ada/libgnat/s-excmac.ads
    break ada/sdefault.adb
    break ada/snames.adb
    break ada/snames.ads

This patch updates the regexp to allow "/" and "-" to appear.

gdb/testsuite/ChangeLog
2019-05-29  Tom Tromey  <tromey@adacore.com>

	* gdb.ada/complete.exp (test_gdb_no_completion): Add "/" and "-"
	to "break complete ada" test case's regexp.
2019-05-29 10:06:13 -06:00
Tom Tromey fa9c3fa035 Make some DWARF complaints clearer
I noticed that the complaint in partial_die_parent_scope was not using
dwarf_tag_name, so I changed that.  Then I noticed that dwarf_tag_name
does not show the numeric value for an unrecognized tag, so I changed
that function and all the related functions to do so.

gdb/ChangeLog
2019-05-29  Tom Tromey  <tromey@adacore.com>

	* dwarf2read.c (partial_die_parent_scope): Call dwarf_tag_name.
	(dwarf_unknown): New function.
	(dwarf_tag_name, dwarf_attr_name, dwarf_form_name)
	(dwarf_type_encoding_name): Use dwarf_unknown.
2019-05-29 09:57:47 -06:00
Tom Tromey 4330d61dfb Fix crash in cp_print_value_fields
PR c++/20020 concerns a crash in cp_print_value_fields.  The immediate
cause is that cp_print_value_fields does not handle the case where
value_static_field fails.  This is fixed in this patch by calling
cp_print_static_field from the "try" block.

Digging a bit deeper, the error occurs because GCC does not emit a
DW_AT_const_value for a static constexpr member appearing in a
template class.  I've filed a GCC bug for this.

Tested on x86-64 Fedora 29.

gdb/ChangeLog
2019-05-29  Tom Tromey  <tromey@adacore.com>

	PR c++/20020:
	* cp-valprint.c (cp_print_value_fields): Call
	cp_print_static_field inside "try".

gdb/testsuite/ChangeLog
2019-05-29  Tom Tromey  <tromey@adacore.com>

	PR c++/20020:
	* gdb.cp/constexpr-field.exp: New file.
	* gdb.cp/constexpr-field.cc: New file.
2019-05-29 09:44:09 -06:00
Alan Modra 6ff185b890 s12z genelf.em
This changes s12z to use generic.em and genelf.em, which is more
suited to targets that use the generic linker hash table.  A tweak or
two to some testsuite predicates then gives a clean testsuite result
on the target.

	PR 24596
binutils/
	* testsuite/lib/binutils-common.exp (supports_gnu_unique): Add
	s12z to targets not supporting this feature.
ld/
	* emulparams/m9s12zelf.sh (TEMPLATE_NAME): Set to generic.
	(EXTRA_EM_FILE): Define to genelf.
	* testsuite/lib/ld-lib.exp (uses_genelf): Add s12z.
2019-05-30 01:01:42 +09:30
Alan Modra 1336939d3c Support tcl procedure calls in run_dump_test xfail
Also support tcl procedure calls in the run_ld_link_tests and
run_ld_link_exec_tests optional "xfail" args.  Implements "is_generic"
and renames "is_generic_elf" to "uses_genelf", then uses these procs
in lots of ld tests.

moxie-elf  -FAIL: ld-elf/orphan3
mt-elf  -FAIL: ld-elf/merge
s12z-elf  -FAIL: ld-discard/extern
s12z-elf  -FAIL: ld-discard/start
s12z-elf  -FAIL: ld-discard/static
s12z-elf  -FAIL: PR ld/21703
s12z-elf  -FAIL: PR ld/21703 -r
s12z-elf  -FAIL: Symbol flags copy
s12z-elf  -FAIL: ld-elf/group1
s12z-elf  -FAIL: ld-elf/group3b
s12z-elf  -FAIL: ld-elf/group8a
s12z-elf  -FAIL: ld-elf/group8b
s12z-elf  -FAIL: ld-elf/group9a
s12z-elf  -FAIL: ld-elf/group9b
s12z-elf  -FAIL: ld-elf/linkonce2
s12z-elf  -FAIL: ld-elf/merge2
s12z-elf  -FAIL: ld-elf/merge3
s12z-elf  -FAIL: ld-elf/pr12851
s12z-elf  -FAIL: ld-elf/pr17550c
s12z-elf  -FAIL: ld-elf/pr17550d
s12z-elf  -FAIL: ld-elf/pr22677
s12z-elf  -FAIL: ld-elf/pr22836-1a
s12z-elf  -FAIL: ld-elf/pr22836-1b
s12z-elf  -FAIL: ld-elf/warn1
s12z-elf  -FAIL: ld-elf/warn3

binutils/
	* testsuite/lib/binutils-common.exp (run_dump_test): Support
	tcl procedures for xfail args.
ld/
	* testsuite/lib/ld-lib.exp (run_ld_link_tests): Support procedure
	calls in optional "xfail" args.
	(run_ld_link_exec_tests): Likewise.
	(is_generic): New.
	(uses_genelf): Rename from is_generic_elf.  Delete bogus semicolons.
	* testsuite/ld-scripts/align.exp: Rename is_generic_elf call.
	* testsuite/ld-elf/elf.exp: Use is_generic and uses_genelf.  Delete
	xfail_implib var.
	* testsuite/ld-elf/sec64k.exp: Use is_generic.
	* testsuite/ld-elf/shared.exp: Likewise.
	* testsuite/ld-discard/extern.d: Use is_generic in xfail.
	* testsuite/ld-discard/start.d: Likewise.
	* testsuite/ld-discard/static.d: Likewise.
	* testsuite/ld-elf/attributes.d: Likewise.
	* testsuite/ld-elf/group1.d: Likewise.
	* testsuite/ld-elf/group3b.d: Likewise.
	* testsuite/ld-elf/group8a.d: Likewise.
	* testsuite/ld-elf/group8b.d: Likewise.
	* testsuite/ld-elf/group9a.d: Likewise.
	* testsuite/ld-elf/group9b.d: Likewise.
	* testsuite/ld-elf/linkonce2.d: Likewise.
	* testsuite/ld-elf/merge2.d: Likewise.
	* testsuite/ld-elf/merge3.d: Likewise.
	* testsuite/ld-elf/pr12851.d: Likewise.
	* testsuite/ld-elf/pr12975.d: Likewise.
	* testsuite/ld-elf/pr13177.d: Likewise.
	* testsuite/ld-elf/pr13195.d: Likewise.
	* testsuite/ld-elf/pr17550c.d: Likewise.
	* testsuite/ld-elf/pr17550d.d: Likewise.
	* testsuite/ld-elf/pr17615.d: Likewise.
	* testsuite/ld-elf/pr21562a.d: Likewise.
	* testsuite/ld-elf/pr21562b.d: Likewise.
	* testsuite/ld-elf/pr21562c.d: Likewise.
	* testsuite/ld-elf/pr21562d.d: Likewise.
	* testsuite/ld-elf/pr21562i.d: Likewise.
	* testsuite/ld-elf/pr21562j.d: Likewise.
	* testsuite/ld-elf/pr21562k.d: Likewise.
	* testsuite/ld-elf/pr21562l.d: Likewise.
	* testsuite/ld-elf/pr21562m.d: Likewise.
	* testsuite/ld-elf/pr21562n.d: Likewise.
	* testsuite/ld-elf/pr22677.d: Likewise.
	* testsuite/ld-elf/pr22836-1a.d: Likewise.
	* testsuite/ld-elf/pr22836-1b.d: Likewise.
	* testsuite/ld-elf/warn3.d: Likewise.
	* testsuite/ld-elf/warn1.d: Likewise and xfail sparc solaris
	targets rather than notarget.
	* testsuite/ld-elf/compressed1d.d: Use uses_genelf in xfail.
	* testsuite/ld-elf/orphan-10.d: Likewise.
	* testsuite/ld-elf/orphan-9.d: Likewise.
	* testsuite/ld-elf/orphan-region.d: Likewise.
	* testsuite/ld-elf/orphan.d: Likewise.
	* testsuite/ld-elf/orphan3.d: Likewise.
	* testsuite/ld-elf/pr20528a.d: Likewise.
	* testsuite/ld-elf/pr20528b.d: Likewise.
	* testsuite/ld-elf/pr23658-1a.d: Likewise.
	* testsuite/ld-elf/pr23658-1b.d: Likewise.
	* testsuite/ld-elf/pr349.d: Likewise.
	* testsuite/ld-elf/warn2.d: Likewise and xfail sparc solaris
	targets rather than notarget.
	* testsuite/ld-elf/merge.d: Correct ms1-*-* to mt-*-*.
2019-05-30 00:52:08 +09:30
Tom Tromey 33a6bc350f Add new GCC 9 warnings to warnings.m4
GCC 9 has a few new warnings that aren't enabled in the gdb build by
default: -Wdeprecated-copy, -Wdeprecated-copy-dtor, and
-Wredundant-move.  This patch enables them all.

Tested by rebuilding with a new GCC (git master) on x86-64 Fedora 29.

gdb/ChangeLog
2019-05-29  Tom Tromey  <tromey@adacore.com>

	* inflow.c (struct terminal_info): Add default operator=.
	* configure: Rebuild.
	* warning.m4 (AM_GDB_WARNINGS): Add -Wdeprecated-copy,
	-Wdeprecated-copy-dtor, -Wredundant-move.

gdb/gdbserver/ChangeLog
2019-05-29  Tom Tromey  <tromey@adacore.com>

	* configure: Rebuild.
2019-05-29 08:56:23 -06:00
Tom Tromey 000439d528 Add "set print finish"
A user wanted to be able to disable the display of the value when
using "finish" -- but still have the value entered into the value
history in case it was useful later on.  Part of the rationale here is
that sometimes the value might be quite large, or expensive to display
(in their case this was compounded by a rogue pretty-printer).

This patch implements this idea.

gdb/ChangeLog
2019-05-29  Tom Tromey  <tromey@adacore.com>

	* NEWS: Add entry.
	* infcmd.c (print_return_value_1): Handle finish_print
	option.
	(show_print_finish): New function.
	(_initialize_infcmd): Add "set/show print finish" commands.
	* valprint.c (user_print_options): Initialize new member.
	* valprint.h (struct value_print_options) <finish_print>: New
	member.

gdb/doc/ChangeLog
2019-05-29  Tom Tromey  <tromey@adacore.com>

	* gdb.texinfo (Continuing and Stepping): Document new
	commands.

gdb/testsuite/ChangeLog
2019-05-29  Tom Tromey  <tromey@adacore.com>

	* gdb.base/finish.exp (finish_no_print): New proc.
	(finish_tests): Call it.
2019-05-29 08:25:38 -06:00
Nick Clifton e33f2313bf Update release tools with libctf support.
top	* src-release.sh (do_proto_toplev): Add libctf to list of
	directories that can be disabled.

binutils* README-how-to-make-a-release: Add libctf to list of directories
	that need updates in their ChangeLogs.
2019-05-29 12:49:13 +01:00
Nick Clifton f948b2de97 Sync top level files with versions from gcc.
top	* Makefile.def (target_modules): Add libphobos.
	(flags_to_pass): Add GDC, GDCFLAGS, GDC_FOR_TARGET and
	GDCFLAGS_FOR_TARGET.
	(dependencies): Make libphobos depend on libatomic, libbacktrace
	configure, and zlib configure.
	(language): Add language d.
	* Makefile.in: Rebuild.
	* Makefile.tpl (BUILD_EXPORTS): Add GDC and GDCFLAGS.
	(HOST_EXPORTS): Add GDC.
	(POSTSTAGE1_HOST_EXPORTS): Add GDC and GDC_FOR_BUILD.
	(BASE_TARGET_EXPORTS): Add GDC.
	(GDC_FOR_BUILD, GDC, GDCFLAGS): New variables.
	(GDC_FOR_TARGET, GDC_FLAGS_FOR_TARGET): New variables.
	(EXTRA_HOST_FLAGS): Add GDC.
	(STAGE1_FLAGS_TO_PASS): Add GDC.
	(EXTRA_TARGET_FLAGS): Add GDC and GDCFLAGS.
	* config-ml.in: Treat GDC and GDCFLAGS like other compiler/flag
	environment variables.
	* configure: Rebuild.
	* configure.ac: Add target-libphobos to target_libraries.  Set and
	substitute GDC_FOR_BUILD and GDC_FOR_TARGET.
2019-05-29 12:43:42 +01:00
Nick Clifton 90bd54236c Do not build libctf for targets that do not use the ELF file format.
top	* configure.ac (noconfigdirs): Add libctf if the target does not use
	the ELF file format.
	* configure: Regenerate.

binutils* configure.ac (LIBCTF): Export.  Set to empty for non-ELF based
	targets.
	(HAVE_LIBCTF): Define if libctf support is available.
	* Makefile.am (LIBCTF): Set value to @LIBCTF@.
	* objdump.c: Make CTF code conditional upon HAVE_LIBCTF being
	defined.
	* readelf.c: Likewise.
	* configure: Regenerate.
	* Makefile.in: Regenerate.
	* config.in: Regenerate.
2019-05-29 11:32:34 +01:00
Nick Alcock 9698cf9b1c Fix libctf build on non-ELF targets.
All machinery works as on ELF, except for automatic loading of ELF
string and symbol tables in the BFD-style open machinery.

        * Makefile.def (dependencies): configure-libctf depends on all-bfd
        and all its deps.
        * Makefile.in: Regenerated.

libctf/
        * configure.in: Check for bfd_section_from_elf_index.
        * configure: Regenerate.
        * config.h.in [HAVE_BFD_ELF]: Likewise.
        * libctf/ctf_open_bfd (ctf_bfdopen_ctfsect): Use it.
        abfd is potentially unused now.
2019-05-29 11:11:37 +02:00
GDB Administrator 90f879191c Automatic date update in version.in 2019-05-29 00:00:28 +00:00
Faraz Shahbazker 1e129bbefa MIPS/LD: Skip overflow check for %pcrel_hi relocations
Overflow checks were removed for all hi16 relocations except PC-relative
high relocations per PR ld/16720.  Remove overflow checks from %pcrel_hi
relocations so that we can correctly handle negative offsets from PC.

bfd/
	* elfxx-mips.c (mips_elf_calculate_relocation) <R_MIPS_PCHI16>:
	Remove overflow check.

ld/
	* testsuite/ld-mips-elf/undefweak-overflow.s: Remove test case
	for pcrel_hi/pcrel_lo.
	* testsuite/ld-mips-elf/undefweak-overflow.d: Update to match.
	* testsuite/ld-mips-elf/reloc-pcrel-r6.s: New test source.
	* testsuite/ld-mips-elf/reloc-pcrel-r6.d: New test linker script.
	* testsuite/ld-mips-elf/reloc-pcrel-r6.ld: New test.
	* testsuite/ld-mips-elf/mips-elf.exp: Run the new test.
2019-05-28 10:49:16 -07:00
H.J. Lu a2f4b66c9e x86: Add CheckRegSize to AVX512_BF16 instructions with Disp8ShiftVL
For AVX512 instructions with Disp8ShiftVL and Broadcast, we may need to
add CheckRegSize to check if broadcast matches the destination register
size.

gas/

	PR gas/24625
	* testsuite/gas/i386/inval-avx512f.s: Add tests for AVX512_BF16
	instructions with invalid broadcast.
	* testsuite/gas/i386/x86-64-inval-avx512f.s: Likewise.
	* testsuite/gas/i386/inval-avx512f.l: Updated.
	* testsuite/gas/i386/x86-64-inval-avx512f.l: Likewise.

opcodes/

	PR gas/24625
	* i386-opc.tbl: Add CheckRegSize to AVX512_BF16 instructions with
	Disp8ShiftVL.
	* i386-tbl.h: Regenerated.
2019-05-28 10:05:44 -07:00
Tom Tromey c0e70c624f Remove find_old_style_renaming_symbol
We found a case where a "bt" was very slow with Ada code.  Profiling
with callgrind showed this to be primarily due to calls to
find_old_style_renaming_symbol.  Because new-style renaming symbols
were implemented in 2007, it seems safe enough to remove this old
code.

A "-batch -ex bt" test on a large Ada program improves from:

    13.23user 0.57system 0:13.82elapsed 99%CPU (0avgtext+0avgdata 571408maxresident)k

to

    4.25user 0.48system 0:04.74elapsed 99%CPU (0avgtext+0avgdata 559844maxresident)k

with this patch.

Tested on x86-64 Fedora 29.  Joel reviewed this internally; and as it
is Ada-specific, I am checking it in.

gdb/ChangeLog
2019-05-28  Tom Tromey  <tromey@adacore.com>

	* ada-lang.c (ada_remove_Xbn_suffix)
	(find_old_style_renaming_symbol)
	(parse_old_style_renaming): Remove.
	(ada_find_renaming_symbol): Don't call
	find_old_style_renaming_symbol.
	(ada_is_renaming_symbol): Rename from
	ada_find_renaming_symbol.  Remove "block" parameter.  Return
	bool.  Now static.
	(ada_read_var_value): Update and simplify.
	* ada-exp.y (write_var_or_type): Remove old code.
2019-05-28 12:39:01 -04:00
Nick Alcock 88981b157b Add libctf to top-level MAINTAINERS; add myself as CTF maintainer. 2019-05-28 17:10:04 +01:00
Nick Alcock 7d9813f196 binutils: CTF support for objdump and readelf
This introduces CTF support for objdump and readelf.  objdump has the
following new arguments:

     --ctf=SECTION: display CTF in the given SECTION
     --ctf-parent=SECTION: name of CTF section that is the parent of this section

readelf has the above, and these two as well:

     --ctf-symbols=SECTION: name of symbol table section (optional)
     --ctf-strings=SECTION: name of string table section (optional)

(objdump can always use BFD machinery to determine the applicable string
and symbol tables automatically, so these arguments are unnecessary.)

Nearly all the work is done by the ctf_dump machinery in libctf: most of
the remaining work is option-processing and section-reading, and thus is
different for objdump and readelf: the minimal amount of similar code
remaining is, in my view, too small to share, particularly given that
objdump uses ctf_bfdopen() and readelf uses ctf_simple_open() since it
doesn't have a bfd.

I am not particularly satisfied with the way resources are freed in
either of these (I was forced to do it at the top level, for lack of
anywhere else to free resources allocated during option processing), but
I can't see any better way to do it without introducing new
infrastructure for no other purpose.

There are essentially arbitrary ordering changes to the Makefile.in's
order of libtool-related stuff that I can't get rid of, but they have no
semantic effect.  (It is possible that some hunks of these changes could
be dropped, but that seems a bit risky to me.)

binutils/
	* objdump.c (ctf-api.h): New include.
	(dump_ctf_section_info): New variable.
	(dump_ctf_section_name): Likewise.
	(usage): Describe new options.
	(enum option_values): Add OPTION_CTF and OPTION_CTF_PARENT.
	(main): Use them to add --ctf and --ctf-parent.
	(read_section_stabs): Add new parameter, entsize_ptr.
	(find_stabs_section): Adjust accordingly.
	(make_ctfsect): New.
	(dump_ctf_indent_lines): New.
	(dump_ctf_archive_member): New.
	(dump_ctf): New.
	(dump_bfd): Call it.  Free resources afterwards.
	* readelf.c (ctf-api.h): New include.
	(CTF_DUMP): New.
	(static bfd_boolean do_ctf): Likewise.
	(dump_ctf_parent_name): Likewise.
	(dump_ctf_symtab_name): Likewise.
	(dump_ctf_strtab_name): Likewise.
	(OPTION_CTF_DUMP): Likewise.
	(OPTION_CTF_PARENT): Likewise.
	(OPTION_CTF_SYMBOLS): Likewise.
	(OPTION_CTF_STRINGS): Likewise.
	(options): Add them.
	(usage): Likewise.
	(parse_args): Handle the new options, requesting CTF_DUMP.
	(process_section_contents): Handle CTF_DUMP.
	(shdr_to_ctf_sect): New.
	(dump_ctf_indent_lines): New.
	(dump_section_as_ctf): New.
	(main): Free resources.
	* Makefile.am (LIBCTF): New variable.
	(objdump_DEPENDENCIES): Use it.
	(readelf_DEPENDENCIES): Likewise.
	(objdump_LDADD): Likewise.
	(readelf_LDADD): Likewise.
	* aclocal.m4: Regenerated.
	* Makefile.in: Likewise.

	* doc/binutils.texi (objdump): Document the new options.
	(readelf): Likewise.
	* doc/ctf.options.texi: New.
	* doc/Makefile.in: Regenerated.
	* NEWS: Mention the new feature.
2019-05-28 17:09:45 +01:00
Nick Alcock 0e65dfbaf3 libctf: build system
This ties libctf into the build system, and makes binutils depend on it
(used by the next commits).

	* Makefile.def (host_modules): Add libctf.
	* Makefile.def (dependencies): Likewise.
	libctf depends on zlib, libiberty, and bfd.
	* Makefile.in: Regenerated.
	* configure.ac (host_libs): Add libctf.
	* configure: Regenerated.

libctf/
	* Makefile.am: New.
	* Makefile.in: Regenerated.
	* config.h.in: Likewise.
	* aclocal.m4: Likewise.
	* configure: Likewise.
2019-05-28 17:09:41 +01:00
Nick Alcock a30b3e182a libctf: debug dumping
This introduces ctf_dump(), an iterator which returns a series of
strings, each representing a debugging dump of one item from a given
section in the CTF file.  The items may be multiline: a callback is
provided to allow the caller to decorate each line as they desire before
the line is returned.

libctf/
	* ctf-dump.c: New.

include/
	* ctf-api.h (ctf_dump_decorate_f): New.
	(ctf_dump_state_t): new.
	(ctf_dump): New.
2019-05-28 17:09:37 +01:00
Nick Alcock 6dbf2b7340 libctf: labels
This facility allows you to associate regions of type IDs with *labels*,
a labelled tiling of the type ID space. You can use these to define
CTF containers with distinct parents for distinct ranges of the ID
space, or to assist with parallelization of CTF processing, or for any
other purpose you can think of.

Notably absent from here (though declared in the API header) is any way
to define new labels: this will probably be introduced soon, as part of
the linker deduplication work.  (One existed in the past, but was deeply
tied to the Solaris CTF file generator and had to be torn out.)

libctf/
	* ctf-labels.c: New.
include/
	* ctf-api.h (ctf_label_f): New.
	(ctf_label_set): New.
	(ctf_label_get): New.
	(ctf_label_topmost): New.
	(ctf_label_info): New.
	(ctf_label_iter): New.
2019-05-28 17:09:30 +01:00
Nick Alcock 6c33b742ce libctf: library version enforcement
This old Solaris standard allows callers to specify that they are
expecting one particular API and/or CTF file format from the library.

libctf/
	* ctf-impl.h (_libctf_version): New declaration.
	* ctf-subr.c (_libctf_version): Define it.
	(ctf_version): New.

include/
	* ctf-api.h (ctf_version): New.
2019-05-28 17:08:29 +01:00