2018-09-17 Kito Cheng <kito@andestech.com>
gas/
* testsuite/gas/riscv/bge.d: New.
* testsuite/gas/riscv/bge.s: Likewise.
opcodes/
* riscv-opc.c (riscv_opcodes): Adjust the order of ble and
bleu.
Patch
d82b3862f1 ("compile: Remove non-const reference parameters")
introduced a regression in compile/compile-cplus-types.c. The new_scope
variable in compile_cplus_instance::enter_scope is used after it was
std::moved. This patch fixes it by referring to the back of the vector
where it was moved instead.
gdb/ChangeLog:
* compile/compile-cplus-types.c
(compile_cplus_instance::enter_scope): Don't use new_scope after
std::move.
Add -mvexwig=[0|1] option to x86 assembler to control how the assembler
should encode the VEX.W bit in WIG VEX instructions.
* gas/NEWS: Mention -mvexwig=[0|1] option.
* config/tc-i386.c (vexwig): New.
(build_vex_prefix): Set the VEX.W bit for -mvexwig=1 for WIG
VEX instructions.
(OPTION_MVEXWIG): New.
(md_longopts): Add -mvexwig=.
(md_parse_option): Handle OPTION_MVEXWIG.
(md_show_usage): Show -mvexwig=[0|1].
* doc/c-i386.texi: Document -mvexwig=[0|1].
* testsuite/gas/i386/avx-wig.d: New file.
* testsuite/gas/i386/avx-wig.s: Likewise.
* testsuite/gas/i386/avx2-wig.d: Likewise.
* testsuite/gas/i386/avx2-wig.s: Likewise.
* testsuite/gas/i386/x86-64-avx-wig.d: Likewise.
* testsuite/gas/i386/x86-64-avx-wig.s: Likewise.
* testsuite/gas/i386/x86-64-avx2-wig.d: Likewise.
* testsuite/gas/i386/x86-64-avx2-wig.s: Likewise.
* testsuite/gas/i386/i386.exp: Run avx-wig, avx2-wig,
x86-64-avx-wig and x86-64-avx2-wig.
add_specific_symbols allocates a buffer to hold symbols. It should be
freed only if it is no longer in use.
PR binutils/23633
* objcopy.c (strip_specific_buffer): New.
(strip_unneeded_buffer): Likewise.
(keep_specific_buffer): Likewise.
(localize_specific_buffer): Likewise.
(globalize_specific_buffer): Likewise.
(keepglobal_specific_buffer): Likewise.
(weaken_specific_buffer): Likewise.
(add_specific_symbols): Add an argument to return pointer to
allocated buffer.
(copy_main): Update add_specific_symbols to update pointers to
allocated buffer. Free pointers to allocated buffer before
return.
On macOS the usual cache directory is ~/Library/Caches. This patch
changes get_standard_cache_dir to use that instead of XDG.
gdb/ChangeLog
2018-09-17 Tom Tromey <tom@tromey.com>
* common/pathstuff.c (get_standard_cache_dir): Use
~/Library/Caches on macOS.
* common/pathstuff.h (get_standard_cache_dir): Update comment.
gdb/doc/ChangeLog
2018-09-17 Tom Tromey <tom@tromey.com>
* gdb.texinfo (Index Files): Update for cache directory change on
macOS.
* objcopy.c (handle_remove_section_option): Don't require a dot
after .rela and .rel to handle a possible relocation section.
* testsuite/binutils-all/remove-relocs-07.s,
* testsuite/binutils-all/remove-relocs-07.d,
* testsuite/binutils-all/remove-relocs-08.d: New tests.
* testsuite/binutils-all/remove-relocs-01.d,
* testsuite/binutils-all/remove-relocs-04.d,
* testsuite/binutils-all/remove-relocs-05.d,
* testsuite/binutils-all/remove-relocs-06.d: Exclude mips64-openbsd.
Since commit
56bcdbea2b ("Let gdb.execute handle multi-line commands")
trying to use a command like gdb.execute("show commands") in Python
fails. GDB ends up trying to run the "commands" command.
The reason is that GDB gets confused with the special "commands"
command. In process_next_line, the lookup_cmd_1 function returns the
cmd_list_element representing the "commands" sub-command of "show".
Lower, we check the cmd_list_element to see if it matches various
control commands by name, including the "commands" command. This is
where we wrongfully conclude that the executed command must be
"commands", when in reality it was "show commands".
The fix proposed in this patch removes the comparisons by name, instead
comparing the cmd_list_element object by pointer with the objects
created at initialization time.
Tested on the buildbot, though on a single builder (Fedora-x86_64-m64).
gdb/ChangeLog:
PR python/23669
* breakpoint.c (commands_cmd_element): New.
(_initialize_breakpoint): Assign commands_cmd_element.
* breakpoint.h (commands_cmd_element): New.
* cli/cli-script.c (while_cmd_element, if_command,
define_cmd_element): New.
(command_name_equals): Remove.
(process_next_line): Compare commands by pointer, not by name.
(_initialize_cli_script): Assign the various cmd_list_element
variables.
* compile/compile.c (compile_cmd_element): New.
(_initialize_compile): Assign compile_cmd_element.
* compile/compile.h (compile_cmd_element): New.
* guile/guile.c (guile_cmd_element): New.
(install_gdb_commands): Assign guile_cmd_element.
* guile/guile.h (guile_cmd_element): New.
* python/python.c (python_cmd_element): New.
(_initialize_python): Assign python_cmd_element.
* python/python.h (python_cmd_element): New.
* tracepoint.c (while_stepping_cmd_element): New.
(_initialize_tracepoint): Assign while_stepping_cmd_element.
* tracepoint.h (while_stepping_cmd_element): New.
gdb/testsuite/ChangeLog:
PR python/23669
* gdb.python/python.exp: Test gdb.execute("show commands").
binutils* testsuite/binutils-all/compress.exp: Rename second "objcopy
zlib-gnu compress debug sections 3" test to "objcopy zlib-gabi
compress debug sections 3" and use gabi object files instead
of gnu object files.
* testsuite/binutils-all/objcopy.exp: Add suffix to the names
of the "ELF group" tests.
* testsuite/binutils-all/readelf.exp (proc readelf_find_size):
Add an iteration parameter and include it in the name of the
test. Update callers to include an iteration count.
gas * testuite/gas/elf/group0a.d: Add extra details to the test
name.
* testuite/gas/elf/group0b.d: Likewise.
* testuite/gas/elf/group1a.d: Likewise.
* testuite/gas/elf/group1b.d: Likewise.
* testuite/gas/elf/group0b.d: Likewise.
* testuite/gas/elf/section9.d: Likewise.
* testuite/gas/i386/ilp32/lns/lns-common-1.d: Likewise.
* testuite/gas/i386/ilp32/lns/lns-duplicate-1.d: Likewise.
ld * testuite/ld/ld-elf/audit.exp: Differentiate the names of the
two "Run with shared with --audit" tests.
* testuite/ld/ld-elf/compress.exp: Differentiate the zlib
compressed debug output test names.
* testuite/ld/ld-i386/tlspie1.d: Add extra details to the test
name.
* testuite/ld/ld-i386/tlspie2.d: Likewise.
* testuite/ld/ld-size/size.exp: Add missing escapes to the end
of lines in the size-3e test.
* testuite/ld/ld-unique/unique.exp: Differentiate the names of
the two "Checking unique PIC object" tests.
* testuite/ld/ld-x86-64/tlspie1.d: Add extra details to the test
name.
When dereferencing a GOT slot with lgrl or lg we rewrite this using
larl to get rid of the extra memory access. However, we cannot do
this for:
- symbols marked for absolute addressing
- symbols at odd addresses (larl can handle only even addresses)
Fixed with the attached patch.
bfd/ChangeLog:
2018-09-17 Andreas Krebbel <krebbel@linux.ibm.com>
* elf64-s390.c (elf_s390_relocate_section): Prevent rewriting of
GOT accesses with larl for ABS or misaligned symbols.
ld/ChangeLog:
2018-09-17 Andreas Krebbel <krebbel@linux.ibm.com>
* testsuite/ld-s390/gotreloc-1.s: Add tests for ABS and misaligned
symbol. Move variables into data section. Make bar 8 bytes wide.
* testsuite/ld-s390/gotreloc-1.ver: Make misaligned_sym resolve locally.
* testsuite/ld-s390/gotreloc_31-1.dd: Adjust patterns.
* testsuite/ld-s390/gotreloc_64-norelro-1.dd: Likewise.
* testsuite/ld-s390/gotreloc_64-relro-1.dd: Likewise.
Simon pointed out that save_infcall_suspend_state and
save_infcall_control_state could return unique pointers. This patch
implements this idea.
gdb/ChangeLog
2018-09-17 Tom Tromey <tom@tromey.com>
* infrun.c (save_infcall_suspend_state): Return
infcall_suspend_state_up.
(save_infcall_control_state): Return infcall_control_state_up.
* inferior.h (save_infcall_suspend_state)
(save_infcall_control_state): Declare later. Return unique
pointers.
This removes release_stop_context_cleanup, replacing it with a
stop_context destructor. It also mildly c++-ifies this struct.
gdb/ChangeLog
2018-09-17 Tom Tromey <tom@tromey.com>
* infrun.c (struct stop_context): Declare constructor,
destructor, "changed" method.
(stop_context::stop_context): Rename from save_stop_context.
(stop_context::~stop_context): Rename from
release_stop_context_cleanup.
(normal_stop): Update.
(stop_context::changed): Rename from stop_context_changed. Return
bool.
This removes a couple of cleanups from infrun by introducing a couple
of unique_ptr specializations.
gdb/ChangeLog
2018-09-17 Tom Tromey <tom@tromey.com>
* inferior.h (struct infcall_suspend_state_deleter): New.
(infcall_suspend_state_up): New typedef.
(struct infcall_control_state_deleter): New.
(infcall_control_state_up): New typedef.
(make_cleanup_restore_infcall_suspend_state)
(make_cleanup_restore_infcall_control_state): Don't declare.
* infcall.c (call_function_by_hand_dummy): Update.
* infrun.c (do_restore_infcall_suspend_state_cleanup)
(make_cleanup_restore_infcall_suspend_state): Remove.
(do_restore_infcall_control_state_cleanup)
(make_cleanup_restore_infcall_control_state): Remove.
This removes a cleanup from infrun.c by taking advantage of the
previous patch to introduce a use of unique_xmalloc_ptr.
gdb/ChangeLog
2018-09-17 Tom Tromey <tom@tromey.com>
* infrun.c (struct infcall_suspend_state) <registers>: Now a
unique_ptr.
<siginfo_data>: Now a unique_xmalloc_ptr.
(save_infcall_suspend_state, restore_infcall_suspend_state)
(discard_infcall_suspend_state)
(get_infcall_suspend_state_regcache): Update.
This changes infrun.c to use new and delete for infcall_suspend_state.
This enables the coming cleanups.
gdb/ChangeLog
2018-09-17 Tom Tromey <tom@tromey.com>
* gdbthread.h (struct thread_suspend_state): Add initializers.
(class thread_info) <suspend>: Remove initializer.
* infrun.c (struct infcall_suspend_state): Add initializers.
(save_infcall_suspend_state): Use new.
(discard_infcall_suspend_state): Use delete.
Some Python APIs steal references from their caller, and the refcount
checker supports this via an attribute.
However, in gdb with C++ we have a better idiom available: we can use
std::move on a gdbpy_ref<> instead. This makes the semantics obvious
at the point of call, and is safer at runtime as well, because the
callee's gdbpy_ref<> will be emptied.
This patch changes the reference-stealing code in gdb to use rvalue
references instead.
Tested on x86-64 Fedora 28.
gdb/ChangeLog
2018-09-16 Tom Tromey <tom@tromey.com>
* python/python-internal.h (CPYCHECKER_STEALS_REFERENCE_TO_ARG):
Remove.
* python/py-varobj.c (py_varobj_iter_ctor): Change pyiter to
rvalue reference. Remove CPYCHECKER_STEALS_REFERENCE_TO_ARG.
(py_varobj_iter_new): Likewise.
(py_varobj_get_iterator): Use gdbpy_ref.
An review by Simon of an earlier showed a few spots related to
thread_to_thread_object that could be simplified. This also detected
a latent bug, where thread_to_thread_object was inconsistent about
setting the Python exception before a NULL return.
Tested on x86-64 Fedora 28.
gdb/ChangeLog
2018-09-16 Tom Tromey <tom@tromey.com>
* python/py-threadevent.c (py_get_event_thread): Simplify.
* python/py-inferior.c (infpy_thread_from_thread_handle):
Return immediately after calling thread_to_thread_object. Use
Py_RETURN_NONE.
(thread_to_thread_object): Set the exception on a NULL return.
Tom mentioned this a while ago, as a way to give you a cheap sense of
progression in your build, as all object files will be built
alphabetically (including the directory part). I tried it and I think
it's nice.
gdb/ChangeLog:
* Makefile.in (LIBGDB_OBS): Sort COMMON_OBS.
gdb/gdbserver/ChangeLog:
* Makefile.in (gdbserver$(EXEEXT)): Sort OBS.
(gdbreplay$(EXEEXT)): Sort GDBREPLAY_OBS.
($(IPA_LIB)): Sort IPA_OBJS.
ADD_DEPS is defined nowhere, so I presume it's not useful. If I'm wrong
and this is actually used, there should be a comment explaining where it
comes from.
gdb/gdbserver/ChangeLog:
* Makefile.in: Remove references to $(ADD_DEPS).
ld/testsuite/ld-s12z/
* reloc-ext18-1.d: New file.
* reloc-ext18-1.d: New file.
* reloc-ext18-2.d: New file.
* reloc-ext18.d: New file.
* reloc-ext18.s: New file.
* reloc-ext24.d: New file.
* reloc-ext24.s: New file.
* reloc-ext32.d: New file.
* reloc-ext32.s: New file.
* reloc-opr.d: New file.
* reloc-opr.d: New file.
* reloc-opr.s: New file.
* reloc-pc-rel-7-15.d: New file.
* reloc-pc-rel-7-15.s: New file.
CPYCHECKER_RETURNS_BORROWED_REF is not used, and I think should never
be used. This patch removes it.
gdb/ChangeLog
2018-09-16 Tom Tromey <tom@tromey.com>
* python/python-internal.h (CPYCHECKER_RETURNS_BORROWED_REF):
Remove.
This changes thread_to_thread_object to return a new reference and
fixes up all the callers.
gdb/ChangeLog
2018-09-16 Tom Tromey <tom@tromey.com>
* python/python-internal.h (thread_to_thread_object): Change
return type.
* python/py-inferior.c (thread_to_thread_object): Return a new
reference.
(infpy_thread_from_thread_handle): Update.
* python/py-infthread.c (gdbpy_selected_thread): Update.
* python/py-stopevent.c (create_stop_event_object): Update.
* python/py-threadevent.c (py_get_event_thread): Return a new
reference.
(py_get_event_thread): Update.
* python/py-event.h (py_get_event_thread): Change return type.
* python/py-continueevent.c (create_continue_event_object):
Update.
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.
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.
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.
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.
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.
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.
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.
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.