Tom Tromey [Thu, 13 Sep 2018 03:44:19 +0000 (21:44 -0600)]
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.
Tom Tromey [Fri, 27 Dec 2013 02:50:05 +0000 (19:50 -0700)]
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.
Tom Tromey [Fri, 14 Sep 2018 13:46:55 +0000 (07:46 -0600)]
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.
Tom Tromey [Fri, 14 Sep 2018 13:45:06 +0000 (07:45 -0600)]
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.
Tom Tromey [Fri, 14 Sep 2018 13:34:05 +0000 (07:34 -0600)]
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.
H.J. Lu [Sun, 16 Sep 2018 00:09:08 +0000 (17:09 -0700)]
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.
GDB Administrator [Sun, 16 Sep 2018 00:01:17 +0000 (00:01 +0000)]
Automatic date update in version.in
Tom Tromey [Sat, 15 Sep 2018 22:29:03 +0000 (16:29 -0600)]
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.
H.J. Lu [Sat, 15 Sep 2018 21:50:40 +0000 (14:50 -0700)]
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.
Alan Modra [Thu, 13 Sep 2018 05:15:47 +0000 (14:45 +0930)]
Consolidate run_dump_test
This merges the three versions of run_dump_test. Improved warning
handling versus the old gas version shows up a number of tests that
need their disassembly updating:
arm-linuxeabi +FAIL: ARM v1 instructions
arm-linuxeabi +FAIL: Accepted v8-a with ARMv8.1 AdvSIMD.
arm-linuxeabi +FAIL: bl local instructions for v4t.
arm-linuxeabi +FAIL: UDF
and some that now fail due to detecting assembly warnings:
h8300-elf +FAIL: binutils-all/strip-13
h8300-elf +FAIL: binutils-all/strip-14
h8300-elf +FAIL: binutils-all/strip-15
I've generally kept the union of all run_dump_test features, except
that the ld target aliases "cfi" and "shared" have disappeared, as has
the binutils substitution of $srcdir as $scrdir/$subdir.
binutils/
* testsuite/binutils-all/add-symbol.d: Add "section_subst: no".
* testsuite/binutils-all/elfedit.exp: Don't set tempfile or copyfile.
* testsuite/binutils-all/symbols-1.d,
* testsuite/binutils-all/symbols-2.d,
* testsuite/binutils-all/symbols-3.d,
* testsuite/binutils-all/symbols-4.d: Quote '*' and '!'.
* testsuite/binutils-all/add-empty-section.d,
* testsuite/binutils-all/add-section.d,
* testsuite/binutils-all/elfedit.exp,
* testsuite/binutils-all/note-1.d,
* testsuite/binutils-all/pr23633.d: Add $subdir after $srcdir.
* testsuite/config/default.exp (AS, ASFLAGS): Define.
* testsuite/config/hppa.sed: Handle all common symbols.
* testsuite/lib/binutils-common.exp (run_dump_test): New proc,
merged from three other versions.
(slurp_options, file_contents, set_file_contents): Likewise.
(big_or_little_endian, get_standard_section_names): Likewise.
* testsuite/lib/utils-lib.exp (run_dump_test): Delete.
(slurp_options, proc file_contents): Delete.
(get_standard_section_names): Delete.
gas/
* testsuite/config/default.exp: Make tmpdir.
* testsuite/lib/gas-defs.exp (run_dump_test): Delete.
(get_standard_section_names, slurp_options): Delete.
ld/
* testsuite/ld-d10v/reloc-007.d,
* testsuite/ld-d10v/reloc-008.d,
* testsuite/ld-d10v/reloc-015.d,
* testsuite/ld-d10v/reloc-016.d: Remove "error:".
* testsuite/ld-elf/eh-frame-hdr.d,
* testsuite/ld-elf/eh5.d,
* testsuite/ld-gc/personality.d: Replace "cfi" and "shared" in
target list with appropriate proc.
* testsuite/ld-elf/frame.exp: Use check_shared_lib_support rather
than "istarget shared".
* testsuite/lib/ld-lib.exp (proc big_or_little_endian): Delete.
(run_dump_test, slurp_options, file_contents): Delete.
(set_file_contents, istarget): Delete.
Alan Modra [Thu, 13 Sep 2018 09:25:30 +0000 (18:55 +0930)]
run_dump_test replace PROG with DUMPPROG in gas and ld
To be compatible with the binutils version, that uses PROG for the
tool under test and DUMPPROG for the dump tool.
gas/
* testsuite/gas/mips/aent-2.d,
* testsuite/gas/mips/aent-mdebug-2.d,
* testsuite/gas/mips/attr-gnu-4-0.d,
* testsuite/gas/mips/attr-gnu-4-1.d,
* testsuite/gas/mips/attr-gnu-4-2.d,
* testsuite/gas/mips/attr-gnu-4-3.d,
* testsuite/gas/mips/attr-gnu-4-5.d,
* testsuite/gas/mips/attr-gnu-4-6.d,
* testsuite/gas/mips/attr-gnu-4-7.d,
* testsuite/gas/mips/attr-none-double.d,
* testsuite/gas/mips/attr-none-o32-fp64-nooddspreg.d,
* testsuite/gas/mips/attr-none-o32-fp64.d,
* testsuite/gas/mips/attr-none-o32-fpxx.d,
* testsuite/gas/mips/attr-none-single-float.d,
* testsuite/gas/mips/attr-none-soft-float.d,
* testsuite/gas/mips/elf-rel27.d,
* testsuite/gas/mips/loc-swap-2.d,
* testsuite/gas/mips/loc-swap-3.d,
* testsuite/gas/mips/loc-swap.d,
* testsuite/gas/mips/micromips@loc-swap-2.d,
* testsuite/gas/mips/micromips@loc-swap.d,
* testsuite/gas/mips/micromips@stabs-symbol-type.d,
* testsuite/gas/mips/mips16-intermix.d,
* testsuite/gas/mips/mips16@loc-swap-2.d,
* testsuite/gas/mips/mips16@loc-swap.d,
* testsuite/gas/mips/mips16@stabs-symbol-type.d,
* testsuite/gas/mips/mips16e@loc-swap.d,
* testsuite/gas/mips/no-odd-spreg.d,
* testsuite/gas/mips/odd-spreg.d,
* testsuite/gas/mips/r6-attr-none-double.d,
* testsuite/gas/mips/stabs-symbol-type.d,
* testsuite/lib/gas-defs.exp (run_dump_test): Replace PROG
with DUMPPROG.
ld/
* testsuite/lib/ld-lib.exp (run_dump_test): Replace PROG
with DUMPPROG.
Alan Modra [Fri, 14 Sep 2018 00:18:08 +0000 (09:48 +0930)]
gas testuite fixes: don't match dump.o
The consolidated run_dump_test will use object file names based on the
source file name, like the current ld version.
* testsuite/gas/elf/symver.d,
* testsuite/gas/ft32/insn.d,
* testsuite/gas/ft32/insnsc.d,
* testsuite/gas/i386/ilp32/elf/symver.d,
* testsuite/gas/lm32/csr.d,
* testsuite/gas/lm32/insn.d,
* testsuite/gas/m68hc11/9s12x-exg-sex-tfr.d,
* testsuite/gas/m68hc11/9s12x-mov.d,
* testsuite/gas/m68hc11/hexprefix.d,
* testsuite/gas/m68hc11/insns9s12x.d,
* testsuite/gas/m68hc11/insns9s12xg.d,
* testsuite/gas/mep/dj1.be.d,
* testsuite/gas/mep/dj1.le.d,
* testsuite/gas/mips/set-arch.d,
* testsuite/gas/mips/tls-o32.d,
* testsuite/gas/nios2/branch-r2.d,
* testsuite/gas/nios2/branch.d,
* testsuite/gas/pdp11/absreloc.d,
* testsuite/gas/pdp11/opcode.d,
* testsuite/gas/pdp11/pr14480.d,
* testsuite/gas/pdp11/pr23481.d,
* testsuite/gas/ppc/xcoff-dwsect-1-32.d,
* testsuite/gas/ppc/xcoff-dwsect-1-64.d,
* testsuite/gas/rx/abs.d,
* testsuite/gas/rx/adc.d,
* testsuite/gas/rx/add.d,
* testsuite/gas/rx/and.d,
* testsuite/gas/rx/bclr.d,
* testsuite/gas/rx/bcnd.d,
* testsuite/gas/rx/bmcnd.d,
* testsuite/gas/rx/bnot.d,
* testsuite/gas/rx/bra.d,
* testsuite/gas/rx/brk.d,
* testsuite/gas/rx/bset.d,
* testsuite/gas/rx/bsr.d,
* testsuite/gas/rx/btst.d,
* testsuite/gas/rx/clrpsw.d,
* testsuite/gas/rx/cmp.d,
* testsuite/gas/rx/dbt.d,
* testsuite/gas/rx/div.d,
* testsuite/gas/rx/divu.d,
* testsuite/gas/rx/emaca.d,
* testsuite/gas/rx/emsba.d,
* testsuite/gas/rx/emul.d,
* testsuite/gas/rx/emula.d,
* testsuite/gas/rx/emulu.d,
* testsuite/gas/rx/fadd.d,
* testsuite/gas/rx/fcmp.d,
* testsuite/gas/rx/fdiv.d,
* testsuite/gas/rx/fmul.d,
* testsuite/gas/rx/fsqrt.d,
* testsuite/gas/rx/fsub.d,
* testsuite/gas/rx/ftoi.d,
* testsuite/gas/rx/ftou.d,
* testsuite/gas/rx/gprel.d,
* testsuite/gas/rx/int.d,
* testsuite/gas/rx/itof.d,
* testsuite/gas/rx/jmp.d,
* testsuite/gas/rx/jsr.d,
* testsuite/gas/rx/machi.d,
* testsuite/gas/rx/maclh.d,
* testsuite/gas/rx/maclo.d,
* testsuite/gas/rx/max.d,
* testsuite/gas/rx/min.d,
* testsuite/gas/rx/mov.d,
* testsuite/gas/rx/movco.d,
* testsuite/gas/rx/movli.d,
* testsuite/gas/rx/movu.d,
* testsuite/gas/rx/msbhi.d,
* testsuite/gas/rx/msblh.d,
* testsuite/gas/rx/msblo.d,
* testsuite/gas/rx/mul.d,
* testsuite/gas/rx/mulhi.d,
* testsuite/gas/rx/mullh.d,
* testsuite/gas/rx/mullo.d,
* testsuite/gas/rx/mvfacgu.d,
* testsuite/gas/rx/mvfachi.d,
* testsuite/gas/rx/mvfaclo.d,
* testsuite/gas/rx/mvfacmi.d,
* testsuite/gas/rx/mvfc.d,
* testsuite/gas/rx/mvfcp.d,
* testsuite/gas/rx/mvtacgu.d,
* testsuite/gas/rx/mvtachi.d,
* testsuite/gas/rx/mvtaclo.d,
* testsuite/gas/rx/mvtc.d,
* testsuite/gas/rx/mvtcp.d,
* testsuite/gas/rx/neg.d,
* testsuite/gas/rx/nop.d,
* testsuite/gas/rx/not.d,
* testsuite/gas/rx/opecp.d,
* testsuite/gas/rx/or.d,
* testsuite/gas/rx/pop.d,
* testsuite/gas/rx/popc.d,
* testsuite/gas/rx/popm.d,
* testsuite/gas/rx/pr19665.d,
* testsuite/gas/rx/pr22737.d,
* testsuite/gas/rx/push.d,
* testsuite/gas/rx/pushc.d,
* testsuite/gas/rx/pushm.d,
* testsuite/gas/rx/r-bcc.d,
* testsuite/gas/rx/r-bra.d,
* testsuite/gas/rx/racl.d,
* testsuite/gas/rx/racw.d,
* testsuite/gas/rx/rdacl.d,
* testsuite/gas/rx/rdacw.d,
* testsuite/gas/rx/revl.d,
* testsuite/gas/rx/revw.d,
* testsuite/gas/rx/rmpa.d,
* testsuite/gas/rx/rolc.d,
* testsuite/gas/rx/rorc.d,
* testsuite/gas/rx/rotl.d,
* testsuite/gas/rx/rotr.d,
* testsuite/gas/rx/round.d,
* testsuite/gas/rx/rte.d,
* testsuite/gas/rx/rtfi.d,
* testsuite/gas/rx/rts.d,
* testsuite/gas/rx/rtsd.d,
* testsuite/gas/rx/sat.d,
* testsuite/gas/rx/satr.d,
* testsuite/gas/rx/sbb.d,
* testsuite/gas/rx/sccnd.d,
* testsuite/gas/rx/scmpu.d,
* testsuite/gas/rx/setpsw.d,
* testsuite/gas/rx/shar.d,
* testsuite/gas/rx/shll.d,
* testsuite/gas/rx/shlr.d,
* testsuite/gas/rx/smovb.d,
* testsuite/gas/rx/smovf.d,
* testsuite/gas/rx/smovu.d,
* testsuite/gas/rx/sstr.d,
* testsuite/gas/rx/stnz.d,
* testsuite/gas/rx/stz.d,
* testsuite/gas/rx/sub.d,
* testsuite/gas/rx/suntil.d,
* testsuite/gas/rx/swhile.d,
* testsuite/gas/rx/tst.d,
* testsuite/gas/rx/utof.d,
* testsuite/gas/rx/wait.d,
* testsuite/gas/rx/xchg.d,
* testsuite/gas/rx/xor.d,
* testsuite/gas/s12z/abs.d,
* testsuite/gas/s12z/adc-imm.d,
* testsuite/gas/s12z/adc-opr.d,
* testsuite/gas/s12z/add-imm.d,
* testsuite/gas/s12z/add-opr.d,
* testsuite/gas/s12z/and-imm.d,
* testsuite/gas/s12z/and-opr.d,
* testsuite/gas/s12z/and-or-cc.d,
* testsuite/gas/s12z/bfext-special.d,
* testsuite/gas/s12z/bfext.d,
* testsuite/gas/s12z/bit-manip.d,
* testsuite/gas/s12z/bit.d,
* testsuite/gas/s12z/bra-expression-defined.d,
* testsuite/gas/s12z/bra-expression-undef.d,
* testsuite/gas/s12z/bra.d,
* testsuite/gas/s12z/brclr-symbols.d,
* testsuite/gas/s12z/brset-clr-opr-imm-rel.d,
* testsuite/gas/s12z/brset-clr-opr-reg-rel.d,
* testsuite/gas/s12z/brset-clr-reg-imm-rel.d,
* testsuite/gas/s12z/brset-clr-reg-reg-rel.d,
* testsuite/gas/s12z/clb.d,
* testsuite/gas/s12z/clr-opr.d,
* testsuite/gas/s12z/clr.d,
* testsuite/gas/s12z/cmp-imm.d,
* testsuite/gas/s12z/cmp-opr-inc.d,
* testsuite/gas/s12z/cmp-opr-rdirect.d,
* testsuite/gas/s12z/cmp-opr-reg.d,
* testsuite/gas/s12z/cmp-opr-rindirect.d,
* testsuite/gas/s12z/cmp-opr-sxe4.d,
* testsuite/gas/s12z/cmp-opr-xys.d,
* testsuite/gas/s12z/cmp-s-imm.d,
* testsuite/gas/s12z/cmp-s-opr.d,
* testsuite/gas/s12z/cmp-xy.d,
* testsuite/gas/s12z/com-opr.d,
* testsuite/gas/s12z/complex-shifts.d,
* testsuite/gas/s12z/db-tb-cc-opr.d,
* testsuite/gas/s12z/db-tb-cc-reg.d,
* testsuite/gas/s12z/dbCC.d,
* testsuite/gas/s12z/dec-opr.d,
* testsuite/gas/s12z/dec.d,
* testsuite/gas/s12z/div.d,
* testsuite/gas/s12z/eor.d,
* testsuite/gas/s12z/exg.d,
* testsuite/gas/s12z/ext24-ld-xy.d,
* testsuite/gas/s12z/inc-opr.d,
* testsuite/gas/s12z/inc.d,
* testsuite/gas/s12z/inh.d,
* testsuite/gas/s12z/jmp.d,
* testsuite/gas/s12z/jsr.d,
* testsuite/gas/s12z/ld-imm-page2.d,
* testsuite/gas/s12z/ld-imm.d,
* testsuite/gas/s12z/ld-immu18.d,
* testsuite/gas/s12z/ld-large-direct.d,
* testsuite/gas/s12z/ld-opr.d,
* testsuite/gas/s12z/ld-s-opr.d,
* testsuite/gas/s12z/ld-small-direct.d,
* testsuite/gas/s12z/lea-immu18.d,
* testsuite/gas/s12z/lea.d,
* testsuite/gas/s12z/mac.d,
* testsuite/gas/s12z/min-max.d,
* testsuite/gas/s12z/mod.d,
* testsuite/gas/s12z/mov.d,
* testsuite/gas/s12z/mul-imm.d,
* testsuite/gas/s12z/mul-opr-opr.d,
* testsuite/gas/s12z/mul-opr.d,
* testsuite/gas/s12z/mul-reg.d,
* testsuite/gas/s12z/mul.d,
* testsuite/gas/s12z/neg-opr.d,
* testsuite/gas/s12z/not-so-simple-shifts.d,
* testsuite/gas/s12z/opr-18u.d,
* testsuite/gas/s12z/opr-expr.d,
* testsuite/gas/s12z/opr-ext-18.d,
* testsuite/gas/s12z/opr-idx-24-reg.d,
* testsuite/gas/s12z/opr-idx3-reg.d,
* testsuite/gas/s12z/opr-idx3-xysp-24.d,
* testsuite/gas/s12z/opr-indirect-expr.d,
* testsuite/gas/s12z/opr-symbol.d,
* testsuite/gas/s12z/or-imm.d,
* testsuite/gas/s12z/or-opr.d,
* testsuite/gas/s12z/p2-mul.d,
* testsuite/gas/s12z/page2-inh.d,
* testsuite/gas/s12z/psh-pul.d,
* testsuite/gas/s12z/qmul.d,
* testsuite/gas/s12z/rotate.d,
* testsuite/gas/s12z/sat.d,
* testsuite/gas/s12z/sbc-imm.d,
* testsuite/gas/s12z/sbc-opr.d,
* testsuite/gas/s12z/shift.d,
* testsuite/gas/s12z/simple-shift.d,
* testsuite/gas/s12z/single-ops.d,
* testsuite/gas/s12z/specd6.d,
* testsuite/gas/s12z/st-large-direct.d,
* testsuite/gas/s12z/st-opr.d,
* testsuite/gas/s12z/st-s-opr.d,
* testsuite/gas/s12z/st-small-direct.d,
* testsuite/gas/s12z/st-xy.d,
* testsuite/gas/s12z/sub-imm.d,
* testsuite/gas/s12z/sub-opr.d,
* testsuite/gas/s12z/tfr.d,
* testsuite/gas/s12z/trap.d,
* testsuite/gas/sh/fdpic.d,
* testsuite/gas/sh/sh2a-pic.d,
* testsuite/gas/sh/sh2a.d: Don't match object file name.
* testsuite/gas/wasm32/disass-2.d,
* testsuite/gas/wasm32/disass.d: Likewise, and tidy regexps.
Alan Modra [Thu, 13 Sep 2018 07:26:08 +0000 (16:56 +0930)]
gas run_dump_test rename stderr and error-output
Use warning_output and error_output, like the ld version of
run_dump_test. Note that some tests used the wrong option, and this
went undetected since the gas version of run_dump_test doesn't
properly check tool error status. This patch corrects wrong options,
in preparation for a later patch that will check error status.
* testsuite/gas/aarch64/armv8_2-a-crypto-fp16-illegal.d,
* testsuite/gas/aarch64/armv8_2-a-illegal.d,
* testsuite/gas/aarch64/armv8_4-a-illegal.d,
* testsuite/gas/aarch64/armv8_4-a-registers-illegal.d,
* testsuite/gas/aarch64/deprecated.d,
* testsuite/gas/aarch64/diagnostic.d,
* testsuite/gas/aarch64/illegal-2.d,
* testsuite/gas/aarch64/illegal-by-element.d,
* testsuite/gas/aarch64/illegal-crypto-nofp.d,
* testsuite/gas/aarch64/illegal-fcmla.d,
* testsuite/gas/aarch64/illegal-fjcvtzs.d,
* testsuite/gas/aarch64/illegal-fp16-nofp.d,
* testsuite/gas/aarch64/illegal-ldapr.d,
* testsuite/gas/aarch64/illegal-ldraa.d,
* testsuite/gas/aarch64/illegal-lse.d,
* testsuite/gas/aarch64/illegal-nofp-armv8_3.d,
* testsuite/gas/aarch64/illegal-nofp16.d,
* testsuite/gas/aarch64/illegal-ras-1.d,
* testsuite/gas/aarch64/illegal-sysreg-2.d,
* testsuite/gas/aarch64/illegal-sysreg-3.d,
* testsuite/gas/aarch64/illegal.d,
* testsuite/gas/aarch64/legacy_reg_names.d,
* testsuite/gas/aarch64/pan-illegal.d,
* testsuite/gas/aarch64/pr22529.d,
* testsuite/gas/aarch64/rm-simd-ext.d,
* testsuite/gas/aarch64/sve-invalid.d,
* testsuite/gas/aarch64/sve-reg-diagnostic.d,
* testsuite/gas/aarch64/sve-sysreg-invalid.d,
* testsuite/gas/aarch64/sysreg-diagnostic.d,
* testsuite/gas/aarch64/verbose-error.d,
* testsuite/gas/all/byte.d,
* testsuite/gas/all/org-1.d,
* testsuite/gas/all/org-2.d,
* testsuite/gas/all/org-3.d,
* testsuite/gas/all/sleb128-9.d,
* testsuite/gas/arc/asm-errors-2.d,
* testsuite/gas/arc/asm-errors-3.d,
* testsuite/gas/arc/asm-errors.d,
* testsuite/gas/arc/attr-rf16.d,
* testsuite/gas/arc/relocs-errors.d,
* testsuite/gas/arc/textinsn-errors.d,
* testsuite/gas/arm/addsw-bad.d,
* testsuite/gas/arm/addthumb2err.d,
* testsuite/gas/arm/adr-invalid.d,
* testsuite/gas/arm/arch7em-bad-1.d,
* testsuite/gas/arm/arch7em-bad-2.d,
* testsuite/gas/arm/arch7em-bad-3.d,
* testsuite/gas/arm/arch7m-bad.d,
* testsuite/gas/arm/archv6s-m-bad.d,
* testsuite/gas/arm/archv6t2-bad.d,
* testsuite/gas/arm/arm-idiv-bad.d,
* testsuite/gas/arm/arm-it-bad-2.d,
* testsuite/gas/arm/arm-it-bad-3.d,
* testsuite/gas/arm/arm-it-bad.d,
* testsuite/gas/arm/arm3-bad.d,
* testsuite/gas/arm/arm7-bad.d,
* testsuite/gas/arm/armv1-bad.d,
* testsuite/gas/arm/armv1.d,
* testsuite/gas/arm/armv2-mp-bad.d,
* testsuite/gas/arm/armv8-2-fp16-scalar-bad.d,
* testsuite/gas/arm/armv8-2-fp16-simd-warning-thumb.d,
* testsuite/gas/arm/armv8-2-fp16-simd-warning.d,
* testsuite/gas/arm/armv8-a+rdma-warning.d,
* testsuite/gas/arm/armv8-a-bad.d,
* testsuite/gas/arm/armv8-a-it-bad.d,
* testsuite/gas/arm/armv8-r-bad.d,
* testsuite/gas/arm/armv8-r-it-bad.d,
* testsuite/gas/arm/armv8_2-a-fp16-illegal.d,
* testsuite/gas/arm/armv8_3-a-fp-bad.d,
* testsuite/gas/arm/armv8_3-a-simd-bad.d,
* testsuite/gas/arm/barrier-bad-thumb.d,
* testsuite/gas/arm/barrier-bad.d,
* testsuite/gas/arm/bl-local-v4t.d,
* testsuite/gas/arm/blx-bl-convert.d,
* testsuite/gas/arm/blx-local.d,
* testsuite/gas/arm/branch-reloc.d,
* testsuite/gas/arm/copro-arm_v2plus-arm_v1.d,
* testsuite/gas/arm/copro-arm_v5plus-arm_v4.d,
* testsuite/gas/arm/copro-arm_v5teplus-arm_v5.d,
* testsuite/gas/arm/copro-arm_v6plus-arm_v5te.d,
* testsuite/gas/arm/copro-thumb_v6t2plus-thumb_v4t-1.d,
* testsuite/gas/arm/copro-thumb_v6t2plus-thumb_v4t-2.d,
* testsuite/gas/arm/copro-thumb_v6t2plus-thumb_v4t-3.d,
* testsuite/gas/arm/copro-thumb_v6t2plus-thumb_v4t-4.d,
* testsuite/gas/arm/crc32-armv8-a-bad.d,
* testsuite/gas/arm/crc32-armv8-r-bad.d,
* testsuite/gas/arm/depr-swp.d,
* testsuite/gas/arm/dest-unpredictable.d,
* testsuite/gas/arm/dotprod-illegal.d,
* testsuite/gas/arm/dotprod-legacy-arch.d,
* testsuite/gas/arm/forbid-armv7-idiv-ext.d,
* testsuite/gas/arm/group-reloc-alu-encoding-bad.d,
* testsuite/gas/arm/group-reloc-alu-parsing-bad.d,
* testsuite/gas/arm/group-reloc-ldc-encoding-bad.d,
* testsuite/gas/arm/group-reloc-ldc-parsing-bad.d,
* testsuite/gas/arm/group-reloc-ldr-encoding-bad.d,
* testsuite/gas/arm/group-reloc-ldr-parsing-bad.d,
* testsuite/gas/arm/group-reloc-ldrs-encoding-bad.d,
* testsuite/gas/arm/group-reloc-ldrs-parsing-bad.d,
* testsuite/gas/arm/insn-error-a.d,
* testsuite/gas/arm/insn-error-t.d,
* testsuite/gas/arm/inst-po-2.d,
* testsuite/gas/arm/iwmmxt-bad.d,
* testsuite/gas/arm/iwmmxt-bad2.d,
* testsuite/gas/arm/ld-sp-warn-cortex-m3.d,
* testsuite/gas/arm/ld-sp-warn-cortex-m4.d,
* testsuite/gas/arm/ld-sp-warn-v7.d,
* testsuite/gas/arm/ld-sp-warn-v7a.d,
* testsuite/gas/arm/ld-sp-warn-v7em.d,
* testsuite/gas/arm/ld-sp-warn-v7m.d,
* testsuite/gas/arm/ld-sp-warn-v7r.d,
* testsuite/gas/arm/ld-sp-warn.d,
* testsuite/gas/arm/ldgesb-bad.d,
* testsuite/gas/arm/ldgesh-bad.d,
* testsuite/gas/arm/ldr-bad.d,
* testsuite/gas/arm/ldr-t-bad.d,
* testsuite/gas/arm/ldrd-unpredictable.d,
* testsuite/gas/arm/ldsgeb.d,
* testsuite/gas/arm/ldsgeh.d,
* testsuite/gas/arm/missing.d,
* testsuite/gas/arm/mrs-msr-arm-v7-a-bad.d,
* testsuite/gas/arm/mrs-msr-thumb-v7-m-bad.d,
* testsuite/gas/arm/msr-imm-bad.d,
* testsuite/gas/arm/msr-reg-bad.d,
* testsuite/gas/arm/mul-overlap.d,
* testsuite/gas/arm/neon-addressing-bad.d,
* testsuite/gas/arm/neon-cond-bad.d,
* testsuite/gas/arm/neon-ldst-align-bad.d,
* testsuite/gas/arm/neon-ldst-es-bad.d,
* testsuite/gas/arm/neon-suffix-bad.d,
* testsuite/gas/arm/neon-vmov-bad.d,
* testsuite/gas/arm/noarm.d,
* testsuite/gas/arm/pr18256.d,
* testsuite/gas/arm/pr18347.d,
* testsuite/gas/arm/pr20429.d,
* testsuite/gas/arm/pr22773.d,
* testsuite/gas/arm/r15-bad.d,
* testsuite/gas/arm/reloc-bad.d,
* testsuite/gas/arm/req.d,
* testsuite/gas/arm/shift-bad-pc.d,
* testsuite/gas/arm/shift-bad.d,
* testsuite/gas/arm/simd_by_scalar_low_regbank.d,
* testsuite/gas/arm/simd_by_scalar_low_regbank_thumb.d,
* testsuite/gas/arm/sp-pc-validations-bad-t-v8a.d,
* testsuite/gas/arm/sp-pc-validations-bad-t.d,
* testsuite/gas/arm/sp-pc-validations-bad.d,
* testsuite/gas/arm/sp-usage-thumb2-relax-on-v7.d,
* testsuite/gas/arm/srs-arm.d,
* testsuite/gas/arm/srs-t2.d,
* testsuite/gas/arm/strex-bad-t.d,
* testsuite/gas/arm/t16-bad.d,
* testsuite/gas/arm/thumb-b-bad.d,
* testsuite/gas/arm/thumb-w-bad.d,
* testsuite/gas/arm/thumb2_bad_reg.d,
* testsuite/gas/arm/thumb2_it_bad.d,
* testsuite/gas/arm/thumb2_it_bad_auto.d,
* testsuite/gas/arm/thumb2_ldmstm_bad.d,
* testsuite/gas/arm/thumb2_ldstd_unpredictable.d,
* testsuite/gas/arm/thumb2_mul-bad.d,
* testsuite/gas/arm/thumb2_str-bad.d,
* testsuite/gas/arm/thumb32.d,
* testsuite/gas/arm/udf-bad.d,
* testsuite/gas/arm/udf.d,
* testsuite/gas/arm/undefined.d,
* testsuite/gas/arm/undefined_coff.d,
* testsuite/gas/arm/vcmp-zero-bad.d,
* testsuite/gas/arm/vcvt-bad.d,
* testsuite/gas/arm/vfp-bad.d,
* testsuite/gas/arm/vfp-bad_t2.d,
* testsuite/gas/arm/vfpv3-d16-bad.d,
* testsuite/gas/arm/vldm-thumb-bad.d,
* testsuite/gas/arm/vldmw-arm-bad.d,
* testsuite/gas/arm/vldmw-thumb-bad.d,
* testsuite/gas/arm/vstr-arm-bad.d,
* testsuite/gas/arm/vstr-thumb-bad.d,
* testsuite/gas/arm/weakdef-2.d,
* testsuite/gas/avr/pr21621.d,
* testsuite/gas/elf/bad-bss.d,
* testsuite/gas/elf/bad-group.d,
* testsuite/gas/elf/bad-group.err,
* testsuite/gas/elf/bad-section-flag.d,
* testsuite/gas/elf/bad-section-flag.err,
* testsuite/gas/elf/bad-size.d,
* testsuite/gas/elf/bad-size.err,
* testsuite/gas/elf/common1.d,
* testsuite/gas/elf/common2.d,
* testsuite/gas/elf/common5a.d,
* testsuite/gas/elf/common5b.d,
* testsuite/gas/elf/common5c.d,
* testsuite/gas/elf/common5d.d,
* testsuite/gas/elf/dwarf2-10.d,
* testsuite/gas/elf/dwarf2-8.d,
* testsuite/gas/elf/dwarf2-9.d,
* testsuite/gas/elf/pr21661.d,
* testsuite/gas/elf/pseudo.d,
* testsuite/gas/elf/section13.d,
* testsuite/gas/i386/bad-size.d,
* testsuite/gas/i386/bundle-bad.d,
* testsuite/gas/i386/ilp32/x86-64-sse-check-warn.d,
* testsuite/gas/i386/intel-intel.d,
* testsuite/gas/i386/intel.d,
* testsuite/gas/i386/intelok.d,
* testsuite/gas/i386/mpx-add-bnd-prefix.d,
* testsuite/gas/i386/sse-check-warn.d,
* testsuite/gas/i386/string-ok.d,
* testsuite/gas/i386/vgather-check-warn.d,
* testsuite/gas/i386/x86-64-mpx-add-bnd-prefix.d,
* testsuite/gas/i386/x86-64-sse-check-warn.d,
* testsuite/gas/i386/x86-64-vgather-check-warn.d,
* testsuite/gas/mips/addiu-error.d,
* testsuite/gas/mips/branch-extern-3.d,
* testsuite/gas/mips/branch-extern-4.d,
* testsuite/gas/mips/branch-local-2.d,
* testsuite/gas/mips/branch-local-3.d,
* testsuite/gas/mips/branch-local-5.d,
* testsuite/gas/mips/branch-local-6.d,
* testsuite/gas/mips/branch-local-n32-2.d,
* testsuite/gas/mips/branch-local-n32-3.d,
* testsuite/gas/mips/branch-local-n32-5.d,
* testsuite/gas/mips/branch-local-n32-6.d,
* testsuite/gas/mips/branch-local-n64-2.d,
* testsuite/gas/mips/branch-local-n64-3.d,
* testsuite/gas/mips/branch-local-n64-5.d,
* testsuite/gas/mips/branch-local-n64-6.d,
* testsuite/gas/mips/branch-section-3.d,
* testsuite/gas/mips/branch-section-4.d,
* testsuite/gas/mips/branch-weak-3.d,
* testsuite/gas/mips/branch-weak-4.d,
* testsuite/gas/mips/break-error.d,
* testsuite/gas/mips/crc-err.d,
* testsuite/gas/mips/crc64-err.d,
* testsuite/gas/mips/ginv-err.d,
* testsuite/gas/mips/interaptiv-mr2@isa-override-1.d,
* testsuite/gas/mips/interaptiv-mr2@isa-override-2.d,
* testsuite/gas/mips/isa-override-2.d,
* testsuite/gas/mips/lui-1.d,
* testsuite/gas/mips/lui-2.d,
* testsuite/gas/mips/macro-warn-1-n32.d,
* testsuite/gas/mips/macro-warn-1.d,
* testsuite/gas/mips/macro-warn-2.d,
* testsuite/gas/mips/macro-warn-3.d,
* testsuite/gas/mips/macro-warn-4.d,
* testsuite/gas/mips/micromips-branch-delay.d,
* testsuite/gas/mips/micromips-branch-relax-insn32-pic.d,
* testsuite/gas/mips/micromips-branch-relax-insn32.d,
* testsuite/gas/mips/micromips-branch-relax-pic.d,
* testsuite/gas/mips/micromips-branch-relax.d,
* testsuite/gas/mips/micromips-compact.d,
* testsuite/gas/mips/micromips-insn32.d,
* testsuite/gas/mips/micromips-noinsn32.d,
* testsuite/gas/mips/micromips-size-1.d,
* testsuite/gas/mips/micromips-trap.d,
* testsuite/gas/mips/micromips-warn-branch-delay.d,
* testsuite/gas/mips/micromips.d,
* testsuite/gas/mips/micromips@addiu-error.d,
* testsuite/gas/mips/micromips@mips5-fp.d,
* testsuite/gas/mips/micromips@msa-relax.d,
* testsuite/gas/mips/micromips@relax-at.d,
* testsuite/gas/mips/micromips@relax-offset.d,
* testsuite/gas/mips/micromips@relax.d,
* testsuite/gas/mips/mips-gp32-fp64-pic.d,
* testsuite/gas/mips/mips-gp32-fp64.d,
* testsuite/gas/mips/mips-gp64-fp32-pic.d,
* testsuite/gas/mips/mips-gp64-fp32.d,
* testsuite/gas/mips/mips-gp64-fp64.d,
* testsuite/gas/mips/mips16-32@mips16-insn-e.d,
* testsuite/gas/mips/mips16-32@mips16-insn-t.d,
* testsuite/gas/mips/mips16-32@mips16-macro-e.d,
* testsuite/gas/mips/mips16-32@mips16-macro-t.d,
* testsuite/gas/mips/mips16-32@mips16-macro.d,
* testsuite/gas/mips/mips16-64@mips16-insn-e.d,
* testsuite/gas/mips/mips16-64@mips16-insn-t.d,
* testsuite/gas/mips/mips16-absolute-reloc-2.d,
* testsuite/gas/mips/mips16-absolute-reloc-3.d,
* testsuite/gas/mips/mips16-branch-addend-5.d,
* testsuite/gas/mips/mips16-branch-unextended-1.d,
* testsuite/gas/mips/mips16-branch-unextended-2.d,
* testsuite/gas/mips/mips16-insn-e.d,
* testsuite/gas/mips/mips16-insn-t.d,
* testsuite/gas/mips/mips16-jal-t.d,
* testsuite/gas/mips/mips16-macro-e.d,
* testsuite/gas/mips/mips16-macro-t.d,
* testsuite/gas/mips/mips16-pcrel-2.d,
* testsuite/gas/mips/mips16-pcrel-3.d,
* testsuite/gas/mips/mips16-pcrel-4.d,
* testsuite/gas/mips/mips16-pcrel-5.d,
* testsuite/gas/mips/mips16-pcrel-absolute-n64-4.d,
* testsuite/gas/mips/mips16-pcrel-absolute-n64-6.d,
* testsuite/gas/mips/mips16-pcrel-absolute-pic-n64-4.d,
* testsuite/gas/mips/mips16-pcrel-absolute-pic-n64-6.d,
* testsuite/gas/mips/mips16-pcrel-addend-n64-8.d,
* testsuite/gas/mips/mips16-pcrel-addend-n64-9.d,
* testsuite/gas/mips/mips16-pcrel-addend-pic-8.d,
* testsuite/gas/mips/mips16-pcrel-addend-pic-9.d,
* testsuite/gas/mips/mips16-pcrel-delay-0.d,
* testsuite/gas/mips/mips16-pcrel-delay-1.d,
* testsuite/gas/mips/mips16-pcrel-n64-0.d,
* testsuite/gas/mips/mips16-pcrel-n64-1.d,
* testsuite/gas/mips/mips16-pcrel-pic-0.d,
* testsuite/gas/mips/mips16-pcrel-pic-1.d,
* testsuite/gas/mips/mips16-reg-error.d,
* testsuite/gas/mips/mips16-relax-unextended-1.d,
* testsuite/gas/mips/mips16-relax-unextended-2.d,
* testsuite/gas/mips/mips16-reloc-error.d,
* testsuite/gas/mips/mips16-sdrasp.d,
* testsuite/gas/mips/mips16@addiu-error.d,
* testsuite/gas/mips/mips16e-32@mips16-insn-e.d,
* testsuite/gas/mips/mips16e-32@mips16-insn-t.d,
* testsuite/gas/mips/mips16e-32@mips16-macro-e.d,
* testsuite/gas/mips/mips16e-32@mips16-macro-t.d,
* testsuite/gas/mips/mips16e-32@mips16-macro.d,
* testsuite/gas/mips/mips16e-32@mips16e-64.d,
* testsuite/gas/mips/mips16e2-32@mips16-insn-e.d,
* testsuite/gas/mips/mips16e2-32@mips16-insn-t.d,
* testsuite/gas/mips/mips16e2-32@mips16-macro-e.d,
* testsuite/gas/mips/mips16e2-32@mips16-macro-t.d,
* testsuite/gas/mips/mips16e2-32@mips16-macro.d,
* testsuite/gas/mips/mips16e2-32@mips16e-64.d,
* testsuite/gas/mips/mips16e2-copy-err.d,
* testsuite/gas/mips/mips16e2-imm-error.d,
* testsuite/gas/mips/mips16e2-interaptiv-mr2@mips16-insn-e.d,
* testsuite/gas/mips/mips16e2-interaptiv-mr2@mips16-insn-t.d,
* testsuite/gas/mips/mips16e2-interaptiv-mr2@mips16-macro-e.d,
* testsuite/gas/mips/mips16e2-interaptiv-mr2@mips16-macro-t.d,
* testsuite/gas/mips/mips16e2-interaptiv-mr2@mips16-macro.d,
* testsuite/gas/mips/mips16e2-interaptiv-mr2@mips16-sub.d,
* testsuite/gas/mips/mips16e2-interaptiv-mr2@mips16e-64-sub.d,
* testsuite/gas/mips/mips16e2-interaptiv-mr2@mips16e-64.d,
* testsuite/gas/mips/mips16e2-interaptiv-mr2@mips16e-sub.d,
* testsuite/gas/mips/mips16e2-mt-err.d,
* testsuite/gas/mips/mips16e2-reloc-error.d,
* testsuite/gas/mips/mips16e2@lui-2.d,
* testsuite/gas/mips/mips16e2@mips16-pcrel-2.d,
* testsuite/gas/mips/mips16e2@mips16-pcrel-delay-0.d,
* testsuite/gas/mips/mips16e2@mips16-pcrel-delay-1.d,
* testsuite/gas/mips/mips1@isa-override-2.d,
* testsuite/gas/mips/mips1@relax-offset.d,
* testsuite/gas/mips/mips2@isa-override-2.d,
* testsuite/gas/mips/mips32-mt.d,
* testsuite/gas/mips/mips32@isa-override-2.d,
* testsuite/gas/mips/mips32r2@isa-override-2.d,
* testsuite/gas/mips/mips32r3@isa-override-2.d,
* testsuite/gas/mips/mips32r5@isa-override-2.d,
* testsuite/gas/mips/mips32r6@isa-override-2.d,
* testsuite/gas/mips/mips5-fp.d,
* testsuite/gas/mips/mips64-mips3d-incl.d,
* testsuite/gas/mips/mips64-mips3d.d,
* testsuite/gas/mips/mipsr6@mips5-fp.d,
* testsuite/gas/mips/msa-relax.d,
* testsuite/gas/mips/octeon3@isa-override-1.d,
* testsuite/gas/mips/octeon3@isa-override-2.d,
* testsuite/gas/mips/option-pic-relax-2.d,
* testsuite/gas/mips/option-pic-relax-3.d,
* testsuite/gas/mips/option-pic-relax-4.d,
* testsuite/gas/mips/option-pic-relax-5.d,
* testsuite/gas/mips/org-1.d,
* testsuite/gas/mips/org-10.d,
* testsuite/gas/mips/org-4.d,
* testsuite/gas/mips/org-5.d,
* testsuite/gas/mips/org-6.d,
* testsuite/gas/mips/r3000@isa-override-2.d,
* testsuite/gas/mips/r3000@relax-offset.d,
* testsuite/gas/mips/r3900@isa-override-2.d,
* testsuite/gas/mips/r3900@relax-offset.d,
* testsuite/gas/mips/reginfo-2-n32.d,
* testsuite/gas/mips/reginfo-2.d,
* testsuite/gas/mips/relax-at.d,
* testsuite/gas/mips/relax-offset.d,
* testsuite/gas/mips/relax-swap1-mips1.d,
* testsuite/gas/mips/relax-swap1-mips2.d,
* testsuite/gas/mips/relax-swap2.d,
* testsuite/gas/mips/relax.d,
* testsuite/gas/mips/save-err.d,
* testsuite/gas/mips/set-arch.d,
* testsuite/gas/mips/xpa-err.d,
* testsuite/gas/mips/xpa-virt-err.d,
* testsuite/gas/msp430/bad.d,
* testsuite/gas/msp430/errata_warns.d,
* testsuite/gas/msp430/pr22133.d,
* testsuite/gas/ppc/lsp-checks.d,
* testsuite/gas/ppc/misalign.d,
* testsuite/gas/ppc/spe2-checks.d,
* testsuite/gas/riscv/bad-csr.d,
* testsuite/gas/riscv/c-addi16sp-fail.d,
* testsuite/gas/riscv/c-addi4spn-fail.d,
* testsuite/gas/riscv/c-fld-fsd-fail.d,
* testsuite/gas/riscv/c-lui-fail.d,
* testsuite/gas/riscv/c-nonzero-imm.d,
* testsuite/gas/riscv/c-nonzero-reg.d,
* testsuite/gas/riscv/fence-fail.d,
* testsuite/gas/riscv/lla64-fail.d,
* testsuite/gas/riscv/rouding-fail.d,
* testsuite/gas/sh/pcrel-hms.d,
* testsuite/gas/sh/pcrel.d,
* testsuite/gas/sparc/dcti-couples-v8.d,
* testsuite/gas/sparc/dcti-couples-v9c.d,
* testsuite/gas/tic6x/arch-invalid-1.d,
* testsuite/gas/tic6x/arch-invalid-2.d,
* testsuite/gas/tic6x/dir-junk.d,
* testsuite/gas/tic6x/insns-bad-1.d,
* testsuite/gas/tic6x/insns-bad-2.d,
* testsuite/gas/tic6x/parallel-bad-1.d,
* testsuite/gas/tic6x/parallel-bad-2.d,
* testsuite/gas/tic6x/parallel-bad-3.d,
* testsuite/gas/tic6x/parallel-bad-4.d,
* testsuite/gas/tic6x/predicate-bad-1.d,
* testsuite/gas/tic6x/predicate-bad-2.d,
* testsuite/gas/tic6x/predicate-bad-3.d,
* testsuite/gas/tic6x/reloc-bad-1.d,
* testsuite/gas/tic6x/reloc-bad-2.d,
* testsuite/gas/tic6x/reloc-bad-3.d,
* testsuite/gas/tic6x/reloc-bad-4.d,
* testsuite/gas/tic6x/reloc-bad-5.d,
* testsuite/gas/tic6x/reloc-bad-6.d,
* testsuite/gas/tic6x/resource-func-unit-1.d,
* testsuite/gas/tic6x/resource-func-unit-2.d,
* testsuite/gas/tic6x/sploop-bad-1.d,
* testsuite/gas/tic6x/sploop-bad-2.d,
* testsuite/gas/tic6x/sploop-bad-3.d,
* testsuite/gas/tic6x/sploop-bad-4.d,
* testsuite/gas/tic6x/sploop-bad-5.d,
* testsuite/gas/tic6x/sploop-bad-6.d,
* testsuite/gas/tic6x/sploop-bad-7.d,
* testsuite/gas/tic6x/unwind-bad-1.d,
* testsuite/gas/tic6x/unwind-bad-2.d,
* testsuite/lib/gas-defs.exp (run_dump_tests): Replace stderr
and error-output with warning_output and error_output.
(slurp_options): Accept underscore rather than dash.
Alan Modra [Thu, 13 Sep 2018 06:14:00 +0000 (15:44 +0930)]
gas run_dump_test rename not-target and not-skip
Use notarget and noskip, like the ld testsuite.
* testsuite/gas/aarch64/codealign.d,
* testsuite/gas/aarch64/litpool.d,
* testsuite/gas/aarch64/mapmisc.d,
* testsuite/gas/aarch64/mapping.d,
* testsuite/gas/aarch64/mapping2.d,
* testsuite/gas/aarch64/mapping3.d,
* testsuite/gas/aarch64/mapping4.d,
* testsuite/gas/all/align.d,
* testsuite/gas/all/fill-1.d,
* testsuite/gas/all/incbin.d,
* testsuite/gas/all/redef2.d,
* testsuite/gas/all/redef3.d,
* testsuite/gas/all/relax.d,
* testsuite/gas/all/sleb128-2.d,
* testsuite/gas/all/sleb128-4.d,
* testsuite/gas/all/sleb128-5.d,
* testsuite/gas/all/sleb128-7.d,
* testsuite/gas/all/sleb128-9.d,
* testsuite/gas/all/weakref1.d,
* testsuite/gas/all/weakref1g.d,
* testsuite/gas/all/weakref1l.d,
* testsuite/gas/all/weakref1u.d,
* testsuite/gas/all/weakref1w.d,
* testsuite/gas/arm/abs12.d,
* testsuite/gas/arm/arch4t.d,
* testsuite/gas/arm/arch7.d,
* testsuite/gas/arm/arch7a-mp.d,
* testsuite/gas/arm/arch7em.d,
* testsuite/gas/arm/archv8m-main-dsp-5.d,
* testsuite/gas/arm/armv8a-automatic-hlt.d,
* testsuite/gas/arm/armv8a-automatic-lda.d,
* testsuite/gas/arm/attr-syntax.d,
* testsuite/gas/arm/automatic-bw.d,
* testsuite/gas/arm/automatic-cbz.d,
* testsuite/gas/arm/automatic-clrex.d,
* testsuite/gas/arm/automatic-lda.d,
* testsuite/gas/arm/automatic-ldaex.d,
* testsuite/gas/arm/automatic-ldaexb.d,
* testsuite/gas/arm/automatic-ldrex.d,
* testsuite/gas/arm/automatic-ldrexd.d,
* testsuite/gas/arm/automatic-movw.d,
* testsuite/gas/arm/automatic-sdiv.d,
* testsuite/gas/arm/automatic-strexb.d,
* testsuite/gas/arm/barrier-thumb.d,
* testsuite/gas/arm/barrier.d,
* testsuite/gas/arm/bignum1.d,
* testsuite/gas/arm/blx-bad.d,
* testsuite/gas/arm/blx-local.s,
* testsuite/gas/arm/crc32-armv8-a-bad.d,
* testsuite/gas/arm/crc32-armv8-a.d,
* testsuite/gas/arm/crc32-armv8-r-bad.d,
* testsuite/gas/arm/crc32-armv8-r.d,
* testsuite/gas/arm/eabi_attr_1.d,
* testsuite/gas/arm/fp-save.d,
* testsuite/gas/arm/local_function.d,
* testsuite/gas/arm/local_label_coff.d,
* testsuite/gas/arm/local_label_wince.d,
* testsuite/gas/arm/mapping.d,
* testsuite/gas/arm/mapping2.d,
* testsuite/gas/arm/mapping3.d,
* testsuite/gas/arm/mapping4.d,
* testsuite/gas/arm/mapshort-elf.d,
* testsuite/gas/arm/mask_1-armv8-a.d,
* testsuite/gas/arm/mask_1-armv8-r.d,
* testsuite/gas/arm/mrs-msr-thumb-v6t2.d,
* testsuite/gas/arm/mrs-msr-thumb-v7-m.d,
* testsuite/gas/arm/mrs-msr-thumb-v7e-m.d,
* testsuite/gas/arm/nomapping.d,
* testsuite/gas/arm/pic.d,
* testsuite/gas/arm/pic_vxworks.d,
* testsuite/gas/arm/plt-1.d,
* testsuite/gas/arm/reloc-bad.d,
* testsuite/gas/arm/reloc-fdpic.d,
* testsuite/gas/arm/t2-branch-global.d,
* testsuite/gas/arm/thumb.d,
* testsuite/gas/arm/thumb2_ldr_immediate_armv6.d,
* testsuite/gas/arm/thumb2_ldr_immediate_highregs_armv6t2.d,
* testsuite/gas/arm/thumb2_pool.d,
* testsuite/gas/arm/thumb2_vpool.d,
* testsuite/gas/arm/thumb2_vpool_be.d,
* testsuite/gas/arm/thumb32.d,
* testsuite/gas/arm/thumbver.d,
* testsuite/gas/arm/tls.d,
* testsuite/gas/arm/tls_vxworks.d,
* testsuite/gas/arm/undefined_coff.d,
* testsuite/gas/arm/unwind.d,
* testsuite/gas/arm/unwind_vxworks.d,
* testsuite/gas/arm/v4bx.d,
* testsuite/gas/arm/vfma1.d,
* testsuite/gas/arm/vldm-arm.d,
* testsuite/gas/arm/weakdef-1.d,
* testsuite/gas/arm/weakdef-2.d,
* testsuite/gas/arm/wince.d,
* testsuite/gas/arm/wince_inst.d,
* testsuite/gas/elf/bignums.d,
* testsuite/gas/elf/common5a.d,
* testsuite/gas/elf/common5b.d,
* testsuite/gas/elf/common5c.d,
* testsuite/gas/elf/common5d.d,
* testsuite/gas/elf/dwarf2-1.d,
* testsuite/gas/elf/dwarf2-10.d,
* testsuite/gas/elf/dwarf2-11.d,
* testsuite/gas/elf/dwarf2-12.d,
* testsuite/gas/elf/dwarf2-13.d,
* testsuite/gas/elf/dwarf2-14.d,
* testsuite/gas/elf/dwarf2-15.d,
* testsuite/gas/elf/dwarf2-16.d,
* testsuite/gas/elf/dwarf2-17.d,
* testsuite/gas/elf/dwarf2-18.d,
* testsuite/gas/elf/dwarf2-2.d,
* testsuite/gas/elf/dwarf2-3.d,
* testsuite/gas/elf/dwarf2-4.d,
* testsuite/gas/elf/dwarf2-5.d,
* testsuite/gas/elf/dwarf2-6.d,
* testsuite/gas/elf/dwarf2-7.d,
* testsuite/gas/elf/dwarf2-8.d,
* testsuite/gas/elf/dwarf2-9.d,
* testsuite/gas/elf/group0c.d,
* testsuite/gas/elf/group1a.d,
* testsuite/gas/elf/group2.d,
* testsuite/gas/elf/groupautoa.d,
* testsuite/gas/elf/ifunc-1.d,
* testsuite/gas/elf/section11.d,
* testsuite/gas/elf/section4.d,
* testsuite/gas/elf/section7.d,
* testsuite/gas/elf/syms.d,
* testsuite/gas/elf/symver.d,
* testsuite/gas/i386/iamcu-1.d,
* testsuite/gas/i386/iamcu-2.d,
* testsuite/gas/i386/iamcu-3.d,
* testsuite/gas/i386/iamcu-4.d,
* testsuite/gas/i386/iamcu-5.d,
* testsuite/gas/i386/ilp32/rex.d,
* testsuite/gas/i386/k1om.d,
* testsuite/gas/i386/l1om.d,
* testsuite/gas/i386/rex.d,
* testsuite/gas/mach-o/sections-3.d,
* testsuite/gas/macros/irp.d,
* testsuite/gas/macros/repeat.d,
* testsuite/gas/macros/rept.d,
* testsuite/gas/macros/semi.d,
* testsuite/gas/macros/test2.d,
* testsuite/gas/macros/test3.d,
* testsuite/gas/macros/vararg.d,
* testsuite/gas/mips/jal-svr4pic-local.d,
* testsuite/gas/mips/micromips@jal-svr4pic-local.d,
* testsuite/gas/mips/mips1@jal-svr4pic-local.d,
* testsuite/gas/mips/r3000@jal-svr4pic-local.d,
* testsuite/gas/ppc/machine.d,
* testsuite/lib/gas-defs.exp (run_dump_test): Replace not-target
and not-skip with notarget and noskip.
Alan Modra [Thu, 13 Sep 2018 06:06:14 +0000 (15:36 +0930)]
binutils run_dump_test rename not-target and not-skip
Use notarget and noskip, like the ld testsuite.
* testsuite/binutils-all/copy-2.d,
* testsuite/binutils-all/copy-3.d,
* testsuite/binutils-all/copy-4.d,
* testsuite/binutils-all/elfedit-1.d,
* testsuite/binutils-all/note-1.d,
* testsuite/binutils-all/note-2-64.d,
* testsuite/binutils-all/strip-11.d,
* testsuite/binutils-all/strip-13.d,
* testsuite/binutils-all/strip-14.d,
* testsuite/binutils-all/testranges.d,
* testsuite/binutils-all/x86-64/pr23494a-x32.d,
* testsuite/binutils-all/x86-64/pr23494a.d,
* testsuite/binutils-all/x86-64/pr23494b-x32.d,
* testsuite/binutils-all/x86-64/pr23494b.d,
* testsuite/binutils-all/x86-64/pr23494c-x32.d,
* testsuite/binutils-all/x86-64/pr23494c.d,
* testsuite/binutils-all/x86-64/pr23494d-x32.d,
* testsuite/binutils-all/x86-64/pr23494d.d,
* testsuite/binutils-all/x86-64/pr23494e-x32.d,
* testsuite/binutils-all/x86-64/pr23494e.d,
* testsuite/lib/utils-lib.exp (run_dump_test): Replace not-target
and not-skip with notarget and noskip.
Alan Modra [Thu, 13 Sep 2018 05:13:34 +0000 (14:43 +0930)]
Remove run_dump_test support for objcopy as a dump program
We have three copies of run_dump_test in the testsuite. This is a first
step towards consolidating them.
A few tests use objcopy to convert to verilog or srec output, then
check that output is as expected. Those tests can just as easily use
objdump, keeping the set of dump programs (addr2line, nm, objdump,
readelf, size) separate from utilities under test. That in turn makes
auto-detecting the dump program possible in more places.
binutils/
* testsuite/binutils-all/group-7a.d,
* testsuite/binutils-all/group-7b.d,
* testsuite/binutils-all/group-7c.d,
* testsuite/binutils-all/symbols-1.d,
* testsuite/binutils-all/symbols-2.d,
* testsuite/binutils-all/symbols-3.d,
* testsuite/binutils-all/symbols-4.d: Remove DUMPPROG.
gas/
* testsuite/gas/mri/char.d: Don't objcopy to srec, objdump instead.
* testsuite/gas/mri/float.d: Likewise.
* testsuite/lib/gas-defs.exp (run_dump_test): Remove support
for objcopy as a dump tool.
ld/
* testsuite/ld-elf/interleave-0.d,
* testsuite/ld-elf/interleave-4.d: Don't objcopy to srec,
objdump instead.
* testsuite/ld-gc/all-debug-sections.d,
* testsuite/ld-scripts/provide-4.d,
* testsuite/ld-scripts/provide-5.d,
* testsuite/ld-scripts/provide-6.d,
* testsuite/ld-scripts/provide-7.d,
* testsuite/ld-scripts/provide-8.d,
* testsuite/ld-scripts/segment-start.d: Remove PROG, specify
nm instead.
* testsuite/lib/ld-lib.exp (run_dump_test): Remove support
for objcopy as a dump tool.
Tom Tromey [Sat, 8 Sep 2018 01:28:39 +0000 (19:28 -0600)]
Fix possible exception leak in python.c
In the Python code, gdb exceptions may not leak into the Python core.
execute_gdb_command was calling bpstat_do_actions outside of a
TRY/CATCH; which seemed risky. I don't have a test case for this, but
if bpstat_do_actions could ever throw, it could crash gdb.
This patch introduces a new scope in order to preserve the current
semantics, so it is looks a bit bigger than it really is.
Tested on x86-64 Fedora 28.
gdb/ChangeLog
2018-09-07 Tom Tromey <tom@tromey.com>
* python/python.c (execute_gdb_command): Call bpstat_do_actions
inside the TRY.
Sandra Loosemore [Sat, 15 Sep 2018 03:09:46 +0000 (20:09 -0700)]
Provide type_align gdbarch function for nios2.
2018-09-14 Sandra Loosemore <sandra@codesourcery.com>
gdb/
* nios2-tdep.c (nios2_type_align): New.
(nios2_gdb_arch_init): Install type_align hook.
GDB Administrator [Sat, 15 Sep 2018 00:00:52 +0000 (00:00 +0000)]
Automatic date update in version.in
Andrew Burgess [Mon, 10 Sep 2018 12:50:34 +0000 (13:50 +0100)]
gdb: Don't leak memory with TYPE_ALLOC / TYPE_ZALLOC
This patch started as an observation from valgrind that GDB appeared
to be loosing track of some memory associated with types. An example
valgrind stack would be:
24 bytes in 1 blocks are possibly lost in loss record 419 of 5,361
at 0x4C2EA1E: calloc (vg_replace_malloc.c:711)
by 0x623D26: xcalloc (common-utils.c:85)
by 0x623D65: xzalloc(unsigned long) (common-utils.c:95)
by 0x72A066: make_function_type(type*, type**) (gdbtypes.c:510)
by 0x72A098: lookup_function_type(type*) (gdbtypes.c:521)
by 0x73635D: gdbtypes_post_init(gdbarch*) (gdbtypes.c:5439)
by 0x727590: gdbarch_data(gdbarch*, gdbarch_data*) (gdbarch.c:5230)
by 0x735B99: builtin_type(gdbarch*) (gdbtypes.c:5313)
by 0x514D95: elf_rel_plt_read(minimal_symbol_reader&, objfile*, bfd_symbol**) (elfread.c:542)
by 0x51662F: elf_read_minimal_symbols(objfile*, int, elfinfo const*) (elfread.c:1121)
by 0x5168A5: elf_symfile_read(objfile*, enum_flags<symfile_add_flag>) (elfread.c:1207)
by 0x8520F5: read_symbols(objfile*, enum_flags<symfile_add_flag>) (symfile.c:794)
When we look in make_function_type we find a call to TYPE_ZALLOC
(inside the INIT_FUNC_SPECIFIC macro). It is this call to TYPE_ZALLOC
that is allocating memory with xcalloc, that is then getting lost.
The problem is tht calling TYPE_ALLOC or TYPE_ZALLOC currently
allocates memory from either the objfile obstack or by using malloc.
The problem with this is that types are allocated either on the
objfile obstack, or on the gdbarch obstack.
As a result, if we discard a type associated with an objfile then
auxiliary data allocated with TYPE_(Z)ALLOC will be correctly
discarded. But, if we were ever to discard a gdbarch then any
auxiliary type data would be leaked. Right now there are very few
places in GDB where a gdbarch is ever discarded, but it shouldn't hurt
to close down these bugs as we spot them.
This commit ensures that auxiliary type data is allocated from the
same obstack as the type itself, which should reduce leaked memory.
The one problem case that I found with this change was in eval.c,
where in one place we allocate a local type structure, and then used
TYPE_ZALLOC to allocate some space for the type. This local type is
neither object file owned, nor gdbarch owned, and so the updated
TYPE_ALLOC code is unable to find an objstack to allocate space on.
My proposed solution for this issue is that the space should be
allocated with a direct call to xzalloc. We could extend TYPE_ALLOC
to check for type->gdbarch being null, and then fall back to a direct
call to xzalloc, however, I think that making this rare case of a
local type require special handling is not a bad thing, this serves to
highlight that clearing up the memory will require special handling
too.
This special case of a local type is interesting as the types owner
field (contained within the main_type) is completely null. While
reflecting on this I looked at how types use the get_type_arch
function. It seems clear that, based on how this is used, it is never
intended that null will be returned from this function. This only
goes to reinforce, how locally alloctaed types, with no owner, are
both special, and need to be handled carefully. To help spot errors
earlier, I added an assert into get_type_arch that the returned arch
is not null.
Inside gdbarch.c I found a few other places where auxiliary type data
was being allocated directly on the heap rather than on the types
obstack. I have fixed these to call TYPE_ALLOC now.
Finally, it is worth noting that as we don't clean up our gdbarch
objects yet, then this will not make much of an impact on the amount
of memory reported as lost at program termination time. Memory
allocated for auxiliary type information is still not freed, however,
it is now on the correct obstack. If we do ever start freeing our
gdbarch structures then the associated type data will be cleaned up
correctly.
Tested on X86-64 GNU/Linux with no regressions.
gdb/ChangeLog:
* eval.c (fake_method::fake_method): Call xzalloc directly for a
type that is neither object file owned, nor gdbarch owned.
* gdbtypes.c (get_type_gdbarch): Add an assert that returned
gdbarch is non-NULL.
(alloc_type_instance): Allocate non-objfile owned types on the
gdbarch obstack.
(copy_type_recursive): Allocate TYPE_FIELDS and TYPE_RANGE_DATA
using TYPE_ALLOC to ensure memory is allocated on the correct
obstack.
* gdbtypes.h (TYPE_ALLOC): Allocate space on either the objfile
obstack, or the gdbarch obstack.
(TYPE_ZALLOC): Rewrite using TYPE_ALLOC.
Maciej W. Rozycki [Fri, 14 Sep 2018 19:22:57 +0000 (20:22 +0100)]
PR ld/21375: MIPS: Add test cases for undefined weaks resolving to zero
Define a new procedure, `run_mips_undefweak_test', and use it to iterate
over several scenarios involving undefined weak symbols resolving to
zero, verifying expected regular MIPS, MIPS16 and microMIPS code, GOT
and dynamic symbol table generation, as well as the setting of the
EI_ABIVERSION field in the ELF file header. In particular ensure that
symbol versioning works and that `__gnu_absolute_zero' gets assigned a
version (any will do) even if it has not been listed for exportation in
a linker version script.
ld/
PR ld/21375
* testsuite/ld-mips-elf/pr21375-abi.hd: New test.
* testsuite/ld-mips-elf/pr21375-noabi.hd: New test.
* testsuite/ld-mips-elf/pr21375.dd: New test.
* testsuite/ld-mips-elf/pr21375h.dd: New test.
* testsuite/ld-mips-elf/pr21375p.dd: New test.
* testsuite/ld-mips-elf/pr21375ph.dd: New test.
* testsuite/ld-mips-elf/pr21375s.dd: New test.
* testsuite/ld-mips-elf/pr21375s-n32.dd: New test.
* testsuite/ld-mips-elf/pr21375s-n64.dd: New test.
* testsuite/ld-mips-elf/pr21375sh.dd: New test.
* testsuite/ld-mips-elf/pr21375sh-n32.dd: New test.
* testsuite/ld-mips-elf/pr21375sh-n64.dd: New test.
* testsuite/ld-mips-elf/pr21375shg.dd: New test.
* testsuite/ld-mips-elf/pr21375sx.dd: New test.
* testsuite/ld-mips-elf/pr21375sxh.dd: New test.
* testsuite/ld-mips-elf/pr21375sm16.dd: New test.
* testsuite/ld-mips-elf/pr21375sm16h.dd: New test.
* testsuite/ld-mips-elf/pr21375su.dd: New test.
* testsuite/ld-mips-elf/pr21375su-n32.dd: New test.
* testsuite/ld-mips-elf/pr21375su-n64.dd: New test.
* testsuite/ld-mips-elf/pr21375suh.dd: New test.
* testsuite/ld-mips-elf/pr21375suh-n32.dd: New test.
* testsuite/ld-mips-elf/pr21375suh-n64.dd: New test.
* testsuite/ld-mips-elf/pr21375sux.dd: New test.
* testsuite/ld-mips-elf/pr21375suxh.dd: New test.
* testsuite/ld-mips-elf/pr21375.gd: New test.
* testsuite/ld-mips-elf/pr21375h.gd: New test.
* testsuite/ld-mips-elf/pr21375p.gd: New test.
* testsuite/ld-mips-elf/pr21375ph.gd: New test.
* testsuite/ld-mips-elf/pr21375s.gd: New test.
* testsuite/ld-mips-elf/pr21375s-n32.gd: New test.
* testsuite/ld-mips-elf/pr21375s-n64.gd: New test.
* testsuite/ld-mips-elf/pr21375sh.gd: New test.
* testsuite/ld-mips-elf/pr21375sh-n32.gd: New test.
* testsuite/ld-mips-elf/pr21375sh-n64.gd: New test.
* testsuite/ld-mips-elf/pr21375shg.gd: New test.
* testsuite/ld-mips-elf/pr21375shl.gd: New test.
* testsuite/ld-mips-elf/pr21375shv.gd: New test.
* testsuite/ld-mips-elf/pr21375sx.gd: New test.
* testsuite/ld-mips-elf/pr21375sxh.gd: New test.
* testsuite/ld-mips-elf/pr21375.sd: New test.
* testsuite/ld-mips-elf/pr21375-irix.sd: New test.
* testsuite/ld-mips-elf/pr21375h.sd: New test.
* testsuite/ld-mips-elf/pr21375h-irix.sd: New test.
* testsuite/ld-mips-elf/pr21375p.sd: New test.
* testsuite/ld-mips-elf/pr21375p-irix.sd: New test.
* testsuite/ld-mips-elf/pr21375ph.sd: New test.
* testsuite/ld-mips-elf/pr21375ph-irix.sd: New test.
* testsuite/ld-mips-elf/pr21375s.sd: New test.
* testsuite/ld-mips-elf/pr21375s-irix.sd: New test.
* testsuite/ld-mips-elf/pr21375s-n32.sd: New test.
* testsuite/ld-mips-elf/pr21375s-n32-irix.sd: New test.
* testsuite/ld-mips-elf/pr21375s-n64.sd: New test.
* testsuite/ld-mips-elf/pr21375s-n64-irix.sd: New test.
* testsuite/ld-mips-elf/pr21375sh.sd: New test.
* testsuite/ld-mips-elf/pr21375sh-irix.sd: New test.
* testsuite/ld-mips-elf/pr21375sh-n32.sd: New test.
* testsuite/ld-mips-elf/pr21375sh-n32-irix.sd: New test.
* testsuite/ld-mips-elf/pr21375sh-n64.sd: New test.
* testsuite/ld-mips-elf/pr21375sh-n64-irix.sd: New test.
* testsuite/ld-mips-elf/pr21375shg.sd: New test.
* testsuite/ld-mips-elf/pr21375shg-irix.sd: New test.
* testsuite/ld-mips-elf/pr21375shl.sd: New test.
* testsuite/ld-mips-elf/pr21375shl-irix.sd: New test.
* testsuite/ld-mips-elf/pr21375shv.sd: New test.
* testsuite/ld-mips-elf/pr21375shv-irix.sd: New test.
* testsuite/ld-mips-elf/pr21375sx.sd: New test.
* testsuite/ld-mips-elf/pr21375sx-irix.sd: New test.
* testsuite/ld-mips-elf/pr21375sxh.sd: New test.
* testsuite/ld-mips-elf/pr21375sxh-irix.sd: New test.
* testsuite/ld-mips-elf/pr21375.ld: New test linker script.
* testsuite/ld-mips-elf/pr21375-xgot.ld: New test linker script.
* testsuite/ld-mips-elf/pr21375.ver: New test version script.
* testsuite/ld-mips-elf/pr21375v.ver: New test version script.
* testsuite/ld-mips-elf/pr21375.s: New test source.
* testsuite/ld-mips-elf/pr21375-mips16.s: New test source.
* testsuite/ld-mips-elf/pr21375-n32.s: New test source.
* testsuite/ld-mips-elf/pr21375-n64.s: New test source.
* testsuite/ld-mips-elf/pr21375-xgot.s: New test source.
* testsuite/ld-mips-elf/mips-elf.exp (run_mips_undefweak_test):
New procedure; run the new tests.
Maciej W. Rozycki [Fri, 14 Sep 2018 19:22:56 +0000 (20:22 +0100)]
PR ld/21375: MIPS: Fix non-zero run-time value for undefined weaks
We have an issue in the MIPS backend, with the handling of undefined
hidden and internal weak symbols. References to such symbols are
supposed to resolve to 0 according to the ELF gABI[1]:
"Unresolved weak symbols have a zero value."
and the 64-bit MIPS psABI[2]:
"If a symbol with one of these [hidden or internal] attributes has no
definition within the executable/DSO being linked, then it must be
resolved to allocated space if common, resolved to zero if weak, or an
error reported otherwise."
however if a GOT relocation is used, then a local GOT entry is created
and used to satisfy the reference. Such an entry is then (in DSO and
PIE binaries) subject to the usual load-time relocation, which means a
non-zero value will be returned if the base address is non-zero. This
will defeat the usual run-time sequence like:
void a (void) __attribute__ ((visibility ("hidden"), weak));
void
x (void)
{
if (a)
a ();
}
This can be reproduced with this simple code:
$ cat libtest.c
extern int a __attribute__ ((visibility ("hidden"), weak));
int *
x (void)
{
return &a;
}
$ cat test.c
int *x (void);
int
main (void)
{
printf ("a: %p\n", x ());
return 0;
}
$ gcc -shared -fPIC -o libtest.so libtest.c
$ gcc -o test test.c -Wl,-rpath,$(pwd) libtest.so
$ ./test
a: 0x77184000
$
The usual approach targets take is making all the steps required to
assign a GOT entry for the symbol referred, and then leave its contents
at zero with no dynamic relocation attached, therefore ensuring that the
value does not change at load time. However this is not going to work
with the implicitly relocated GOT the MIPS psABI specifies[3]:
"The dynamic linker relocates the global offset table by first adding
the difference between the base where the shared object is loaded and
the value of the dynamic tag DT_MIPS_BASE_ADDRESS to all local global
offset table entries."
and we cannot therefore use the local GOT part.
And we cannot offhand use the global part either, as the symbol would
then have to be exported and possibly wrongly preempt symbols in other
modules involved in the dynamic load, because as per the ELF gABI[1] we
are not allowed to enter a hidden or internal symbol into the dynamic
symbol table (and then use its associated GOT entry):
"A hidden symbol contained in a relocatable object must be either
removed or converted to STB_LOCAL binding by the link-editor when the
relocatable object is included in an executable file or shared object."
and:
"An internal symbol contained in a relocatable object must be either
removed or converted to STB_LOCAL binding by the link-editor when the
relocatable object is included in an executable file or shared object."
So we have to choose something else.
Our choice is further limited by the need for the reference associated
with the GOT relocation to stay within the signed 16-bit limit from the
GOT pointer base register, while being compliant with the ELF gABI and
the MIPS psABI. However as Alan Modra has observed[4] one possibility
is to edit (relax) the code such that the GOT reference is removed
altogether.
Based on these observations then modify MIPS BFD linker backend code to:
1. Interpret code associated with GOT relocations and relax the usual LW
or LD instructions into a corresponding immediate load operation that
places the value of 0 in the intended register, while leaving the GOT
entry allocated and initialized as usually.
2. Leave any other instructions associated with GOT relocations in place
and instead redirect the reference to a global GOT entry associated
with a special `__gnu_absolute_zero' symbol created for this purpose,
whose value is 0, SHN_ABS section marks it absolute, binding is
global and export class protected, ensuring that the locally provided
value is always used at load time, and that the value is not
relocated by the dynamic loader.
3. Adjust any high-part GOT relocation used, typically associated with
a LUI instruction, accordingly, so that run-time consistency is
maintained, either by resolving to the original entry if the
instruction associated with the corresponding low-part GOT relocation
has been relaxed to an immediate load (in which case the value loaded
with LUI will be overwritten), or by also redirecting the reference
to `__gnu_absolute_zero' to complete the GOT access sequence if that
symbol has been used.
4. Add a target `elf_backend_hide_symbol' hook, for the three MIPS ABIs,
which prevents the `__gnu_absolute_zero' symbol from being forced
local, to ensure that the redirection works and the symbol remains
global/protected with existing linker scripts unchanged.
5. Observing the issue with handling SHN_ABS symbols in the GNU dynamic
loader, covered by glibc PR 19818, set the EI_ABIVERSION field in the
ELF file header produced to 4 (ABI_ABSOLUTE) if `__gnu_absolute_zero'
symbol has been produced and the target configured indicates the GNU
operating system, so that broken versions of the GNU dynamic loader
gracefully reject the file in loading rather than going astray. Keep
EI_ABIVERSION at the original value for other operating systems or if
no `__gnu_absolute_zero' symbol has been made.
The name of the special `__gnu_absolute_zero' has no meaning other than
how a human reader can interpret it, as it is ignored in dynamic loading
in the handling of the scenarios concerned. This is because the symbol
resolves locally, and it's only the symbol's attributes that matter so
that the associated GOT entry remains unchanged at load time.
Therefore the name is somewhat arbitrary, observing however the need to
use the name space reserved for the system so that it does not conflict
with a possible user symbol, and hence the leading underscore, and also
the `gnu' infix to denote a GNU feature. Other implementations wishing
to address the problem in a similar way may choose a different name and
have the solution still work, possibly with a mixture of modules used in
a dynamic having symbols of different names provided, which will however
not interact with each other due to the protected export class.
The symbol can be referred explicitly, however the name is an internal
implementation detail rather than a part of the ABI, and therefore no
specific semantics is guaranteed.
One limitation of this change is that if `__gnu_absolute_zero' has been
already defined, then we do not wipe the old definition and all kinds of
odd behavior can result. This is however like with other symbols we
internally define, such as `_GLOBAL_OFFSET_TABLE_' or `__rld_map', and
therefore left as a possible future enhancement.
As an optimization the relaxation of LW and LD instructions to a load of
immediate zero is always made, even SVR4 PIC code for code that will end
up in a regular (non-PIE) executable, because there is a cache advantage
with the avoidance of a load from the GOT, even if it is otherwise
guaranteed to remain zero. It does not reliably happen though, due to a
symbol exportation issue affecting executables, covered by PR ld/21805.
One existing test case needs to be updated, as it triggers relaxation
introduced with this change and consequently linker output does not
match expectations anymore. As we want to keep the original issue
covered with the test case modify it then to use the LWL instruction in
place of LW, and adjust the output expected accordingly.
References:
[1] "System V Application Binary Interface - DRAFT - 19 October 2010",
The SCO Group, Section "Symbol Table",
<http://www.sco.com/developers/gabi/2012-12-31/ch4.symtab.html>
[2] "64-bit ELF Object File Specification, Draft Version 2.5", MIPS
Technologies / Silicon Graphics Computer Systems, Order Number
007-4658-001, Section 2.5 "Symbol Table", p. 22,
<http://techpubs.sgi.com/library/manuals/4000/007-4658-001/pdf/007-4658-001.pdf>
[3] "SYSTEM V APPLICATION BINARY INTERFACE, MIPS RISC Processor
Supplement, 3rd Edition", Section "Global Offset Table", p. 5-10,
<http://www.linux-mips.org/pub/linux/mips/doc/ABI/mipsabi.pdf>
[4] "Undo dynamic symbol state after regular object sym type mismatch",
<https://sourceware.org/ml/binutils/2017-07/msg00265.html>
bfd/
PR ld/21375
* elfxx-mips.h (_bfd_mips_elf_hide_symbol): New prototype.
(_bfd_mips_elf_linker_flags): Update prototype.
* elf32-mips.c (elf_backend_hide_symbol): New macro.
* elf64-mips.c (elf_backend_hide_symbol): Likewise.
* elfn32-mips.c (elf_backend_hide_symbol): Likewise.
* elfxx-mips.c (mips_elf_link_hash_table): Add
`use_absolute_zero' and `gnu_target' members.
(mips_elf_record_global_got_symbol): Call
`_bfd_mips_elf_hide_symbol' rather than
`_bfd_elf_link_hash_hide_symbol'.
(mips_use_local_got_p): Return FALSE if the symbol is absolute.
(mips_elf_obtain_contents): Reorder function.
(mips_elf_nullify_got_load): New function.
(mips_elf_calculate_relocation): Add `contents' parameter.
Nullify GOT loads or if it is not possible, then redirect GOT
relocations to the `__gnu_absolute_zero' symbol, for references
that are supposed to resolve to zero.
(mips_elf_define_absolute_zero): New function.
(_bfd_mips_elf_check_relocs): Prepare for arrangements made in
`mips_elf_calculate_relocation' for references made via the GOT
that are supposed to resolve to zero.
(_bfd_mips_elf_hide_symbol): New function.
(_bfd_mips_elf_linker_flags): Add the `gnu_target' parameter,
set the `gnu_target' member of the MIPS hash table.
(MIPS_LIBC_ABI_ABSOLUTE): New enumeration constant.
(_bfd_mips_post_process_headers): Use it.
ld/
PR ld/21375
* emultempl/mipself.em: Set `gnu_target' according to ${target}.
(mips_create_output_section_statements): Update call to
`_bfd_mips_elf_linker_flags'.
* testsuite/ld-mips-elf/pr21334.s: Use LWL rather than LW.
* testsuite/ld-mips-elf/pr21334.dd: Update accordingly.
Maciej W. Rozycki [Fri, 14 Sep 2018 19:22:56 +0000 (20:22 +0100)]
MIPS/BFD: Factor out relocated field storing
Move code used to store the contents of a relocated field in output into
a separate function, `mips_elf_store_contents', complementing existing
`mips_elf_obtain_contents'.
bfd/
* elfxx-mips.c (mips_elf_store_contents): New function...
(mips_elf_perform_relocation): ... factored out from here.
Maciej W. Rozycki [Fri, 14 Sep 2018 19:22:56 +0000 (20:22 +0100)]
LD: Always make a SEGMENT_START expression section-relative
Fix an issue with the SEGMENT_START builtin function where its result is
absolute when taken from the default supplied, and section-relative when
taken from a `-T' command-line override. This is against documentation,
inconsistent and unexpected, and with PIE executables gives an incorrect
result with the `__executable_start' symbol.
Make the result of SEGMENT_START always section-relative then.
ld/
* ldexp.c (fold_binary): Always make the result of SEGMENT_START
section-relative.
* testsuite/ld-scripts/segment-start.d: New test.
* testsuite/ld-scripts/segment-start.ld: New test linker script.
* testsuite/ld-scripts/segment-start.s: New test source.
* testsuite/ld-scripts/script.exp: Run the new test.
Maciej W. Rozycki [Fri, 14 Sep 2018 19:22:56 +0000 (20:22 +0100)]
LD: Avoid a division by zero page size with SEGMENT_START handling
Avoid a division by zero and thus a linker crash in SEGMENT_START script
builtin function handling, by not checking the value supplied with a
`-T' command-line override against the maximum page size if that has not
been set.
ld/
* ldexp.c (fold_binary): Check that `config.maxpagesize' is
non-zero before using it as a divisor.
H.J. Lu [Fri, 14 Sep 2018 19:21:08 +0000 (12:21 -0700)]
x86: Check non-WIG EVEX instruction encoding with -mevexwig=1
Verify that -mevexwig=1 has no impact on non-WIG EVEX instruction encoding.
PR gas/23642
* testsuite/gas/i386/evex-wig2.d: New file.
* testsuite/gas/i386/evex-wig2.s: Likewise.
* testsuite/gas/i386/x86-64-evex-wig2.d: Likewise.
* testsuite/gas/i386/x86-64-evex-wig2.s: Likewise.
* testsuite/gas/i386/i386.exp: Run evex-wig2 and
x86-64-evex-wig2.
H.J. Lu [Fri, 14 Sep 2018 19:19:58 +0000 (12:19 -0700)]
x86: Support VEX/EVEX WIG encoding
Add VEXWIG, defined as 3, to indicate that the VEX.W/EVEX.W bit is
ignored by such VEX/EVEX instructions, aka WIG instructions. Set
VexW=3 on VEX/EVEX WIG instructions. Update assembler to check
VEXWIG when setting the VEX.W bit.
gas/
PR gas/23642
* config/tc-i386.c (build_vex_prefix): Check VEXWIG when setting
the VEX.W bit.
(build_evex_prefix): Check VEXWIG when setting the EVEX.W bit.
opcodes/
PR gas/23642
* i386-opc.h (VEXWIG): New.
* i386-opc.tbl: Set VexW=3 on VEX/EVEX WIG instructions.
* i386-tbl.h: Regenerated.
H.J. Lu [Fri, 14 Sep 2018 18:25:01 +0000 (11:25 -0700)]
x86: Handle unsupported static rounding in vcvt[u]si2sd in 32-bit mode
Update x86 disassembler to handle the unsupported static rounding in
vcvt[u]si2sd in 32-bit mode.
gas/
PR binutils/23655
* testsuite/gas/i386/evex.d: Updated.
opcodes/
PR binutils/23655
* i386-dis-evex.h: Replace EXxEVexR with EXxEVexR64 for
vcvtsi2sd%LQ and vcvtusi2sd%LQ.
* i386-dis.c (EXxEVexR64): New.
(evex_rounding_64_mode): Likewise.
(OP_Rounding): Handle evex_rounding_64_mode.
H.J. Lu [Fri, 14 Sep 2018 17:49:43 +0000 (10:49 -0700)]
x86: Properly decode EVEX.W in vcvt[u]si2s[sd] in 32-bit mode
Update x86 disassembler to ignore the EVEX.W bit in EVEX vcvt[u]si2s[sd]
instructions in 32-bit mode.
gas/
PR binutils/23655
* testsuite/gas/i386/evex.d: New file.
* testsuite/gas/i386/evex.s: Likewise.
* testsuite/gas/i386/i386.exp: Run evex.
opcodes/
PR binutils/23655
* i386-dis-evex.h (evex_table): Replace Eq with Edqa for
vcvtsi2ss%LQ, vcvtsi2sd%LQ, vcvtusi2ss%LQ and vcvtusi2sd%LQ.
* i386-dis.c (Edqa): New.
(dqa_mode): Likewise.
(intel_operand_size): Handle dqa_mode as m_mode.
(OP_E_register): Handle dqa_mode as dq_mode.
(OP_E_memory): Set shift for dqa_mode based on address_mode.
H.J. Lu [Fri, 14 Sep 2018 13:51:29 +0000 (06:51 -0700)]
i386: Reformat OP_E_memory
* i386-dis.c (OP_E_memory): Reformat.
Tom Tromey [Fri, 14 Sep 2018 12:57:05 +0000 (06:57 -0600)]
Remove an unnecessary block in call_function_by_hand_dummy
I noticed that call_function_by_hand_dummy has a block that only
exists to declare a variable, like:
{
int i;
for (i = ...0)
...
}
This patch removes the unnecessary and the extra indentation by moving
the declaration into the "for".
gdb/ChangeLog
2018-09-14 Tom Tromey <tom@tromey.com>
* infcall.c (call_function_by_hand_dummy): Remove unnecessary
block.
Lifang Xia [Fri, 14 Sep 2018 13:02:51 +0000 (21:02 +0800)]
csky: Support PC relative diff relocation
Define DIFF_EXPR_OK to Support PC relative diff relocation,
and add CKCORE_PCREL32 relocation process
bfd/
* elf32-csky.c (csky_elf_howto_table): Fill special_function of
R_CKCORE_PCREL32.
(csky_elf_relocate_section): Add R_CKCORE_PCREL32 process.
gas/
* config/tc-csky.c (md_apply_fix): Transmit
BFD_RELOC_32_PCREL to BFD_RELOC_CKCORE_PCREL32.
(tc_gen_reloc): Trasmit BFD_RELOC_CKCORE_ADDR32 to
BFD_RELOC_CKCORE_PCREL32 while pc-relative.
* config/tc-csky.h (DIFF_EXPR_OK): Define to enable PC relative
diff relocs.
Tom Tromey [Thu, 13 Sep 2018 22:33:27 +0000 (16:33 -0600)]
Make variable in get_startup_shell non-static
I noticed that a variable in get_startup_shell is "static". However,
I couldn't see any reason it ought to be, so this removes the
"static".
gdb/ChangeLog
2018-09-14 Tom Tromey <tom@tromey.com>
* nat/fork-inferior.c (get_startup_shell): Remove "static".
Alan Modra [Fri, 14 Sep 2018 09:50:06 +0000 (19:20 +0930)]
PR23633 testcase fix
PR binutils/23633
* testsuite/binutils-all/pr23633.d: Don't fail when assembler
generates sections other than .text.
Alan Modra [Tue, 11 Sep 2018 14:20:15 +0000 (23:50 +0930)]
PR23425, unresolved symbol diagnostic
dwarf2.c code reasonably assumes that debug info is local to a file,
an assumption now violated by gcc, resulting in "DWARF error: invalid
abstract instance DIE ref" or wrong details when attempting to print
linker error messages with file, function and line reported.
This is because find_abstract_instance is only prepared to handle
DW_FORM_ref_addr when the .debug_info section referenced is in the
current file. When that isn't the case, relocations to access another
file's .debug_info will typically be against a symbol defined at the
start of that .debug_info section, plus an addend. Since the dwarf2.c
code only considers the current file's debug info, that symbol will be
undefined, resolving to zero. In effect the ref_addr will wrongly
resolve to the current file's .debug_info.
This patch avoids the problem by treating relocations in debug
sections against undefined symbols in a similar manner to the way
relocations against symbols defined in discarded sections are
resolved. They result in a zero value (except in .debug_ranges)
regardless of the addend.
PR 23425
* reloc.c (bfd_generic_get_relocated_section_contents): Zero reloc
fields in debug sections when reloc is against an undefined symbol
and called from bfd_simple_get_relocated_section_contents or
similar.
* dwarf2.c (find_abstract_instance): Return true for zero offset
DW_FORM_ref_addr without returning values.
Jan Beulich [Fri, 14 Sep 2018 09:21:15 +0000 (11:21 +0200)]
x86: fold CRC32 templates
Just like other insns having byte and word forms, these can also make
use of the W modifier, which at the same time allows simplifying some
other code a little bit.
Alan Hayward [Wed, 5 Sep 2018 09:11:32 +0000 (10:11 +0100)]
Testsuite: Add gdb_simple_compile
Simplfy gdb.exp by adding a function that will attempt to
compile a piece of code, then clean up, leaving the created
object.
gdb/testsuite
* lib/gdb.exp (gdb_simple_compile): Add proc.
(is_elf_target): Use gdb_simple_compile.
(skip_altivec_tests): Likewise.
(skip_vsx_tests): Likewise.
(skip_tsx_tests): Likewise.
(skip_btrace_tests): Likewise.
(skip_btrace_pt_tests): Likewise.
(gdb_can_simple_compile): Likewise.
(gdb_has_argv0): Likewise.
(gdb_target_symbol_prefix): Likewise.
(target_supports_scheduler_locking): Likewise.
GDB Administrator [Fri, 14 Sep 2018 00:00:32 +0000 (00:00 +0000)]
Automatic date update in version.in
Tom Tromey [Thu, 13 Sep 2018 22:30:48 +0000 (16:30 -0600)]
Generate more tags in gdb/testsuite/Makefile
I noticed that the TAGS target in gdb/testsuite/Makefile does not pick
up Tcl procs defined with proc_with_prefix or gdb_caching_proc. This
patch fixes this by updating the regexp.
Tested in Emacs.
gdb/testsuite/ChangeLog
2018-09-13 Tom Tromey <tom@tromey.com>
* Makefile.in (TAGS): Recognize proc_with_prefix and
gdb_caching_proc.
Tom Tromey [Thu, 13 Sep 2018 22:23:52 +0000 (16:23 -0600)]
Make infpy_thread_from_thread_handle static
I noticed that infpy_thread_from_thread_handle is not static, but
should be. This patch changes it.
gdb/ChangeLog
2018-09-13 Tom Tromey <tom@tromey.com>
* python/py-inferior.c (infpy_thread_from_thread_handle): Now
static.
Tom Tromey [Thu, 30 Aug 2018 05:05:54 +0000 (23:05 -0600)]
Remove cleanup from try_open_exec_file
This removes a cleanup from try_open_exec_file, using std::string to
manage the storage instead.
gdb/ChangeLog
2018-09-13 Tom Tromey <tom@tromey.com>
* exec.c (try_open_exec_file): Use std::string.
Tom Tromey [Thu, 30 Aug 2018 05:03:09 +0000 (23:03 -0600)]
Return std::string from gdb_bfd_errmsg
This changes gdb_bfd_errmsg to return a std::string, removing a
cleanup. This approach may be slightly less efficient than the
previous code, but I don't believe this is very important in this
situation.
gdb/ChangeLog
2018-09-13 Tom Tromey <tom@tromey.com>
* utils.h (gdb_bfd_errmsg): Return std::string.
* exec.c (exec_file_attach): Update.
* compile/compile-object-load.c (compile_object_load): Update.
* utils.c (gdb_bfd_errmsg): Return std::string.
Tom Tromey [Thu, 30 Aug 2018 04:49:40 +0000 (22:49 -0600)]
Remove cleanup from procfs.c
This removes the last remaining cleanup from procfs.c, replacing it
with a unique_ptr specialization.
gdb/ChangeLog
2018-09-13 Tom Tromey <tom@tromey.com>
* procfs.c (struct procinfo_deleter): New.
(procinfo_up): New typedef.
(do_destroy_procinfo_cleanup): Remove.
(procfs_target::info_proc): Use procinfo_up. Remove cleanups.
Tom Tromey [Thu, 30 Aug 2018 04:42:57 +0000 (22:42 -0600)]
Remove cleanup from add_path
This removes a cleanup from add_path, replacing it with a use of
gdb::unique_xmalloc_ptr. Note that this declaration had to be hoisted
somewhat, to avoid inteference from the "goto"s in this function.
gdb/ChangeLog
2018-09-13 Tom Tromey <tom@tromey.com>
* source.c (add_path): Use gdb::unique_xmalloc_ptr.
Simon Marchi [Thu, 13 Sep 2018 19:41:32 +0000 (15:41 -0400)]
python: Fix erroneous doc about gdb.objfiles()
The code implementing gdb.objfiles() returns a list of objfiles for the
current program space (the program space of the selected inferior). The
documentation for the gdb.objfiles() Python method, however, states:
Return a sequence of all the objfiles current known to GDB.
That sounds wrong to me. I tried to phrase to be more precise.
gdb/doc/ChangeLog:
* python.texi (Objfiles In Python): Update gdb.objfiles() doc.
Simon Marchi [Thu, 13 Sep 2018 19:40:41 +0000 (15:40 -0400)]
python: Add Progspace.objfiles method
This patch adds an objfiles method to the Progspace object, which
returns a sequence of the objfiles associated to that program space. I
chose a method rather than a property for symmetry with gdb.objfiles().
gdb/ChangeLog:
* python/py-progspace.c (PSPY_REQUIRE_VALID): New macro.
(pspy_get_objfiles): New function.
(progspace_object_methods): New.
(pspace_object_type): Add tp_methods callback.
* python/python-internal.h (build_objfiles_list): New
declaration.
* python/python.c (build_objfiles_list): New function.
(gdbpy_objfiles): Implement using build_objfiles_list.
* NEWS: Mention the Progspace.objfiles method.
gdb/doc/ChangeLog:
* python.texi (Program Spaces In Python): Document the
Progspace.objfiles method.
(Objfiles In Python): Mention that gdb.objfiles() is identical
to gdb.selected_inferior().progspace.objfiles().
gdb/testsuite/ChangeLog:
* gdb.python/py-progspace.exp: Test the Progspace.objfiles
method.
Simon Marchi [Thu, 13 Sep 2018 19:39:26 +0000 (15:39 -0400)]
python: Add Inferior.progspace property
This patch adds a progspace property to the gdb.Inferior type, which
allows getting the gdb.Progspace object associated to that inferior.
In conjunction with the following patch, this will allow scripts iterate
on objfiles associated with a particular inferior.
gdb/ChangeLog:
* python/py-inferior.c (infpy_get_progspace): New function.
(inferior_object_getset): Add progspace property.
* NEWS: Mention the new property.
gdb/doc/ChangeLog:
* python.texi (Inferiors In Python): Document
Inferior.progspace.
(Program Spaces In Python): Document that
gdb.current_progspace() is the same as
gdb.selected_inferior().progspace.
gdb/testsuite/ChangeLog:
* gdb.python/py-inferior.exp: Add tests for Inferior.progspace
and a few other Inferior properties when the Inferior is no
longer valid.
Tom Tromey [Thu, 13 Sep 2018 16:56:34 +0000 (10:56 -0600)]
Make Rust error message mention the field name
I noticed a spot in rust-lang.c where the placeholder "foo" was used
instead of the actual field name. This patch fixes the bug.
gdb/ChangeLog
2018-09-13 Tom Tromey <tom@tromey.com>
PR rust/23650:
* rust-lang.c (rust_evaluate_subexp): Use field name, not "foo".
gdb/testsuite/ChangeLog
2018-09-13 Tom Tromey <tom@tromey.com>
PR rust/23650:
* gdb.rust/simple.exp: Add test for enum field access error.
Tom Tromey [Tue, 11 Sep 2018 21:28:04 +0000 (15:28 -0600)]
Fix crash with empty Rust enum
While testing my Rust compiler patch to fix the DWARF representation
of Rust enums (https://github.com/rust-lang/rust/pull/54004), I found
a gdb crash coming from one of the Rust test cases.
The bug here is that the new variant support in gdb does not handle
the case where there are no variants in the enum.
This patch fixes the problem in a straightforward way. Note that the
new tests are somewhat lax because I did not want to try to fully fix
this corner case for older compilers. If you think that's
unacceptable, let meknow.
Tested on x86-64 Fedora 28 using several versions of the Rust
compiler. I intend to push this to the 8.2 branch as well.
gdb/ChangeLog
2018-09-13 Tom Tromey <tom@tromey.com>
PR rust/23626:
* rust-lang.c (rust_enum_variant): Now static.
(rust_empty_enum_p): New function.
(rust_print_enum, rust_evaluate_subexp, rust_print_struct_def):
Handle empty enum.
gdb/testsuite/ChangeLog
2018-09-13 Tom Tromey <tom@tromey.com>
PR rust/23626:
* gdb.rust/simple.rs (EmptyEnum): New type.
(main): Use it.
* gdb.rust/simple.exp (test_one_slice): Add empty enum test.
Sergio Durigan Junior [Wed, 12 Sep 2018 05:14:31 +0000 (01:14 -0400)]
Add "contrib" to the list of GDB support dirs (on src-release.sh)
On commit:
commit
5a6996172e6294ea37054b1a9caa3a923a8fe399
Author: Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
Date: Mon Aug 6 16:05:16 2018 +0200
Update dg-extract-results.* from gcc
dg-extract-results.sh was moved from the "gdb/contrib/" directory to
the toplevel "contrib/" directory. However, src-release.sh was not
updated in order to include "contrib/" in the tarball release of GDB.
This makes it very inconvenient to run and analyze the GDB testsuite
results. This commit adds "contrib/" to the list of support
directories that are included in each GDB release.
ChangeLog:
2018-09-12 Sergio Durigan Junior <sergiodj@redhat.com>
* src-release.sh (GDB_SUPPORT_DIRS): Add "contrib".
H.J. Lu [Thu, 13 Sep 2018 16:09:00 +0000 (09:09 -0700)]
Add a testcase for PR binutils/23633
PR binutils/23633
* testsuite/binutils-all/objcopy.exp: Run pr23633.
* testsuite/binutils-all/pr23633.d: New file.
* testsuite/binutils-all/pr23633.list: Likewise.
* testsuite/binutils-all/pr23633.s: Likewise.
Simon Marchi [Thu, 13 Sep 2018 15:53:22 +0000 (11:53 -0400)]
python: Provide textual representation for Inferior and Objfile
Printing a GDB Python object is notoriously not helpful:
>>> print(gdb.selected_inferior())
<gdb.Inferior object at 0x7fea59aed198>
>>> print(gdb.objfiles())
[<gdb.Objfile object at 0x7fea59b57c90>]
This makes printing debug traces more difficult than it should be. This
patch provides some repr() implementation for these two types (more to
come if people agree with the idea, but I want to test the water first).
Here's the same example as above, but with this patch:
>>> print(gdb.selected_inferior())
<gdb.Inferior num=1>
>>> print(gdb.objfiles())
[<gdb.Objfile filename=/home/emaisin/build/binutils-gdb-gcc-git/gdb/test>]
I implemented repr rather than str, because when printing a list (or
another container I suppose), Python calls the repr method of the
elements. This is useful when printing a list of inferiors or objfiles.
The print(gdb.objfiles()) above would not have worked if I had
implemented str.
I found this post useful to understand the difference between repr and
str:
https://stackoverflow.com/questions/
1436703/difference-between-str-and-repr
gdb/ChangeLog:
* python/py-inferior.c (infpy_repr): New.
(inferior_object_type): Register infpy_repr.
* python/py-objfile.c (objfpy_repr): New.
(objfile_object_type): Register objfpy_repr.
gdb/testsuite/ChangeLog:
* gdb.python/py-inferior.exp: Test repr() of gdb.Inferior.
* gdb.python/py-objfile.exp: Test repr() of gdb.Objfile.
* gdb.python/py-symtab.exp: Update test printing an objfile.
gdb/doc/ChangeLog:
* python.texi (Basic Python): Mention the string representation
of GDB Python objects.
Nick Clifton [Thu, 13 Sep 2018 15:14:36 +0000 (16:14 +0100)]
Fix a use-after-freed error introduced by previous attempt to fix a Coverity scan result.
PR 23633
* objcopy.c (add_specific_symbols): Do not free the buffer at the
end of the function.
H.J. Lu [Thu, 13 Sep 2018 14:38:45 +0000 (07:38 -0700)]
x86: Remove VexW=1 from WIG VEX movq and vmovq
Put back changes lost in commit
41d1ab6a6d96937fd0db04e53746f93f53687807.
H.J. Lu [Wed, 12 Sep 2018 22:12:59 +0000 (15:12 -0700)]
i386: Update VexW field for VEX instructions
1. Mark VEX.W0 VEX instructions with VexW=1.
2. Mark VEX.W1 VEX instructions with VexW=2.
3. Remove VexW=1 from WIG VEX instructions.
* i386-opc.tbl: Add VexW=1 to VEX.W0 VEX movd, cvtsi2ss, cvtsi2sd,
pextrd, pinsrd, vcvtsi2sd, vcvtsi2ss, vmovd, vpextrd and vpinsrd.
Add VexW=2 to VEX.W1 VEX movd, movq, pextrq, pinsrq, vmod, vmovq,
vpextrq and vpinsrq. Remove VexW=1 from WIG VEX movq and vmovq.
* i386-tbl.h: Regenerated.
H.J. Lu [Thu, 13 Sep 2018 13:12:31 +0000 (06:12 -0700)]
x86: Swap destination/source to encode VEX only if possible
When encoding VEX, we can swap destination and source only if there are
more than 1 register operand.
* config/tc-i386.c (build_vex_prefix): Swap destination and
source only if there are more than 1 register operand.
Jan Beulich [Thu, 13 Sep 2018 09:26:06 +0000 (11:26 +0200)]
x86: drop bogus IgnoreSize from a few further insns
Jan Beulich [Thu, 13 Sep 2018 09:25:30 +0000 (11:25 +0200)]
x86: drop bogus IgnoreSize from AVX512_4* insns
Jan Beulich [Thu, 13 Sep 2018 09:24:53 +0000 (11:24 +0200)]
x86: drop bogus IgnoreSize from AVX512DQ insns
Jan Beulich [Thu, 13 Sep 2018 09:24:23 +0000 (11:24 +0200)]
x86: drop bogus IgnoreSize from AVX512BW insns
Jan Beulich [Thu, 13 Sep 2018 09:23:50 +0000 (11:23 +0200)]
x86: drop bogus IgnoreSize from AVX512VL insns
Jan Beulich [Thu, 13 Sep 2018 09:23:17 +0000 (11:23 +0200)]
x86: drop bogus IgnoreSize from AVX512ER insns
Jan Beulich [Thu, 13 Sep 2018 09:22:49 +0000 (11:22 +0200)]
x86: drop bogus IgnoreSize from AVX512F insns
Jan Beulich [Thu, 13 Sep 2018 09:22:03 +0000 (11:22 +0200)]
x86: drop bogus IgnoreSize from SHA insns
Jan Beulich [Thu, 13 Sep 2018 09:21:36 +0000 (11:21 +0200)]
x86: drop bogus IgnoreSize from XOP and SSE4a insns
Jan Beulich [Thu, 13 Sep 2018 09:19:21 +0000 (11:19 +0200)]
x86: drop bogus IgnoreSize from AVX2 insns
Jan Beulich [Thu, 13 Sep 2018 09:18:52 +0000 (11:18 +0200)]
x86: drop bogus IgnoreSize from AVX insns
Jan Beulich [Thu, 13 Sep 2018 09:16:49 +0000 (11:16 +0200)]
x86: drop bogus IgnoreSize from GNFI insns
Jan Beulich [Thu, 13 Sep 2018 09:16:19 +0000 (11:16 +0200)]
x86: drop bogus IgnoreSize from PCLMUL/VPCLMUL insns
Jan Beulich [Thu, 13 Sep 2018 09:15:38 +0000 (11:15 +0200)]
x86: drop bogus IgnoreSize from AES/VAES insns
Jan Beulich [Thu, 13 Sep 2018 09:15:01 +0000 (11:15 +0200)]
x86: drop bogus IgnoreSize from SSE4.2 insns
Jan Beulich [Thu, 13 Sep 2018 09:14:32 +0000 (11:14 +0200)]
x86: drop bogus IgnoreSize from SSE4.1 insns
Jan Beulich [Thu, 13 Sep 2018 09:12:51 +0000 (11:12 +0200)]
x86: drop bogus IgnoreSize from SSSE3 insns
Jan Beulich [Thu, 13 Sep 2018 09:12:23 +0000 (11:12 +0200)]
x86: drop bogus IgnoreSize from SSE3 insns
Jan Beulich [Thu, 13 Sep 2018 09:11:55 +0000 (11:11 +0200)]
x86: drop bogus IgnoreSize from SSE2 insns
Jan Beulich [Thu, 13 Sep 2018 09:11:26 +0000 (11:11 +0200)]
x86: drop bogus IgnoreSize from SSE insns
Jan Beulich [Thu, 13 Sep 2018 09:08:37 +0000 (11:08 +0200)]
x86: drop unnecessary {,No}Rex64
Jan Beulich [Thu, 13 Sep 2018 09:07:55 +0000 (11:07 +0200)]
x86: also allow D on 3-operand insns
For now this is just for VMOVS{D,S}.
Jan Beulich [Thu, 13 Sep 2018 09:07:07 +0000 (11:07 +0200)]
x86: use D attribute also for SIMD templates
Various moves come in load and store forms, and just like on the GPR
and FPU sides there would better be only one pattern. In some cases this
is not feasible because the opcodes are too different, but quite a few
cases follow a similar standard scheme. Introduce Opcode_SIMD_FloatD and
Opcode_SIMD_IntD, generalize handling in operand_size_match() (reverse
operand handling there simply needs to match "straight" operand one),
and fix a long standing, but so far only latent bug with when to zap
found_reverse_match.
Also once again drop IgnoreSize where pointlessly applied to templates
touched anyway as well as *word when redundant with Reg*.
Jan Beulich [Thu, 13 Sep 2018 09:06:07 +0000 (11:06 +0200)]
x86: fold ILP32 output of "opts" tests
The output is identical to that of the LP64 tests. No need to fully
spell this out twice.
Jan Beulich [Thu, 13 Sep 2018 09:05:27 +0000 (11:05 +0200)]
x86: improve operand reversal
In quite a few cases the .s suffix or {load} / {store} prefixes did not
work as intended, or produced errors when they're supposed to be ignored
when it is not possible to carry out the request.
The change here re-purposes(?) the .s suffix to no longer mean "store"
(if that's what 's' did stand for), since the forms used in the base
templates are not consistently loads (and we unlikely want to change
that). The pseudo prefixes will now fulfill what their names say, i.e.
{load} now only ever produces a load form encoding (if available) while
{store} only ever produces a store form one (again if available). This
requires minimal test suite adjustments, while the majority of the
changes there are simply additions.
Jan Beulich [Thu, 13 Sep 2018 09:04:38 +0000 (11:04 +0200)]
x86: add code comment on deprecated status of pseudo-suffixes
Jan Beulich [Thu, 13 Sep 2018 09:03:35 +0000 (11:03 +0200)]
x86-64: bndmk, bndldx, and bndstx don't allow RIP-relative addressing
Nick Clifton [Thu, 13 Sep 2018 08:34:53 +0000 (09:34 +0100)]
Fix the use by the RL78 assembler of an uninitialised field in the expresion structure.
* dwarf2dbg.c (generic_dwarf2_emit_offset): Use memset to
initialise expression structure.
(set_or_check_view): Likewise.
(out_set_addr): Likewise.
(emit_fixed_inc_line_addr): Likewise.
(relax_inc_line_addr): Likewise.
(out_debug_line): Likewise.
(out_debug_ranges): Likewise.
(out_debug_aranges): Likewise.
(out_debug_info): Likewise.
GDB Administrator [Thu, 13 Sep 2018 00:00:26 +0000 (00:00 +0000)]
Automatic date update in version.in
John Baldwin [Wed, 12 Sep 2018 17:43:13 +0000 (17:43 +0000)]
Remove unused "tmp" variable.
gdb/ChangeLog:
* fbsd-nat.c (fbsd_nat_target::info_proc): Remove unused variable.
John Baldwin [Tue, 11 Sep 2018 17:53:37 +0000 (17:53 +0000)]
Fix a typo in a comment.
gdb/ChangeLog:
* aarch64-fbsd-tdep.h (AARCH64_FBSD_SIZEOF_GREGSET): Fix comment
typo.
Simon Marchi [Wed, 12 Sep 2018 22:27:57 +0000 (18:27 -0400)]
python: Add tests for trying to use an invalid Inferior object
This patch adds tests for trying to use property or methods on a
gdb.Inferior object that represents an inferior that does not exist
anymore. We expect an exception to be thrown.
gdb/testsuite/ChangeLog:
* gdb.python/py-inferior.exp: Test using an invalid gdb.Inferior
object.
Sergio Durigan Junior [Wed, 12 Sep 2018 17:16:02 +0000 (13:16 -0400)]
Move 'is_regular_file' from common-utils.c to filestuff.c
There is no reason for 'is_regular_file' to be in common-utils.c; it
belongs to 'filestuff.c'. This commit moves the function definition
and its prototype to the appropriate files.
The motivation behind this move is a failure that happens on certain
cross-compilation environments when compiling the IPA library, due to
the way gnulib probes the need for a 'stat' call replacement. Because
configure checks when cross-compiling are more limited, gnulib decides
that it needs to substitute the 'stat' calls its own 'rpl_stat';
however, the IPA library doesn't link with gnulib, which leads to an
error when compiling 'common-utils.c':
...
/opt/x86-core2--musl--bleeding-edge-2018.09-1/bin/i686-buildroot-linux-musl-g++ -shared -fPIC -Wl,--soname=libinproctrace.so -Wl,--no-undefined -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -Os -I. -I. -I./../common -I./../regformats -I./.. -I./../../include -I./../gnulib/import -Ibuild-gnulib-gdbserver/import -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -Wall -Wpointer-arith -Wno-unused -Wunused-value -Wunused-function -Wno-switch -Wno-char-subscripts -Wempty-body -Wunused-but-set-parameter -Wunused-but-set-variable -Wno-sign-compare -Wno-narrowing -Wno-error=maybe-uninitialized -DGDBSERVER \
-Wl,--dynamic-list=./proc-service.list -o libinproctrace.so ax-ipa.o common-utils-ipa.o errors-ipa.o format-ipa.o print-utils-ipa.o regcache-ipa.o remote-utils-ipa.o rsp-low-ipa.o tdesc-ipa.o tracepoint-ipa.o utils-ipa.o vec-ipa.o linux-i386-ipa.o linux-x86-tdesc-ipa.o arch/i386-ipa.o -ldl -pthread
/opt/x86-core2--musl--bleeding-edge-2018.09-1/lib/gcc/i686-buildroot-linux-musl/8.2.0/../../../../i686-buildroot-linux-musl/bin/ld: common-utils-ipa.o: in function `is_regular_file(char const*, int*)':
common-utils.c:(.text+0x695): undefined reference to `rpl_stat'
collect2: error: ld returned 1 exit status
Makefile:413: recipe for target 'libinproctrace.so' failed
make[1]: *** [libinproctrace.so] Error 1
...
More details can also be found at:
https://sourceware.org/ml/gdb-patches/2018-09/msg00304.html
The most simple fix for this problem is to move 'is_regular_file' to
'filestuff.c', which is not used by IPA. This ends up making the
files more logically organized as well, since 'is_regular_file' is a
file operation.
No regressions found.
gdb/ChangeLog:
2018-09-12 Sergio Durigan Junior <sergiodj@redhat.com>
* common/common-utils.c: Don't include '<sys/stat.h>'.
(is_regular_file): Move to...
* common/filestuff.c (is_regular_file): ... here.
* common/common-utils.h (is_regular_file): Move to...
* common/filestuff.h (is_regular_file): ... here.
Simon Marchi [Wed, 12 Sep 2018 16:24:41 +0000 (12:24 -0400)]
Add debug output about skipping files and functions
While trying to create skips for libstdc++, I found myself debugging GDB
quite a bit, mostly to find out what the exact function name to match
is. I thought it would make sense to have this information as debug
output.
This patch adds "set debug skip on|off".
gdb/ChangeLog:
* skip.c (debug_skip): New variable.
(skiplist_entry::do_skip_file_p): Add debug output.
(skiplist_entry::do_skip_gfile_p): Likewise.
(skiplist_entry::skip_function_p): Likewise.
(_initialize_step_skip): Create debug command.
* NEWS: Mention set/show debug skip.
gdb/doc/ChangeLog:
* gdb.texinfo (Skipping Over Functions and Files): Document
set/show debug skip.
Alan Hayward [Wed, 12 Sep 2018 10:52:09 +0000 (11:52 +0100)]
Testsuite: Add gdb_can_simple_compile
Simplfy gdb.exp by adding a function that will attempt to
compile a piece of code, then clean up.
gdb/testsuite
* lib/gdb.exp (gdb_can_simple_compile): Add proc.
(support_complex_tests): Use gdb_can_simple_compile.
(is_ilp32_target): Likewise.
(is_lp64_target): Likewise.
(is_64_target): Likewise.
(is_amd64_regs_target): Likewise.
(is_aarch32_target): Likewise.
(gdb_int128_helper): Likewise.
GDB Administrator [Wed, 12 Sep 2018 00:00:24 +0000 (00:00 +0000)]
Automatic date update in version.in
Xavier Roirand [Sat, 8 Sep 2018 14:51:21 +0000 (16:51 +0200)]
Darwin: set startup-with-shell to off on Sierra and later.
On Mac OS X Sierra and later, the shell is not allowed to be
debug so add a check and disable startup with shell in that
case. This disabling is done temporary before forking
inferior and restored after the fork.
gdb/ChangeLog:
* darwin-nat.c (should_disable_startup_with_shell):
New function.
(darwin_nat_target::create_inferior): Add call.
Change-Id: Ie4d9090f65fdf2e83ecf7a0f9d0647fb1c27cdcc
Xavier Roirand [Sun, 9 Sep 2018 13:13:58 +0000 (15:13 +0200)]
Darwin: fix SIGTRAP when debugging
Debugging a program under Darwin does not work:
(gdb) start
Temporary breakpoint 1 at 0x100000fb4: file /tmp/helloworld.c, line 1.
Starting program: /private/tmp/helloworld
[New Thread 0x2903 of process 60326]
During startup program terminated with signal SIGTRAP, Trace/breakpoint
trap.
Field signaled from darwin_thread_info is not initialized thus signal
sent to the debuggee is considered as not sent by GDB whereas it should.
This patch fixes this problem and also updates (change type and/or
initialize) other fields in the same structure at the same time.
gdb/ChangeLog:
* darwin-nat.h (struct darwin_thread_info) <gdb_port,
inf_port, msg_state>: Initialize.
(struct darwin_thread_info) <signaled, single_step>: Change
type and initialize.
(struct darwin_thread_info) <event>: Initialize.
Change-Id: I0fe2a6985df9d0dfcc8a2a258a3ef70cfa19b403
Jan Kratochvil [Tue, 11 Sep 2018 10:59:52 +0000 (12:59 +0200)]
[testsuite] Fix dg-extract-results.sh path
There was a typo in patch:
commit
5a6996172e6294ea37054b1a9caa3a923a8fe399
Author: Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
Date: Mon Aug 6 16:05:16 2018 +0200
Update dg-extract-results.* from gcc
gdb/testsuite/ChangeLog
2018-09-11 Jan Kratochvil <jan.kratochvil@redhat.com>
* Makefile.in (check-parallel-racy): Fix dg-extract-results.sh path.
GDB Administrator [Tue, 11 Sep 2018 00:00:52 +0000 (00:00 +0000)]
Automatic date update in version.in
Sergio Durigan Junior [Mon, 10 Sep 2018 16:52:04 +0000 (12:52 -0400)]
Fix PR gdb/23558: Use system's 'getcwd' when cross-compiling GDB
This is a backport of a gnulib fix for the following bug:
https://sourceware.org/bugzilla/show_bug.cgi?id=23558
The problem reported there is about the replacement of 'getcwd' when
cross-compiling GDB. With our current gnulib copy, the mechanism for
deciding whether to use the system's 'getcwd' or gnulib's version is
too simplistic and pessimistic, so when cross-compiling we always end
up using gnulib's version, which has a limitation: it cannot handle
the situation when the parent directory doesn't have read permissions.
The solution is to backport the following gnulib commit:
commit
a96d2e67052c879b1bcc5bc461722beac75fc372
Author: Bruno Haible <bruno@clisp.org>
Date: Thu Aug 23 21:13:19 2018 +0200
getcwd: Add cross-compilation guesses.
gdb/ChangeLog:
2018-09-10 Sergio Durigan Junior <sergiodj@redhat.com>
PR gdb/23555
PR gdb/23558
* gnulib/import/m4/getcwd-path-max.m4: Add cross-compilation
guesses.
Sergio Durigan Junior [Mon, 10 Sep 2018 16:22:59 +0000 (12:22 -0400)]
Revert "Update gnulib to current upstream master"
This reverts commit
7a6dbc2fdb2323c35e981f93236f323e9d7c0b24 ("Update
gnulib to current upstream master"). It is needed because the gnulib
update caused problems with people using old GCC compilers (version
4.8, for example), which support C99 but don't default to using it.
Unfortunately this broke GDB for these users. A more detailed report
of what happened can be found at:
https://lists.gnu.org/archive/html/bug-gnulib/2018-08/msg00157.html
The reason for updating our gnulib copy was to fix PR gdb/23558.
Reverting this patch reintroduces the bug, so in order to fix it I
will submit a subsequent patch which cherry-picks the fix from gnulib.
gdb/ChangeLog:
2018-09-10 Sergio Durigan Junior <sergiodj@redhat.com>
Revert:
2018-08-29 Sergio Durigan Junior <sergiodj@redhat.com>
PR gdb/23555
PR gdb/23558
* gnulib/aclocal.m4: Regenerate.
* gnulib/config.in: Regenerate.
* gnulib/configure: Regenerate.
* gnulib/import/Makefile.am: Update.
* gnulib/import/Makefile.in: Update.
* gnulib/import/extra/snippet/_Noreturn.h: Rename to...
* gnulib/import/_Noreturn.h: ... this.
* gnulib/import/alloca.in.h: Update.
* gnulib/import/extra/snippet/arg-nonnull.h: Rename to...
* gnulib/import/arg-nonnull.h: ... this.
* gnulib/import/assure.h: Update.
* gnulib/import/at-func.c: Update.
* gnulib/import/basename-lgpl.c: Update.
* gnulib/import/extra/snippet/c++defs.h: Rename to...
* gnulib/import/c++defs.h: ... this.
* gnulib/import/canonicalize-lgpl.c: Update.
* gnulib/import/cdefs.h: Update.
* gnulib/import/chdir-long.c: Update.
* gnulib/import/chdir-long.h: Update.
* gnulib/import/cloexec.c: Update.
* gnulib/import/cloexec.h: Update.
* gnulib/import/close.c: Update.
* gnulib/import/closedir.c: Update.
* gnulib/import/config.charset: Update.
* gnulib/import/dirent-private.h: Update.
* gnulib/import/dirent.in.h: Update.
* gnulib/import/dirfd.c: Update.
* gnulib/import/dirname-lgpl.c: Update.
* gnulib/import/dirname.h: Update.
* gnulib/import/dosname.h: Update.
* gnulib/import/dup-safer-flag.c: Update.
* gnulib/import/dup-safer.c: Update.
* gnulib/import/dup.c: Update.
* gnulib/import/dup2.c: Update.
* gnulib/import/errno.in.h: Update.
* gnulib/import/error.c: Update.
* gnulib/import/error.h: Update.
* gnulib/import/exitfail.c: Update.
* gnulib/import/exitfail.h: Update.
* gnulib/import/extra/update-copyright: Update.
* gnulib/import/fchdir.c: Update.
* gnulib/import/fcntl.c: Update.
* gnulib/import/fcntl.in.h: Update.
* gnulib/import/fd-hook.c: Update.
* gnulib/import/fd-hook.h: Update.
* gnulib/import/fd-safer-flag.c: Update.
* gnulib/import/fd-safer.c: Update.
* gnulib/import/fdopendir.c: Update.
* gnulib/import/filename.h: Update.
* gnulib/import/filenamecat-lgpl.c: Update.
* gnulib/import/filenamecat.h: Update.
* gnulib/import/flexmember.h: Update.
* gnulib/import/float+.h: Update.
* gnulib/import/float.c: Update.
* gnulib/import/float.in.h: Update.
* gnulib/import/fnmatch.c: Update.
* gnulib/import/fnmatch.in.h: Update.
* gnulib/import/fnmatch_loop.c: Update.
* gnulib/import/fpucw.h: Update.
* gnulib/import/frexp.c: Update.
* gnulib/import/frexpl.c: Update.
* gnulib/import/fstat.c: Update.
* gnulib/import/fstatat.c: Update.
* gnulib/import/getcwd-lgpl.c: Update.
* gnulib/import/getcwd.c: Update.
* gnulib/import/getdtablesize.c: Update.
* gnulib/import/getlogin_r.c: Update.
* gnulib/import/getprogname.c: Update.
* gnulib/import/getprogname.h: Update.
* gnulib/import/gettext.h: Update.
* gnulib/import/gettimeofday.c: Update.
* gnulib/import/glob-libc.h: Update.
* gnulib/import/glob.c: Update.
* gnulib/import/glob.in.h: Update.
* gnulib/import/glob_internal.h: Update.
* gnulib/import/glob_pattern_p.c: Update.
* gnulib/import/globfree.c: Update.
* gnulib/import/hard-locale.c: Update.
* gnulib/import/hard-locale.h: Update.
* gnulib/import/intprops.h: Update.
* gnulib/import/inttypes.in.h: Update.
* gnulib/import/isnan.c: Update.
* gnulib/import/isnand-nolibm.h: Update.
* gnulib/import/isnand.c: Update.
* gnulib/import/isnanl-nolibm.h: Update.
* gnulib/import/isnanl.c: Update.
* gnulib/import/itold.c: Update.
* gnulib/import/libc-config.h: Update.
* gnulib/import/limits.in.h: Update.
* gnulib/import/localcharset.c: Update.
* gnulib/import/localcharset.h: Update.
* gnulib/import/localtime-buffer.c: Update.
* gnulib/import/localtime-buffer.h: Update.
* gnulib/import/lstat.c: Update.
* gnulib/import/m4/00gnulib.m4: Update.
* gnulib/import/m4/__inline.m4: Update.
* gnulib/import/m4/absolute-header.m4: Update.
* gnulib/import/m4/alloca.m4: Update.
* gnulib/import/m4/builtin-expect.m4: Update.
* gnulib/import/m4/canonicalize.m4: Update.
* gnulib/import/m4/chdir-long.m4: Update.
* gnulib/import/m4/close.m4: Update.
* gnulib/import/m4/closedir.m4: Update.
* gnulib/import/m4/configmake.m4: Update.
* gnulib/import/m4/d-ino.m4: Update.
* gnulib/import/m4/d-type.m4: Update.
* gnulib/import/m4/dirent_h.m4: Update.
* gnulib/import/m4/dirfd.m4: Update.
* gnulib/import/m4/dirname.m4: Update.
* gnulib/import/m4/double-slash-root.m4: Update.
* gnulib/import/m4/dup.m4: Update.
* gnulib/import/m4/dup2.m4: Update.
* gnulib/import/m4/eealloc.m4: Update.
* gnulib/import/m4/environ.m4: Update.
* gnulib/import/m4/errno_h.m4: Update.
* gnulib/import/m4/error.m4: Update.
* gnulib/import/m4/exponentd.m4: Update.
* gnulib/import/m4/exponentl.m4: Update.
* gnulib/import/m4/extensions.m4: Update.
* gnulib/import/m4/extern-inline.m4: Update.
* gnulib/import/m4/fchdir.m4: Update.
* gnulib/import/m4/fcntl-o.m4: Update.
* gnulib/import/m4/fcntl.m4: Update.
* gnulib/import/m4/fcntl_h.m4: Update.
* gnulib/import/m4/fdopendir.m4: Update.
* gnulib/import/m4/filenamecat.m4: Update.
* gnulib/import/m4/flexmember.m4: Update.
* gnulib/import/m4/float_h.m4: Update.
* gnulib/import/m4/fnmatch.m4: Update.
* gnulib/import/m4/fnmatch_h.m4: Update.
* gnulib/import/m4/fpieee.m4: Update.
* gnulib/import/m4/frexp.m4: Update.
* gnulib/import/m4/frexpl.m4: Update.
* gnulib/import/m4/fstat.m4: Update.
* gnulib/import/m4/fstatat.m4: Update.
* gnulib/import/m4/getcwd-abort-bug.m4: Update.
* gnulib/import/m4/getcwd-path-max.m4: Update.
* gnulib/import/m4/getcwd.m4: Update.
* gnulib/import/m4/getdtablesize.m4: Update.
* gnulib/import/m4/getlogin.m4: Update.
* gnulib/import/m4/getlogin_r.m4: Update.
* gnulib/import/m4/getpagesize.m4: Update.
* gnulib/import/m4/getprogname.m4: Update.
* gnulib/import/m4/gettimeofday.m4: Update.
* gnulib/import/m4/glibc21.m4: Update.
* gnulib/import/m4/glob.m4: Update.
* gnulib/import/m4/glob_h.m4: Update.
* gnulib/import/m4/gnulib-cache.m4: Update.
* gnulib/import/m4/gnulib-common.m4: Update.
* gnulib/import/m4/gnulib-comp.m4: Update.
* gnulib/import/m4/gnulib-tool.m4: Update.
* gnulib/import/m4/hard-locale.m4: Update.
* gnulib/import/m4/include_next.m4: Update.
* gnulib/import/m4/inttypes-pri.m4: Update.
* gnulib/import/m4/inttypes.m4: Update.
* gnulib/import/m4/isnand.m4: Update.
* gnulib/import/m4/isnanl.m4: Update.
* gnulib/import/m4/largefile.m4: Update.
* gnulib/import/m4/limits-h.m4: Update.
* gnulib/import/m4/localcharset.m4: Update.
* gnulib/import/m4/locale-fr.m4: Update.
* gnulib/import/m4/locale-ja.m4: Update.
* gnulib/import/m4/locale-zh.m4: Update.
* gnulib/import/m4/localtime-buffer.m4: Update.
* gnulib/import/m4/longlong.m4: Update.
* gnulib/import/m4/lstat.m4: Update.
* gnulib/import/m4/malloc.m4: Update.
* gnulib/import/m4/malloca.m4: Update.
* gnulib/import/m4/math_h.m4: Update.
* gnulib/import/m4/mbrtowc.m4: Update.
* gnulib/import/m4/mbsinit.m4: Update.
* gnulib/import/m4/mbsrtowcs.m4: Update.
* gnulib/import/m4/mbstate_t.m4: Update.
* gnulib/import/m4/memchr.m4: Update.
* gnulib/import/m4/memmem.m4: Update.
* gnulib/import/m4/mempcpy.m4: Update.
* gnulib/import/m4/memrchr.m4: Update.
* gnulib/import/m4/mkdir.m4: Update.
* gnulib/import/m4/mkstemp.m4: Update.
* gnulib/import/m4/mmap-anon.m4: Update.
* gnulib/import/m4/mode_t.m4: Update.
* gnulib/import/m4/msvc-inval.m4: Update.
* gnulib/import/m4/msvc-nothrow.m4: Update.
* gnulib/import/m4/multiarch.m4: Update.
* gnulib/import/m4/nocrash.m4: Update.
* gnulib/import/m4/off_t.m4: Update.
* gnulib/import/m4/onceonly.m4: Update.
* gnulib/import/m4/open-cloexec.m4: Update.
* gnulib/import/m4/open.m4: Update.
* gnulib/import/m4/openat.m4: Update.
* gnulib/import/m4/opendir.m4: Update.
* gnulib/import/m4/pathmax.m4: Update.
* gnulib/import/m4/rawmemchr.m4: Update.
* gnulib/import/m4/readdir.m4: Update.
* gnulib/import/m4/readlink.m4: Update.
* gnulib/import/m4/realloc.m4: Update.
* gnulib/import/m4/rename.m4: Update.
* gnulib/import/m4/rewinddir.m4: Update.
* gnulib/import/m4/rmdir.m4: Update.
* gnulib/import/m4/save-cwd.m4: Update.
* gnulib/import/m4/secure_getenv.m4: Update.
* gnulib/import/m4/setenv.m4: Update.
* gnulib/import/m4/signal_h.m4: Update.
* gnulib/import/m4/ssize_t.m4: Update.
* gnulib/import/m4/stat-time.m4: Update.
* gnulib/import/m4/stat.m4: Update.
* gnulib/import/m4/std-gnu11.m4: Update.
* gnulib/import/m4/stdbool.m4: Update.
* gnulib/import/m4/stddef_h.m4: Update.
* gnulib/import/m4/stdint.m4: Update.
* gnulib/import/m4/stdio_h.m4: Update.
* gnulib/import/m4/stdlib_h.m4: Update.
* gnulib/import/m4/strchrnul.m4: Update.
* gnulib/import/m4/strdup.m4: Update.
* gnulib/import/m4/strerror.m4: Update.
* gnulib/import/m4/string_h.m4: Update.
* gnulib/import/m4/strstr.m4: Update.
* gnulib/import/m4/strtok_r.m4: Update.
* gnulib/import/m4/sys_socket_h.m4: Update.
* gnulib/import/m4/sys_stat_h.m4: Update.
* gnulib/import/m4/sys_time_h.m4: Update.
* gnulib/import/m4/sys_types_h.m4: Update.
* gnulib/import/m4/tempname.m4: Update.
* gnulib/import/m4/time_h.m4: Update.
* gnulib/import/m4/unistd-safer.m4: Update.
* gnulib/import/m4/unistd_h.m4: Update.
* gnulib/import/m4/warn-on-use.m4: Update.
* gnulib/import/m4/wchar_h.m4: Update.
* gnulib/import/m4/wchar_t.m4: Update.
* gnulib/import/m4/wctype_h.m4: Update.
* gnulib/import/m4/wint_t.m4: Update.
* gnulib/import/malloc.c: Update.
* gnulib/import/malloc/scratch_buffer.h: Update.
* gnulib/import/malloc/scratch_buffer_grow.c: Update.
* gnulib/import/malloc/scratch_buffer_grow_preserve.c: Update.
* gnulib/import/malloc/scratch_buffer_set_array_size.c: Update.
* gnulib/import/malloca.c: Update.
* gnulib/import/malloca.h: Update.
* gnulib/import/malloca.valgrind: Update.
* gnulib/import/math.in.h: Update.
* gnulib/import/mbrtowc.c: Update.
* gnulib/import/mbsinit.c: Update.
* gnulib/import/mbsrtowcs-impl.h: Update.
* gnulib/import/mbsrtowcs-state.c: Update.
* gnulib/import/mbsrtowcs.c: Update.
* gnulib/import/memchr.c: Update.
* gnulib/import/memmem.c: Update.
* gnulib/import/mempcpy.c: Update.
* gnulib/import/memrchr.c: Update.
* gnulib/import/mkdir.c: Update.
* gnulib/import/mkstemp.c: Update.
* gnulib/import/msvc-inval.c: Update.
* gnulib/import/msvc-inval.h: Update.
* gnulib/import/msvc-nothrow.c: Update.
* gnulib/import/msvc-nothrow.h: Update.
* gnulib/import/open.c: Update.
* gnulib/import/openat-die.c: Update.
* gnulib/import/openat-priv.h: Update.
* gnulib/import/openat-proc.c: Update.
* gnulib/import/openat.c: Update.
* gnulib/import/openat.h: Update.
* gnulib/import/opendir.c: Update.
* gnulib/import/pathmax.h: Update.
* gnulib/import/pipe-safer.c: Update.
* gnulib/import/rawmemchr.c: Update.
* gnulib/import/readdir.c: Update.
* gnulib/import/readlink.c: Update.
* gnulib/import/realloc.c: Update.
* gnulib/import/ref-add.sin: Update.
* gnulib/import/ref-del.sin: Update.
* gnulib/import/rename.c: Update.
* gnulib/import/rewinddir.c: Update.
* gnulib/import/rmdir.c: Update.
* gnulib/import/same-inode.h: Update.
* gnulib/import/save-cwd.c: Update.
* gnulib/import/save-cwd.h: Update.
* gnulib/import/scratch_buffer.h: Update.
* gnulib/import/secure_getenv.c: Update.
* gnulib/import/setenv.c: Update.
* gnulib/import/signal.in.h: Update.
* gnulib/import/stat-time.c: Update.
* gnulib/import/stat-time.h: Update.
* gnulib/import/stat-w32.c: Update.
* gnulib/import/stat-w32.h: Update.
* gnulib/import/stat.c: Update.
* gnulib/import/stdbool.in.h: Update.
* gnulib/import/stddef.in.h: Update.
* gnulib/import/stdint.in.h: Update.
* gnulib/import/stdio.in.h: Update.
* gnulib/import/stdlib.in.h: Update.
* gnulib/import/str-two-way.h: Update.
* gnulib/import/strchrnul.c: Update.
* gnulib/import/strdup.c: Update.
* gnulib/import/streq.h: Update.
* gnulib/import/strerror-override.c: Update.
* gnulib/import/strerror-override.h: Update.
* gnulib/import/strerror.c: Update.
* gnulib/import/string.in.h: Update.
* gnulib/import/stripslash.c: Update.
* gnulib/import/strnlen1.c: Update.
* gnulib/import/strnlen1.h: Update.
* gnulib/import/strstr.c: Update.
* gnulib/import/strtok_r.c: Update.
* gnulib/import/sys_stat.in.h: Update.
* gnulib/import/sys_time.in.h: Update.
* gnulib/import/sys_types.in.h: Update.
* gnulib/import/tempname.c: Update.
* gnulib/import/tempname.h: Update.
* gnulib/import/time.in.h: Update.
* gnulib/import/unistd--.h: Update.
* gnulib/import/unistd-safer.h: Update.
* gnulib/import/unistd.in.h: Update.
* gnulib/import/unsetenv.c: Update.
* gnulib/import/verify.h: Update.
* gnulib/import/extra/snippet/warn-on-use.h: Update.
* gnulib/import/wchar.in.h: Update.
* gnulib/import/wctype.in.h: Update.
* gnulib/import/xalloc-oversized.h: Update.
* gnulib/update-gnulib.sh (GNULIB_COMMIT_SHA1): Set to
"
53e2c179f26a890fa6685af4b6c1397ee370433b".
Simon Marchi [Mon, 10 Sep 2018 16:11:01 +0000 (17:11 +0100)]
Remove unused variable in record-btrace.c
old_inferior_ptid is unused, this is caught by a gcc built from git
recently, not sure about previous versions:
/home/emaisin/src/binutils-gdb/gdb/record-btrace.c: In function ‘frame_info* get_thread_current_frame(thread_info*)’:
/home/emaisin/src/binutils-gdb/gdb/record-btrace.c:1974:10: error: unused variable ‘old_inferior_ptid’ [-Werror=unused-variable]
1974 | ptid_t old_inferior_ptid;
| ^~~~~~~~~~~~~~~~~
gdb/ChangeLog:
* record-btrace.c (get_thread_current_frame): Remove
old_inferior_ptid.
Jerome Guitton [Mon, 10 Sep 2018 15:37:52 +0000 (10:37 -0500)]
(Ada) Fix resolving of homonym components in tagged types
ada_value_struct_elt is used when displaying a component (say, 'N') of
a record object (say, 'Obj') of type, say, 't1'. Now if Obj is tagged
(Ada parlance: "tagged types" are what other object-oriented languages
call "classes"), then 'N' may not be visible in the current view and
we need to look for it in its actual type. We do that at the same time
as resolving variable-length fields. This would typically be done by
the following call to ada_value_struct_elt, with the last parameter
check_tag set to 1:
t1 = ada_to_fixed_type (ada_get_base_type (t1), NULL,
address, NULL, 1);
This is the general logic, but recently we introduced a special case
to handle homonyms. Different components may have the same name in a
tagged type. For instance:
type Top_T is tagged record
N : Integer := 1;
end record;
type Middle_T is new Top.Top_T with record
N : Character := 'a';
end record;
Middle_T extends Top_T and both define a (different) component with
the same name ('N'). In such a case, using the actual type of a
Middle_T object would create a confusion, since we would have two
component 'N' in this actual type.
So, to handle homonyms, we convert t1 to the actual type *if
and only if* N cannot be found in the current view. For example, if Obj
has been created as a Middle_T but is seen as a Top_T'Class at our
point of execution, then "print Obj.N" will display the integer field
defined in Top_T's declaration.
Now, even if we find N in the current view, we still have to get a
fixed type: for instance, the record can be unconstrained and we still
need a fixed type to get the proper offset to each field. That is
to say, in this case:
type Dyn_Top_T (Disc : Natural) is tagged record
S : Integer_Array (1 .. Disc) := (others => Disc);
N : Integer := 1;
end record;
type Dyn_Middle_T is new Dyn_Top.Dyn_Top_T with record
N : Character := 'a';
U : Integer := 42;
end record;
If we have an object Obj of type Dyn_Middle_T and we want to display
U, we don't need to build, from its tag, a real type with all its real
fields. In other words, we don't need to add the parent components:
Disc, S, and the integer N. We only need to access U and it is
directly visible in Dyn_Middle_T. So no tag handling. However, we do
need to build a fixed-size type to have the proper offset to U (since
this offset to U depends on the size of Obj.S, which itself is dynamic
and depends on the value of Obj.Disc).
We accidentally lost some of this treatment when we introduced the
resolution of homonyms. This patch re-install this part by uncoupling
the tag resolution from the "fixing" of variable-length components.
This change also slightly simplifies the non-tagged case: in the
non-tagged case, no need to set check_tag to 1, since we already know
that there is no tag.
gdb/ChangeLog:
* ada-lang.c (ada_value_struct_elt): Call ada_to_fixed_type
with check_tag to 1 if and only if the type is tagged and the
component being searched cannot been found in the current
view. Otherwise, always call ada_to_fixed_type with
check_tag to 0.
gdb/testsuite/ChangeLog:
* gdb.ada/same_component_name: Add test for case of tagged record
with variable-length fields.