Commit Graph

93555 Commits

Author SHA1 Message Date
Maciej W. Rozycki c5196c9298 MIPS: Don't use a 32-bit BFD architecture with a 64-bit ABI
Select `bfd_mach_mips4000', which corresponds to the MIPS III ISA, the
earlies with 64-bit support, whenever a 32-bit BFD architecture has been
chosen to use with a 64-bit ABI.  The situation can happen in a few
cases:

1. When the user has used `set architecture' or `set mips abi' commands
   to override automatic selection and then starts a debug session by
   requesting to run, attach or connect to a target.

2. In native debugging when reattaching to a previously debugged process
   where the program to be debugged has been since discarded, as
   observed with:

FAIL: gdb.base/attach.exp: attach2, with no file (GDB internal error)

   in n32 and n64 regression testing.

3. In remote debugging with a non-XML debug stub when discarding the
   program to be debugged while connected to the remote target, as
   observed with:

FAIL: gdb.base/break-unload-file.exp: cmdline: always-inserted on: break: file (GDB internal error)

   in n32 and n64 regression testing.

In the latter two cases the ABI, quite rightfully, is retained while the
program to be debugged is discarded.  This is because in that case the
ABI previously determined is carried over along with `gdbarch' in use,
which is retained.  The BFD architecture is however discarded and the
default then applies, because it is not attached to `gdbarch'.

In all these cases we trip with an internal error message as follows:

.../gdb/mips-tdep.c:766: internal-error: bad register size
A problem internal to GDB has been detected,
further debugging may prove unreliable.
Quit this debugging session? (y or n) n

This is a bug, please report it.  For instructions, see:
<http://www.gnu.org/software/gdb/bugs/>.

coming from `mips_pseudo_register_read', because the raw register width
inferred from the BFD architecture turns out to be 4 for the general
registers while the cooked register width inferred from the ABI in
effect is 8.

We do not hit this internal error in remote debugging with an XML debug
stub, because in that case raw register width information is passed by
the stub along with the XML target description.

Ultimately I think we ought to make the BFD architecture sticky like the
ABI, however in the interim this simple fix will do, removing the error
across all three cases.  The case where the user has used `set mips abi'
or `set architecture' commands has to be handled anyway, and although a
more sophisticated solution could be envisaged, such as reporting an
error with the respective `set' command, I think this is too much of a
corner case to bother.

	gdb/
	* mips-tdep.c (mips_gdbarch_init): Don't use a 32-bit BFD
	architecture with a 64-bit ABI.
2018-02-26 19:43:17 +00:00
Maciej W. Rozycki 37c33887bd MIPS: Reorder ABI determination ahead of target description loading
Move ABI determination code ahead of target description loading so that
architecture information can be adjusted according to the ABI selected,
and then used in OS dependent register information initialization needed
for target description processing.  No functional change.

	gdb/
	* gdb/mips-tdep.c (mips_gdbarch_init): Reorder ABI determination
	ahead of target description loading.
2018-02-26 19:43:17 +00:00
Tom Tromey d4dd32824a Change frame_filter_flags to use DEF_ENUM_FLAGS_TYPE
This changes frame_filter_flags to use DEF_ENUM_FLAGS_TYPE, and
updates all the uses.  It also changes the enum constants to use <<,
as suggested by Sergio.

ChangeLog
2018-02-26  Tom Tromey  <tom@tromey.com>

	* stack.c (backtrace_command_1): Update.
	* python/python-internal.h (gdbpy_apply_frame_filter): Change type
	of "flags".
	* python/py-framefilter.c (py_print_frame)
	(gdbpy_apply_frame_filter): Change type of "flags".
	* mi/mi-cmd-stack.c (mi_apply_ext_lang_frame_filter): Change type
	of "flags".
	(mi_cmd_stack_list_frames, mi_cmd_stack_list_locals)
	(mi_cmd_stack_list_args, mi_cmd_stack_list_variables): Update.
	* extension.h (enum frame_filter_flag): Rename from
	frame_filter_flags.
	(frame_filter_flags): Define using DEF_ENUM_FLAGS_TYPE.
	(apply_ext_lang_frame_filter): Change type of "flags".
	* extension.c (apply_ext_lang_frame_filter): Change type of
	"flags".
	* extension-priv.h (struct extension_language_ops)
	<apply_frame_filter>: Change type of "flags".
2018-02-26 09:37:03 -07:00
Tom Tromey 6893c19a8b Make "bt N" print correct number of frames when using a frame filter
PR python/16497 notes that using "bt" with a positive argument prints
the wrong number of frames when a frame filter is in use.  Also, in this
case, the non-frame-filter path will print a message about "More stack
frames" when there are more; but this is not done in the frame-filter
case.

The first problem is that backtrace_command_1 passes the wrong value
to apply_ext_lang_frame_filter -- that function takes the final
frame's number as an argument, but backtrace_command_1 passes the
count, which is off by one.

The solution to the second problem is to have the C stack-printing
code stop at the correct number of frames and then print the message.

Tested using the buildbot.

ChangeLog
2018-02-26  Tom Tromey  <tom@tromey.com>

	PR python/16497:
	* stack.c (backtrace_command_1): Set PRINT_MORE_FRAMES flag.  Fix
	off-by-one in py_end computation.
	* python/py-framefilter.c (gdbpy_apply_frame_filter): Handle
	PRINT_MORE_FRAMES.
	* extension.h (enum frame_filter_flags) <PRINT_MORE_FRAMES>: New
	constant.

2018-02-26  Tom Tromey  <tom@tromey.com>

	PR python/16497:
	* gdb.python/py-framefilter.exp: Update test.
2018-02-26 09:37:03 -07:00
Tom Tromey 2ddeaf8a7d Handle DW_TAG_variant_part and DW_TAG_variant
This changes dwarf2read to understand DW_TAG_variant_part and
DW_TAG_variant.

Note that DW_AT_discr_list is not handled.  I did not need this for
Rust.  I imagine this should not be too hard to add later, should
someone need it.  Meanwhile I have gdb emit a complaint if it is seen.

There is a lurking issue concerning the placement of the discriminant
in the DWARF.  For Rust, I ended up following the letter of the
standard and having the discriminant be a child of the
DW_TAG_variant_part.  However, GCC's Ada support does not do this.
Pierre-Marie filed this with the DWARF committee:

    http://dwarfstd.org/ShowIssue.php?issue=180123.1

However as that is read-only, if you have comments you might consider
adding them to the GCC bug:

    https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83935

Finally, there is a DWARF extension lurking in here.  In Rust, a
univariant enum will not have a discriminant.  However, in order to
unify the representation of all data-carrying enums, I've made LLVM
(and my forthcoming rustc patch) emit a univariant enum using a
DW_TAG_variant with a single variant part and without DW_AT_discr.
The lack of this DW_AT_discr is the extension.  I will submit an issue
on dwarfstd.org about this.

2018-02-26  Tom Tromey  <tom@tromey.com>

	* dwarf2read.c (struct variant_field): New.
	(struct nextfield) <variant>: New field.
	(dwarf2_add_field): Handle DW_TAG_variant_part.
	(dwarf2_attach_fields_to_type): Attach a discriminant_info to a
	discriminated union.
	(read_structure_type): Handle DW_TAG_variant_part.
	(handle_struct_member_die): New function, extracted from
	process_structure_scope.  Handle DW_TAG_variant.
	(process_structure_scope): Handle discriminated unions.  Call
	handle_struct_member_die.

2018-02-26  Tom Tromey  <tom@tromey.com>

	* gdb.dwarf2/variant.c: New file.
	* gdb.dwarf2/variant.exp: New file.
