Commit Graph

93771 Commits

Author SHA1 Message Date
Tom Tromey a5b5adf529 Make copy_token_string return unique_xmalloc_ptr
This changes copy_token_string to return a unique_xmalloc_ptr, which
allows the removal of some cleanups.

ChangeLog
2018-04-05  Tom Tromey  <tom@tromey.com>

	* linespec.c (copy_token_string): Return a unique_xmalloc_ptr.
	(unexpected_linespec_error): Update.
	(linespec_parse_basic, parse_linespec): Update.
2018-04-05 07:39:34 -06:00
Tom Tromey 6a307fc5f5 Fix some indentation in linespec.c
This removes some leftover comments and fixes the indentation in a
couple of spots in linespec.c.

ChangeLog
2018-04-05  Tom Tromey  <tom@tromey.com>

	* linespec.c (linespec_parse_basic): Reindent.
2018-04-05 07:39:34 -06:00
Tom Tromey 41c1efc614 Remove some cleanups from search_minsyms_for_name
This changes struct collect_minsyms to use a std::vector, which
enables the removal of a cleanup from search_minsyms_for_name.  This
also changes iterate_over_minimal_symbols to take a
gdb::function_view, which makes a function in linespec.c more
type-safe.

ChangeLog
2018-04-05  Tom Tromey  <tom@tromey.com>

	* minsyms.h (iterate_over_minimal_symbols): Update.
	* minsyms.c (iterate_over_minimal_symbols): Take a
	gdb::function_view.
	* linespec.c (struct collect_minsyms): Remove.
	(compare_msyms): Now a std::sort comparator.
	(add_minsym): Add parameters.
	(search_minsyms_for_name): Update.  Use std::vector.
2018-04-05 07:39:33 -06:00
Maciej W. Rozycki 65bd20451f binutils/testsuite: Tighten the error message check with `strip-13'
Avoid false positives and actually verify both that an `unsupported
relocation type 0x8f' message is produced and that no other message is,
except for the final `bad value', in the `strip-13' test.  This ensures
that it is a relocation processing error and not a different issue that
has caused `strip' to terminate unsuccessfully, and that the number
representing the unsupported relocation has not been clobbered.

	binutils/
	* testsuite/binutils-all/strip-13.d: Also expect `unsupported
	relocation type 0x8f' error message.
2018-04-05 13:08:35 +01:00
Maciej W. Rozycki 2f8ceb3899 binutils/testsuite: Support REL and MIPS64 reloc formats with `strip-13'
Add source variants for the `strip-13' test that produce relocations in
the REL and MIPS64 formats, fixing a failure for the `mips64el-openbsd'
target.  This also corrects output for `i*86-*', `i960-*', `m6812-*' and
`m68hc12-*', o32 `mips*-*', and `score*-*' targets, which however does
not show up as a test result change due to lax error message matching
causing `bad value' previously produced by `strip' as a result of input
file rejection to be accepted as a test pass.

For `m6811-*' aka `m68hc11-*' targets this causes a phantom regression,
because they use 16-bit addressing and therefore `.dc.a' emits 16-bit
quantities causing relocation data constructed in assembly not to be as
expected.  Previously input was rejected by `strip' with a `bad value'
message and now it is accepted, however due to the relocation data error
the relocation number is not one of the unsupported ones and the tool
completes successfully, which scores as a test failure.

