aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2018-01-02gdb/copyright.py: Remove testsuite/gdb.base/step-line.{c,inp} special handlingJoel Brobecker2-3/+6
In the past, these files needed to be handled by hand, because the testcase was sensitive to the length of the header, which was potentially changing when new copyright years were added to the copyright header. Now that we simply maintain and update a range, the length of the copyright header should not change as a consequence of the update performed by this script, so special handling of those files is no longer necessary. gdb/ChangeLog: * copyright.py (BY_HAND): Remove gdb/testsuite/gdb.base/step-line.inp and gdb/testsuite/gdb.base/step-line.c.
2018-01-02gdb/copyright.py: Do not forget to remind about MULTIPLE_COPYRIGHT_HEADERSJoel Brobecker2-1/+16
There is a small logical error in the part of the script that dumps the list of files in BY_HAND + MULTIPLE_COPYRIGHT_HEADERS but only checkis the contents of BY_HAND. The issue becomes apparent as soon as BY_HAND is empty. Prevent this from happening by treating the two lists separately, as this allows us to provide a more informative message in the case of MULTIPLE_COPYRIGHT_HEADERS. gdb/ChangeLog: * copyright.py (main): Dump the contents of MULTIPLE_COPYRIGHT_HEADERS (separately) from BY_HAND, even if BY_HAND is empty.
2018-01-02Update copyright year in version message of GDB, GDBserver and GDBreplayJoel Brobecker5-3/+14
gdb/ChangeLog: * top.c (print_gdb_version): Update Copyright year in version message. gdb/gdbserver/ChangeLog: * gdbreplay.c (gdbreplay_version): Update copyright year in version message. * server.c (gdbserver_version): Likewise.
2018-01-02Yearly rotation of the gdb/ChangeLog fileJoel Brobecker3-18453/+18467
gdb/ChangeLog * config/djgpp/fnchange.lst: Add entry for gdb/ChangeLog-2017.
2018-01-02Automatic date update in version.inGDB Administrator1-1/+1
2018-01-01Automatic date update in version.inGDB Administrator1-1/+1
2017-12-31Avoid indexing std::vector past the endRuslan Kabatsayev2-4/+9
The code here wants to find address of an element, and often this element is one past the end of std::vector. Dereferencing that element leads to undefined behavior, so it's better to simply use pointer arithmetic instead of taking address of invalid dereference. gdb/ChangeLog: * psymtab.c (recursively_search_psymtabs): Use pointer arithmetic instead of dereferencing std::vector past the end.
2017-12-30Only ignore -Wenum-compare-switch if it existsSimon Marchi2-3/+12
My patch dwarf2read: Silence -Wenum-compare-switch warning 132448f8359a268f34f074b0908b5255b568da06 made some parts of dwarf2read.c ignore warnings about switch using enums of different kinds. What I did not realize was that older Clang versions (prior to 6) did not have that warning, and therefore give this error: /home/emaisin/src/binutils-gdb/gdb/dwarf2read.c:24187:7: error: unknown warning group '-Wenum-compare-switch', ignored [-Werror,-Wunknown-pragmas] DIAGNOSTIC_IGNORE_SWITCH_DIFFERENT_ENUM_TYPES ^ /home/emaisin/src/binutils-gdb/gdb/common/diagnostics.h:42:3: note: expanded from macro 'DIAGNOSTIC_IGNORE_SWITCH_DIFFERENT_ENUM_TYPES' DIAGNOSTIC_IGNORE ("-Wenum-compare-switch") ^ /home/emaisin/src/binutils-gdb/gdb/common/diagnostics.h:27:3: note: expanded from macro 'DIAGNOSTIC_IGNORE' _Pragma (STRINGIFY (GCC diagnostic ignored option)) ^ <scratch space>:10:25: note: expanded from here GCC diagnostic ignored "-Wenum-compare-switch" ^ Clang has a way to test if it knows about a particular warning. This patch uses that feature to only define DIAGNOSTIC_IGNORE_SWITCH_DIFFERENT_ENUM_TYPES to something if the warning is recognized by the Clang version being used. I tested building dwarf2read.c with clang 4, 5, 6, as well as gcc. gdb/ChangeLog: * common/diagnostics.h (DIAGNOSTIC_IGNORE_SWITCH_DIFFERENT_ENUM_TYPES): Only define if the compiler knows about -Wenum-compare-switch.
2017-12-30dwarf2read: Silence -Wenum-compare-switch warningSimon Marchi2-0/+12
Compiling with Clang 6 gives: /home/emaisin/src/binutils-gdb/gdb/dwarf2read.c:24385:14: error: comparison of two values with different enumeration types in switch statement ('enum dwarf_macro_record_type' and 'dwarf_macinfo_record_type') [-Werror,-Wenum-compare-switch] case DW_MACINFO_vendor_ext: ^~~~~~~~~~~~~~~~~~~~~ /home/emaisin/src/binutils-gdb/gdb/dwarf2read.c:24561:7: error: comparison of two values with different enumeration types in switch statement ('enum dwarf_macro_record_type' and 'dwarf_macinfo_record_type') [-Werror,-Wenum-compare-switch] case DW_MACINFO_vendor_ext: ^~~~~~~~~~~~~~~~~~~~~ This code uses the two enum types on purpose, because it handles both .debug_macro and .debug_macinfo sections. Add some pragmas to disable the warning in these specific cases. gdb/ChangeLog: * dwarf2read.c (dwarf_decode_macro_bytes): Ignore -Wenum-compare-switch warning. (dwarf_decode_macros): Likewise.
2017-12-30C++-ify parser_stateTom Tromey9-102/+110
This mildly C++-ifies parser_state and stap_parse_info -- just enough to remove some cleanups. This version includes the changes implemented by Simon. Regression tested by the buildbot. gdb/ChangeLog 2017-12-30 Tom Tromey <tom@tromey.com> Simon Marchi <simon.marchi@ericsson.com> * stap-probe.h (struct stap_parse_info): Add constructor, destructor. * stap-probe.c (stap_parse_argument): Update. * rust-exp.y (rust_lex_tests): Update. * parser-defs.h (struct parser_state): Add constructor, destructor, release method. <expout>: Change type to expression_up. (null_post_parser): Change type. (initialize_expout, reallocate_expout): Remove. * parse.c (parser_state::parser_state): Rename from initialize_expout. (parser_state::release): Rename from reallocate_expout. (write_exp_elt, parse_exp_in_context_1, increase_expout_size): Update. (null_post_parser): Change type of "exp". * dtrace-probe.c (dtrace_probe::build_arg_exprs): Update. * ada-lang.c (resolve, resolve_subexp) (replace_operator_with_call): Change type of "expp". * language.h (struct language_defn) <la_post_parser>: Change type of "expp".
2017-12-31Automatic date update in version.inGDB Administrator1-1/+1
2017-12-30Make mapped_debug_names and mapped_index finalSimon Marchi2-2/+7
When compiling with Clang 6, I see these warnings: /home/emaisin/src/binutils-gdb/gdb/dwarf2read.c:25421:5: error: destructor called on non-final 'mapped_index' that has virtual functions but non-virtual destructor [-Werror,-Wdelete-non-virtual-dtor] data->index_table->~mapped_index (); ^ In file included from /home/emaisin/src/binutils-gdb/gdb/dwarf2read.c:31: In file included from /home/emaisin/src/binutils-gdb/gdb/defs.h:28: In file included from /home/emaisin/src/binutils-gdb/gdb/common/common-defs.h:92: In file included from /home/emaisin/src/binutils-gdb/gdb/common/gdb_unique_ptr.h:23: In file included from /usr/bin/../lib/gcc/x86_64-linux-gnu/5.4.0/../../../../include/c++/5.4.0/memory:81: /usr/bin/../lib/gcc/x86_64-linux-gnu/5.4.0/../../../../include/c++/5.4.0/bits/unique_ptr.h:76:2: error: delete called on non-final 'mapped_debug_names' that has virtual functions but non-virtual destructor [-Werror,-Wdelete-non-virtual-dtor] delete __ptr; ^ /usr/bin/../lib/gcc/x86_64-linux-gnu/5.4.0/../../../../include/c++/5.4.0/bits/unique_ptr.h:236:4: note: in instantiation of member function 'std::default_delete<mapped_debug_names>::operator()' requested here get_deleter()(__ptr); ^ /home/emaisin/src/binutils-gdb/gdb/dwarf2read.c:2374:21: note: in instantiation of member function 'std::unique_ptr<mapped_debug_names, std::default_delete<mapped_debug_names> >::~unique_ptr' requested here dwarf2_per_objfile::dwarf2_per_objfile (struct objfile *objfile_, ^ This patch silences these warnings by making the classes final. gdb/ChangeLog: * dwarf2read.c (struct mapped_debug_names): Make final. (struct mapped_index): Make final.
2017-12-29Ignore warning about using different types of enums in switchSimon Marchi3-0/+16
When compiling with clang 6, I see a bunch of warnings like this: /home/emaisin/src/binutils-gdb/gdb/amd64-linux-tdep.c:1427:8: error: comparison of two values with different enumeration types in switch statement ('enum amd64_syscall' and 'amd 64_x32_syscall') [-Werror,-Wenum-compare-switch] case amd64_x32_sys_move_pages: ^~~~~~~~~~~~~~~~~~~~~~~~ In this switch, we indeed use enumerators of both types amd64_x32_syscall and amd64_syscall. This is done on purpose, and the enum values are chosen so that they are complementary. I think it's still a useful warning, so I chose to ignore just that particular case. gdb/ChangeLog: * common/diagnostics.h (DIAGNOSTIC_IGNORE_SWITCH_DIFFERENT_ENUM_TYPES): New macro. * amd64-linux-tdep.c (amd64_canonicalize_syscall): Use it.
2017-12-29Remove unnecessary call to get_thread_db_infoSimon Marchi2-5/+6
In thread_db_detach, we call get_thread_db_info to first check if there exists a thread_db_info entry for the pid to detach. If there is, then we call delete_thread_db_info. It's unnecessary to call get_thread_db_info in the first place, since delete_thread_db_info handles the case where no thread_db_info entry exist for the given pid. gdb/ChangeLog: * linux-thread-db.c (thread_db_detach): Remove call to delete_thread_db_info.
2017-12-30Automatic date update in version.inGDB Administrator1-1/+1
2017-12-29Automatic date update in version.inGDB Administrator1-1/+1
2017-12-28RISC-V: Add missing privileged spec registers.Jim Wilson5-148/+736
gas/ * testsuite/gas/riscv/priv-reg.d, testsuite/gas/riscv/priv-reg.s: New. include/ * opcode/riscv-opc.h (DECLARE_CSR): Add missing privileged registers. Sort to match privileged spec documentation order. (DECLARE_CSR_ALIAS): Add ubadaddr, and comments.
2017-12-28Remove unused HP-UX TARGET_OBJECT_ enumsSimon Marchi2-9/+5
These two enumerators are unused, remove them. gdb/ChangeLog: * target.h (enum target_object) <TARGET_OBJECT_HPUX_UREGS, TARGET_OBJECT_HPUX_SOLIB_GOT>: Remove.
2017-12-28Automatic date update in version.inGDB Administrator1-1/+1
2017-12-27tdesc: handle arbitrary strings in tdesc_register_in_reggroup_pStafford Horne8-41/+57
tdesc_register_in_reggroup_p in now able to handle arbitrary groups. This is useful when groups are created while the target descriptor file is received from the remote. This can be the case of a soft core target processor where registers/groups can change. gdb/ChangeLog: yyyy-mm-dd Franck Jullien <franck.jullien@gmail.com> Stafford Horne <shorne@gmail.com> * target-descriptions.c (tdesc_register_in_reggroup_p): Support arbitrary strings. (tdesc_use_registers): Add logic to register new reggroups. (tdesc_reg::group): Update comment to indicate we allow arbitrary strings. * NEWS (Changes since GDB 8.0): Announce that GDB supports arbitrary reggroups. gdb/testsuite/ChangeLog: yyyy-mm-dd Stafford Horne <shorne@gmail.com> * gdb.xml/extra-regs.xml: Add example foo reggroup. * gdb.xml/tdesc-regs.exp: Add test to check for foo reggroup. gdb/doc/ChangeLog: yyyy-mm-dd Stafford Horne <shorne@gmail.com> * gdb.texinfo (Target Description Format): Explain that arbitrary strings are now allowed for register groups.
2017-12-27reggroups: Add reggroup_gdbarch_new, reggroup_find for dynamic reggroupsStafford Horne3-0/+44
Traditionally reggroups have been created via reggroup_new() during initialization code and never freed. Now, if we want to initialize reggroups dynamically (i.e. in target description) we should be able to free them. Create this function reggroup_gdbarch_new() which will allocate the reggroup memory onto the passed gdbarch obstack. Also creating reggroup_find() as a utility to find a gdbarch registered reggroup object by name. gdb/ChangeLog: yyyy-mm-dd Stafford Horne <shorne@gmail.com> * reggroups.c (reggroup_gdbarch_new): New function. (reggroup_find): New function. * reggroups.h (reggroup_gdbarch_new): New function. (reggroup_find): New function.
2017-12-27reggroups: Convert reggroups from post_init to pre_initStafford Horne2-11/+13
Currently the reggroups gdbarch_data cannot be manipulated until after the gdbarch is completely initialized. This is usually done when the object init depends on architecture specific fields. In the case of reggroups it only depends on the obstack being available. Coverting this to pre_init allows using reggroups during gdbarch initialization. This is needed to allow registering arbitrary reggroups during gdbarch initializations. gdb/ChangeLog: yyyy-mm-dd Stafford Horne <shorne@gmail.com> * reggroups.c (reggroups_init): Change to depend only on obstack rather than gdbarch. (reggroup_add): Remove logic for forcing premature init. (_initialize_reggroup): Set `reggroups_data` with gdbarch_data_register_pre_init() rather than gdbarch_data_register_post_init().
2017-12-27reggroups: Add test and docs for `info reg $reggroup` featureStafford Horne7-2/+160
Until now this feature has existed but was not documented. Adding docs and tests. gdb/ChangeLog: yyyy-mm-dd Stafford Horne <shorne@gmail.com> * infcmd.c (_initialize_infcmd): Add help for info reg $reggroup and info all-registers $reggroup feature. gdb/doc/ChangeLog: yyyy-mm-dd Stafford Horne <shorne@gmail.com> * gdb.texinfo (Registers): Document info reg $reggroup feature. gdb/testsuite/ChangeLog: yyyy-mm-dd Stafford Horne <shorne@gmail.com> * gdb.base/reggroups.c: New file. * gdb.base/reggroups.exp: New file.
2017-12-27Automatic date update in version.inGDB Administrator1-1/+1
2017-12-26Automatic date update in version.inGDB Administrator1-1/+1
2017-12-25Automatic date update in version.inGDB Administrator1-1/+1
2017-12-24Automatic date update in version.inGDB Administrator1-1/+1
2017-12-23Add ATTRIBUTE_PRINTF to printf_field_type_assignmentSimon Marchi2-0/+6
Get rid of: /home/simark/src/binutils-gdb/gdb/target-descriptions.c:2026:25: error: format string is not a string literal [-Werror,-Wformat-nonliteral] vprintf_unfiltered (fmt, args); when building with clang. gdb/ChangeLog: * target-descriptions.c (print_c_tdesc) <printf_field_type_assignment>: Add ATTRIBUTE_PRINTF.
2017-12-23Automatic date update in version.inGDB Administrator1-1/+1
2017-12-22Automatic date update in version.inGDB Administrator1-1/+1
2017-12-21Do not emit "field_type" var if not needed on "maint print c-tdesc"Simon Marchi37-51/+86
While fiddling a bit with -Wunused-variable, Sergio noticed that "maint print c-tdesc" was always generating code for the "tdesc_type *field_type" variable, even when it wasn't used. This is caught by GCC when using -Wunused-variable, of course. This patch changes the print_c_tdesc class to only output the field declaration when we actually need it. It shouldn't be necessary to do the same with the other variable declarations (type_with_fields and element_type), because they are always if they are declared. The C files in features/ are regenerated, some declarations of field_type are removed, as expected, while some others move to where they are used for the first time. gdb/ChangeLog: * target-descriptions.c (print_c_tdesc) <visit>: Don't output field_type declaration, use printf_field_type_assignment instead. <printf_field_type_assignment>: New method. * features/aarch64-core.c, features/aarch64-fpu.c features/arc-arcompact.c, features/arc-v2.c, features/arm/arm-with-iwmmxt.c, features/i386/32bit-core.c, features/i386/32bit-mpx.c, features/i386/32bit-sse.c, features/i386/64bit-avx512.c, features/i386/64bit-core.c, features/i386/64bit-mpx.c, features/i386/64bit-sse.c, features/i386/x32-core.c, features/or1k.c, features/rs6000/powerpc-7400.c, features/rs6000/powerpc-altivec32.c, features/rs6000/powerpc-altivec32l.c, features/rs6000/powerpc-altivec64.c, features/rs6000/powerpc-altivec64l.c, features/rs6000/powerpc-cell32l.c, features/rs6000/powerpc-cell64l.c, features/rs6000/powerpc-isa205-altivec32l.c, features/rs6000/powerpc-isa205-altivec64l.c, features/rs6000/powerpc-isa205-vsx32l.c, features/rs6000/powerpc-isa205-vsx64l.c, features/rs6000/powerpc-vsx32.c, features/rs6000/powerpc-vsx32l.c, features/rs6000/powerpc-vsx64.c, features/rs6000/powerpc-vsx64l.c, features/s390-gs-linux64.c, features/s390-tevx-linux64.c, features/s390-vx-linux64.c, features/s390x-gs-linux64.c, features/s390x-tevx-linux64.c, features/s390x-vx-linux64.c: Re-generate.
2017-12-20Remove write-only assignment in rs6000-tdep.cUros Bizjak2-1/+5
The result of this memory read is never used, so it can be removed. gdb/ChangeLog: * rs6000-tdep.c (ppc_deal_with_atomic_sequence): Remove write-only assignment to "insn" variable.
2017-12-21Automatic date update in version.inGDB Administrator1-1/+1
2017-12-20RISC-V: Add compressed instruction hints, and a few misc cleanups.Jim Wilson16-13/+156
gas/ * config/tc-riscv.c (risc_ip) <o>: Add comment. * testsuite/gas/riscv/c-nonzero-imm.d, * testsuite/gas/riscv/c-nonzero-imm.l, * testsuite/gas/riscv/c-nonzero-imm.s, * testsuite/gas/riscv/c-nonzero-reg.d, * testsuite/gas/riscv/c-nonzero-reg.l, * testsuite/gas/riscv/c-nonzero-reg.s, * testsuite/gas/riscv/c-zero-imm-64.d, * testsuite/gas/riscv/c-zero-imm-64.s, * testsuite/gas/riscv/c-zero-imm.d, testsuite/gas/riscv/c-zero-imm.s, * testsuite/gas/riscv/c-zero-reg.d, * testsuite/gas/riscv/c-zero-reg.s: New. opcodes/ * riscv-opc.c (match_c_add_with_hint, match_c_lui_with_hint): New. (riscv_opcodes) <li>: Delete "d,0" line. Change Cj to Co. <andi, and, add, addiw, addw, c.addi>: Change Cj to Co. <add>: Add explanatory comment for 4-operand add instruction. <c.nop>: Add support for immediate operand. <c.mv, c.add>: Use match_c_add_with_hint instead of match_c_add. <c.lui>: Use match_c_lui_with_hint instead of match_c_lui. <c.li, c.slli>: Use match_opcode instead of match_rd_nonzero.
2017-12-20[Cell/B.E.] Fix regression due to gdbarch_significant_addr_bitUlrich Weigand3-0/+13
On Cell/B.E. multi-architecture debugging we use a "merged" address space that encodes both the main PowerPC address space and the local store address spaces of all active SPUs. This will always occupy 64 bits. However, gdbarch_addr_bit is set to 32 on SPU, and may be set to 32 as well on PowerPC. Since the new gdbarch_significant_addr_bit defaults to the value of gdbarch_addr_bit, this means addresses may be improperly truncated. Work around this problem by explicitly setting gdbarch_significant_addr_bit to 64 both for the SPU target and also for PowerPC target that support Cell/B.E. execution. gdb/ChangeLog: 2017-12-20 Ulrich Weigand <uweigand@de.ibm.com> * spu-tdep.c (spu_gdbarch_init): Set set_gdbarch_significant_addr_bit to 64 bits. (ppc_linux_init_abi): Likewise, if Cell/B.E. is supported.
2017-12-19Fix ChangeLog formattingSimon Marchi2-2/+2
Doing some unrelated grepping found that there were some missing spaces, fix it.
2017-12-20Automatic date update in version.inGDB Administrator1-1/+1
2017-12-19Correct disassembly of dot product instructions.Tamar Christina10-438/+471
Dot products deviate from the normal disassembly rules for lane indexed instruction. Their canonical representation is in the form of: v0.2s, v0.8b, v0.4b[0] instead of v0.2s, v0.8b, v0.b[0] to try to denote that these instructions select 4x 1 byte elements instead of a single 1 byte element. Previously we were disassembling them following the normal rules, this patch corrects the disassembly. gas/ PR gas/22559 * config/tc-aarch64.c (vectype_to_qualifier): Support AARCH64_OPND_QLF_S_4B. * gas/testsuite/gas/aarch64/dotproduct.d: Update disassembly. include/ PR gas/22559 * aarch64.h (aarch64_opnd_qualifier): Add AARCH64_OPND_QLF_S_4B. opcodes/ PR gas/22559 * aarch64-asm.c (aarch64_ins_reglane): Change AARCH64_OPND_QLF_S_B to AARCH64_OPND_QLF_S_4B * aarch64-dis.c (aarch64_ext_reglane): Change AARCH64_OPND_QLF_S_B to AARCH64_OPND_QLF_S_4B * aarch64-opc.c (aarch64_opnd_qualifiers): Add 4b variant. * aarch64-tbl.h (QL_V2DOT): Change S_B to S_4B.
2017-12-19Add support for V_4B so we can properly reject it.Tamar Christina9-3/+47
Previously parse_vector_type_for_operand was changed to allow the use of 4b register size for indexed lane instructions. However this had the unintended side effect of also allowing 4b for normal vector registers. Because this support was only partial the rest of the tool silently treated 4b as 8b and continued. This patch adds full support for 4b so it can be properly distinguished from 8b and the correct errors are generated. With this patch you still can't encode any instruction which actually requires v<num>.4b but such instructions don't exist so to prevent needing a workaround in get_vreg_qualifier_from_value this was just omitted. gas/ PR gas/22529 * config/tc-aarch64.c (vectype_to_qualifier): Support AARCH64_OPND_QLF_V_4B. * gas/testsuite/gas/aarch64/pr22529.s: New. * gas/testsuite/gas/aarch64/pr22529.d: New. * gas/testsuite/gas/aarch64/pr22529.l: New. include/ PR gas/22529 * opcode/aarch64.h (aarch64_opnd_qualifier): Add AARCH64_OPND_QLF_V_4B. opcodes/ PR gas/22529 * aarch64-opc.c (aarch64_opnd_qualifiers): Add 4b variant.
2017-12-19Stop readelf from complaining about relocation sections with an sh_info ↵Nick Clifton2-5/+15
field of 0 in dynamic executables. PR 22587 * readelf.c (process_section_headers): Do not complain about an sh_info field of 0 in relocation sections of ET_EXEC or ET_DYN type executables.
2017-12-19Automatic date update in version.inGDB Administrator1-1/+1
2017-12-19PR22626, invalid dynindx used for dynamic relocs against section symsAlan Modra2-8/+22
_bfd_elf_link_renumber_dynsyms is called twice by the linker. The first call in bfd_elf_size_dynamic_sections is just to answer the question as to whether there are there any dynamic symbols. The second call in bfd_elf_size_dynsym_hash_dynstr sets the st_shndx value that dynamic symbols will have. strip_excluded_output_sections is called between these two calls. So sections seen on the first _bfd_elf_link_renumber_dynsyms pass might differ from those seen on the second pass. Unfortunately, that can result in a stripped section's dynamic symbol being assigned a dynindx on the first pass but not corrected to the final value (of zero, ie. not dynamic) on the second pass. PowerPC, x86, mips, and most other targets that emit dynamic section symbols, just test that section symbol dynindx is non-zero before using a given section symbol in dynamic relocations. This patch prevents _bfd_elf_link_renumber_dynsyms from setting any section symbol dynindx on the first pass. PR 22626 * elflink.c (_bfd_elf_link_renumber_dynsyms): Don't set section dynindx when section_sym_count is NULL. (bfd_elf_size_dynamic_sections): Pass NULL section_sym_count to preliminary _bfd_elf_link_renumber_dynsyms call.
2017-12-19Test binutils_assemble return valueAlan Modra12-290/+323
This is a followup to "binutils nm testsuite tidy". Since the perror in binutils_assemble has been removed, we need to take more care in failure paths. The patch also fixed a number of .exp files that have multiple tests, where an assembly failure returns from the .exp file. In most cases it is nicer to attempt all tests. * testsuite/binutils-all/ar.exp (unique_symbol): Don't run AR if assembly fails. * testsuite/binutils-all/arc/objdump.exp (check_assembly): If objfile is empty, fail test. * testsuite/binutils-all/arm/objdump.exp: Don't return if assembly fails for a test, continue on to other tests. * testsuite/binutils-all/bfin/objdump.exp: Likewise. * testsuite/binutils-all/hppa/objdump.exp: Likewise. * testsuite/binutils-all/m68k/objdump.exp: Likewise. * testsuite/binutils-all/vax/objdump.exp: Likewise. * testsuite/binutils-all/size.exp: Likewise. * testsuite/binutils-all/nm.exp: Likewise. Move PR12753 test. * testsuite/binutils-all/objcopy.exp: Don't perror on assembly fail. * testsuite/binutils-all/objdump.exp: Report assembly fails.
2017-12-18Decode expression lists used with DW_AT_byte_size and other DWARF attributes.Nick Clifton2-0/+23
PR 22532 * dwarf.c (read_and_display_attr_value): Add attributes that might use the DW_FORM_exprloc form, and if so, display the decoded location expression list.
2017-12-18Resolve PR 22493 - the encoding to be used when pushing the stack pointer ↵Nick Clifton2-0/+11
onto the stack. PR 22493 * config/tc-arm.c (encode_ldmstm): Do not use A2 encoding of the PUSH insn when pushing the stack pointer.
2017-12-18x86: fold certain AVX and AVX2 templatesJan Beulich7-4144/+841
Just like for instructions in GPRs, there's no need to have separate templates for otherwise identical insns acting on XMM or YMM registers (or memory of the same size).
2017-12-18x86: fold RegXMM/RegYMM/RegZMM into RegSIMDJan Beulich11-46431/+46461
... qualified by their respective sizes, allowing to drop FirstXmm0 at the same time.
2017-12-18x86: drop FloatReg and FloatAccJan Beulich8-32592/+32603
Express them as Reg|Tbyte and Acc|Tbyte respectively.
2017-12-18x86: replace Reg8, Reg16, Reg32, and Reg64Jan Beulich10-32899/+33388
Use a combination of a single new Reg bit and Byte, Word, Dword, or Qword instead. Besides shrinking the number of operand type bits this has the benefit of making register handling more similar to accumulator handling (a generic flag is being accompanied by a "size qualifier"). It requires, however, to split a few insn templates, as it is no longer correct to have combinations like Reg32|Reg64|Byte. This slight growth in size will hopefully be outweighed by this change paving the road for folding a presumably much larger number of templates later on.
2017-12-17improved error message when getting an exception printing a variableJoel Brobecker6-5/+173
Consider the following Ada code defining a global variable whose type is an array of static bounds (1 .. 2), but where its elements are a variant record whose size is not statically known: type Ints is array (Natural range <>) of Integer; type Bounded_Ints (Max_Size : Natural) is record Length : Natural := 0; Objs : Ints (1 .. Max_Size); end record; type Ints_Doubled is array (1 .. 2) of Bounded_Ints (Idem (0)); Global : Ints_Doubled; When compiling this program at -O2 using a GCC-6.4-based compiler on x86_64-linux, trying to print the value of that global variable yields: (gdb) p global $1 = Let's look at the debugging info, which starts with the global variable itself... .uleb128 0x19 # (DIE (0x25e) DW_TAG_variable) .long .LASF32 # DW_AT_name: "fd__global" .long 0x273 # DW_AT_type ... its type is a reference to a typedef ... .uleb128 0x14 # (DIE (0x273) DW_TAG_reference_type) .byte 0x8 # DW_AT_byte_size .long 0x202 # DW_AT_type [...] .uleb128 0x15 # (DIE (0x202) DW_TAG_typedef) .long .LASF19 # DW_AT_name: "fd__ints_doubled" .long 0x20d # DW_AT_type ... of an array (1..2) ... .uleb128 0x2 # (DIE (0x20d) DW_TAG_array_type) .long .LASF19 # DW_AT_name: "fd__ints_doubled" .long 0x15b # DW_AT_type .long 0x221 # DW_AT_sibling .uleb128 0x16 # (DIE (0x21a) DW_TAG_subrange_type) .long 0x40 # DW_AT_type .sleb128 2 # DW_AT_upper_bound .byte 0 # end of children of DIE 0x20d ... of a struct whose name is fd__Tints_doubledC: .uleb128 0x10 # (DIE (0x15b) DW_TAG_structure_type) .long .LASF11 # DW_AT_name: "fd__Tints_doubledC" .long 0x1e4 # DW_AT_GNAT_descriptive_type # DW_AT_artificial .long 0x1e4 # DW_AT_sibling .uleb128 0x7 # (DIE (0x16a) DW_TAG_member) .long .LASF4 # DW_AT_name: "max_size" [snip] The error occurs while Ada evaluator is trying to "fix" the element type inside the array, so as to determine its actual size. For that, it searches for a parallel "XVZ" variable, which, when found, contains the object's actual size. Unfortunately in our case, the variable exists but has been optimized out, as seen by the presence of a variable DIE in the debugging info, but with no address attribute: .uleb128 0x18 # (DIE (0x24e) DW_TAG_variable) .long .LASF31 # DW_AT_name: "fd__Tints_doubledC___XVZ" .long 0x257 # DW_AT_type # DW_AT_artificial Discussing this with some members of AdaCore's compiler team, it is expected that the optimizer can get rid of this variable, and we don't want to pessimize the code just to improve debuggability, since -O2 is about performance. So, the idea of this patch is not to make it work, but provide a bit more information to help users understand what kind of error is preventing GDB from being able to print the variable's value. The first hurdle we had to clear was the fact that ada_val_print traps all exceptions (including QUIT ones!), and does so completly silently. So, the fix was to add a trace of the exception being generated. While doing so, we fix an old XXX/FIXME by only catching errors, letting QUIT exceptions go through. Once this is done, we now get an error message, which gives a first clue as to what was happening: (gdb) p fd.global $1 = <error reading variable: value has been optimized out> However, it would be more useful to know which value it was that was optimized out. For that purpose, we enhanced ada-lang.c::ada_to_fixed_type_1 so as to re-throw the error with a message which indicates which variable we failed to read. With those changes, the new output is now: (gdb) p fd.global $1 = <error reading variable: unable to read value of fd__Tints_doubledC___XVZ (value has been optimized out)> gdb/ChangeLog: * ada-lang.c (ada_to_fixed_type_1): Rethrow errors with a more detailed exception message when getting an exception while trying to read the value of an XVZ variable. * ada-valprint.c (ada_val_print): Only catch RETURN_MASK_ERROR exceptions. Print an error message when an exception is caught. gdb/testsuite/ChangeLog: * gdb.dwarf2/ada-valprint-error.c: New file. * gdb.dwarf2/ada-valprint-error.exp: New file. Tested on x86_64-linux