2018-02-26 09:21:08 -07:00
Tom Tromey c9317f214b Convert Rust to use discriminated unions
A Rust enum is, essentially, a discriminated union.  Currently the
Rust language support handles Rust enums locally, in rust-lang.c.
However, because I am changing the Rust compiler to use
DW_TAG_variant* to represent enums, it seemed better to have a single
internal representation for Rust enums in gdb.

This patch implements this idea by moving the current Rust enum
handling code to dwarf2read.  This allows the simplification of some
parts of rust-lang.c as well.

2018-02-26  Tom Tromey  <tom@tromey.com>

	* rust-lang.h (rust_last_path_segment): Declare.
	* rust-lang.c (rust_last_path_segment): Now public.  Change
	contract.
	(struct disr_info): Remove.
	(RUST_ENUM_PREFIX, RUST_ENCODED_ENUM_REAL)
	(RUST_ENCODED_ENUM_HIDDEN, rust_union_is_untagged)
	(rust_get_disr_info, rust_tuple_variant_type_p): Remove.
	(rust_enum_p, rust_enum_variant): New function.
	(rust_underscore_fields): Remove "offset" parameter.
	(rust_print_enum): New function.
	(rust_val_print) <TYPE_CODE_UNION>: Remove enum code.
	<TYPE_CODE_STRUCT>: Call rust_print_enum when appropriate.
	(rust_print_struct_def): Add "for_rust_enum" parameter.  Handle
	enums.
	(rust_internal_print_type): New function, from rust_print_type.
	Remove enum code.
	(rust_print_type): Call rust_internal_print_type.
	(rust_evaluate_subexp) <STRUCTOP_ANONYMOUS, STRUCTOP_STRUCT>:
	Update enum handling.
	* dwarf2read.c (struct dwarf2_cu) <rust_unions>: New field.
	(rust_fully_qualify, alloc_discriminant_info, quirk_rust_enum)
	(rust_union_quirks): New functions.
	(process_full_comp_unit, process_full_type_unit): Call
	rust_union_quirks.
	(process_structure_scope): Update rust_unions if necessary.

2018-02-26  Tom Tromey  <tom@tromey.com>

	* gdb.rust/simple.exp: Accept more possible results in enum test.
2018-02-26 09:21:08 -07:00
Tom Tromey 7c22600aab Initial support for variant parts
This adds some initial support for variant parts to gdbtypes.h.  A
variant part is represented as a union.  The union has a flag
indicating that it has a discriminant, and information about the
discriminant is attached using the dynamic property system.

2018-02-26  Tom Tromey  <tom@tromey.com>

	* value.h (value_union_variant): Declare.
	* valops.c (value_union_variant): New function.
	* gdbtypes.h (TYPE_FLAG_DISCRIMINATED_UNION): New macro.
	(struct discriminant_info): New.
	(enum dynamic_prop_node_kind) <DYN_PROP_DISCRIMINATED>: New
	enumerator.
	(struct main_type) <flag_discriminated_union>: New field.
2018-02-26 09:21:08 -07:00
Tom Tromey 15ce8941e7 Sign-extend non-bit-fields in unpack_bits_as_long
unpack_bits_as_long is documented as sign-extending its result when
the type is signed.  However, it was only doing sign-extension in the
case where the field was a bitfield -- that is, not when the "bitsize"
parameter was 0, indicating the size should be taken from the type.

Also, unpack_bits_as_long was incorrectly computing the shift for
big-endian architectures for the non-bitfield case.

This patch fixes these bugs in a straightforward way.  A new selftest
is included.

2018-02-26  Tom Tromey  <tom@tromey.com>

	* Makefile.in (SUBDIR_UNITTESTS_SRCS): Add
	unittests/unpack-selftests.c.
	* unittests/unpack-selftests.c: New file.
	* value.c (unpack_bits_as_long): Fix bugs in non-bitfield cases.
2018-02-26 09:21:08 -07:00
Maciej W. Rozycki d7c798565e GAS/doc: Clean up `.dc' and `.ds' directive descriptions
gas/
	* doc/as.texinfo (Pseudo Ops): Clean up `.dc' and `.ds'
	descriptions.
2018-02-26 16:11:03 +00:00
Yao Qi 48fbe735fb Move read_partial_die to partial_die_info::read
gdb:

2018-02-26  Yao Qi  <yao.qi@linaro.org>

	* dwarf2read.c (struct partial_die_info) <read>: New method.
	(read_partial_die): Remove the declaration.
	(load_partial_dies): Update.
	(partial_die_info::partial_die_info):
	(read_partial_die): Change it to partial_die_info::read.
2018-02-26 15:38:01 +00:00
Yao Qi 52356b79d7 Move fixup_partial_die to partial_die_info::fixup
fixup_partial_die can be a partial_die_info method fixup.

gdb:

2018-02-26  Yao Qi  <yao.qi@linaro.org>

	* dwarf2read.c (struct partial_die_info) <fixup>: New method.
	(fixup_partial_die): Remove declaration.
	(scan_partial_symbols): Update.
	(partial_die_parent_scope): Likewise.
	(partial_die_full_name): Likewise.
	(fixup_partial_die): Change it to partial_die_info::fixup.
2018-02-26 15:38:01 +00:00
Yao Qi 35cc7ed70c Remove one argument abbrev_len in read_partial_die
gdb:

2018-02-26  Yao Qi  <yao.qi@linaro.org>

	* dwarf2read.c (read_partial_die): Update the declaration.
	(load_partial_dies): Caller update.
	(read_partial_die): Remove one argument abbrev_len.
2018-02-26 15:38:01 +00:00
Yao Qi 6f06d47ba0 Class-fy partial_die_info
This patch is to class-fy partial_die_info.  Two things special here,

 - disable assignment operator, but keep copy ctor, which is used in
   load_partial_dies,
 - have a private ctor which is only used by dwarf2_cu::find_partial_die,
   I don't want other code use it, so make it private,

gdb:

2018-02-26  Yao Qi  <yao.qi@linaro.org>

	* dwarf2read.c (struct partial_die_info): Add ctor, delete
	assignment operator.
	(load_partial_dies): Use ctor and copy ctor.
	(read_partial_die): Update.
	(dwarf2_cu::find_partial_die): Use ctor.
2018-02-26 15:38:01 +00:00
Yao Qi d590ff257c Change find_partial_die_in_comp_unit to dwarf2_cu::find_partial_die
This patch changes find_partial_die_in_comp_unit to a dwarf2_cu method
find_partial_die.

gdb:

2018-02-26  Yao Qi  <yao.qi@linaro.org>

	* dwarf2read.c (struct dwarf2_cu) <find_partial_die>: New method.
	(find_partial_die_in_comp_unit): Change it to
	dwarf2_cu::find_partial_die.
	(find_partial_die): Update.
2018-02-26 15:38:01 +00:00
Yao Qi fd0a254f81 Don't check abbrev is NULL in read_partial_die
'abbrev' won't be NULL, so don't check it.

gdb:

2018-02-26  Yao Qi  <yao.qi@linaro.org>

	* dwarf2read.c (read_partial_die): Remove the code checking abbrev
	is NULL.
2018-02-26 15:38:00 +00:00
Yao Qi cd9983dd5f Re-write partial_die_info allocation in load_partial_dies
load_partial_dies has a "while (1)" loop to visit each die, and create
partial_die_info if needed in each iteration, like this,

  part_die = XOBNEW (&cu->comp_unit_obstack, struct partial_die_info);

  while (1)
   {
      if (foo1) continue;

      if (foo2) continue;

      read_partial_die (, , part_die, ,);

      ....
      part_die = XOBNEW (&cu->comp_unit_obstack, struct partial_die_info);
   };

