Commit Graph

95525 Commits

Author SHA1 Message Date
GDB Administrator aff4a11991 Automatic date update in version.in 2018-09-18 00:00:38 +00:00
Philippe Waroquiers 6eb5dbce1e [OBVIOUS] ChangeLog for obvious enable frame-filter help fix.
ChangeLog for 62b1765c90
2018-09-18 00:54:31 +02:00
Philippe Waroquiers 62b1765c90 [OBVIOUS] enable frame-filter short help uses disable instead of enable
Without the patch:
  (gdb) apropos able frame-filter
  disable frame-filter -- GDB command to disable the specified frame-filter
  enable frame-filter -- GDB command to disable the specified frame-filter

With the patch:
  (gdb) apropos able frame-filter
  disable frame-filter -- GDB command to disable the specified frame-filter
  enable frame-filter -- GDB command to enable the specified frame-filter

Pushed as obvious
2018-09-18 00:19:51 +02:00
Tom Tromey ae292b3afc Do not pass -DNDEBUG to Python compilations in development mode
The Python CFLAGS include -DNDEBUG.  This was apparently done
intentionally -- setting the flags is done manually because, according
to a comment, python-config passes too many things to the compiler
(which is true).

Per PR python/20445, this patch changes configure so that -DNDEBUG is
only used by release builds.  This probably doesn't have very much
effect in practice, but I did see that some Python headers use assert,
so perhaps it will give some safety.