Disable the test case for `m6811-*' and `m68hc11-*' targets then, as it
is a test case bug rather than a problem with the relevant backend.  A
separate change to the test case is required to correct this problem, at
which point the test case can be enabled for the affected targets.

	binutils/
	* testsuite/binutils-all/strip-13.s: Rename to...
	* testsuite/binutils-all/strip-13rela.s: ... this.
	* testsuite/binutils-all/strip-13rel.s: New test source.
	* testsuite/binutils-all/strip-13mips64.s: New test source.
	* testsuite/binutils-all/strip-13.d: Remove `arm-*', `d10v-*',
	`dlx-*' and `xgate-*' from `not-target' list.  Add `m6811-*' and
	`m68hc11-*' to `not-target' list.
	* testsuite/binutils-all/objcopy.exp: Switch between sources for
	`strip-13'.
2018-04-05 13:08:35 +01:00
Maciej W. Rozycki aad7be454b binutils/testsuite: Enable `strip-13' test for `hppa*-*'
Based on relocations defined in include/elf/*.h files we have relocation
numbers: 143, 159, 214 and 215 currently not used by any of our ELF
targets.  Use 143 then instead of 241 to enable the `strip-13' test for
`hppa*-*' targets.  It has a side effect with some targets of verifying
that unused relocations whose numbers are below the respective R_*_max
value are handled correctly.

	binutils/
	* testsuite/binutils-all/strip-13.s: Use 143 (0x8f) rather than
	241 (0xf1) for the relocation number and RELA addend.
	* testsuite/binutils-all/strip-13.d: Remove `hppa*-*' from the
	`not-target' list.
2018-04-05 13:08:35 +01:00
GDB Administrator e778be0dd1 Automatic date update in version.in 2018-04-05 00:00:24 +00:00
Alan Modra 544838989a [GOLD] Make powerpc64 .branch_lt relro
Better security beats better placement for code optimization.

	* powerpc.cc (Target_powerpc::make_brlt_section): Make .branch_lt relro.
2018-04-05 08:26:10 +09:30
Alan Modra 0e8452bb22 elf-hppa.h warning fix
* elf-hppa.h (elf_hppa_info_to_howto): Init howto to NULL.
	(elf_hppa_info_to_howto_rel): Likewise.
2018-04-05 08:24:15 +09:30
John David Anglin 89f60df20b * binutils/MAINTAINERS: Update e-mail address. 2018-04-04 18:29:17 -04:00
H.J. Lu caf0678c84 i386: Clear vex instead of vex.evex
"vex" has many fields to control how to decode an instruction.  Clear
all fields in "vex" before decoding an instruction to avoid using values
left from the previous instruction.

gas/

	PR binutils/23025
	* testsuite/gas/i386/prefix.s: Add tests for vcvtpd2dq with
	VEX and EVEX prefixes.
	* testsuite/gas/i386/prefix.d: Updated.

opcodes/

	PR binutils/23025
	* i386-dis.c (get_valid_dis386): Don't set vex.prefix nor vex.w
	to 0.
	(print_insn): Clear vex instead of vex.evex.
2018-04-04 04:36:44 -07:00
Eric Botcazou 142b7a144b Add blurb about linker changes for Cygwin and Mingw targets. 2018-04-04 12:18:09 +02:00
Eric Botcazou 9d8e8f445c Speed up direct linking with DLLs on Windows (2/2).
This patch deals with the generation of the import library on the fly.

The implementation is inefficient because the linker makes a lot of
calls to realloc and memmove when importing the symbols in order to
maintain a sorted list of symbols.

This is fixable by relying on the fact that, for every linked DLL,
the list of symbols it exports is already sorted so you can import
them en masse once you have found the insertion point.

ld/
	* deffile.h (def_file_add_import_from): Declare.
	(def_file_add_import_at): Likewise.
	* deffilep.y (fill_in_import): New function extracted from...
	(def_file_add_import): ...here.  Call it.
	(def_file_add_import_from): New function.
	(def_file_add_import_at): Likewise.
	* pe-dll.c (pe_implied_import_dll): Use an optimized version of the
	insertion loop for imported symbols if possible.
2018-04-04 12:13:05 +02:00
Eric Botcazou 317ff0084b Speed up direct linking with DLLs on Windows (1/2).
This patch deals with the auto-import feature.  There are 2 versions
of this feature: the original one, which was piggybacked on the OS
loader with an optional help from the runtime (--enable-auto-import
--enable-runtime-pseudo-reloc-v1) and is still the one mostly
documented in the sources and manual; the enhanced one by Kai Tietz,
which is entirely piggybacked on the runtime (--enable-auto-import
--enable-runtime-pseudo-reloc-v2) and is the default for Mingw and
Cygwin nowadays.

The implementation is inefficient because of pe[p]_find_data_imports:
for every undefined symbol, the function walks the entire set of
relocations for all the input files and does a direct name comparison
for each of them.

This is easily fixable by using a hash-based map for v1 and a simple
hash table for v2.  This patch leaves v1 alone and only changes v2.
It also factors out pe[p]_find_data_imports into a common function,
removes old cruft left and right, and attempts to better separate
the implementations of v1 and v2 in the code.

ld/
	* emultempl/pe.em (U_SIZE): Delete.
	(pe_data_import_dll): Likewise.
	(make_import_fixup): Return void, take 4th parameter and pass it down
	in call to pe_create_import_fixup.
	(pe_find_data_imports): Move to...
	(gld_${EMULATION_NAME}_after_open): Run the stdcall fixup pass after
	the auto-import pass and add a guard before running the latter.
	* emultempl/pep.em (U_SIZE): Delete.
	(pep_data_import_dll): Likewise.
	(make_import_fixup): Return void, take 4th parameter and pass it down
	in call to pe_create_import_fixup.
	(pep_find_data_imports): Move to...
	(gld_${EMULATION_NAME}_after_open): Run the stdcall fixup pass after
	the auto-import pass and add a guard before running the latter.
	* pe-dll.c (runtime_pseudp_reloc_v2_init): Change type to bfd_boolean.
	(pe_walk_relocs_of_symbol): Rename into...
	(pe_walk_relocs): ...this.  Add 2 more parameters,4th parameter to the
	callback prototype and pass 4th parameter in calls to the callback.
	If the import hash table is present, invoke the callback on the reloc
	if the symbol name is in the table.
	(pe_find_data_imports): ...here.  Take 2 parameters.  Build an import
	hash table for the pseudo-relocation support version 2.  When it is
	built, walk the relocations only once at the end; when it is not, do
	not build a fixup when the symbol isn't part of an import table.
	Issue the associated warning only after a first fixup is built.
	(tmp_seq2): Delete.
	(make_singleton_name_imp): Likewise.
	(make_import_fixup_mark): Return const char * and a stable string.
	(make_import_fixup_entry): Do not deal with the pseudo-relocation
	support version 2.
	(make_runtime_pseudo_reloc): Factor out code and fix formatting.
	(pe_create_import_fixup): Add 5th parameter.  Clearly separate the
	pseudo-relocation support version 2 from the rest.  Fix formatting.
	* pe-dll.h (pe_walk_relocs_of_symbol): Delete.
	(pe_find_data_imports): Declare.
	(pe_create_import_fixup): Add 5th parameter.
	* pep-dll.c (pe_data_import_dll): Delete.
	(pe_find_data_imports): Define.
	(pe_walk_relocs_of_symbol): Delete.
	* pep-dll.h (pep_walk_relocs_of_symbol): Delete.
	(pep_find_data_imports): Declare.
	(pep_create_import_fixup): Add 5th parameter.
	* ld.texinfo (--enable-auto-import): Adjust to new implementation.
2018-04-04 12:07:50 +02:00
Nick Clifton 4fb0d2b912 Update Spanish translations for ld/ opcodes/ and gold/ sub-directories 2018-04-04 09:00:18 +01:00
Nick Clifton f1ca0d6d8b Retire Jason Eckhardt as i860 maintainer.
* MAINTAINERS: Move Jason Eckhardt to past maintainers section.
2018-04-04 08:35:19 +01:00
Maciej W. Rozycki 8ee55178c2 PR binutils/22875: HPPA/ELF: Also fail with relocation placeholders
Do not consider R_PARISC_UNIMPLEMENTED placeholder relocation entries of
the `elf_hppa_howto_table' table valid in `info_to_howto' HPPA handlers.
Instead issue an unsupported relocation type error and return a NULL
howto as with relocations whose number is R_PARISC_UNIMPLEMENTED or
beyond.

	bfd/
	* elf-hppa.h (elf_hppa_info_to_howto): Also return
	unsuccessfully for unimplemented relocations.
	(elf_hppa_info_to_howto_rel): Likewise.
2018-04-04 02:00:49 +01:00
Maciej W. Rozycki 5d7c8b8048 PR binutils/22875: i860/ELF: Report unsupported relocation types
Complement commit f3185997ac ("PR 22875: Stop strip corrupting unknown
relocs"), <https://sourceware.org/ml/binutils/2018-02/msg00445.html>,
and also set the `bfd_error_bad_value' error and report an unsupported
relocation type if a howto lookup fails with the i860 backend, fixing a
confusing `no error' error message and removing a binutils test failure:

failed with: <.../binutils/strip-new: tmpdir/bintest.o: no error>, expected: <.* bad value>
.../binutils/strip-new: tmpdir/bintest.o: no error
FAIL: binutils-all/strip-13

with the `i860-stardent-elf' target.

	bfd/
	* elf32-i860.c (lookup_howto): Add `abfd' parameter.  Set the
	`bfd_error_bad_value' error and call `_bfd_error_handler' on a
	howto lookup failure.
	(elf32_i860_reloc_type_lookup): Adjust `lookup_howto' call
	accordingly.
	(elf32_i860_info_to_howto_rela): Likewise.
	(elf32_i860_relocate_splitn): Likewise.
	(elf32_i860_relocate_pc16): Likewise.
	(elf32_i860_relocate_pc26): Likewise.
	(elf32_i860_relocate_section): Likewise.
2018-04-04 02:00:49 +01:00
Maciej W. Rozycki 707bad1b21 PR binutils/22875: Visium/ELF: Prevent an out-of-bounds howto table access
Prevent an out-of-bounds `visium_elf_howto_table' table access in
`visium_info_to_howto_rela' by using the size of the table rather than
R_VISIUM_max to determine the number of entries in the contiguous
regular Visium relocation range defined and described in the table.

	bfd/
	* elf32-visium.c (visium_info_to_howto_rela): Correct the range
	check for `visium_elf_howto_table' table access.
2018-04-04 02:00:49 +01:00
Maciej W. Rozycki 0cc919dc6a PR binutils/22875: IQ2000/ELF: Prevent an out-of-bounds howto table access
Prevent an out-of-bounds `iq2000_elf_howto_table' table access in
`iq2000_info_to_howto_rela' by using the size of the table rather than
R_IQ2000_max to determine the number of entries in the contiguous
regular IQ2000 relocation range defined and described in the table.

	bfd/
	* elf32-iq2000.c (iq2000_info_to_howto_rela): Correct the range
	check for `iq2000_elf_howto_table' table access.
2018-04-04 02:00:49 +01:00
Maciej W. Rozycki f428698edf PR binutils/22875: FRV/ELF: Prevent an out-of-bounds howto table access
Prevent an out-of-bounds `elf32_frv_howto_table' table access in
`frv_info_to_howto_rela' by using the size of the table rather than
R_FRV_max to determine the number of entries in the contiguous regular
FRV relocation range defined and described in the table.

	bfd/
	* elf32-frv.c (frv_info_to_howto_rela): Correct the range check
	for `elf32_frv_howto_table' table access.
2018-04-04 02:00:48 +01:00
Maciej W. Rozycki 7ed6f92aaf PR binutils/22875: MIPS/ELF: Also fail with relocation placeholders
Do not consider placeholder EMPTY_HOWTO relocation entries valid in
`rtype_to_howto' MIPS handlers.  Instead issue an unsupported relocation
type error and return a NULL howto as with relocations outside the three
ISA-specific min-max ranges.

	bfd/
	* elf32-mips.c (mips_elf32_rtype_to_howto): Also return
	unsuccessfully for placeholder howtos.
	* elf64-mips.c (mips_elf64_rtype_to_howto): Likewise.
	* elfn32-mips.c (mips_elf_n32_rtype_to_howto): Likewise.
2018-04-04 02:00:48 +01:00
GDB Administrator 270baac007 Automatic date update in version.in 2018-04-04 00:00:24 +00:00
Tom Tromey c5edbf3d1c Change read_alphacoff_dynamic_symtab to use gdb::byte_vector
This changes read_alphacoff_dynamic_symtab to use gdb::byte_vector.
This allows for the removal of some cleanups.

Tested by the buildbot; though I don't know whether this code path is
ever actually run.

gdb/ChangeLog
2018-04-03  Tom Tromey  <tom@tromey.com>

	* mipsread.c (read_alphacoff_dynamic_symtab): Use
	gdb::byte_vector.
2018-04-03 12:03:33 -06:00
Maciej W. Rozycki dfdad367e4 MIPS/LD/testsuite: Correct LD emulations for `mips*-*-kfreebsd*-gnu'
Complement commit 86b24e15c4 ("MIPS/LD/testsuite: Correct
comm-data.exp test ABI/emul/endian arrangement") and set LD emulations
correctly for `mips*-*-kfreebsd*-gnu' targets in comm-data.exp, removing
test suite failures:

FAIL: MIPS o32/copyreloc common symbol override test (auxiliary shared object build)
FAIL: MIPS o32/copyreloc common symbol override test
FAIL: MIPS o32/nocopyreloc common symbol override test (auxiliary shared object build)
FAIL: MIPS o32/nocopyreloc common symbol override test

	ld/
	* testsuite/ld-mips-elf/comm-data.exp: Correct support for
	`mips*-*-kfreebsd*-gnu' targets.
2018-04-03 09:18:06 +01:00
Cary Coutant bce5a025d2 Fix problem where mixed section types can cause internal error during a -r link.
During a -r (or --emit-relocs) link, if two sections had the same name but
different section types, gold would put relocations for both sections into
the same relocation section even though the data sections remained separate.

For .eh_frame sections, when one section is PROGBITS and another is
X86_64_UNWIND, we really should be using the UNWIND section type and
combining the sections anyway.  For other sections, we should be
creating one relocation section for each output data section.

gold/
	PR gold/23016
	* incremental.cc (can_incremental_update): Check for unwind section
	type.
	* layout.h (Layout::layout): Add sh_type parameter.
	* layout.cc (Layout::layout): Likewise.
	(Layout::layout_reloc): Create new output reloc section if data
	section does not already have one.
	(Layout::layout_eh_frame): Check for unwind section type.
	(Layout::make_eh_frame_section): Use unwind section type for .eh_frame
	and .eh_frame_hdr.
	* object.h (Sized_relobj_file::Shdr_write): New typedef.
	(Sized_relobj_file::layout_section): Add sh_type parameter.
	(Sized_relobj_file::Deferred_layout::Deferred_layout): Add sh_type
	parameter.
	* object.cc (Sized_relobj_file::check_eh_frame_flags): Check for
	unwind section type.
	(Sized_relobj_file::layout_section): Add sh_type parameter; pass it
	to Layout::layout.
	(Sized_relobj_file::do_layout): Make local copy of sh_type.
	Force .eh_frame sections to unwind section type.
	Pass sh_type to layout_section.
	(Sized_relobj_file<size, big_endian>::do_layout_deferred_sections):
	Pass sh_type to layout_section.
	* output.cc (Output_section::Output_section): Initialize reloc_section_.
	* output.h (Output_section::reloc_section): New method.
	(Output_section::set_reloc_section): New method.
	(Output_section::reloc_section_): New data member.
	* target.h (Target::unwind_section_type): New method.
	(Target::Target_info::unwind_section_type): New data member.

	* aarch64.cc (aarch64_info): Add unwind_section_type.
	* arm.cc (arm_info, arm_nacl_info): Likewise.
	* i386.cc (i386_info, i386_nacl_info, iamcu_info): Likewise.
	* mips.cc (mips_info, mips_nacl_info): Likewise.
	* powerpc.cc (powerpc_info): Likewise.
	* s390.cc (s390_info): Likewise.
	* sparc.cc (sparc_info): Likewise.
	* tilegx.cc (tilegx_info): Likewise.
	* x86_64.cc (x86_64_info, x86_64_nacl_info): Likewise.

	* testsuite/Makefile.am (pr23016_1, pr23016_2): New test cases.
	* testsuite/Makefile.in: Regenerate.
	* testsuite/testfile.cc: Add unwind_section_type.
	* testsuite/pr23016_1.sh: New test script.
	* testsuite/pr23016_1a.s: New source file.
	* testsuite/pr23016_1b.s: New source file.
	* testsuite/pr23016_2.sh: New test script.
	* testsuite/pr23016_2a.s: New source file.
	* testsuite/pr23016_2b.s: New source file.
2018-04-02 19:07:04 -07:00
GDB Administrator 8849a5e9ed Automatic date update in version.in 2018-04-03 00:00:24 +00:00
Weimin Pan b39efc483a Add myself as a write-after-approval GDB maintainer. 2018-04-02 16:23:59 -05:00
Joel Brobecker 121ad66c94 Fix merge issues in gdb/ChangeLog and gdb/testsuite/ChangeLog...
... introduced by the previous commit to these files.
Also adjust the date in the new ChangeLog entries (out of date).
2018-04-02 11:34:11 -07:00
Weimin Pan 79f1873171 Fix infinite recursion when printing static member with typedef
The original problem was fixed (see related PR 22242). But using a typedef
as the declared type for a static member variable, as commented in this PR,
is still causing gdb to get into infinite loop when printing the static
member's value. This problem can be reproduced as follows:

% cat t.cc
class A {
    typedef A type;
public:
    bool operator==(const type& other) { return true; }

    static const type INSTANCE;
};

const A A::INSTANCE;

int main() {
    A a;
    if (a == A::INSTANCE) {
        return -1;
    }
    return 0;
}
% g++ -g t.cc
% gdb -ex "start" -ex "p a" a.out

The fix is rather trivial - in cp_print_static_field(), should call
check_typedef() to get the static member's real type and use it to
check whether it's a struct or an array.

As Simon suggested, I've added a new test case to the testsuite
and am passing the original type, not the real type, as argument
to both cp_print_value_fields() and val_print().

Re-tested on both aarch64-linux-gnu and amd64-linux-gnu. No regressions.
2018-04-02 12:53:43 -05:00
Joel Brobecker 3d6b3b8221 gdb/ChangeLog: Fix filenames in a couple of entries 2018-04-02 06:49:57 -07:00
Tom Tromey 09473be85c Change rs6000_ptrace_ldinfo to return a byte_vector
This changes rs6000_ptrace_ldinfo to return a byte_vector.  I think
this points out an existing double-free in
rs6000_xfer_shared_libraries.

Tested by the buildbot.

gdb/ChangeLog
2018-04-01  Tom Tromey  <tom@tromey.com>

	* rs6000-nat.c (rs6000_ptrace_ldinfo): Return a byte_vector.
	(rs6000_xfer_shared_libraries): Update.
2018-04-01 20:28:51 -06:00
GDB Administrator a9f4c2f56f Automatic date update in version.in 2018-04-02 00:00:44 +00:00
Simon Marchi ec1f2d91e0 Remove char_ptr typedef
Now that all instances of VEC(char_ptr) are gone, we can remove the
typedef.  There is just one usage left, that is trivial to replace.

Tested by rebuilding on an enable-targets=all build.

gdb/ChangeLog:

	* common/gdb_vecs.h (char_ptr): Remove.
	* tracepoint.c (encode_actions_1): Remove usage of char_ptr.
2018-04-01 14:23:17 -04:00
GDB Administrator a16ffec0da Automatic date update in version.in 2018-04-01 00:00:56 +00:00
GDB Administrator dc20d41409 Automatic date update in version.in 2018-03-31 00:00:27 +00:00
Simon Marchi d8611974cf Remove usage of VEC(char_ptr) in gdbscm_parse_function_args
This is a straightforward replacement, no change in behavior are
intended/expected.

This is the last usage of VEC(char_ptr), so it can now be removed.

gdb/ChangeLog:

	* guile/scm-utils.c (gdbscm_parse_function_args): Replace VEC
	with std::vector.
	* common/gdb_vecs.h (DEF_VEC_P (char_ptr)): Remove.
2018-03-30 17:18:56 -04:00
Simon Marchi 17d08cd413 Use std::vector and std::string instead of VEC(char_ptr) in gdbserver tdesc
This is a straightforward replacement, no change in behavior are
intended/expected.

gdb/gdbserver/ChangeLog:

	* tdesc.h (struct target_desc) <features>: Change type to
	std::vector<std::string>.
	* tdesc.c (target_desc::~target_desc): Adjust to std::vector
	changes.
	(tdesc_get_features_xml): Likewise.
	(tdesc_create_feature): Likewise.
2018-03-30 17:18:55 -04:00
Simon Marchi a18ba4e4c9 Use std::vector in uploaded_tp
This patch changes the VEC(char_ptr) fields in uploaded_tp to use
std::vector<char *>.  At first, I wanted to creep in more changes, like
using std::string, but it was making the patch too big and less focused,
so I decided to keep it to just that.

It also looks like the strings in those vectors are never free'd.  If
so, we can fix that in another patch.

gdb/ChangeLog:

	* tracepoint.h (struct uploaded_tp): Initialize fields.
	<actions, step_actions, cmd_strings>: Change type to
	std::vector<char *>.
	* tracepoint.c (get_uploaded_tp): Allocate with new.
	(free_uploaded_tps): Free with delete.
	(parse_tracepoint_definition): Adjust to std::vector change.
	* breakpoint.c (read_uploaded_action): Likewise.
	(create_tracepoint_from_upload): Likewise.
	* ctf.c (ctf_write_uploaded_tp): Likewise.
	(SET_ARRAY_FIELD): Likewise.
	* tracefile-tfile.c (tfile_write_uploaded_tp): Likewise.
2018-03-30 17:18:54 -04:00
Tom Tromey a7961323e2 Remove some cleanups from solib-svr4.c
This removes a few cleanups from solib-svr4.c in a straightforward
way.

gdb/ChangeLog
2018-03-30  Tom Tromey  <tom@tromey.com>

	* solib-svr4.c (lm_info_read): Use gdb::byte_vector.  Return
	std::unique_ptr.
	(svr4_keep_data_in_core): Update.
	(svr4_read_so_list): Update.
2018-03-30 13:22:58 -06:00
Tom Tromey e83e4e2402 Change target_read_string to use unique_xmalloc_ptr
This changes the out parameter of target_read_string to be a
unique_xmalloc_ptr.  This avoids a cleanup and sets the stage for more
cleanup removals.

This patch also removes a seemingly needless alloca from
print_subexp_standard.

gdb/ChangeLog
2018-03-30  Tom Tromey  <tom@tromey.com>

	* windows-nat.c (handle_output_debug_string, handle_exception):
	Update.
	* target.h (target_read_string): Update.
	* target.c (target_read_string): Change "string" to
	unique_xmalloc_ptr.
	* solib-svr4.c (open_symbol_file_object, svr4_read_so_list):
	Update.
	* solib-frv.c (frv_current_sos): Update.
	* solib-dsbt.c (dsbt_current_sos): Update.
	* solib-darwin.c (darwin_current_sos): Update.
	* linux-thread-db.c (inferior_has_bug): Update.
	* expprint.c (print_subexp_standard) <case OP_OBJC_MSGCALL>:
	Update.  Remove alloca.
	* ada-lang.c (ada_main_name): Update.
2018-03-30 13:22:58 -06:00
Tom Tromey 263db9a1f4 Remove free_dwo_file_cleanup
This removes free_dwo_file_cleanup, the last cleanup in dwarf2read.c.
This is replaced with a unique_ptr; which, despite the fact that a
dwo_file is obstack-allocated, seemed like the best fit.

gdb/ChangeLog
2018-03-30  Tom Tromey  <tom@tromey.com>

	* dwarf2read.c (struct free_dwo_file_cleanup_data): Remove.
	(struct dwo_file_deleter): New.
	(dwo_file_up): New typedef.
	(open_and_init_dwo_file): Use dwo_file_up.
	(free_dwo_file_cleanup): Remove.
2018-03-30 13:15:58 -06:00
Tom Tromey 5dafb3d176 Remove parameter from free_dwo_file
The objfile parameter to free_dwo_file is unused, so remove it.

gdb/ChangeLog
2018-03-30  Tom Tromey  <tom@tromey.com>

	* dwarf2read.c (free_dwo_file): Remove "objfile" parameter.
	(free_dwo_file_cleanup, free_dwo_file_from_slot): Update.
2018-03-30 13:15:57 -06:00
Tom Tromey 11ed8cada6 Remove free_cached_comp_units cleanups
This changes free_cached_comp_units from a cleanup function to an RAII
class.

gdb/ChangeLog
2018-03-30  Tom Tromey  <tom@tromey.com>

	* dwarf2read.c (class free_cached_comp_units): New class.
	(dw2_instantiate_symtab, dwarf2_build_psymtabs_hard): Use it.
	(free_cached_comp_units): Remove function.
2018-03-30 13:15:57 -06:00
Tom Tromey 9ae79dac31 Remove make_cleanup_unpush_target
This removes make_cleanup_unpush_target, replacing it with a
unique_ptr.  This may seem odd, because the object in question is not
actually freed, but unique_ptr provided the necessary functionality.

Tested by the buildbot.

gdb/ChangeLog
2018-03-30  Tom Tromey  <tom@tromey.com>

	* utils.h (make_cleanup_unpush_target): Remove.
	* inf-ptrace.c (struct target_unpusher): New.
	(target_unpush_up) New typedef.
	(inf_ptrace_create_inferior, inf_ptrace_attach): Use
	target_unpush_up.
	* utils.c (do_unpush_target, make_cleanup_unpush_target): Remove.
2018-03-30 13:10:42 -06:00
Peter Bergner f2ab4b4206 Make power8 the default cpu when assembling for 64-bit little endian targets.
gas/
	PR binutils/23013
	* config/tc-ppc.c (ppc_set_cpu): Select appropriate cpu when ppc_obj64
	and little endian.
2018-03-30 08:33:27 -05:00
GDB Administrator f7c486b165 Automatic date update in version.in 2018-03-30 00:00:36 +00:00
Maciej W. Rozycki 75def2abc3 PR binutils/22875: MIPS: Remove duplicate unsupported relocation processing
Remove a duplicate `unsupported relocation type' message and the setting
of the `bfd_error_bad_value' error from `mips_elf32_rtype_to_howto',
added with commit f3185997ac ("PR 22875: Stop strip corrupting unknown
relocs"), <https://sourceware.org/ml/binutils/2018-02/msg00445.html>.
This message is already produced and the `bfd_error_bad_value' error set
by `mips_elf32_rtype_to_howto' before a NULL howto is returned, so there
is no need to repeat these actions here.

	bfd/
	* elf32-mips.c (mips_info_to_howto_rel): Remove the calls to
	`_bfd_error_handler' and to set the `bfd_error_bad_value' error.
2018-03-29 14:10:37 +01:00
GDB Administrator 515d75a486 Automatic date update in version.in 2018-03-29 00:00:32 +00:00
Maciej W. Rozycki 8b6a949ae5 BFD/PA: Remove ATTRIBUTE_UNUSED from `elf_hppa_info_to_howto_rel'
Remove ATTRIBUTE_UNUSED annotation from the `abfd' parameter in
`elf_hppa_info_to_howto' now that commit f3185997ac ("PR 22875: Stop
strip corrupting unknown relocs"),
<https://sourceware.org/ml/binutils/2018-02/msg00445.html>, made it
used.

	bfd/
	* elf-hppa.h (elf_hppa_info_to_howto_rel): Remove
	ATTRIBUTE_UNUSED from `abfd'.
2018-03-28 22:42:17 +01:00