the code was written in a way that spaces are allocated on necessary on
cu->comp_unit_obstack.  I want to class-fy partial_die_info, but
partial_die_info ctor can't follow XOBNEW immediately, so this patch
rewrite this loop to:

  while (1)
   {
      if (foo1) continue;

      if (foo2) continue;

      struct partial_die_info pdi;
      read_partial_die (, , &pdi, ,);

      part_die = XOBNEW (&cu->comp_unit_obstack, struct partial_die_info);
      memcpy (part_die, &pdi, sizeof (pdi));
   };

we create a local variable pdi, if we need it, call XOBNEW, and copy.
This also reduce one XOBNEW call.  I measured the number of XOBNEW call in
load_partial_dies when gdb reads dwarf2read.o, without this patch, it is
18827, and with this patch, it is 18826.

gdb:

2018-026-26  Yao Qi  <yao.qi@linaro.org>

	* dwarf2read.c (load_partial_dies): Move the location of XOBNEW.
2018-02-26 15:38:00 +00:00
Alan Hayward f46cd62a69 Move arch/tdesc.h to common/tdesc.h
gdb/
	* arch/amd64.h: Use common/tdesc.h.
	* arch/i386.c: Likewise.
	* arch/i386.h: Likewise.
	* arch/tic6x.c: Likewise.
	* arch/tdesc.h: Move file from here...
	* common/tdesc.h: ...to here.
	* features/aarch64-core.c: Regenerate.
	* features/aarch64-fpu.c: Regenerate.
	* features/i386/32bit-avx.c: Regenerate.
	* features/i386/32bit-avx512.c: Regenerate.
	* features/i386/32bit-core.c: Regenerate.
	* features/i386/32bit-linux.c: Regenerate.
	* features/i386/32bit-mpx.c: Regenerate.
	* features/i386/32bit-pkeys.c: Regenerate.
	* features/i386/32bit-sse.c: Regenerate.
	* features/i386/64bit-avx.c: Regenerate.
	* features/i386/64bit-avx512.c: Regenerate.
	* features/i386/64bit-core.c: Regenerate.
	* features/i386/64bit-linux.c: Regenerate.
	* features/i386/64bit-mpx.c: Regenerate.
	* features/i386/64bit-pkeys.c: Regenerate.
	* features/i386/64bit-segments.c: Regenerate.
	* features/i386/64bit-sse.c: Regenerate.
	* features/i386/x32-core.c: Regenerate.
	* features/tic6x-c6xp.c: Regenerate.
	* features/tic6x-core.c: Regenerate.
	* features/tic6x-gp.c: Regenerate.
	* target-descriptions.c: Use common/tdesc.h.
	* target-descriptions.h: Likewise.

gdbserver/
	* tdesc.c: Use common/tdesc.h.
	* tdesc.h: Likewise.