Tested by rebuilding and re-running gdb.python/*.exp on x86-64 Fedora 28.

gdb/ChangeLog
2018-09-17  Tom Tromey  <tom@tromey.com>

	PR python/20445:
	* configure: Rebuild.
	* configure.ac: Conditionally use -DNDEBUG for Python.
2018-09-17 13:51:38 -06:00
Tom Tromey da658607ed Check for gmp when checking for mpfr
There was a report on irc that the gdb check for mpfr failed when only
static libraries are available.  The issue is that mpfr depends on
gmp, but this is not handled explicitly by gdb.

Ideally upstream would switch to pkg-config.  Or even more ideally, we
would incorporate pkg-config into the compiler and not mess with any
of this.

Meanwhile, this changes gdb's configure to add gmp to the link line
when checking for mpfr.

gdb/ChangeLog
2018-09-17  Tom Tromey  <tom@tromey.com>

	* configure: Rebuild.
	* configure.ac: Use gmp as a library dependency when checking for
	mpfr.
2018-09-17 13:51:38 -06:00
Pedro Alves d35da542a7 [gdb/Python] Eliminate find_inferior_object
Commit 00431a78b2 ("Use thread_info and inferior pointers more
throughout") removed the declaration of find_inferior_object, but
missed removing the definition.

gdb/ChangeLog:
2018-09-17  Pedro Alves  <palves@redhat.com>

	* python/py-inferior.c (find_inferior_object): Delete.
2018-09-17 19:46:40 +01:00
Jim Wilson 4e2b18982a RISC-V: bge[u] should get higher priority than ble[u].
2018-09-17  Kito Cheng  <kito@andestech.com>
gas/
	* testsuite/gas/riscv/bge.d: New.
	* testsuite/gas/riscv/bge.s: Likewise.
opcodes/
	* riscv-opc.c (riscv_opcodes): Adjust the order of ble and
	  bleu.
2018-09-17 11:43:08 -07:00
Simon Marchi 461464f226 Fix use-after-move in compile/compile-cplus-types.c
Patch

  d82b3862f1 ("compile: Remove non-const reference parameters")

introduced a regression in compile/compile-cplus-types.c.  The new_scope
variable in compile_cplus_instance::enter_scope is used after it was
std::moved.  This patch fixes it by referring to the back of the vector
where it was moved instead.

gdb/ChangeLog:

	* compile/compile-cplus-types.c
	(compile_cplus_instance::enter_scope): Don't use new_scope after
	std::move.
2018-09-17 13:11:07 -04:00
H.J. Lu 04e2a1829e x86: Set EVex=2 on EVEX.128 only vmovd and vmovq
EVEX "VMOVD xmm1, r32/m32", "VMOVD r32/m32, xmm2", "VMOVQ xmm1, r64/m64",
"VMOVD r64/m64, xmm2", "VMOVQ xmm1, xmm2/m64" and "VMOVQ xmm1/m64, xmm2"
can only be encoded with EVEX.128.  Set EVex=2 on EVEX.128 only vmovd and
vmovq.

gas/

	PR gas/23670
	* testsuite/gas/i386/evex-lig-2.d: New file.
	* testsuite/gas/i386/evex-lig-2.s: Likewise.
	* testsuite/gas/i386/x86-64-evex-lig-2.d: Likewise.
	* testsuite/gas/i386/x86-64-evex-lig-2.s: Likewise.
	* testsuite/gas/i386/i386.exp: Run evex-lig-2 and
	x86-64-evex-lig-2.

opcodes/

	PR gas/23670
	* i386-dis-evex.h (evex_table): Use EVEX_LEN_0F6E_P_2,
	EVEX_LEN_0F7E_P_1, EVEX_LEN_0F7E_P_2 and EVEX_LEN_0FD6_P_2.
	(EVEX_LEN_0F6E_P_2): New EVEX_LEN_TABLE entry.
	(EVEX_LEN_0F7E_P_1): Likewise.
	(EVEX_LEN_0F7E_P_2): Likewise.
	(EVEX_LEN_0FD6_P_2): Likewise.
	* i386-dis.c (USE_EVEX_LEN_TABLE): New.
	(EVEX_LEN_TABLE): Likewise.
	(EVEX_LEN_0F6E_P_2): New enum.
	(EVEX_LEN_0F7E_P_1): Likewise.
	(EVEX_LEN_0F7E_P_2): Likewise.
	(EVEX_LEN_0FD6_P_2): Likewise.
	(evex_len_table): New.
	(get_valid_dis386): Handle USE_EVEX_LEN_TABLE.
	* i386-opc.tbl: Set EVex=2 on EVEX.128 only vmovd and vmovq.
	* i386-tbl.h: Regenerated.
2018-09-17 09:33:35 -07:00
H.J. Lu d5f787c2bc x86: Set Vex=1 on VEX.128 only vmovd and vmovq
AVX "VMOVD xmm1, r32/m32", "VMOVD r32/m32, xmm2", "VMOVQ xmm1, r64/m64"
and "VMOVD r64/m64, xmm2" can only be encoded with VEX.128.  Set Vex=1
on VEX.128 only vmovd and vmovq.

gas/

	PR gas/23665
	* testsuite/gas/i386/avx-scalar.s: Remove vmovq and vmovd tests.
	* testsuite/gas/i386/x86-64-avx-scalar.s: Likewise.
	* testsuite/gas/i386/avx-scalar-intel.d: Updated.
	* testsuite/gas/i386/avx-scalar.d: Likewise.
	* testsuite/gas/i386/x86-64-avx-scalar-intel.d: Likewise.
	* testsuite/gas/i386/x86-64-avx-scalar.d: Likewise.
	* testsuite/gas/i386/i386.exp: Run avx-scalar2 and
	x86-64-avx-scalar2.
	* testsuite/gas/i386/avx-scalar-2.d: New file.
	* testsuite/gas/i386/avx-scalar-2.s: Likewise.
	* testsuite/gas/i386/x86-64-avx-scalar-2.d: Likewise.
	* testsuite/gas/i386/x86-64-avx-scalar-2.s: Likewise.

opcodes/

	PR gas/23665
	* i386-dis.c (vex_len_table): Update VEX_LEN_0F6E_P_2 and
	VEX_LEN_0F7E_P_2 entries.
	* i386-opc.tbl: Set Vex=1 on VEX.128 only vmovd and vmovq.
	* i386-tbl.h: Regenerated.
2018-09-17 09:31:17 -07:00
H.J. Lu 0375113302 x86: Add -mvexwig=[0|1] option to assembler
Add -mvexwig=[0|1] option to x86 assembler to control how the assembler
should encode the VEX.W bit in WIG VEX instructions.

	* gas/NEWS: Mention -mvexwig=[0|1] option.
	* config/tc-i386.c (vexwig): New.
	(build_vex_prefix): Set the VEX.W bit for -mvexwig=1 for WIG
	VEX instructions.
	(OPTION_MVEXWIG): New.
	(md_longopts): Add -mvexwig=.
	(md_parse_option): Handle OPTION_MVEXWIG.
	(md_show_usage): Show -mvexwig=[0|1].
	* doc/c-i386.texi: Document -mvexwig=[0|1].
	* testsuite/gas/i386/avx-wig.d: New file.
	* testsuite/gas/i386/avx-wig.s: Likewise.
	* testsuite/gas/i386/avx2-wig.d: Likewise.
	* testsuite/gas/i386/avx2-wig.s: Likewise.
	* testsuite/gas/i386/x86-64-avx-wig.d: Likewise.
	* testsuite/gas/i386/x86-64-avx-wig.s: Likewise.
	* testsuite/gas/i386/x86-64-avx2-wig.d: Likewise.
	* testsuite/gas/i386/x86-64-avx2-wig.s: Likewise.
	* testsuite/gas/i386/i386.exp: Run avx-wig, avx2-wig,
	x86-64-avx-wig and x86-64-avx2-wig.
2018-09-17 09:26:29 -07:00
H.J. Lu ec6f095abc x86: Update disassembler for VexWIG
The VEX.W bit is ignored by some VEX instructions, aka WIG instructions.
Update x86 disassembler to handle VEX WIG instructions.

	* i386-dis.c (VZERO_Fixup): Removed.
	(VZERO): Likewise.
	(VEX_LEN_0F10_P_1): Likewise.
	(VEX_LEN_0F10_P_3): Likewise.
	(VEX_LEN_0F11_P_1): Likewise.
	(VEX_LEN_0F11_P_3): Likewise.
	(VEX_LEN_0F2E_P_0): Likewise.
	(VEX_LEN_0F2E_P_2): Likewise.
	(VEX_LEN_0F2F_P_0): Likewise.
	(VEX_LEN_0F2F_P_2): Likewise.
	(VEX_LEN_0F51_P_1): Likewise.
	(VEX_LEN_0F51_P_3): Likewise.
	(VEX_LEN_0F52_P_1): Likewise.
	(VEX_LEN_0F53_P_1): Likewise.
	(VEX_LEN_0F58_P_1): Likewise.
	(VEX_LEN_0F58_P_3): Likewise.
	(VEX_LEN_0F59_P_1): Likewise.
	(VEX_LEN_0F59_P_3): Likewise.
	(VEX_LEN_0F5A_P_1): Likewise.
	(VEX_LEN_0F5A_P_3): Likewise.
	(VEX_LEN_0F5C_P_1): Likewise.
	(VEX_LEN_0F5C_P_3): Likewise.
	(VEX_LEN_0F5D_P_1): Likewise.
	(VEX_LEN_0F5D_P_3): Likewise.
	(VEX_LEN_0F5E_P_1): Likewise.
	(VEX_LEN_0F5E_P_3): Likewise.
	(VEX_LEN_0F5F_P_1): Likewise.
	(VEX_LEN_0F5F_P_3): Likewise.
	(VEX_LEN_0FC2_P_1): Likewise.
	(VEX_LEN_0FC2_P_3): Likewise.
	(VEX_LEN_0F3A0A_P_2): Likewise.
	(VEX_LEN_0F3A0B_P_2): Likewise.
	(VEX_W_0F10_P_0): Likewise.
	(VEX_W_0F10_P_1): Likewise.
	(VEX_W_0F10_P_2): Likewise.
	(VEX_W_0F10_P_3): Likewise.
	(VEX_W_0F11_P_0): Likewise.
	(VEX_W_0F11_P_1): Likewise.
	(VEX_W_0F11_P_2): Likewise.
	(VEX_W_0F11_P_3): Likewise.
	(VEX_W_0F12_P_0_M_0): Likewise.
	(VEX_W_0F12_P_0_M_1): Likewise.
	(VEX_W_0F12_P_1): Likewise.
	(VEX_W_0F12_P_2): Likewise.
	(VEX_W_0F12_P_3): Likewise.
	(VEX_W_0F13_M_0): Likewise.
	(VEX_W_0F14): Likewise.
	(VEX_W_0F15): Likewise.
	(VEX_W_0F16_P_0_M_0): Likewise.
	(VEX_W_0F16_P_0_M_1): Likewise.
	(VEX_W_0F16_P_1): Likewise.
	(VEX_W_0F16_P_2): Likewise.
	(VEX_W_0F17_M_0): Likewise.
	(VEX_W_0F28): Likewise.
	(VEX_W_0F29): Likewise.
	(VEX_W_0F2B_M_0): Likewise.
	(VEX_W_0F2E_P_0): Likewise.
	(VEX_W_0F2E_P_2): Likewise.
	(VEX_W_0F2F_P_0): Likewise.
	(VEX_W_0F2F_P_2): Likewise.
	(VEX_W_0F50_M_0): Likewise.
	(VEX_W_0F51_P_0): Likewise.
	(VEX_W_0F51_P_1): Likewise.
	(VEX_W_0F51_P_2): Likewise.
	(VEX_W_0F51_P_3): Likewise.
	(VEX_W_0F52_P_0): Likewise.
	(VEX_W_0F52_P_1): Likewise.
	(VEX_W_0F53_P_0): Likewise.
	(VEX_W_0F53_P_1): Likewise.
	(VEX_W_0F58_P_0): Likewise.
	(VEX_W_0F58_P_1): Likewise.
	(VEX_W_0F58_P_2): Likewise.
	(VEX_W_0F58_P_3): Likewise.
	(VEX_W_0F59_P_0): Likewise.
	(VEX_W_0F59_P_1): Likewise.
	(VEX_W_0F59_P_2): Likewise.
	(VEX_W_0F59_P_3): Likewise.
	(VEX_W_0F5A_P_0): Likewise.
	(VEX_W_0F5A_P_1): Likewise.
	(VEX_W_0F5A_P_3): Likewise.
	(VEX_W_0F5B_P_0): Likewise.
	(VEX_W_0F5B_P_1): Likewise.
	(VEX_W_0F5B_P_2): Likewise.
	(VEX_W_0F5C_P_0): Likewise.
	(VEX_W_0F5C_P_1): Likewise.
	(VEX_W_0F5C_P_2): Likewise.
	(VEX_W_0F5C_P_3): Likewise.
	(VEX_W_0F5D_P_0): Likewise.
	(VEX_W_0F5D_P_1): Likewise.
	(VEX_W_0F5D_P_2): Likewise.
	(VEX_W_0F5D_P_3): Likewise.
	(VEX_W_0F5E_P_0): Likewise.
	(VEX_W_0F5E_P_1): Likewise.
	(VEX_W_0F5E_P_2): Likewise.
	(VEX_W_0F5E_P_3): Likewise.
	(VEX_W_0F5F_P_0): Likewise.
	(VEX_W_0F5F_P_1): Likewise.
	(VEX_W_0F5F_P_2): Likewise.
	(VEX_W_0F5F_P_3): Likewise.
	(VEX_W_0F60_P_2): Likewise.
	(VEX_W_0F61_P_2): Likewise.
	(VEX_W_0F62_P_2): Likewise.
	(VEX_W_0F63_P_2): Likewise.
	(VEX_W_0F64_P_2): Likewise.
	(VEX_W_0F65_P_2): Likewise.
	(VEX_W_0F66_P_2): Likewise.
	(VEX_W_0F67_P_2): Likewise.
	(VEX_W_0F68_P_2): Likewise.
	(VEX_W_0F69_P_2): Likewise.
	(VEX_W_0F6A_P_2): Likewise.
	(VEX_W_0F6B_P_2): Likewise.
	(VEX_W_0F6C_P_2): Likewise.
	(VEX_W_0F6D_P_2): Likewise.
	(VEX_W_0F6F_P_1): Likewise.
	(VEX_W_0F6F_P_2): Likewise.
	(VEX_W_0F70_P_1): Likewise.
	(VEX_W_0F70_P_2): Likewise.
	(VEX_W_0F70_P_3): Likewise.
	(VEX_W_0F71_R_2_P_2): Likewise.
	(VEX_W_0F71_R_4_P_2): Likewise.
	(VEX_W_0F71_R_6_P_2): Likewise.
	(VEX_W_0F72_R_2_P_2): Likewise.
	(VEX_W_0F72_R_4_P_2): Likewise.
	(VEX_W_0F72_R_6_P_2): Likewise.
	(VEX_W_0F73_R_2_P_2): Likewise.
	(VEX_W_0F73_R_3_P_2): Likewise.
	(VEX_W_0F73_R_6_P_2): Likewise.
	(VEX_W_0F73_R_7_P_2): Likewise.
	(VEX_W_0F74_P_2): Likewise.
	(VEX_W_0F75_P_2): Likewise.
	(VEX_W_0F76_P_2): Likewise.
	(VEX_W_0F77_P_0): Likewise.
	(VEX_W_0F7C_P_2): Likewise.
	(VEX_W_0F7C_P_3): Likewise.
	(VEX_W_0F7D_P_2): Likewise.
	(VEX_W_0F7D_P_3): Likewise.
	(VEX_W_0F7E_P_1): Likewise.
	(VEX_W_0F7F_P_1): Likewise.
	(VEX_W_0F7F_P_2): Likewise.
	(VEX_W_0FAE_R_2_M_0): Likewise.
	(VEX_W_0FAE_R_3_M_0): Likewise.
	(VEX_W_0FC2_P_0): Likewise.
	(VEX_W_0FC2_P_1): Likewise.
	(VEX_W_0FC2_P_2): Likewise.
	(VEX_W_0FC2_P_3): Likewise.
	(VEX_W_0FD0_P_2): Likewise.
	(VEX_W_0FD0_P_3): Likewise.
	(VEX_W_0FD1_P_2): Likewise.
	(VEX_W_0FD2_P_2): Likewise.
	(VEX_W_0FD3_P_2): Likewise.
	(VEX_W_0FD4_P_2): Likewise.
	(VEX_W_0FD5_P_2): Likewise.
	(VEX_W_0FD6_P_2): Likewise.
	(VEX_W_0FD7_P_2_M_1): Likewise.
	(VEX_W_0FD8_P_2): Likewise.
	(VEX_W_0FD9_P_2): Likewise.
	(VEX_W_0FDA_P_2): Likewise.
	(VEX_W_0FDB_P_2): Likewise.
	(VEX_W_0FDC_P_2): Likewise.
	(VEX_W_0FDD_P_2): Likewise.
	(VEX_W_0FDE_P_2): Likewise.
	(VEX_W_0FDF_P_2): Likewise.
	(VEX_W_0FE0_P_2): Likewise.
	(VEX_W_0FE1_P_2): Likewise.
	(VEX_W_0FE2_P_2): Likewise.
	(VEX_W_0FE3_P_2): Likewise.
	(VEX_W_0FE4_P_2): Likewise.
	(VEX_W_0FE5_P_2): Likewise.
	(VEX_W_0FE6_P_1): Likewise.
	(VEX_W_0FE6_P_2): Likewise.
	(VEX_W_0FE6_P_3): Likewise.
	(VEX_W_0FE7_P_2_M_0): Likewise.
	(VEX_W_0FE8_P_2): Likewise.
	(VEX_W_0FE9_P_2): Likewise.
	(VEX_W_0FEA_P_2): Likewise.
	(VEX_W_0FEB_P_2): Likewise.
	(VEX_W_0FEC_P_2): Likewise.
	(VEX_W_0FED_P_2): Likewise.
	(VEX_W_0FEE_P_2): Likewise.
	(VEX_W_0FEF_P_2): Likewise.
	(VEX_W_0FF0_P_3_M_0): Likewise.
	(VEX_W_0FF1_P_2): Likewise.
	(VEX_W_0FF2_P_2): Likewise.
	(VEX_W_0FF3_P_2): Likewise.
	(VEX_W_0FF4_P_2): Likewise.
	(VEX_W_0FF5_P_2): Likewise.
	(VEX_W_0FF6_P_2): Likewise.
	(VEX_W_0FF7_P_2): Likewise.
	(VEX_W_0FF8_P_2): Likewise.
	(VEX_W_0FF9_P_2): Likewise.
	(VEX_W_0FFA_P_2): Likewise.
	(VEX_W_0FFB_P_2): Likewise.
	(VEX_W_0FFC_P_2): Likewise.
	(VEX_W_0FFD_P_2): Likewise.
	(VEX_W_0FFE_P_2): Likewise.
	(VEX_W_0F3800_P_2): Likewise.
	(VEX_W_0F3801_P_2): Likewise.
	(VEX_W_0F3802_P_2): Likewise.
	(VEX_W_0F3803_P_2): Likewise.
	(VEX_W_0F3804_P_2): Likewise.
	(VEX_W_0F3805_P_2): Likewise.
	(VEX_W_0F3806_P_2): Likewise.
	(VEX_W_0F3807_P_2): Likewise.
	(VEX_W_0F3808_P_2): Likewise.
	(VEX_W_0F3809_P_2): Likewise.
	(VEX_W_0F380A_P_2): Likewise.
	(VEX_W_0F380B_P_2): Likewise.
	(VEX_W_0F3817_P_2): Likewise.
	(VEX_W_0F381C_P_2): Likewise.
	(VEX_W_0F381D_P_2): Likewise.
	(VEX_W_0F381E_P_2): Likewise.
	(VEX_W_0F3820_P_2): Likewise.
	(VEX_W_0F3821_P_2): Likewise.
	(VEX_W_0F3822_P_2): Likewise.
	(VEX_W_0F3823_P_2): Likewise.
	(VEX_W_0F3824_P_2): Likewise.
	(VEX_W_0F3825_P_2): Likewise.
	(VEX_W_0F3828_P_2): Likewise.
	(VEX_W_0F3829_P_2): Likewise.
	(VEX_W_0F382A_P_2_M_0): Likewise.
	(VEX_W_0F382B_P_2): Likewise.
	(VEX_W_0F3830_P_2): Likewise.
	(VEX_W_0F3831_P_2): Likewise.
	(VEX_W_0F3832_P_2): Likewise.
	(VEX_W_0F3833_P_2): Likewise.
	(VEX_W_0F3834_P_2): Likewise.
	(VEX_W_0F3835_P_2): Likewise.
	(VEX_W_0F3837_P_2): Likewise.
	(VEX_W_0F3838_P_2): Likewise.
	(VEX_W_0F3839_P_2): Likewise.
	(VEX_W_0F383A_P_2): Likewise.
	(VEX_W_0F383B_P_2): Likewise.
	(VEX_W_0F383C_P_2): Likewise.
	(VEX_W_0F383D_P_2): Likewise.
	(VEX_W_0F383E_P_2): Likewise.
	(VEX_W_0F383F_P_2): Likewise.
	(VEX_W_0F3840_P_2): Likewise.
	(VEX_W_0F3841_P_2): Likewise.
	(VEX_W_0F38DB_P_2): Likewise.
	(VEX_W_0F3A08_P_2): Likewise.
	(VEX_W_0F3A09_P_2): Likewise.
	(VEX_W_0F3A0A_P_2): Likewise.
	(VEX_W_0F3A0B_P_2): Likewise.
	(VEX_W_0F3A0C_P_2): Likewise.
	(VEX_W_0F3A0D_P_2): Likewise.
	(VEX_W_0F3A0E_P_2): Likewise.
	(VEX_W_0F3A0F_P_2): Likewise.
	(VEX_W_0F3A21_P_2): Likewise.
	(VEX_W_0F3A40_P_2): Likewise.
	(VEX_W_0F3A41_P_2): Likewise.
	(VEX_W_0F3A42_P_2): Likewise.
	(VEX_W_0F3A62_P_2): Likewise.
	(VEX_W_0F3A63_P_2): Likewise.
	(VEX_W_0F3ADF_P_2): Likewise.
	(VEX_LEN_0F77_P_0): New.
	(prefix_table): Update PREFIX_VEX_0F10, PREFIX_VEX_0F11,
	PREFIX_VEX_0F12, PREFIX_VEX_0F16, PREFIX_VEX_0F2E,
	PREFIX_VEX_0F2F, PREFIX_VEX_0F51, PREFIX_VEX_0F52,
	PREFIX_VEX_0F53, PREFIX_VEX_0F58, PREFIX_VEX_0F59,
	PREFIX_VEX_0F5A, PREFIX_VEX_0F5B, PREFIX_VEX_0F5C,
	PREFIX_VEX_0F5D, PREFIX_VEX_0F5E, PREFIX_VEX_0F5F,
	PREFIX_VEX_0F60, PREFIX_VEX_0F61, PREFIX_VEX_0F62,
	PREFIX_VEX_0F63, PREFIX_VEX_0F64, PREFIX_VEX_0F65,
	PREFIX_VEX_0F66, PREFIX_VEX_0F67, PREFIX_VEX_0F68,
	PREFIX_VEX_0F69, PREFIX_VEX_0F6A, PREFIX_VEX_0F6B,
	PREFIX_VEX_0F6C, PREFIX_VEX_0F6D, PREFIX_VEX_0F6F,
	PREFIX_VEX_0F70, PREFIX_VEX_0F71_REG_2, PREFIX_VEX_0F71_REG_4,
	PREFIX_VEX_0F71_REG_6, PREFIX_VEX_0F72_REG_4,
	PREFIX_VEX_0F72_REG_6, PREFIX_VEX_0F73_REG_2,
	PREFIX_VEX_0F73_REG_3, PREFIX_VEX_0F73_REG_6,
	PREFIX_VEX_0F73_REG_7, PREFIX_VEX_0F74, PREFIX_VEX_0F75,
	PREFIX_VEX_0F76, PREFIX_VEX_0F77, PREFIX_VEX_0F7C,
	PREFIX_VEX_0F7D, PREFIX_VEX_0F7F, PREFIX_VEX_0FC2,
	PREFIX_VEX_0FD0, PREFIX_VEX_0FD1, PREFIX_VEX_0FD2,
	PREFIX_VEX_0FD3, PREFIX_VEX_0FD4, PREFIX_VEX_0FD5,
	PREFIX_VEX_0FD8, PREFIX_VEX_0FD9, PREFIX_VEX_0FDA,
	PREFIX_VEX_0FDC, PREFIX_VEX_0FDD, PREFIX_VEX_0FDE,
	PREFIX_VEX_0FDF, PREFIX_VEX_0FE0, PREFIX_VEX_0FE1,
	PREFIX_VEX_0FE2, PREFIX_VEX_0FE3, PREFIX_VEX_0FE4,
	PREFIX_VEX_0FE5, PREFIX_VEX_0FE6, PREFIX_VEX_0FE8,
	PREFIX_VEX_0FE9, PREFIX_VEX_0FEA, PREFIX_VEX_0FEB,
	PREFIX_VEX_0FEC, PREFIX_VEX_0FED, PREFIX_VEX_0FEE,
	PREFIX_VEX_0FEF, PREFIX_VEX_0FF1. PREFIX_VEX_0FF2,
	PREFIX_VEX_0FF3, PREFIX_VEX_0FF4, PREFIX_VEX_0FF5,
	PREFIX_VEX_0FF6, PREFIX_VEX_0FF8, PREFIX_VEX_0FF9,
	PREFIX_VEX_0FFA, PREFIX_VEX_0FFB, PREFIX_VEX_0FFC,
	PREFIX_VEX_0FFD, PREFIX_VEX_0FFE, PREFIX_VEX_0F3800,
	PREFIX_VEX_0F3801, PREFIX_VEX_0F3802, PREFIX_VEX_0F3803,
	PREFIX_VEX_0F3804, PREFIX_VEX_0F3805, PREFIX_VEX_0F3806,
	PREFIX_VEX_0F3807, PREFIX_VEX_0F3808, PREFIX_VEX_0F3809,
	PREFIX_VEX_0F380A, PREFIX_VEX_0F380B, PREFIX_VEX_0F3817,
	PREFIX_VEX_0F381C, PREFIX_VEX_0F381D, PREFIX_VEX_0F381E,
	PREFIX_VEX_0F3820, PREFIX_VEX_0F3821, PREFIX_VEX_0F3822,
	PREFIX_VEX_0F3823, PREFIX_VEX_0F3824, PREFIX_VEX_0F3825,
	PREFIX_VEX_0F3828, PREFIX_VEX_0F3829, PREFIX_VEX_0F382B,
	PREFIX_VEX_0F382C, PREFIX_VEX_0F3831, PREFIX_VEX_0F3832,
	PREFIX_VEX_0F3833, PREFIX_VEX_0F3834, PREFIX_VEX_0F3835,
	PREFIX_VEX_0F3837, PREFIX_VEX_0F3838, PREFIX_VEX_0F3839,
	PREFIX_VEX_0F383A, PREFIX_VEX_0F383B, PREFIX_VEX_0F383C,
	PREFIX_VEX_0F383D, PREFIX_VEX_0F383E, PREFIX_VEX_0F383F,
	PREFIX_VEX_0F3840, PREFIX_VEX_0F3A08, PREFIX_VEX_0F3A09,
	PREFIX_VEX_0F3A0A, PREFIX_VEX_0F3A0B, PREFIX_VEX_0F3A0C,
	PREFIX_VEX_0F3A0D, PREFIX_VEX_0F3A0E, PREFIX_VEX_0F3A0F,
	PREFIX_VEX_0F3A40 and PREFIX_VEX_0F3A42 entries.
	(vex_table): Update VEX 0F28 and 0F29 entries.
	(vex_len_table): Update VEX_LEN_0F10_P_1, VEX_LEN_0F10_P_3,
	VEX_LEN_0F11_P_1, VEX_LEN_0F11_P_3, VEX_LEN_0F2E_P_0,
	VEX_LEN_0F2E_P_2, VEX_LEN_0F2F_P_0, VEX_LEN_0F2F_P_2,
	VEX_LEN_0F51_P_1, VEX_LEN_0F51_P_3, VEX_LEN_0F52_P_1,
	VEX_LEN_0F53_P_1, VEX_LEN_0F58_P_1, VEX_LEN_0F58_P_3,
	VEX_LEN_0F59_P_1, VEX_LEN_0F59_P_3, VEX_LEN_0F5A_P_1,
	VEX_LEN_0F5A_P_3, VEX_LEN_0F5C_P_1, VEX_LEN_0F5C_P_3,
	VEX_LEN_0F5D_P_1, VEX_LEN_0F5D_P_3, VEX_LEN_0F5E_P_1,
	VEX_LEN_0F5E_P_3, VEX_LEN_0F5F_P_1, VEX_LEN_0F5F_P_3,
	VEX_LEN_0FC2_P_1, VEX_LEN_0FC2_P_3, VEX_LEN_0F3A0A_P_2 and
	VEX_LEN_0F3A0B_P_2 entries.
	(vex_w_table): Remove VEX_W_0F10_P_0, VEX_W_0F10_P_1,
	VEX_W_0F10_P_2, VEX_W_0F10_P_3, VEX_W_0F11_P_0, VEX_W_0F11_P_1,
	VEX_W_0F11_P_2, VEX_W_0F11_P_3, VEX_W_0F12_P_0_M_0,
	VEX_W_0F12_P_0_M_1, VEX_W_0F12_P_1, VEX_W_0F12_P_2,
	VEX_W_0F12_P_3, VEX_W_0F13_M_0, VEX_W_0F14, VEX_W_0F15,
	VEX_W_0F16_P_0_M_0, VEX_W_0F16_P_0_M_1, VEX_W_0F16_P_1,
	VEX_W_0F16_P_2, VEX_W_0F17_M_0, VEX_W_0F28, VEX_W_0F29,
	VEX_W_0F2B_M_0, VEX_W_0F2E_P_0, VEX_W_0F2E_P_2, VEX_W_0F2F_P_0,
	VEX_W_0F2F_P_2, VEX_W_0F50_M_0, VEX_W_0F51_P_0, VEX_W_0F51_P_1,
	VEX_W_0F51_P_2, VEX_W_0F51_P_3, VEX_W_0F52_P_0, VEX_W_0F52_P_1,
	VEX_W_0F53_P_0, VEX_W_0F53_P_1, VEX_W_0F58_P_0, VEX_W_0F58_P_1,
	VEX_W_0F58_P_2, VEX_W_0F58_P_3, VEX_W_0F59_P_0, VEX_W_0F59_P_1,
	VEX_W_0F59_P_2, VEX_W_0F59_P_3, VEX_W_0F5A_P_0, VEX_W_0F5A_P_1,
	VEX_W_0F5A_P_3, VEX_W_0F5B_P_0, VEX_W_0F5B_P_1, VEX_W_0F5B_P_2,
	VEX_W_0F5C_P_0, VEX_W_0F5C_P_1, VEX_W_0F5C_P_2, VEX_W_0F5C_P_3,
	VEX_W_0F5D_P_0, VEX_W_0F5D_P_1, VEX_W_0F5D_P_2, VEX_W_0F5D_P_3,
	VEX_W_0F5E_P_0, VEX_W_0F5E_P_1, VEX_W_0F5E_P_2, VEX_W_0F5E_P_3,
	VEX_W_0F5F_P_0, VEX_W_0F5F_P_1, VEX_W_0F5F_P_2, VEX_W_0F5F_P_3,
	VEX_W_0F60_P_2, VEX_W_0F61_P_2, VEX_W_0F62_P_2, VEX_W_0F63_P_2,
	VEX_W_0F64_P_2, VEX_W_0F65_P_2, VEX_W_0F66_P_2, VEX_W_0F67_P_2,
	VEX_W_0F68_P_2, VEX_W_0F69_P_2, VEX_W_0F6A_P_2, VEX_W_0F6B_P_2,
	VEX_W_0F6C_P_2, VEX_W_0F6D_P_2, VEX_W_0F6F_P_1, VEX_W_0F6F_P_2,
	VEX_W_0F70_P_1, VEX_W_0F70_P_2, VEX_W_0F70_P_3,
	VEX_W_0F71_R_2_P_2, VEX_W_0F71_R_4_P_2, VEX_W_0F71_R_6_P_2,
	VEX_W_0F72_R_2_P_2, VEX_W_0F72_R_4_P_2, VEX_W_0F72_R_6_P_2,
	VEX_W_0F73_R_2_P_2, VEX_W_0F73_R_3_P_2, VEX_W_0F73_R_6_P_2,
	VEX_W_0F73_R_7_P_2, VEX_W_0F74_P_2, VEX_W_0F75_P_2,
	VEX_W_0F76_P_2, VEX_W_0F77_P_0, VEX_W_0F7C_P_2, VEX_W_0F7C_P_3,
	VEX_W_0F7D_P_2, VEX_W_0F7D_P_3, VEX_W_0F7E_P_1, VEX_W_0F7F_P_1,
	VEX_W_0F7F_P_2, VEX_W_0FAE_R_2_M_0, VEX_W_0FAE_R_3_M_0,
	VEX_W_0FC2_P_0, VEX_W_0FC2_P_1, VEX_W_0FC2_P_2, VEX_W_0FC2_P_3,
	VEX_W_0FD0_P_2, VEX_W_0FD0_P_3, VEX_W_0FD1_P_2, VEX_W_0FD2_P_2,
	VEX_W_0FD3_P_2, VEX_W_0FD4_P_2, VEX_W_0FD5_P_2, VEX_W_0FD6_P_2,
	VEX_W_0FD7_P_2_M_1, VEX_W_0FD8_P_2, VEX_W_0FD9_P_2,
	VEX_W_0FDA_P_2, VEX_W_0FDB_P_2, VEX_W_0FDC_P_2, VEX_W_0FDD_P_2,
	VEX_W_0FDE_P_2, VEX_W_0FDF_P_2, VEX_W_0FE0_P_2, VEX_W_0FE1_P_2,
	VEX_W_0FE2_P_2, VEX_W_0FE3_P_2, VEX_W_0FE4_P_2, VEX_W_0FE5_P_2,
	VEX_W_0FE6_P_1, VEX_W_0FE6_P_2, VEX_W_0FE6_P_3,
	VEX_W_0FE7_P_2_M_0, VEX_W_0FE8_P_2, VEX_W_0FE9_P_2,
	VEX_W_0FEA_P_2, VEX_W_0FEB_P_2, VEX_W_0FEC_P_2, VEX_W_0FED_P_2,
	VEX_W_0FEE_P_2, VEX_W_0FEF_P_2, VEX_W_0FF0_P_3_M_0,
	VEX_W_0FF1_P_2, VEX_W_0FF2_P_2, VEX_W_0FF3_P_2, VEX_W_0FF4_P_2,
	VEX_W_0FF5_P_2, VEX_W_0FF6_P_2, VEX_W_0FF7_P_2, VEX_W_0FF8_P_2,
	VEX_W_0FF9_P_2, VEX_W_0FFA_P_2, VEX_W_0FFB_P_2, VEX_W_0FFC_P_2,
	VEX_W_0FFD_P_2, VEX_W_0FFE_P_2, VEX_W_0F3800_P_2,
	VEX_W_0F3801_P_2, VEX_W_0F3802_P_2, VEX_W_0F3803_P_2,
	VEX_W_0F3804_P_2, VEX_W_0F3805_P_2, VEX_W_0F3806_P_2,
	VEX_W_0F3807_P_2, VEX_W_0F3808_P_2, VEX_W_0F3809_P_2,
	VEX_W_0F380A_P_2, VEX_W_0F380B_P_2, VEX_W_0F3817_P_2,
	VEX_W_0F381C_P_2, VEX_W_0F381D_P_2, VEX_W_0F381E_P_2,
	VEX_W_0F3820_P_2, VEX_W_0F3821_P_2, VEX_W_0F3822_P_2,
	VEX_W_0F3823_P_2, VEX_W_0F3824_P_2, VEX_W_0F3825_P_2,
	VEX_W_0F3828_P_2, VEX_W_0F3829_P_2, VEX_W_0F382A_P_2_M_0,
	VEX_W_0F382B_P_2, VEX_W_0F3830_P_2, VEX_W_0F3831_P_2,
	VEX_W_0F3832_P_2, VEX_W_0F3833_P_2, VEX_W_0F3834_P_2,
	VEX_W_0F3835_P_2, VEX_W_0F3837_P_2, VEX_W_0F3838_P_2,
	VEX_W_0F3839_P_2, VEX_W_0F383A_P_2, VEX_W_0F383B_P_2,
	VEX_W_0F383C_P_2, VEX_W_0F383D_P_2, VEX_W_0F383E_P_2,
	VEX_W_0F383F_P_2, VEX_W_0F3840_P_2, VEX_W_0F3841_P_2,
	VEX_W_0F38DB_P_2, VEX_W_0F3A08_P_2, VEX_W_0F3A09_P_2,
	VEX_W_0F3A0A_P_2, VEX_W_0F3A0B_P_2, VEX_W_0F3A0C_P_2,
	VEX_W_0F3A0D_P_2, VEX_W_0F3A0E_P_2, VEX_W_0F3A0F_P_2,
	VEX_W_0F3A21_P_2, VEX_W_0F3A40_P_2, VEX_W_0F3A41_P_2,
	VEX_W_0F3A42_P_2, VEX_W_0F3A62_P_2, VEX_W_0F3A63_P_2 and
	VEX_W_0F3ADF_P_2 entries.
	(mod_table): Update MOD_VEX_0F2B, MOD_VEX_0F50,
	MOD_VEX_0FD7_PREFIX_2, MOD_VEX_0FE7_PREFIX_2,
	MOD_VEX_0FF0_PREFIX_3 and MOD_VEX_0F382A_PREFIX_2 entries.
2018-09-17 09:24:26 -07:00
H.J. Lu d839b91499 Free symbol buffers if they are no longer in use
add_specific_symbols allocates a buffer to hold symbols.  It should be
freed only if it is no longer in use.

	PR binutils/23633
	* objcopy.c (strip_specific_buffer): New.
	(strip_unneeded_buffer): Likewise.
	(keep_specific_buffer): Likewise.
	(localize_specific_buffer): Likewise.
	(globalize_specific_buffer): Likewise.
	(keepglobal_specific_buffer): Likewise.
	(weaken_specific_buffer): Likewise.
	(add_specific_symbols): Add an argument to return pointer to
	allocated buffer.
	(copy_main): Update add_specific_symbols to update pointers to
	allocated buffer.  Free pointers to allocated buffer before
	return.
2018-09-17 08:53:29 -07:00
Tom Tromey e6cd1dc1e6 Update get_standard_cache_dir for macOS
On macOS the usual cache directory is ~/Library/Caches.  This patch
changes get_standard_cache_dir to use that instead of XDG.

gdb/ChangeLog
2018-09-17  Tom Tromey  <tom@tromey.com>

	* common/pathstuff.c (get_standard_cache_dir): Use
	~/Library/Caches on macOS.
	* common/pathstuff.h (get_standard_cache_dir): Update comment.

gdb/doc/ChangeLog
2018-09-17  Tom Tromey  <tom@tromey.com>

	* gdb.texinfo (Index Files): Update for cache directory change on
	macOS.
2018-09-17 08:43:12 -06:00
Alan Modra c12d9fa2af Support objcopy --remove-section=.relaFOO
* objcopy.c (handle_remove_section_option): Don't require a dot
	after .rela and .rel to handle a possible relocation section.
	* testsuite/binutils-all/remove-relocs-07.s,
	* testsuite/binutils-all/remove-relocs-07.d,
	* testsuite/binutils-all/remove-relocs-08.d: New tests.
	* testsuite/binutils-all/remove-relocs-01.d,
	* testsuite/binutils-all/remove-relocs-04.d,
	* testsuite/binutils-all/remove-relocs-05.d,
	* testsuite/binutils-all/remove-relocs-06.d: Exclude mips64-openbsd.
2018-09-17 23:31:18 +09:30
Alan Modra a4b9568c7e Remove bogus notarget in gas teststuite
* testsuite/gas/arm/arch7.d: Delete notarget.
	* testsuite/gas/arm/arch7a-mp.d: Likewise.
	* testsuite/gas/arm/arch7em.d: Likewise.
	* testsuite/gas/arm/archv8m-main-dsp-5.d: Likewise.
	* testsuite/gas/arm/barrier.d: Likewise.
	* testsuite/gas/arm/bignum1.d: Likewise.
	* testsuite/gas/arm/thumb32.d: Likewise.
	* testsuite/gas/elf/dwarf2-1.d: Likewise.
	* testsuite/gas/elf/dwarf2-2.d: Likewise.
	* testsuite/gas/elf/dwarf2-4.d: Likewise.
	* testsuite/gas/elf/group2.d: Likewise.
	* testsuite/gas/arm/mapshort-elf.d: Only notarget pe and wince.
	* testsuite/gas/elf/dwarf2-3.d: Delete notarget, xfail ft32 and h8300.
	* testsuite/gas/elf/dwarf2-6.d: Delete notarget, xfail a few.
2018-09-17 23:22:30 +09:30
Alan Modra 0b1352e04c A few hppa testcase tidies
binutils/
	* testsuite/lib/binutils-common.exp (is_som_format): New proc.
	(run_dump_test): Correct target test for alternate .comm syntax.
	(get_standard_section_names): Handle som format.
	* testsuite/lib/utils-lib.exp (default_binutils_assemble_flags):
	Correct target test for alternate .comm syntax.
gas/
	* testsuite/gas/all/gas.exp (redef3): Don't xfail for hppa.
	(octa): Run for hppa.
	* testsuite/gas/elf/elf.exp (common1, common2): Likewise.
	* testsuite/gas/elf/symver.d: Delete notarget.
ld/
	* testsuite/ld-elf/comm-data5.d: Remove notarget for hppa.
	* testsuite/ld-scripts/defined6.d: Likewise.
2018-09-17 23:17:14 +09:30
Alan Modra 8c9604b6a2 Adjust some strip testcases to silence h8300 warnings
* testsuite/binutils-all/strip-13mips64.s: Add section flags
	for reloc section.
	* testsuite/binutils-all/strip-13rel.s: Likewise.
	* testsuite/binutils-all/strip-13rela.s: Likewise.
	* testsuite/binutils-all/strip-14mips64.s: Likewise.
	* testsuite/binutils-all/strip-14rel.s: Likewise.
	* testsuite/binutils-all/strip-14rela.s: Likewise.
	* testsuite/binutils-all/strip-15mips64.s: Likewise.
	* testsuite/binutils-all/strip-15rel.s: Likewise.
	* testsuite/binutils-all/strip-15rela.s: Likewise.
2018-09-17 23:16:48 +09:30
H.J. Lu 6fa52824c3 x86: Replace VexW=3 with VexWIG
* i386-opc.tbl (VexWIG): New.
	Replace VexW=3 with VexWIG.
2018-09-17 06:12:06 -07:00
Simon Marchi 8588b35692 python: Make gdb.execute("show commands") work (PR 23669)
Since commit

  56bcdbea2b ("Let gdb.execute handle multi-line commands")

trying to use a command like gdb.execute("show commands") in Python
fails.  GDB ends up trying to run the "commands" command.

The reason is that GDB gets confused with the special "commands"
command.  In process_next_line, the lookup_cmd_1 function returns the
cmd_list_element representing the "commands" sub-command of "show".
Lower, we check the cmd_list_element to see if it matches various
control commands by name, including the "commands" command.  This is
where we wrongfully conclude that the executed command must be
"commands", when in reality it was "show commands".

The fix proposed in this patch removes the comparisons by name, instead
comparing the cmd_list_element object by pointer with the objects
created at initialization time.

Tested on the buildbot, though on a single builder (Fedora-x86_64-m64).

gdb/ChangeLog:

	PR python/23669
	* breakpoint.c (commands_cmd_element): New.
	(_initialize_breakpoint): Assign commands_cmd_element.
	* breakpoint.h (commands_cmd_element): New.
	* cli/cli-script.c (while_cmd_element, if_command,
	define_cmd_element): New.
	(command_name_equals): Remove.
	(process_next_line): Compare commands by pointer, not by name.
	(_initialize_cli_script): Assign the various cmd_list_element
	variables.
	* compile/compile.c (compile_cmd_element): New.
	(_initialize_compile): Assign compile_cmd_element.
	* compile/compile.h (compile_cmd_element): New.
	* guile/guile.c (guile_cmd_element): New.
	(install_gdb_commands): Assign guile_cmd_element.
	* guile/guile.h (guile_cmd_element): New.
	* python/python.c (python_cmd_element): New.
	(_initialize_python): Assign python_cmd_element.
	* python/python.h (python_cmd_element): New.
	* tracepoint.c (while_stepping_cmd_element): New.
	(_initialize_tracepoint): Assign while_stepping_cmd_element.
	* tracepoint.h (while_stepping_cmd_element): New.

gdb/testsuite/ChangeLog:

	PR python/23669
	* gdb.python/python.exp: Test gdb.execute("show commands").
2018-09-17 08:26:24 -04:00
Nick Clifton a0a8a9340d Ensure that binutils test names are unique.
binutils* testsuite/binutils-all/compress.exp: Rename second "objcopy
	zlib-gnu compress debug sections 3" test to "objcopy zlib-gabi
	compress debug sections 3" and use gabi object files instead
	of gnu object files.
	* testsuite/binutils-all/objcopy.exp: Add suffix to the names
	of the "ELF group" tests.
	* testsuite/binutils-all/readelf.exp (proc readelf_find_size):
	Add an iteration parameter and include it in the name of the
	test.  Update callers to include an iteration count.

gas	* testuite/gas/elf/group0a.d: Add extra details to the test
	name.
	* testuite/gas/elf/group0b.d: Likewise.
	* testuite/gas/elf/group1a.d: Likewise.
	* testuite/gas/elf/group1b.d: Likewise.
	* testuite/gas/elf/group0b.d: Likewise.
	* testuite/gas/elf/section9.d: Likewise.
	* testuite/gas/i386/ilp32/lns/lns-common-1.d: Likewise.
	* testuite/gas/i386/ilp32/lns/lns-duplicate-1.d: Likewise.

ld	* testuite/ld/ld-elf/audit.exp: Differentiate the names of the
	two "Run with shared with --audit" tests.
	* testuite/ld/ld-elf/compress.exp: Differentiate the zlib
	compressed debug output test names.
	* testuite/ld/ld-i386/tlspie1.d: Add extra details to the test
	name.
	* testuite/ld/ld-i386/tlspie2.d: Likewise.
	* testuite/ld/ld-size/size.exp: Add missing escapes to the end
	of lines in the size-3e test.
	* testuite/ld/ld-unique/unique.exp: Differentiate the names of
	the two "Checking unique PIC object" tests.
	* testuite/ld/ld-x86-64/tlspie1.d: Add extra details to the test
	name.
2018-09-17 10:10:47 +01:00
Andreas Krebbel e6213e09ed S/390: Prevent GOT access rewrite for certain symbols
When dereferencing a GOT slot with lgrl or lg we rewrite this using
larl to get rid of the extra memory access.  However, we cannot do
this for:

- symbols marked for absolute addressing
- symbols at odd addresses (larl can handle only even addresses)

Fixed with the attached patch.

bfd/ChangeLog:

2018-09-17  Andreas Krebbel  <krebbel@linux.ibm.com>

	* elf64-s390.c (elf_s390_relocate_section): Prevent rewriting of
	GOT accesses with larl for ABS or misaligned symbols.

ld/ChangeLog:

2018-09-17  Andreas Krebbel  <krebbel@linux.ibm.com>

	* testsuite/ld-s390/gotreloc-1.s: Add tests for ABS and misaligned
	symbol. Move variables into data section. Make bar 8 bytes wide.
	* testsuite/ld-s390/gotreloc-1.ver: Make misaligned_sym resolve locally.
	* testsuite/ld-s390/gotreloc_31-1.dd: Adjust patterns.
	* testsuite/ld-s390/gotreloc_64-norelro-1.dd: Likewise.
	* testsuite/ld-s390/gotreloc_64-relro-1.dd: Likewise.
2018-09-17 11:01:24 +02:00
Tom Tromey cb5248409d Make save_infcall_*_state return unique pointers
Simon pointed out that save_infcall_suspend_state and
save_infcall_control_state could return unique pointers.  This patch
implements this idea.

gdb/ChangeLog
2018-09-17  Tom Tromey  <tom@tromey.com>

	* infrun.c (save_infcall_suspend_state): Return
	infcall_suspend_state_up.
	(save_infcall_control_state): Return infcall_control_state_up.
	* inferior.h (save_infcall_suspend_state)
	(save_infcall_control_state): Declare later.  Return unique
	pointers.
2018-09-17 00:42:19 -06:00
Tom Tromey 2d844eaf9c Remove release_stop_context_cleanup
This removes release_stop_context_cleanup, replacing it with a
stop_context destructor.  It also mildly c++-ifies this struct.

gdb/ChangeLog
2018-09-17  Tom Tromey  <tom@tromey.com>

	* infrun.c (struct stop_context): Declare constructor,
	destructor, "changed" method.
	(stop_context::stop_context): Rename from save_stop_context.
	(stop_context::~stop_context): Rename from
	release_stop_context_cleanup.
	(normal_stop): Update.
	(stop_context::changed): Rename from stop_context_changed.  Return
	bool.
2018-09-17 00:42:19 -06:00
Tom Tromey c7c4d3fa80 Remove two infrun cleanups
This removes a couple of cleanups from infrun by introducing a couple
of unique_ptr specializations.

gdb/ChangeLog
2018-09-17  Tom Tromey  <tom@tromey.com>

	* inferior.h (struct infcall_suspend_state_deleter): New.
	(infcall_suspend_state_up): New typedef.
	(struct infcall_control_state_deleter): New.
	(infcall_control_state_up): New typedef.
	(make_cleanup_restore_infcall_suspend_state)
	(make_cleanup_restore_infcall_control_state): Don't declare.
	* infcall.c (call_function_by_hand_dummy): Update.
	* infrun.c (do_restore_infcall_suspend_state_cleanup)
	(make_cleanup_restore_infcall_suspend_state): Remove.
	(do_restore_infcall_control_state_cleanup)
	(make_cleanup_restore_infcall_control_state): Remove.
2018-09-17 00:42:18 -06:00
Tom Tromey ee841dd8fe Use new and delete for struct infcall_control_state
This changes infrun.c to use new and delete for infcall_control_state.

gdb/ChangeLog
2018-09-17  Tom Tromey  <tom@tromey.com>

	* gdbthread.h (struct thread_control_state): Add initializer.
	(class thread_info) <control>: Remove initializer.
	* inferior.h (struct inferior_control_state): Add initializer.
	(class inferior) <control>: Remove initializer.
	(exit_inferior_1): Update.
	* infrun.c (struct infcall_control_state): Add constructors.
	(save_infcall_control_state): Use new.
	(restore_infcall_control_state, discard_infcall_control_state):
	Use delete.
2018-09-17 00:42:18 -06:00
Tom Tromey 117f580a97 Remove cleanup from infrun.c
This removes a cleanup from infrun.c by taking advantage of the
previous patch to introduce a use of unique_xmalloc_ptr.

gdb/ChangeLog
2018-09-17  Tom Tromey  <tom@tromey.com>

	* infrun.c (struct infcall_suspend_state) <registers>: Now a
	unique_ptr.
	<siginfo_data>: Now a unique_xmalloc_ptr.
	(save_infcall_suspend_state, restore_infcall_suspend_state)
	(discard_infcall_suspend_state)
	(get_infcall_suspend_state_regcache): Update.
2018-09-17 00:42:17 -06:00
Tom Tromey dd848631cb Use new and delete for struct infcall_suspend_state
This changes infrun.c to use new and delete for infcall_suspend_state.
This enables the coming cleanups.

gdb/ChangeLog
2018-09-17  Tom Tromey  <tom@tromey.com>

	* gdbthread.h (struct thread_suspend_state): Add initializers.
	(class thread_info) <suspend>: Remove initializer.
	* infrun.c (struct infcall_suspend_state): Add initializers.
	(save_infcall_suspend_state): Use new.
	(discard_infcall_suspend_state): Use delete.
2018-09-17 00:42:17 -06:00
Tom Tromey 1a3389079d Don't steal references in the gdb Python code
Some Python APIs steal references from their caller, and the refcount
checker supports this via an attribute.

However, in gdb with C++ we have a better idiom available: we can use
std::move on a gdbpy_ref<> instead.  This makes the semantics obvious
at the point of call, and is safer at runtime as well, because the
callee's gdbpy_ref<> will be emptied.

This patch changes the reference-stealing code in gdb to use rvalue
references instead.

Tested on x86-64 Fedora 28.

gdb/ChangeLog
2018-09-16  Tom Tromey  <tom@tromey.com>

	* python/python-internal.h (CPYCHECKER_STEALS_REFERENCE_TO_ARG):
	Remove.
	* python/py-varobj.c (py_varobj_iter_ctor): Change pyiter to
	rvalue reference.  Remove CPYCHECKER_STEALS_REFERENCE_TO_ARG.
	(py_varobj_iter_new): Likewise.
	(py_varobj_get_iterator): Use gdbpy_ref.
2018-09-16 23:48:21 -06:00
Tom Tromey 4a137fec2e Simplify uses of thread_to_thread_object
An review by Simon of an earlier showed a few spots related to
thread_to_thread_object that could be simplified.  This also detected
a latent bug, where thread_to_thread_object was inconsistent about
setting the Python exception before a NULL return.

Tested on x86-64 Fedora 28.

gdb/ChangeLog
2018-09-16  Tom Tromey  <tom@tromey.com>

	* python/py-threadevent.c (py_get_event_thread): Simplify.
	* python/py-inferior.c (infpy_thread_from_thread_handle):
	Return immediately after calling thread_to_thread_object.  Use
	Py_RETURN_NONE.
	(thread_to_thread_object): Set the exception on a NULL return.
2018-09-16 23:36:54 -06:00
Simon Marchi 8ff03f0bfb Sort objects in gdb and gdbserver Makefiles
Tom mentioned this a while ago, as a way to give you a cheap sense of
progression in your build, as all object files will be built
alphabetically (including the directory part).  I tried it and I think
it's nice.

gdb/ChangeLog:

	* Makefile.in (LIBGDB_OBS): Sort COMMON_OBS.

gdb/gdbserver/ChangeLog:

	* Makefile.in (gdbserver$(EXEEXT)): Sort OBS.
	(gdbreplay$(EXEEXT)): Sort GDBREPLAY_OBS.
	($(IPA_LIB)): Sort IPA_OBJS.
2018-09-16 20:34:56 -04:00
Simon Marchi a1cd91dc2f gdbserver/Makefile.in: Remove ADD_DEPS
ADD_DEPS is defined nowhere, so I presume it's not useful.  If I'm wrong
and this is actually used, there should be a comment explaining where it
comes from.

gdb/gdbserver/ChangeLog:

	* Makefile.in: Remove references to $(ADD_DEPS).
2018-09-16 20:34:56 -04:00
GDB Administrator e08ef628a7 Automatic date update in version.in 2018-09-17 00:00:39 +00:00
John Darrington 43276309de S12Z Add tests for relocs.
ld/testsuite/ld-s12z/
    * reloc-ext18-1.d: New file.
    * reloc-ext18-1.d: New file.
    * reloc-ext18-2.d: New file.
    * reloc-ext18.d: New file.
    * reloc-ext18.s: New file.
    * reloc-ext24.d: New file.
    * reloc-ext24.s: New file.
    * reloc-ext32.d: New file.
    * reloc-ext32.s: New file.
    * reloc-opr.d: New file.
    * reloc-opr.d: New file.
    * reloc-opr.s: New file.
    * reloc-pc-rel-7-15.d: New file.
    * reloc-pc-rel-7-15.s: New file.
2018-09-16 17:50:09 +02:00
John Darrington 57d5aa265f Don't emit data_section_size when -r is specified
* ld/scripttempl/elfm9s12z.sc (.install): Add RELOCATING+ qualifier.
2018-09-16 17:50:09 +02:00
John Darrington 19f1fffecd S12Z: LD: Rename z12s.exp --> s12z.exp
* ld/testsuite/ld-s12z/z12s.exp: Delete.
* ld/testsuite/ld-s12z/s12z.exp: New file.
2018-09-16 17:50:09 +02:00
John Darrington e6d9d92855 S12Z: Remove diagnostic printf statement.
* bfd/elf32-s12z.c (bfd_elf32_bfd_reloc_name_lookup): Remove diagnostic printf
  (artifact from debugging)
2018-09-16 17:50:09 +02:00
John Darrington 808325d203 S12Z: Set the source mask value of all howtos to zero.
Thanks to Alan Modra for this hint.

* bfd/elf32-s12z.c (elf_s12z_howto_table): set all src_mask members to zero.
2018-09-16 17:50:09 +02:00
Tom Tromey 94c8b7253a Remove CPYCHECKER_RETURNS_BORROWED_REF
CPYCHECKER_RETURNS_BORROWED_REF is not used, and I think should never
be used.  This patch removes it.

gdb/ChangeLog
2018-09-16  Tom Tromey  <tom@tromey.com>

	* python/python-internal.h (CPYCHECKER_RETURNS_BORROWED_REF):
	Remove.
2018-09-16 07:25:57 -06:00
Tom Tromey db1337cc83 Change thread_to_thread_object to return a new reference
This changes thread_to_thread_object to return a new reference and
fixes up all the callers.

gdb/ChangeLog
2018-09-16  Tom Tromey  <tom@tromey.com>

	* python/python-internal.h (thread_to_thread_object): Change
	return type.
	* python/py-inferior.c (thread_to_thread_object): Return a new
	reference.
	(infpy_thread_from_thread_handle): Update.
	* python/py-infthread.c (gdbpy_selected_thread): Update.
	* python/py-stopevent.c (create_stop_event_object): Update.
	* python/py-threadevent.c (py_get_event_thread): Return a new
	reference.
	(py_get_event_thread): Update.
	* python/py-event.h (py_get_event_thread): Change return type.
	* python/py-continueevent.c (create_continue_event_object):
	Update.
2018-09-16 07:25:57 -06:00
Tom Tromey 0a9db5ad8a Change objfile_to_objfile_object to return a new reference
This changes objfile_to_objfile_object to return a new references and
fixes up all the uses.

gdb/ChangeLog
2018-09-16  Tom Tromey  <tom@tromey.com>

	* python/py-progspace.c (pspy_get_objfiles): Update.
	* python/python-internal.h (objfile_to_objfile_object): Change
	return type.
	* python/py-newobjfileevent.c (create_new_objfile_event_object):
	Update.
	* python/py-xmethods.c (gdbpy_get_matching_xmethod_workers):
	Update.
	* python/python.c (gdbpy_get_current_objfile): Update.
	(gdbpy_objfiles): Update.
	* python/py-objfile.c (objfpy_get_owner, gdbpy_lookup_objfile):
	Update.
	(objfile_to_objfile_object): Return a new reference.
	* python/py-symtab.c (stpy_get_objfile): Update.
	* python/py-prettyprint.c (find_pretty_printer_from_objfiles):
	Update.
2018-09-16 07:25:56 -06:00
Tom Tromey 3c7aa30778 Change pspace_to_pspace_object to return a new reference
This changes pspace_to_pspace_object to return a new reference and
fixes up all the callers.

gdb/ChangeLog
2018-09-16  Tom Tromey  <tom@tromey.com>

	* python/py-inferior.c (infpy_get_progspace): Update.
	* python/python-internal.h (pspace_to_pspace_object): Change
	return type.
	* python/py-newobjfileevent.c
	(create_clear_objfiles_event_object): Update.
	* python/py-xmethods.c (gdbpy_get_matching_xmethod_workers):
	Update.
	* python/python.c (gdbpy_get_current_progspace): Update.
	(gdbpy_progspaces): Update.
	* python/py-progspace.c (pspace_to_pspace_object): Return a new
	reference.
	* python/py-objfile.c (objfpy_get_progspace): Update.
	* python/py-prettyprint.c (find_pretty_printer_from_progspace):
	Update.
2018-09-16 07:25:56 -06:00
Tom Tromey 8743a9cdd2 Add more methods to gdb.Progspace
There are a number of global functions in the gdb Python module which
really should be methods on Progspace.  This patch adds new methods to
Progspace and then redefines these globals in terms of these new
methods.

This version has been rebased on the related changes that Simon
recently put in.

Built and regtested on x86-64 Fedora 28.

gdb/ChangeLog
2018-09-16  Tom Tromey  <tom@tromey.com>

	* python/lib/gdb/__init__.py (current_progspace, objfiles)
	(solib_name, block_for_pc, find_pc_line): New functions.
	(execute_unwinders): Update.
	* python/py-block.c (gdbpy_block_for_pc): Remove.
	* python/py-inferior.c (infpy_get_progspace): New function.
	(inferior_object_getset) <progspace>: Add.
	* python/py-progspace.c (pspy_objfiles): Rewrite.
	(pspy_solib_name, pspy_block_for_pc)
	(pspy_find_pc_line, pspy_is_valid): New functions.
	(progspace_object_methods): Add entries for solib_name,
	block_for_pc, find_pc_line, is_valid.
	* python/python-internal.h (gdbpy_block_for_pc)
	(build_objfiles_list): Don't declare.
	* python/python.c: Don't include solib.h.
	(gdbpy_solib_name, gdbpy_find_pc_line)
	(gdbpy_get_current_progspace, build_objfiles_list)
	(gdbpy_objfiles): Remove.
	(GdbMethods) <current_progspace, objfiles, block_for_pc,
	solib_name, find_pc_line>: Remove entries.

gdb/doc/ChangeLog
2018-09-16  Tom Tromey  <tom@tromey.com>

	* python.texi (Basic Python): Update docs for find_pc_line,
	solib_name.
	(Progspaces In Python): Update docs for current_progspace.
	Document block_for_pc, find_pc_line, is_valid, nsolib_name.
	Move method documentation before example.
2018-09-16 06:52:37 -06:00
Tom Tromey 752312ba4e Use GNU style for metasyntactic variables in gdbserver
This changes a couple of places in gdbserver to use the GNU style for
metasyntactic variables.

gdb/gdbserver/ChangeLog
2018-09-16  Tom Tromey  <tom@tromey.com>

	* remote-utils.c (remote_open): Use GNU style for metasyntactic
	variables.
	* gdbreplay.c (gdbreplay_usage): Use GNU style for metasyntactic
	variables.
2018-09-16 06:25:17 -06:00
Tom Tromey 65e65158c5 Use GNU style for metasyntactic variables in gdb
I searched for other spots that did not use the GNU style for
metasyntactic syntactic variables.  This patch fixes most of the ones
I found in gdb proper.  There are a few remaining in MI, but I was
unsure whether those should be touched.

gdb/ChangeLog
2018-09-16  Tom Tromey  <tom@tromey.com>

	* top.c (new_ui_command): Use GNU style for metasyntactic
	variables.
	* breakpoint.c (stopat_command): Use GNU style for metasyntactic
	variables.
	* maint.c (maintenance_translate_address): Remove "<>" around
	text.
	* interps.c (interpreter_exec_cmd): Use GNU style for
	metasyntactic variables.
	* nto-procfs.c (nto_procfs_target_info): Use GNU style for
	metasyntactic variables.
	* tracepoint.c (tfind_range_command): Use GNU style for
	metasyntactic variables.
	(tfind_outside_command): Likewise.
	(_initialize_tracepoint): Likewise.
	* remote.c (extended_remote_target::create_inferior): Use GNU
	style for metasyntactic variables.
	* sparc64-tdep.c (adi_examine_command): Use GNU style for
	metasyntactic variables.
	(adi_assign_command): Likewise.

gdb/testsuite/ChangeLog
2018-09-16  Tom Tromey  <tom@tromey.com>

	* gdb.base/new-ui.exp (do_execution_tests): Update.
	* gdb.base/dbx.exp (test_breakpoints): Update.
2018-09-16 06:25:17 -06:00
Tom Tromey f4bab6ff22 Expand "show disassembler-options" output
I typed this:

    (gdb) help set disassembler-options
    Set the disassembler options.
    Usage: set disassembler-options OPTION [,OPTION]...

    See: 'show disassembler-options' for valid option values.

... so I tried what it said and got:

    (gdb) show disassembler-options
    The current disassembler options are ''

This surprised me a little, so this patch adds some text to explain
the situation when an architecture does not have disassembler options.

While there I noticed one more spot where gdb was not using the GNU
style for metasyntactic variables.  This patch fixes this as well.

gdb/ChangeLog
2018-09-16  Tom Tromey  <tom@tromey.com>

	* disasm.c (show_disassembler_options_sfunc): Use GNU style for
	metasyntactic variables.  Print message if no disassembler options
	are available.
2018-09-16 06:25:16 -06:00
H.J. Lu db4cc66567 x86: Set VexW=3 on AVX vrsqrtss
AVX vrsqrtss is a VEX WIG instruction.

	* i386-opc.tbl: Set VexW=3 on AVX vrsqrtss.
	* i386-tbl.h: Regenerated.
2018-09-15 17:10:17 -07:00
GDB Administrator 6e809f2dfa Automatic date update in version.in 2018-09-16 00:01:17 +00:00
Tom Tromey cbaaa0cafc Change get_inferior_args to return const char *
I noticed that get_inferior_args should return const char *, because
it is just returning a reference to something owned by the inferior.

I'm checking this in.

gdb/ChangeLog
2018-09-15  Tom Tromey  <tom@tromey.com>

	* infcmd.c (get_inferior_args): Return const char *.
	* inferior.h (get_inferior_args): Return type now const.
	* linux-tdep.c (linux_fill_prpsinfo): Update.
	* procfs.c (procfs_target::make_corefile_notes): Update.
2018-09-15 16:31:58 -06:00
H.J. Lu 3c3741435f x86: Set Vex=1 on VEX.128 only vmovq
AVX "VMOVQ xmm1, xmm2/m64" and "VMOVQ xmm1/m64, xmm2" can only be
encoded with VEX.128.  Set Vex=1 on VEX.128 only vmovq and update
assembler tests.

gas/

	PR gas/23665
	* testsuite/gas/i386/avx-scalar-intel.d: Updated.
	* testsuite/gas/i386/avx-scalar.d: Likewise.
	* testsuite/gas/i386/x86-64-avx-scalar-intel.d: Likewise.
	* testsuite/gas/i386/x86-64-avx-scalar.d: Likewise.

opcodes/

	PR gas/23665
	* i386-dis.c (vex_len_table): Update VEX_LEN_0F7E_P_1 and
	VEX_LEN_0FD6_P_2 entries.
	* i386-opc.tbl: Set Vex=1 on VEX.128 only vmovq.
	* i386-tbl.h: Regenerated.
2018-09-15 14:50:40 -07:00