aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2018-02-27Update get_args documentationPhil Muldoon2-3/+24
This patch adds argument compilation documentation, expanding on the already existing comments, giving a more thorough explanation of the source of the arguments used in the final argument string. gdb/ChangeLog: * compile/compile.c (get_args): Add additional comments explaining function.
2018-02-27ld: Add --enable-separate-codeH.J. Lu12-6/+151
This patch adds --enable-separate-code to ld configure to turn on -z separate-code by default and enables it by default for Linux/x86. This avoids mixing code pages with data to improve cache performance as well as security. To reduce x86-64 executable and shared object sizes, the maximum page size is reduced from 2MB to 4KB when -z separate-code is turned on by default. Note: -z max-page-size= can be used to set the maximum page size. We compared SPEC CPU 2017 performance before and after this change on Skylake server. There are no any significant performance changes. Everything is mostly below +/-1%. bfd/ * config.in: Regenerated. * configure: Likewise. * configure.ac: Add --enable-separate-code. (DEFAULT_LD_Z_SEPARATE_CODE): New AC_DEFINE_UNQUOTED. Default to 1 for Linux/x86 targets, * elf64-x86-64.c (ELF_MAXPAGESIZE): Set to 0x1000 if DEFAULT_LD_Z_SEPARATE_CODE is 1. ld/ * NEWS: Mention --enable-separate-code. * configure.ac: Add --enable-separate-code. (DEFAULT_LD_Z_SEPARATE_CODE): New AC_DEFINE_UNQUOTED. * configure.tgt: Default ac_default_ld_z_separate_code to 1 for Linux/x86 targets. * config.in: Regenerated. * configure: Likewise. * emultempl/elf32.em (gld${EMULATION_NAME}_before_parse): Set link_info.separate_code DEFAULT_LD_Z_SEPARATE_CODE.
2018-02-27Change target_write_memory_blocks to use std::vectorTom Tromey4-228/+167
This changes target_write_memory_blocks to use std::vector, rather than VEC. This allows the removal of some cleanups. This version incorporates the additions that Simon made. Regression tested by the buildbot. ChangeLog 2018-02-27 Simon Marchi <simon.marchi@polymtl.ca> Tom Tromey <tom@tromey.com> * target.h (memory_write_request_s): Remove typedef. Don't define VEC. (target_write_memory_blocks): Change argument to std::vector. (struct memory_write_request): Add constructor. * target-memory.c (compare_block_starting_address): Return bool. Change argument types. (claim_memory): Change arguments to use std::vector. (split_regular_and_flash_blocks, blocks_to_erase) (compute_garbled_blocks): Likewise. (cleanup_request_data, cleanup_write_requests_vector): Remove. (target_write_memory_blocks): Change argument to std::vector. * symfile.c (struct load_section_data): Add constructor and destructor. Use std::vector for "requests". (struct load_progress_data): Add initializers. (load_section_callback): Update. Use "new". (clear_memory_write_data): Remove. (generic_load): Update.
2018-02-27[ARM] Remove ARM_FEATURE_COPY macroThomas Preud'homme4-11/+11
Among the macros to manipulate an arm_feature_set structure is the ARM_FEATURE_COPY which copy the value of a feature set into another. This can be achieved with a simple assignement which most of the existing code does. This patch removes the last 2 uses of that macro and remove the macro altogether. 2018-02-27 Thomas Preud'homme <thomas.preudhomme@arm.com> include/ * opcode/arm.h (ARM_FEATURE_COPY): Remove macro definition. 2018-02-27 Thomas Preud'homme <thomas.preudhomme@arm.com> opcodes/ * arm-dis.c (print_insn_coprocessor): Replace uses of ARM_FEATURE_COPY macro by assignements.
2018-02-27Explicitly specify common tdesc.h for use with aarch64.hAlan Hayward2-1/+5
gdb/ * arch/aarch64.h: Use common/tdesc.h.
2018-02-27x86: Add -O[2|s] assembler command-line optionsH.J. Lu26-5356/+6161
On x86, some instructions have alternate shorter encodings: 1. When the upper 32 bits of destination registers of andq $imm31, %r64 testq $imm31, %r64 xorq %r64, %r64 subq %r64, %r64 known to be zero, we can encode them without the REX_W bit: andl $imm31, %r32 testl $imm31, %r32 xorl %r32, %r32 subl %r32, %r32 This optimization is enabled with -O, -O2 and -Os. 2. Since 0xb0 mov with 32-bit destination registers zero-extends 32-bit immediate to 64-bit destination register, we can use it to encode 64-bit mov with 32-bit immediates. This optimization is enabled with -O, -O2 and -Os. 3. Since the upper bits of destination registers of VEX128 and EVEX128 instructions are extended to zero, if all bits of destination registers of AVX256 or AVX512 instructions are zero, we can use VEX128 or EVEX128 encoding to encode AVX256 or AVX512 instructions. When 2 source registers are identical, AVX256 and AVX512 andn and xor instructions: VOP %reg, %reg, %dest_reg can be encoded with VOP128 %reg, %reg, %dest_reg This optimization is enabled with -O2 and -Os. 4. 16-bit, 32-bit and 64-bit register tests with immediate may be encoded as 8-bit register test with immediate. This optimization is enabled with -Os. This patch does: 1. Add {nooptimize} pseudo prefix to disable instruction size optimization. 2. Add optimize to i386_opcode_modifier to tell assembler that encoding of an instruction may be optimized. gas/ PR gas/22871 * NEWS: Mention -O[2|s]. * config/tc-i386.c (_i386_insn): Add no_optimize. (optimize): New. (optimize_for_space): Likewise. (fits_in_imm7): New function. (fits_in_imm31): Likewise. (optimize_encoding): Likewise. (md_assemble): Call optimize_encoding to optimize encoding. (parse_insn): Handle {nooptimize}. (md_shortopts): Append "O::". (md_parse_option): Handle -On. * doc/c-i386.texi: Document -O0, -O, -O1, -O2 and -Os as well as {nooptimize}. * testsuite/gas/cfi/cfi-x86_64.d: Pass -O0 to assembler. * testsuite/gas/i386/ilp32/cfi/cfi-x86_64.d: Likewise. * testsuite/gas/i386/i386.exp: Run optimize-1, optimize-2, optimize-3, x86-64-optimize-1, x86-64-optimize-2, x86-64-optimize-3 and x86-64-optimize-4. * testsuite/gas/i386/optimize-1.d: New file. * testsuite/gas/i386/optimize-1.s: Likewise. * testsuite/gas/i386/optimize-2.d: Likewise. * testsuite/gas/i386/optimize-2.s: Likewise. * testsuite/gas/i386/optimize-3.d: Likewise. * testsuite/gas/i386/optimize-3.s: Likewise. * testsuite/gas/i386/x86-64-optimize-1.s: Likewise. * testsuite/gas/i386/x86-64-optimize-1.d: Likewise. * testsuite/gas/i386/x86-64-optimize-2.d: Likewise. * testsuite/gas/i386/x86-64-optimize-2.s: Likewise. * testsuite/gas/i386/x86-64-optimize-3.d: Likewise. * testsuite/gas/i386/x86-64-optimize-3.s: Likewise. * testsuite/gas/i386/x86-64-optimize-4.d: Likewise. * testsuite/gas/i386/x86-64-optimize-4.s: Likewise. opcodes/ PR gas/22871 * i386-gen.c (opcode_modifiers): Add Optimize. * i386-opc.h (Optimize): New enum. (i386_opcode_modifier): Add optimize. * i386-opc.tbl: Add "Optimize" to "mov $imm, reg", "sub reg, reg/mem", "test $imm, acc", "test $imm, reg/mem", "and $imm, acc", "and $imm, reg/mem", "xor reg, reg/mem", "movq $imm, reg" and AVX256 and AVX512 versions of vandnps, vandnpd, vpandn, vpandnd, vpandnq, vxorps, vxorpd, vpxor, vpxord and vpxorq. * i386-tbl.h: Regenerated.
2018-02-27Add a new Portuguese translation for the binutils sub-directory, and update ↵Nick Clifton6-1008/+13053
the Russian translation for the gas sub-directory. gas * po/ru.po: Updated Russian translation. binutils* po/pt.po: New Portuguese translation. * configure.ac (ALL_LINGUAS): Add pt. * configure: Regenerate.
2018-02-27Use standardized error message for unrecognized relocs.Nick Clifton11-11/+23
bfd * aout-cris.c (swap_ext_reloc_out): Standadize error/warning message. * elf-hppa.h (elf_hppa_info_to_howto_rel): Likewise. * elf32-i386.c (elf_i386_reloc_type_lookup): Likewise. * elf32-xtensa.c (elf_xtensa_reloc_type_lookup): Likewise. * elf64-ppc.c (ppc64_elf_reloc_type_lookup): Likewise. * elf64-s390.c (elf_s390_reloc_type_lookup): Likewise. * elf64-sh64.c (sh_elf64_info_to_howto): Likewise. * elfxx-ia64.c (ia64_elf_reloc_type_lookup): Likewise. * elfxx-sparc.c (_bfd_sparc_elf_reloc_type_lookup): Likewise. * elfxx-tilegx.c (tilegx_reloc_type_lookup): Likewise.
2018-02-27Have info_to_howto functions return a success/fail status. Check this ↵Nick Clifton95-415/+996
result. Stop strip from completeing if one of these functions fails. bfd PR 22875 * elf-bfd.h (struct elf_backend_data): Change the return type of the elf_info_to_howto and elf_info_to_howto_rel function pointers to bfd_boolean. * elfcode.h (elf_slurp_reloc_table_from_section): Check the return value from the info_to_howto function and fail if that function failed. * elf32-h8300.c (elf32_h8_relocate_section): Check return value from the info_to_howto function. (elf32_h8_relax_section): Likewise. * elf32-lm32.c (lm32_elf_relocate_section): Likewise. * elf32-m68hc1x.c (elf32_m68hc11_relocate_section): Likewise. * elf32-score.c (s3_bfd_score_elf_relocate_section): Likewise. * elf32-score7.c (s7_bfd_score_elf_relocate_section): Likewise. * elf32-tic6x.c (elf32_tic6x_relocate_section): Likewise. * elf64-ia64-vms.c (elf64_ia64_relocate_section): Likewise. * elf64-sparc.c (elf64_sparc_slurp_one_reloc_table): Likewise. * elf64-x86-64.c (elf_x86_64_tls_transition): Likewise. * elfnn-ia64.c (elfNN_ia64_relocate_section): Likewise. * elfnn-riscv.c (riscv_elf_check_relocs): Likewise. (riscv_elf_relocate_section): Likewise. * elf-hppa.h (elf_hppa_info_to_howto): Change return type to bfd_boolean. Issue an error message, set an error value and return FALSE if the reloc is not recognized. (elf_hppa_info_to_howto_rel): Likewise. * elf-m10200.c (mn10200_info_to_howto): Likewise. * elf-m10300.c (mn10300_info_to_howto): Likewise. * elf.c (_bfd_elf_no_info_to_howto): Likewise. * elf32-arc.c (arc_info_to_howto_rel): Likewise. * elf32-arm.c (elf32_arm_info_to_howto): Likewise. * elf32-avr.c (avr_info_to_howto_rela): Likewise. * elf32-bfin.c (bfin_info_to_howto): Likewise. * elf32-cr16.c (elf_cr16_info_to_howto): Likewise. * elf32-cr16c.c (elf_cr16c_info_to_howto): Likewise. * elf32-cris.c (elf_cr16c_info_to_howto_rel, cris_info_to_howto_rela): Likewise. * elf32-crx.c (elf_crx_info_to_howto): Likewise. * elf32-d10v.c (d10v_info_to_howto_rel): Likewise. * elf32-d30v.c (d30v_info_to_howto_rel, d30v_info_to_howto_rela): Likewise. * elf32-dlx.c (dlx_rtype_to_howto, elf32_dlx_info_to_howto, elf32_dlx_info_to_howto_rel): Likewise. * elf32-epiphany.c (epiphany_info_to_howto_rela): Likewise. * elf32-fr30.c (fr30_info_to_howto_rela): Likewise. * elf32-frv.c (frv_info_to_howto_rela, frvfdpic_info_to_howto_rel): Likewise. * elf32-ft32.c (ft32_info_to_howto_rela): Likewise. * elf32-gen.c (elf_generic_info_to_howto, elf_generic_info_to_howto_rel): Likewise. * elf32-h8300.c (elf32_h8_info_to_howto, elf32_h8_info_to_howto_rel): Likewise. * elf32-i370.c (i370_elf_info_to_howto): Likewise. * elf32-i386.c (elf_i386_reloc_type_lookup, elf_i386_rtype_to_howto, elf_i386_info_to_howto_rel): Likewise. * elf32-i860.c (lookup_howto, elf32_i860_info_to_howto_rela): Likewise. * elf32-i960.c (elf32_i960_info_to_howto_rel): Likewise. * elf32-ip2k.c (ip2k_info_to_howto_rela): Likewise. * elf32-iq2000.c (iq2000_info_to_howto_rela): Likewise. * elf32-lm32.c (lm32_info_to_howto_rela): Likewise. * elf32-m32c.c (m32c_info_to_howto_rela): Likewise. * elf32-m32r.c (m32r_info_to_howto_rel, m32r_info_to_howto): Likewise. * elf32-m68hc11.c (m68hc11_info_to_howto_rel): Likewise. * elf32-m68hc12.c (m68hc11_info_to_howto_rel): Likewise. * elf32-m68k.c (rtype_to_howto): Likewise. * elf32-mcore.c (mcore_elf_info_to_howto): Likewise. * elf32-mep.c (mep_info_to_howto_rela): Likewise. * elf32-metag.c (metag_info_to_howto_rela): Likewise. * elf32-microblaze.c (microblaze_elf_info_to_howto): Likewise. * elf32-mips.c (mips_info_to_howto_rel, mips_info_to_howto_rela): Likewise. * elf32-moxie.c (moxie_info_to_howto_rela): Likewise. * elf32-msp430.c (msp430_info_to_howto_rela): Likewise. * elf32-mt.c (mt_info_to_howto_rela): Likewise. * elf32-nds32.c (nds32_info_to_howto_rel, nds32_info_to_howto): Likewise. * elf32-nios2.c (nios2_elf32_info_to_howto): Likewise. * elf32-or1k.c (or1k_info_to_howto_rela): Likewise. * elf32-pj.c (pj_elf_info_to_howto): Likewise. * elf32-ppc.c (ppc_elf_info_to_howto): Likewise. * elf32-pru.c (pru_elf32_info_to_howto): Likewise. * elf32-rl78.c (rl78_info_to_howto_rela): Likewise. * elf32-rx.c (rx_info_to_howto_rela): Likewise. * elf32-s390.c (elf_s390_info_to_howto): Likewise. * elf32-score.c (s3_bfd_score_info_to_howto, _bfd_score_info_to_howto): Likewise. * elf32-score7.c (s7_bfd_score_info_to_howto): Likewise. * elf32-sh.c (sh_elf_info_to_howto): Likewise. * elf32-spu.c (spu_elf_info_to_howto): Likewise. * elf32-tic6x.c (elf32_tic6x_info_to_howto, elf32_tic6x_info_to_howto_rel): Likewise. * elf32-tilepro.c (tilepro_info_to_howto_rela): Likewise. * elf32-v850.c (v850_elf_info_to_howto_rel, v850_elf_info_to_howto_rela, v800_elf_info_to_howto): Likewise. * elf32-vax.c (rtype_to_howto): Likewise. * elf32-visium.c (visium_info_to_howto_rela): Likewise. * elf32-wasm32.c (elf32_wasm32_rtype_to_howto, elf32_wasm32_info_to_howto_rela): Likewise. * elf32-xc16x.c (elf32_xc16x_info_to_howto): Likewise. * elf32-xgate.c (xgate_info_to_howto_rel): Likewise. * elf32-xstormy16.c (xstormy16_info_to_howto_rela): Likewise. * elf32-xtensa.c (elf_xtensa_info_to_howto_rela): Likewise. * elf64-alpha.c (elf64_alpha_info_to_howto): Likewise. * elf64-gen.c (elf_generic_info_to_howto, elf_generic_info_to_howto_rel): Likewise. * elf64-ia64-vms.c (elf64_ia64_info_to_howto): Likewise. * elf64-mips.c (mips_elf64_info_to_howto_rela): Likewise. * elf64-mmix.c (mmix_info_to_howto_rela): Likewise. * elf64-ppc.c (ppc64_elf_info_to_howto): Likewise. * elf64-s390.c (elf_s390_reloc_type_lookup): Likewise. * elf64-sh64.c (elf_s390_info_to_howto, sh_elf64_info_to_howto): Likewise. * elf64-x86-64.c (elf_x86_64_info_to_howto): Likewise. * elfn32-mips.c (mips_info_to_howto_rel, mips_info_to_howto_rela): Likewise. * elfnn-aarch64.c (elfNN_aarch64_info_to_howto): Likewise. * elfnn-ia64.c (elfNN_ia64_info_to_howto): Likewise. * elfnn-riscv.c (riscv_info_to_howto_rela): Likewise. * elfxx-ia64.c (ia64_elf_reloc_type_lookup): Likewise. * elfxx-sparc.c (_bfd_sparc_elf_info_to_howto): Likewise. * elfxx-tilegx.c (tilegx_info_to_howto_rela): Likewise. * elf32-score.h (s7_bfd_score_info_to_howto): Update prototype. * elfxx-sparc.h (_bfd_sparc_elf_info_to_howto): Update prototype. * elfxx-tilegx.h (tilegx_info_to_howto_rela): Update prototype. * elfxx-target.h (elf_info_to_howto, elf_info_to_howto_rel): Default to NULL. binutils PR 22875 * objcopy.c (copy_object): Check the error status after marking symbols used in relocations. * testsuite/binutils-all/strip-13.s: New test source file. * testsuite/binutils-all/strip-13.s: New test driver file. * testsuite/binutils-all/objcopy.exp: Run the new test.
2018-02-27Automatic date update in version.inGDB Administrator1-1/+1
2018-02-26ChangeLog entry for previous commit.Jim Wilson1-0/+8
2018-02-26IA-64: Fix linker error with --no-keep-memory.Jim Wilson1-0/+6
bfd/ PR 15904 * elfnn-ia64.c (elfNN_ia64_relax_section): After ia64_elf_relax_brl call, set changed_contents and changed_relocs. Likewise after successful ia64_elf_relax_br call.
2018-02-26Add test for load commandSimon Marchi4-8/+98
There doesn't seem to by any test for the load command. I suggest to add this test, so that we can have a minimum of confidence we don't break it completely while refactoring the code that implements it. gdb/testsuite/ChangeLog: * gdb.base/load-command.c: New file. * gdb.base/load-command.exp: New file. * lib/gdb.exp (gdb_is_target_remote_prompt): Rename to... (gdb_is_target_1): ...this, and generalize for other targets than just remote. (gdb_is_target_remote): Use gdb_is_target_1. (gdb_is_target_native): use gdb_is_target_1.
2018-02-26MIPS: Don't use a 32-bit BFD architecture with a 64-bit ABIMaciej W. Rozycki2-0/+13
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-26MIPS: Reorder ABI determination ahead of target description loadingMaciej W. Rozycki2-182/+183
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-26Change frame_filter_flags to use DEF_ENUM_FLAGS_TYPETom Tromey8-18/+45
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-26Make "bt N" print correct number of frames when using a frame filterTom Tromey6-2/+49
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-26Handle DW_TAG_variant_part and DW_TAG_variantTom Tromey5-37/+470
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-26Convert Rust to use discriminated unionsTom Tromey6-510/+640
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-26Initial support for variant partsTom Tromey4-0/+113
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-26Sign-extend non-bit-fields in unpack_bits_as_longTom Tromey4-3/+76
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-26GAS/doc: Clean up `.dc' and `.ds' directive descriptionsMaciej W. Rozycki2-5/+9
gas/ * doc/as.texinfo (Pseudo Ops): Clean up `.dc' and `.ds' descriptions.
2018-02-26Move read_partial_die to partial_die_info::readYao Qi2-52/+64
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-26Move fixup_partial_die to partial_die_info::fixupYao Qi2-38/+44
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-26Remove one argument abbrev_len in read_partial_dieYao Qi2-7/+11
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-26Class-fy partial_die_infoYao Qi2-26/+70
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-26Change find_partial_die_in_comp_unit to dwarf2_cu::find_partial_dieYao Qi2-6/+15
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-26Don't check abbrev is NULL in read_partial_dieYao Qi2-10/+12
'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-26Re-write partial_die_info allocation in load_partial_diesYao Qi2-30/+29
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-26Move arch/tdesc.h to common/tdesc.hAlan Hayward32-53/+90
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-26Fix typo in documentation of assembler's .dc directive.Nick Clifton2-1/+5
* doc/as.texinfo (Dc): Fix typo.
2018-02-26Segfault on phdrs allocated but not createdAlan Modra2-7/+11
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-26ld error/warning messagesAlan Modra145-655/+790
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-26ld message translation for emultempl and emulparamsAlan Modra8-28/+474
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-26crx string overflow warningAlan Modra2-1/+6
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-26Automatic date update in version.inGDB Administrator1-1/+1
2018-02-26assorted target messagesAlan Modra40-222/+248
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-26BFD messagesAlan Modra37-55/+96
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-26AOUT/COFF/PE messagesAlan Modra16-62/+71
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-26ARM and AArch64 messagesAlan Modra28-157/+182
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-26MIPS messagesAlan Modra88-642/+738
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-26ELF linker messagesAlan Modra19-100/+121
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-26unrecognized/unsupported reloc messageAlan Modra81-242/+297
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-26PPC error/warning messagesAlan Modra12-83/+92
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-25Fix double space expected in cp_test_ptype_classSimon Marchi2-1/+6
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-25Automatic date update in version.inGDB Administrator1-1/+1
2018-02-24Remove most cleanups from linux-thread-db.cTom Tromey2-103/+49
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-24Remove cleanups from check_fast_tracepoint_salsTom Tromey8-23/+28
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-24Automatic date update in version.inGDB Administrator1-1/+1
2018-02-23GDB/testsuite: Fix a typo in $actual_lineMaciej W. Rozycki2-1/+6
Fix a commit 883fd55ab104 ("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.