2018-02-26 11:46:57 +00:00
Nick Clifton 46c685acda Fix typo in documentation of assembler's .dc directive.
* doc/as.texinfo (Dc): Fix typo.
2018-02-26 11:28:23 +00:00
Alan Modra 6838f2bed6 Segfault on phdrs allocated but not created
A number of ARM tests show results like:
ld-new: no address assigned to the veneers output section .gnu.sgstubs
ld-new: can not size stub section: invalid operation
ld-new: warning: cannot find entry symbol _start; defaulting to 0000000000010074
ld-new: tmpdir/cmse-veneers-no-gnu_sgstubs: warning: allocated section `.text' not in segment
Segmentation fault
PASS: Secure gateway veneers: no .gnu.sgstubs section

The PASS despite the segv shows the danger of using "#..." to match
error output.  This patch doesn't try to fix the testuite, but does
prevent the segfault.

	* elf.c (assign_file_positions_except_relocs): Don't segfault
	when actual number of phdrs is less than allocated.  Delete
	outdated comment.  Formatting.
2018-02-26 10:51:12 +10:30
Alan Modra df5f2391f7 ld error/warning messages
This patch standardizes messages in ld, to better conform to the GNU
coding standard.  Besides issues of capitalization and full-stops,
I've
- Split up help messages for target options, so that adding a new
  option does not mean loss of translation for all the others.
- Embedded tabs have been removed, since a user might have tab stops
  set at other than 8 char intervals.
- Added missing program name (%P).  ld isn't the compiler.
- Put %F and %X first (and removed %X if %F was present).  These can
  go anywhere, but look silly in the m%Fiddle of a message, and
  choosing "%P%F:" in some messages but "%F%P:" in others leads to the
  likelihood of duplication in ld.pot.  Besides, the colon belongs
  with %P.

	* emulparams/call_nop.sh, * emulparams/cet.sh,
	* emulparams/elf32mcore.sh, * emultempl/aarch64elf.em
	* emultempl/aix.em, * emultempl/alphaelf.em, * emultempl/armcoff.em,
	* emultempl/armelf.em, * emultempl/avrelf.em, * emultempl/beos.em,
	* emultempl/bfin.em, * emultempl/cr16elf.em, * emultempl/elf32.em,
	* emultempl/elf-generic.em, * emultempl/hppaelf.em,
	* emultempl/linux.em, * emultempl/lnk960.em,
	* emultempl/m68hc1xelf.em, * emultempl/m68kcoff.em,
	* emultempl/m68kelf.em, * emultempl/metagelf.em,
	* emultempl/mipself.em, * emultempl/mmix-elfnmmo.em,
	* emultempl/mmo.em, * emultempl/msp430.em, * emultempl/nds32elf.em,
	* emultempl/nios2elf.em, * emultempl/pe.em, * emultempl/pep.em,
	* emultempl/ppc32elf.em, * emultempl/ppc64elf.em,
	* emultempl/scoreelf.em, * emultempl/sh64elf.em,
	* emultempl/spuelf.em, * emultempl/sunos.em, * emultempl/tic6xdsbt.em,
	* emultempl/ticoff.em, * emultempl/v850elf.em, * emultempl/vms.em,
	* emultempl/vxworks.em, * emultempl/xtensaelf.em, * ldcref.c,
	* ldctor.c, * ldexp.c, * ldfile.c, * ldgram.y, * ldlang.c,
	* ldmain.c, * ldmisc.c, * ldwrite.c, * lexsup.c, * mri.c, * pe-dll.c,
	* plugin.c: Standardize error/warning messages.
	* testsuite/ld-arc/jli-overflow.err,
	* testsuite/ld-arm/cmse-implib-errors.out,
	* testsuite/ld-arm/cmse-new-earlier-later-implib.out,
	* testsuite/ld-arm/cmse-new-implib-not-sg-in-implib.out,
	* testsuite/ld-arm/cmse-new-wrong-implib.out,
	* testsuite/ld-arm/cmse-veneers-no-gnu_sgstubs.out,
	* testsuite/ld-arm/cmse-veneers-wrong-entryfct.out,
	* testsuite/ld-arm/vxworks1-static.d,
	* testsuite/ld-cris/tls-err-20x.d, * testsuite/ld-cris/tls-err-29.d,
	* testsuite/ld-cris/tls-err-31.d, * testsuite/ld-cris/tls-err-33.d,
	* testsuite/ld-cris/tls-err-35.d, * testsuite/ld-cris/tls-err-37.d,
	* testsuite/ld-cris/tls-err-39.d, * testsuite/ld-cris/tls-err-41.d,
	* testsuite/ld-cris/tls-err-43.d, * testsuite/ld-cris/tls-err-45.d,
	* testsuite/ld-cris/tls-err-47.d, * testsuite/ld-cris/tls-err-49.d,
	* testsuite/ld-cris/tls-err-51.d, * testsuite/ld-cris/tls-err-67.d,
	* testsuite/ld-elf/dwarf2.err, * testsuite/ld-elf/dwarf3.err,
	* testsuite/ld-elf/orphan-5.l, * testsuite/ld-elf/orphan-6.l,
	* testsuite/ld-i386/vxworks1-static.d,
	* testsuite/ld-mips-elf/bal-jalx-pic-micromips-n32.d,
	* testsuite/ld-mips-elf/bal-jalx-pic-micromips-n64.d,
	* testsuite/ld-mips-elf/bal-jalx-pic-micromips.d,
	* testsuite/ld-mips-elf/bal-jalx-pic-n32.d,
	* testsuite/ld-mips-elf/bal-jalx-pic-n64.d,
	* testsuite/ld-mips-elf/bal-jalx-pic.d,
	* testsuite/ld-mips-elf/jal-global-overflow-1.d,
	* testsuite/ld-mips-elf/jal-local-overflow-1.d,
	* testsuite/ld-mips-elf/mode-change-error-1.d,
	* testsuite/ld-mips-elf/unaligned-branch-2.d,
	* testsuite/ld-mips-elf/unaligned-branch-ignore-2.d,
	* testsuite/ld-mips-elf/unaligned-branch-ignore-micromips.d,
	* testsuite/ld-mips-elf/unaligned-branch-ignore-mips16.d,
	* testsuite/ld-mips-elf/unaligned-branch-ignore-r6-1.d,
	* testsuite/ld-mips-elf/unaligned-branch-micromips.d,
	* testsuite/ld-mips-elf/unaligned-branch-mips16.d,
	* testsuite/ld-mips-elf/unaligned-branch-r6-1.d,
	* testsuite/ld-mips-elf/unaligned-branch-r6-2.d,
	* testsuite/ld-mips-elf/unaligned-branch.d,
	* testsuite/ld-mips-elf/unaligned-jalx-1.d,
	* testsuite/ld-mips-elf/unaligned-jalx-3.d,
	* testsuite/ld-mips-elf/unaligned-jalx-addend-1.d,
	* testsuite/ld-mips-elf/unaligned-jalx-addend-3.d,
	* testsuite/ld-mips-elf/unaligned-jalx-addend-micromips-1.d,
	* testsuite/ld-mips-elf/unaligned-jalx-addend-mips16-1.d,
	* testsuite/ld-mips-elf/unaligned-jalx-micromips-1.d,
	* testsuite/ld-mips-elf/unaligned-jalx-mips16-1.d,
	* testsuite/ld-mips-elf/unaligned-jump-micromips.d,
	* testsuite/ld-mips-elf/unaligned-jump-mips16.d,
	* testsuite/ld-mips-elf/unaligned-jump.d,
	* testsuite/ld-mips-elf/unaligned-ldpc-1.d,
	* testsuite/ld-mips-elf/unaligned-lwpc-1.d,
	* testsuite/ld-mips-elf/undefined.d,
	* testsuite/ld-mips-elf/vxworks1-static.d,
	* testsuite/ld-mmix/bpo-20.d, * testsuite/ld-mmix/bpo-20m.d,
	* testsuite/ld-mmix/bpo-7.d, * testsuite/ld-mmix/bpo-7m.d,
	* testsuite/ld-mmix/bpo-8.d, * testsuite/ld-mmix/bpo-8m.d,
	* testsuite/ld-mmix/greg-17.d, * testsuite/ld-mmix/greg-18.d,
	* testsuite/ld-mmix/greg-8.d, * testsuite/ld-mmix/greg-9.d,
	* testsuite/ld-plugin/plugin-14.d, * testsuite/ld-plugin/plugin-15.d,
	* testsuite/ld-plugin/plugin-16.d, * testsuite/ld-plugin/plugin-20.d,
	* testsuite/ld-plugin/plugin-21.d, * testsuite/ld-plugin/plugin-22.d,
	* testsuite/ld-plugin/plugin-23.d, * testsuite/ld-plugin/plugin-6.d,
	* testsuite/ld-plugin/plugin-7.d, * testsuite/ld-plugin/plugin-8.d,
	* testsuite/ld-powerpc/aix-weak-3-32.d,
	* testsuite/ld-powerpc/aix-weak-3-64.d,
	* testsuite/ld-powerpc/vxworks1-static.d,
	* testsuite/ld-sh/vxworks1-static.d,
	* testsuite/ld-sparc/vxworks1-static.d,
	* testsuite/ld-undefined/undefined.exp,
	* testsuite/ld-x86-64/pie1.d: Update for changed errors and warnings.
	* testsuite/ld-elf/warn1.d, * testsuite/ld-elf/warn2.d: Correct regex.
2018-02-26 10:51:12 +10:30
Alan Modra 33589acbfe ld message translation for emultempl and emulparams
Most of the emultempl/*.em error/warning messages do not currently
appear in ld.pot, and fixing that is not simply a matter of adding
missing files to POTFILES.  The difficulty is the shell-script
quoting, for example aarch64elf.em:PARSE_AND_LIST_OPTIONS "Don'\''t".
I suppose you could avoid contractions like "don't" but I'm unsure as
to whether gettext could handle everything in the emulparams scripts.

The right thing to do is feed the generated C files to gettext, as
this patch does.  The patch just copies what is already done in bfd/
for generated files.

	* Makefile.am (EMULATION_FILES, POTFILES): Delete.
	(SRC_POTFILES, BLD_POTFILES): Define.
	(po/POTFILES.in): Delete rule.
	(po/SRC-POTFILES.in, po/BLD-POTFILES.in): New rules.
	* configure.ac: Add AC_CONFIG_COMMANDS to create po/Makefile.
	* po/Make-in (DISTFILES): Remove POTFILES.in, add SRC-POTFILES.in
	and BLD-POTFILES.in.
	(POTFILES): Delete.
	(SRC-POTFILES, BLD-POTFILES): Define place marker.
	(ld.pot): Build from SRC-POTFILES plus BLD-POTFILES.
	(distclean, maintainer-clean): Tidy up new files.
	(POTFILES, POTFILES.in): Delete rules.
	(SRC-POTFILES, BLD-POTFILES, SRC-POTFILES.in, BLD-POTFILES.in):
	New rules.
	(Makefile): Depend on SRC-POTFILES and BLD-POTFILES.
	* po/SRC-POTFILES.in: Rename from po/POTFILES.in.
	* po/BLD-POTFILES.in: New file.
	* Makefile.in: Regenerate.
	* configure: Regenerate.
2018-02-26 10:51:12 +10:30
Alan Modra e95b887f85 crx string overflow warning
gcc8 complains wrongly about the buffer not being large enough, at
least at -Og optimization.

	* crx-dis.c (getregliststring): Allocate a large enough buffer
	to silence false positive gcc8 warning.
2018-02-26 10:51:12 +10:30
GDB Administrator 128a19de3d Automatic date update in version.in 2018-02-26 00:00:31 +00:00
Alan Modra 38f14ab8fc assorted target messages
bfd/
	* elf-m10300.c, * elf-s390-common.c, * elf32-arc.c, * elf32-cris.c,
	* elf32-dlx.c, * elf32-frv.c, * elf32-i370.c, * elf32-lm32.c,
	* elf32-m32r.c, * elf32-m68hc1x.c, * elf32-m68k.c,
	* elf32-microblaze.c, * elf32-msp430.c, * elf32-nds32.c,
	* elf32-nios2.c, * elf32-or1k.c, * elf32-rl78.c, * elf32-rx.c,
	* elf32-score.c, * elf32-score7.c, * elf32-sh-symbian.c,
	* elf32-sh.c, * elf32-spu.c, * elf32-v850.c, * elf32-xtensa.c,
	* elf64-alpha.c, * elf64-ia64-vms.c, * elf64-mmix.c,
	* elf64-sh64.c, * elf64-sparc.c, * elfnn-ia64.c, * elfxx-tilegx.c,
	* mmo.c, * osf-core.c, * srec.c, * vms-alpha.c: Standardize
	error/warning messages.
ld/
	* testsuite/ld-cris/pcrelcp-1.d,
	* testsuite/ld-mmix/start-2.d: Update.
2018-02-26 09:34:15 +10:30
Alan Modra 6e05870c97 BFD messages
bfd/
	* archive.c, * bfd.c, * linker.c, * reloc.c, * stabs.c,
	* syms.c: Standardize error/warning messages.
binutils/
	* testsuite/binutils-all/mips/mips-reginfo-n32.d,
	* testsuite/binutils-all/mips/mips-reginfo.d: Update.
gas/
	* testsuite/gas/mips/reginfo-2.l: Update.
ld/
	* testsuite/ld-arm/cmse-implib-errors.out,
	* testsuite/ld-arm/cmse-new-earlier-later-implib.out,
	* testsuite/ld-arm/cmse-new-implib-not-sg-in-implib.out,
	* testsuite/ld-arm/cmse-new-wrong-implib.out,
	* testsuite/ld-arm/cmse-veneers-no-gnu_sgstubs.out,
	* testsuite/ld-arm/cmse-veneers-wrong-entryfct.out,
	* testsuite/ld-cris/badgotr1.d,
	* testsuite/ld-cris/tls-err-24.d,
	* testsuite/ld-cris/tls-err-25.d,
	* testsuite/ld-cris/tls-err-26.d,
	* testsuite/ld-cris/tls-err-27.d,
	* testsuite/ld-cris/tls-err-28.d,
	* testsuite/ld-cris/tls-err-40.d,
	* testsuite/ld-cris/tls-err-44.d,
	* testsuite/ld-cris/tls-err-48.d,
	* testsuite/ld-cris/tls-err-52.d,
	* testsuite/ld-cris/tls-err-53.d,
	* testsuite/ld-cris/tls-err-55.d,
	* testsuite/ld-cris/tls-err-56.d,
	* testsuite/ld-cris/tls-err-62.d,
	* testsuite/ld-cris/tls-err-65.d,
	* testsuite/ld-cris/tls-err-77.d,
	* testsuite/ld-elf/empty-implib.out,
	* testsuite/ld-elf/indirect.exp: Update.
2018-02-26 09:33:15 +10:30
Alan Modra 59d08d6ce8 AOUT/COFF/PE messages
Capitalization, full-stops and unnecessary trailing \n fixes.

	* aout-adobe.c, * aout-cris.c, * i386linux.c, * m68klinux.c,
	* sparclinux.c, * coff-alpha.c, * coff-arm.c, * coff-mcore.c,
	* coffcode.h, * coffgen.c, * cofflink.c, * ecoff.c, * pe-mips.c,
	* peXXigen.c, * peicode.h: Standardize error/warning messages.
2018-02-26 09:32:35 +10:30
Alan Modra 90b6238f06 ARM and AArch64 messages
More standarization of error/warning messages.  The ARM backend has
some multi-line error messages, which don't fit particularly well with
the GNU coding standard insistence that error messages shouldn't be
capitalized or have a full-stop.  I've replaced the line breaks with
semicolons.

So for instance the following
  system/path/to/ld: myobject.o: invalid special symbol `foo'.
  system/path/to/ld: It must be a global or weak function symbol.
becomes
  system/path/to/ld: myobject.o: invalid special symbol `foo'; it must be a global or weak function symbol

bfd/
	* elf32-arm.c, * elfnn-aarch64.c: Standardize error/warning messages.
ld/
	* testsuite/ld-aarch64/reloc-overflow-bad.d,
	* testsuite/ld-arm/attr-merge-9.out,
	* testsuite/ld-arm/attr-merge-arch-2.d,
	* testsuite/ld-arm/attr-merge-unknown-1.d,
	* testsuite/ld-arm/attr-merge-unknown-2.d,
	* testsuite/ld-arm/attr-merge-unknown-2r.d,
	* testsuite/ld-arm/attr-merge-unknown-3.d,
	* testsuite/ld-arm/cmse-implib-errors.out,
	* testsuite/ld-arm/cmse-new-earlier-later-implib.out,
	* testsuite/ld-arm/cmse-new-implib-no-output.out,
	* testsuite/ld-arm/cmse-new-implib-not-sg-in-implib.out,
	* testsuite/ld-arm/cmse-new-implib.out,
	* testsuite/ld-arm/cmse-new-wrong-implib.out,
	* testsuite/ld-arm/cmse-veneers-no-gnu_sgstubs.out,
	* testsuite/ld-arm/cmse-veneers-wrong-entryfct.out,
	* testsuite/ld-arm/group-relocs-alu-bad-2.d,
	* testsuite/ld-arm/group-relocs-alu-bad.d,
	* testsuite/ld-arm/group-relocs-ldc-bad-2.d,
	* testsuite/ld-arm/group-relocs-ldc-bad.d,
	* testsuite/ld-arm/group-relocs-ldr-bad-2.d,
	* testsuite/ld-arm/group-relocs-ldr-bad.d,
	* testsuite/ld-arm/group-relocs-ldrs-bad-2.d,
	* testsuite/ld-arm/group-relocs-ldrs-bad.d,
	* testsuite/ld-arm/stm32l4xx-cannot-fix-far-ldm.d: Update.
2018-02-26 09:31:52 +10:30
Alan Modra 2c1c967956 MIPS messages
More standardization of messages.

bfd/
	* elfxx-mips.c: Standardize error/warning messages.
binutils/
	* testsuite/binutils-all/mips/mips-reginfo-n32.d,
	* testsuite/binutils-all/mips/mips-reginfo.d: Update.
gas/
	* testsuite/gas/mips/reginfo-2.l: Update.
ld/
	* testsuite/ld-mips-elf/attr-gnu-4-12.d,
	* testsuite/ld-mips-elf/attr-gnu-4-13.d,
	* testsuite/ld-mips-elf/attr-gnu-4-14.d,
	* testsuite/ld-mips-elf/attr-gnu-4-16.d,
	* testsuite/ld-mips-elf/attr-gnu-4-17.d,
	* testsuite/ld-mips-elf/attr-gnu-4-18.d,
	* testsuite/ld-mips-elf/attr-gnu-4-19.d,
	* testsuite/ld-mips-elf/attr-gnu-4-21.d,
	* testsuite/ld-mips-elf/attr-gnu-4-23.d,
	* testsuite/ld-mips-elf/attr-gnu-4-24.d,
	* testsuite/ld-mips-elf/attr-gnu-4-25.d,
	* testsuite/ld-mips-elf/attr-gnu-4-26.d,
	* testsuite/ld-mips-elf/attr-gnu-4-27.d,
	* testsuite/ld-mips-elf/attr-gnu-4-28.d,
	* testsuite/ld-mips-elf/attr-gnu-4-29.d,
	* testsuite/ld-mips-elf/attr-gnu-4-31.d,
	* testsuite/ld-mips-elf/attr-gnu-4-32.d,
	* testsuite/ld-mips-elf/attr-gnu-4-34.d,
	* testsuite/ld-mips-elf/attr-gnu-4-35.d,
	* testsuite/ld-mips-elf/attr-gnu-4-36.d,
	* testsuite/ld-mips-elf/attr-gnu-4-37.d,
	* testsuite/ld-mips-elf/attr-gnu-4-38.d,
	* testsuite/ld-mips-elf/attr-gnu-4-39.d,
	* testsuite/ld-mips-elf/attr-gnu-4-41.d,
	* testsuite/ld-mips-elf/attr-gnu-4-42.d,
	* testsuite/ld-mips-elf/attr-gnu-4-43.d,
	* testsuite/ld-mips-elf/attr-gnu-4-45.d,
	* testsuite/ld-mips-elf/attr-gnu-4-46.d,
	* testsuite/ld-mips-elf/attr-gnu-4-47.d,
	* testsuite/ld-mips-elf/attr-gnu-4-48.d,
	* testsuite/ld-mips-elf/attr-gnu-4-49.d,
	* testsuite/ld-mips-elf/attr-gnu-4-52.d,
	* testsuite/ld-mips-elf/attr-gnu-4-53.d,
	* testsuite/ld-mips-elf/attr-gnu-4-54.d,
	* testsuite/ld-mips-elf/attr-gnu-4-58.d,
	* testsuite/ld-mips-elf/attr-gnu-4-59.d,
	* testsuite/ld-mips-elf/attr-gnu-4-61.d,
	* testsuite/ld-mips-elf/attr-gnu-4-62.d,
	* testsuite/ld-mips-elf/attr-gnu-4-63.d,
	* testsuite/ld-mips-elf/attr-gnu-4-64.d,
	* testsuite/ld-mips-elf/attr-gnu-4-68.d,
	* testsuite/ld-mips-elf/attr-gnu-4-69.d,
	* testsuite/ld-mips-elf/attr-gnu-4-71.d,
	* testsuite/ld-mips-elf/attr-gnu-4-72.d,
	* testsuite/ld-mips-elf/attr-gnu-4-73.d,
	* testsuite/ld-mips-elf/attr-gnu-4-74.d,
	* testsuite/ld-mips-elf/attr-gnu-4-78.d,
	* testsuite/ld-mips-elf/attr-gnu-4-79.d,
	* testsuite/ld-mips-elf/attr-gnu-4-81.d,
	* testsuite/ld-mips-elf/attr-gnu-4-89.d,
	* testsuite/ld-mips-elf/attr-gnu-8-12.d,
	* testsuite/ld-mips-elf/attr-gnu-8-21.d,
	* testsuite/ld-mips-elf/bal-jalx-pic-micromips-n32.d,
	* testsuite/ld-mips-elf/bal-jalx-pic-micromips-n64.d,
	* testsuite/ld-mips-elf/bal-jalx-pic-micromips.d,
	* testsuite/ld-mips-elf/bal-jalx-pic-n32.d,
	* testsuite/ld-mips-elf/bal-jalx-pic-n64.d,
	* testsuite/ld-mips-elf/bal-jalx-pic.d,
	* testsuite/ld-mips-elf/mode-change-error-1.d,
	* testsuite/ld-mips-elf/unaligned-branch-2.d,
	* testsuite/ld-mips-elf/unaligned-branch-ignore-2.d,
	* testsuite/ld-mips-elf/unaligned-branch-ignore-micromips.d,
	* testsuite/ld-mips-elf/unaligned-branch-ignore-mips16.d,
	* testsuite/ld-mips-elf/unaligned-branch-ignore-r6-1.d,
	* testsuite/ld-mips-elf/unaligned-branch-micromips.d,
	* testsuite/ld-mips-elf/unaligned-branch-mips16.d,
	* testsuite/ld-mips-elf/unaligned-branch-r6-1.d,
	* testsuite/ld-mips-elf/unaligned-branch-r6-2.d,
	* testsuite/ld-mips-elf/unaligned-branch.d,
	* testsuite/ld-mips-elf/unaligned-jalx-1.d,
	* testsuite/ld-mips-elf/unaligned-jalx-3.d,
	* testsuite/ld-mips-elf/unaligned-jalx-addend-1.d,
	* testsuite/ld-mips-elf/unaligned-jalx-addend-3.d,
	* testsuite/ld-mips-elf/unaligned-jalx-addend-micromips-1.d,
	* testsuite/ld-mips-elf/unaligned-jalx-addend-mips16-1.d,
	* testsuite/ld-mips-elf/unaligned-jalx-micromips-1.d,
	* testsuite/ld-mips-elf/unaligned-jalx-mips16-1.d,
	* testsuite/ld-mips-elf/unaligned-jump-micromips.d,
	* testsuite/ld-mips-elf/unaligned-jump-mips16.d,
	* testsuite/ld-mips-elf/unaligned-jump.d: Update.
2018-02-26 09:31:04 +10:30
Alan Modra 9793eb7792 ELF linker messages
This fixes a number of cases where we capitalized error messages or
printed a full-stop, and corrects "Dwarf" to "DWARF".

bfd/
	* dwarf2.c, * elf-attrs.c, * elf-eh-frame.c, * elf.c, * elf32-gen.c,
	* elflink.c: Standardize error/warning messages.  Replace use of
	linker callback einfo with _bfd_error_handler when possible.
ld/
	* testsuite/ld-elf/indirect.exp,
	* testsuite/ld-elf/pr22649-2ab-mips.msg,
	* testsuite/ld-elf/pr22649-2cd-mips.msg,
	* testsuite/ld-elf/pr22649.msg,
	* testsuite/ld-elf/tls_common.exp,
	* testsuite/ld-elfcomm/elfcomm.exp,
	* testsuite/ld-arm/attr-merge-incompatible.d,
	* testsuite/ld-tic6x/attr-compatibility-gnu-other.d,
	* testsuite/ld-tic6x/attr-compatibility-other-gnu.d,
	* testsuite/ld-tic6x/attr-compatibility-other-other.d,
	* testsuite/ld-i386/warn1.d: Update expected error/warning messages.
2018-02-26 09:29:15 +10:30
Alan Modra 0aa13feeeb unrecognized/unsupported reloc message
It must get boring translating all the variants we have of
unrecognized/unsupported/invalid/unexpected reloc number.  This patch
cuts down on the number of variations.

	* aoutx.h, * coff-alpha.c, * coff-i860.c, * coff-m68k.c,
	* coff-mcore.c, * coff-ppc.c, * coff-rs6000.c, * coff-sh.c,
	* coff-tic4x.c, * coff-tic54x.c, * coff-tic80.c, * coff-w65.c,
	* elf-bfd.h, * elf-m10300.c, * elf.c, * elf32-avr.c, * elf32-bfin.c,
	* elf32-cr16.c, * elf32-cr16c.c, * elf32-cris.c, * elf32-crx.c,
	* elf32-d10v.c, * elf32-d30v.c, * elf32-dlx.c, * elf32-epiphany.c,
	* elf32-fr30.c, * elf32-frv.c, * elf32-i370.c, * elf32-i386.c,
	* elf32-i960.c, * elf32-ip2k.c, * elf32-iq2000.c, * elf32-lm32.c,
	* elf32-m32c.c, * elf32-m32r.c, * elf32-m68hc11.c, * elf32-m68hc12.c,
	* elf32-m68k.c, * elf32-mcore.c, * elf32-mep.c, * elf32-metag.c,
	* elf32-microblaze.c, * elf32-mips.c, * elf32-moxie.c,
	* elf32-msp430.c, * elf32-mt.c, * elf32-nds32.c, * elf32-or1k.c,
	* elf32-pj.c, * elf32-ppc.c, * elf32-rl78.c, * elf32-rx.c,
	* elf32-s390.c, * elf32-sh.c, * elf32-spu.c, * elf32-tic6x.c,
	* elf32-v850.c, * elf32-vax.c, * elf32-visium.c, * elf32-wasm32.c,
	* elf32-xgate.c, * elf32-xtensa.c, * elf64-alpha.c,
	* elf64-ia64-vms.c, * elf64-mips.c, * elf64-mmix.c,
	* elf64-ppc.c, * elf64-s390.c, * elf64-sparc.c, * elf64-x86-64.c,
	* elfn32-mips.c, * elfnn-aarch64.c, * elfnn-ia64.c,
	* elfnn-riscv.c, * elfxx-mips.c, * elfxx-riscv.c, * elfxx-riscv.h,
	* elfxx-sparc.c, * elfxx-sparc.h, * reloc.c: Standardize
	unrecognized/unsupported reloc message.
2018-02-26 09:28:27 +10:30
Alan Modra cf97bcb0c3 PPC error/warning messages
The GNU coding standard says error messages should be of the form
  program:sourcefile:lineno: message
or
  program: message

and
"The string message should not begin with a capital letter when it
follows a program name and/or file name, because that isn’t the
beginning of a sentence. (The sentence conceptually starts at the
beginning of the line.) Also, it should not end with a period."

This patch does that for ppc, and removes some British spelling.
I've also switched some error output from using the linker callback
einfo to _bfd_error_handler, due to improved compilation time
argument checking now done for the latter function.

bfd/
	* elf32-ppc.c: Standardize error/warning messages.  Use
	_bfd_error_handler rather than einfo when einfo features not used.
	* elf64-ppc.c: Likewise.
ld/
	* testsuite/ld-powerpc/attr-gnu-12-21.d: Update.
	* testsuite/ld-powerpc/attr-gnu-4-12.d: Update.
	* testsuite/ld-powerpc/attr-gnu-4-13.d: Update.
	* testsuite/ld-powerpc/attr-gnu-4-21.d: Update.
	* testsuite/ld-powerpc/attr-gnu-4-23.d: Update.
	* testsuite/ld-powerpc/attr-gnu-4-31.d: Update.
	* testsuite/ld-powerpc/attr-gnu-4-32.d: Update.
	* testsuite/ld-powerpc/attr-gnu-8-23.d: Update.
2018-02-26 09:27:36 +10:30
Simon Marchi 6f6d0c269e Fix double space expected in cp_test_ptype_class
I noticed some failures of some buildbot slaves, e.g.:

FAIL: gdb.cp/nested-types.exp: ptype S10 (limit = 1) // wrong nested type enum definition: enum S10::E10 {S10::A10, S10::B10, S10::C10};

The issue is that they have an older gcc (not c++11 by default?) that
doesn't emit the enum underlying type information.  When the
enum type is printed by ptype, it looks like this:

  enum S10::E10 {S10::A10, S10::B10, S10::C10};

instead of this on older gccs:

  enum S10::E10 : unsigned int {S10::A10, S10::B10, S10::C10};

The regex that matches this is in cp_test_ptype_class, and is

  enum $nested_name (: (unsigned )?int)? \{

If the "unsigned int" portion is not present, then it requires the
string to have two spaces between the enum name and opening bracket.
The fix is simply to move the trailing space inside the ? group.

gdb/testsuite/ChangeLog:

	* lib/cp-support.exp (cp_test_ptype_class): Move space inside
	parentheses.
2018-02-25 15:12:37 -05:00
GDB Administrator 4de41a68ed Automatic date update in version.in 2018-02-25 00:00:59 +00:00
Tom Tromey 9b292f6880 Remove most cleanups from linux-thread-db.c
This removes most (but not all) cleanups from linux-thread-db.c.
std::string and std::vector are used in place of manual memory
management.

The remaining cleanup in linux-thread-db.c uses
make_cleanup_free_char_ptr_vec, which requires a somewhat bigger
change.

Regression tested by the buildbot.

ChangeLog
2018-02-24  Tom Tromey  <tom@tromey.com>

	* linux-thread-db.c (try_thread_db_load_from_pdir_1)
	(try_thread_db_load_from_dir, thread_db_load_search): Use
	std::string.
	(info_auto_load_libthread_db_compare): Return bool.  Change
	argument types.
	(info_auto_load_libthread_db): Use std::vector, std::string.
	Remove cleanups.
2018-02-24 10:02:42 -07:00
Tom Tromey 281d762b1a Remove cleanups from check_fast_tracepoint_sals
This changes the gdbarch fast_tracepoint_valid_at method to use a
std::string as its out parameter, and then updates all the uses.  This
allows removing a cleanup from breakpoint.c.

Regression tested by the buildbot.

ChangeLog
2018-02-24  Tom Tromey  <tom@tromey.com>

	* i386-tdep.c (i386_fast_tracepoint_valid_at): "msg" now a
	std::string.
	* gdbarch.sh (fast_tracepoint_valid_at): Change "msg" to a
	std::string*.
	* gdbarch.c: Rebuild.
	* gdbarch.h: Rebuild.
	* breakpoint.c (check_fast_tracepoint_sals): Use std::string.
	* arch-utils.h (default_fast_tracepoint_valid_at): Update.
	* arch-utils.c (default_fast_tracepoint_valid_at): "msg" now a
	std::string*.
2018-02-24 10:01:11 -07:00
GDB Administrator d4333bab0a Automatic date update in version.in 2018-02-24 00:00:28 +00:00
Maciej W. Rozycki 11b031457e GDB/testsuite: Fix a typo in $actual_line
Fix a commit 883fd55ab1 ("Record nested types") issue:

ERROR: tcl error sourcing .../gdb/testsuite/gdb.cp/nested-types.exp.
ERROR: can't read "actual_linejj": no such variable
    while executing
"append txt " definition: $actual_linejj""
    (procedure "cp_test_ptype_class" line 324)
    invoked from within
"cp_test_ptype_class $name "ptype $name (limit = $limit)" $key  $name $children"    (procedure "test_nested_limit" line 28)
    invoked from within
"test_nested_limit -1 false"
    (file ".../gdb/testsuite/gdb.cp/nested-types.exp" line 310)
    invoked from within
"source .../gdb/testsuite/gdb.cp/nested-types.exp"
    ("uplevel" body line 1)
    invoked from within
"uplevel #0 source .../gdb/testsuite/gdb.cp/nested-types.exp"
    invoked from within
"catch "uplevel #0 source $test_file_name""
testcase .../gdb/testsuite/gdb.cp/nested-types.exp completed in 9 seconds

caused by $actual_line having been accidentally referred to as
$actual_linejj in one place.

	gdb/testsuite/
	* lib/cp-support.exp (cp_test_ptype_class): Fix a typo in the
	name of a variable: $actual_linejj -> $actual_line.
2018-02-23 20:14:41 +00:00
Simon Marchi 9d8780f0d0 dwarf: Make sect_offset 64-bits
Does anybody have an opinion about this?  It would be nice to unbreak
the "default" build with clang (i.e. without passing special -Wno-error=
flags).

Here's a version rebased on today's master.

From 47d28075117fa2ddb93584ec50881e33777a85e5 Mon Sep 17 00:00:00 2001
From: Simon Marchi <simon.marchi@ericsson.com>
Date: Sat, 30 Dec 2017 22:48:18 -0500
Subject: [PATCH] dwarf: Make sect_offset 64-bits

Compiling with Clang 6 shows these errors:

/home/emaisin/src/binutils-gdb/gdb/dwarf2read.c:26610:43: error: result of comparison of constant 4294967296 with expression of type 'typename std::underlying_type<sect_offset>::type' (a
ka 'unsigned int') is always false [-Werror,-Wtautological-constant-out-of-range-compare]
      if (to_underlying (per_cu.sect_off) >= (static_cast<uint64_t> (1) << 32))
          ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/emaisin/src/binutils-gdb/gdb/dwarf2read.c:26618:43: error: result of comparison of constant 4294967296 with expression of type 'typename std::underlying_type<sect_offset>::type' (a
ka 'unsigned int') is always false [-Werror,-Wtautological-constant-out-of-range-compare]
      if (to_underlying (per_cu.sect_off) >= (static_cast<uint64_t> (1) << 32))
          ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

The code in question checks if there is any offset exceeding 32 bits,
and therefore if we need to use the 64-bit DWARF format when writing the
.debug_names section.  The type we use currently to represent section
offsets is an unsigned int (32-bits), which means a value of this type
will never exceed 32 bits, hence the errors above.

There are many signs that we want to support 64-bits DWARF (although I
haven't tested), such as:

 - We correctly read initial length fields (read_initial_length)
 - We take that into account when reading offsets (read_offset_1)
 - The check_dwarf64_offsets function

However, I don't see how it can work if sect_offset is a 32-bits type.
Every time we record a section offset, we risk truncating the value.
And if a file uses the 64-bit DWARF format, it's most likely because
there are such offset values that overflow 32 bits.

Because of this, I think the way forward is to change sect_offset to be
a uint64_t.  It will be able to represent any offset, regardless of the
bitness of the DWARF info.

This patch was regtested on the buildbot.

gdb/ChangeLog:

	* gdbtypes.h (sect_offset): Change type to uint64_t.
	(sect_offset_str): New function.
	* dwarf2read.c (create_addrmap_from_aranges): Use
	sect_offset_str.
	(error_check_comp_unit_head): Likewise.
	(create_debug_type_hash_table): Likewise.
	(read_cutu_die_from_dwo): Likewise.
	(init_cutu_and_read_dies): Likewise.
	(init_cutu_and_read_dies_no_follow): Likewise.
	(process_psymtab_comp_unit_reader): Likewise.
	(partial_die_parent_scope): Likewise.
	(peek_die_abbrev): Likewise.
	(process_queue): Likewise.
	(dwarf2_physname): Likewise.
	(read_namespace_alias): Likewise.
	(read_import_statement): Likewise.
	(create_dwo_cu_reader): Likewise.
	(create_cus_hash_table): Likewise.
	(lookup_dwo_cutu): Likewise.
	(inherit_abstract_dies): Likewise.
	(read_func_scope): Likewise.
	(read_call_site_scope): Likewise.
	(dwarf2_add_member_fn): Likewise.
	(read_common_block): Likewise.
	(read_module_type): Likewise.
	(read_typedef): Likewise.
	(read_subrange_type): Likewise.
	(load_partial_dies): Likewise.
	(read_partial_die): Likewise.
	(find_partial_die): Likewise.
	(read_str_index): Likewise.
	(dwarf2_string_attr): Likewise.
	(build_error_marker_type): Likewise.
	(lookup_die_type): Likewise.
	(dump_die_shallow): Likewise.
	(follow_die_ref): Likewise.
	(dwarf2_fetch_die_loc_sect_off): Likewise.
	(dwarf2_fetch_constant_bytes): Likewise.
	(follow_die_sig): Likewise.
	(get_signatured_type): Likewise.
	(get_DW_AT_signature_type): Likewise.
	(dwarf2_find_containing_comp_unit): Likewise.
	(set_die_type): Likewise.
2018-02-23 13:03:33 -05:00
Alan Modra 01f7e10cf2 PR22881, null pointer dereference in assign_file_positions_for_non_load_sections
PR 22881
	* elf.c (assign_file_positions_for_non_load_sections): Remove RELRO
	segment if no matching LOAD segment.
2018-02-23 21:40:48 +10:30
Nick Clifton 340d33e565 Document the assembler's .dc, .dcb and .ds directives.
* doc/as.texinfo (Pseudo Ops): Add nodes for .dc, .dcb and .ds.
2018-02-23 10:43:53 +00:00
Kuan-Lin Chen e859f6558c nds32: Support target directive .ict_model. 2018-02-23 14:27:13 +08:00
Kuan-Lin Chen 9c70c5223b Fix up one ChangeLog date. 2018-02-23 14:26:24 +08:00
GDB Administrator 5bce538d6a Automatic date update in version.in 2018-02-23 00:00:35 +00:00
Sriraman Tallam 0b65c07b97 New plugin interface to get list of symbols wrapped with --wrap option.
2018-02-22  Sriraman Tallam  <tmsriram@google.com>

	* plugin.cc (get_wrap_symbols): New plugin interface.
	(load): Add get_wrap_symbols to transfer vector.
	* plugin-api.h (ld_plugin_get_wrap_symbols): New plugin interface.
	* testsuite/plugin_test.c (onload): Call and check get_wrap_symbols
	interface.
	* testsuite/plugin_test_wrap_symbols.sh: New test script.
	* testsuite/plugin_test_wrap_symbols_1.cc: New file.
	* testsuite/plugin_test_wrap_symbols_2.cc: New file.
	* testsuite/Makefile.am (plugin_test_wrap_symbols): New test.
	* testsuite/Makefile.in: Regenerate.
2018-02-22 13:56:46 -08:00
Jim Wilson 0bccfb2994 RISC-V: Make disassebler work for --enable-targets=all config.
opcodes/
	* disassemble.c (ARCH_riscv): Define if ARCH_all.
2018-02-22 11:28:51 -08:00
Andre Simoes Dias Vieira 7bdf778b10 Diagnose when trying to assemble conditional FP16 vmovx and vins
This patch makes GAS emit a warning when trying to assemble the Armv8.2
FP16 instructions VMOVX and VINS with condition codes. The Armv8-A
Reference Manual specifies these instructions without conditional codes
and says that if they are found in an IT block that they are CONSTRAINED
UNPREDICABLE.

gas/ChangeLog:
2018-02-22  Andre Vieira  <andre.simoesdiasvieira@arm.com>

	* config/tc-arm.c (do_neon_movhf): If conditional error out when in arm
	mode and emit warning in thumb mode.
	* testsuite/gas/arm/armv8-2-fp16-scalar-bad.s: Add new tests.
	* testsuite/gas/arm/armv8-2-fp16-scalar-bad.l: Idem.
2018-02-22 16:34:36 +00:00
H.J. Lu 6b6b680700 x86: Add {rex} pseudo prefix
Add {rex} pseudo prefix to generate a REX byte for integer and legacy
vector instructions if possible.  Note that this differs from the rex
prefix which generates REX prefix unconditionally.

gas/

	* config/tc-i386.c (_i386_insn): Add rex_encoding.
	(md_assemble): When i.rex_encoding is true, generate a REX byte
	if possible.
	(parse_insn): Set i.rex_encoding for {rex}.
	* doc/c-i386.texi: Document {rex}.
	* testsuite/gas/i386/x86-64-pseudos.s: Add {rex} tests.
	* testsuite/gas/i386/x86-64-pseudos.d: Updated.

opcodes/

	* i386-opc.tbl: Add {rex},
	* i386-tbl.h: Regenerated.
2018-02-22 06:18:39 -08:00
A. Wilcox 39334a61e6 Fix memory access violation when attempting to shorten a suffixed micromips instruction during lookup.
PR 22014
	* config/tc-mips.c (mips_lookup_insn): Use memmove to strip the
	instruction size suffix.
2018-02-22 12:49:49 +00:00
GDB Administrator f4a69c9aea Automatic date update in version.in 2018-02-22 00:00:27 +00:00
John Baldwin 54a27fe598 Fix a typo.
gdb/testsuite/ChangeLog:

	* gdb.arch/amd64-i386-address.exp: Fix a typo.
2018-02-21 11:13:51 -08:00