aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2017-04-25Change readonly_p to boolYao Qi2-4/+10
This patch changes readonly_p type to bool. gdb: 2017-04-25 Yao Qi <yao.qi@linaro.org> * regcache.c (struct regcache) <readonly_p>: Change its type to bool. (regcache_xmalloc_1): Update parameter type and callers update.
2017-04-25MIPS/readelf: Simplify GOT[1] data availability checkMaciej W. Rozycki2-18/+19
Unavailable data is handled gracefully in MIPS GOT processing done by `print_mips_got_entry', so all that is needed in special GOT[1] handling is to verify whether data can be retrieved for the purpose of the GNU marker check done with `byte_get'. Remove the extra error reporting code then, introduced with commit 75ec1fdbb797 ("Fix runtime seg-fault in readelf when parsing a corrupt MIPS binary.") in the course of addressing PR binutils/21344, and defer the error case to regular local GOT entry processing. binutils/ * readelf.c (process_mips_specific): Remove error reporting from GOT[1] processing.
2017-04-25MIPS/readelf: Remove extraneous null GOT data checkMaciej W. Rozycki2-2/+5
Null data is handled gracefully throughout in MIPS GOT processing, with addresses printed normally and unavailable data shown as `<unknown>' by `print_mips_got_entry', and special processing code for GOT[1] doing an explicit check. Remove an unwanted null GOT data check then, introduced with commit 592458412fb2 in the course of addressing PR binutils/12855. binutils/ * readelf.c (process_mips_specific): Remove null GOT data check.
2017-04-25[ARC] Enhance enter/leave mnemonics.Claudiu Zissulescu7-20/+85
enter/leave mnemonics are enhanced to not only accept register ranges but also single register (i.e., r13) or even no GPR register at all. gas/ 2017-04-25 Claudiu Zissulescu <claziss@synopsys.com> * testsuite/gas/arc/leave_enter.d: Update test. * testsuite/gas/arc/leave_enter.s: Likewise. opcodes/ 2017-04-25 Claudiu Zissulescu <claziss@synopsys.com> * arc-dis.c (print_insn_arc): Smartly print enter/leave mnemonics. * arc-opc.c (insert_r13el): New function. (R13_EL): Define. * arc-tbl.h: Add new enter/leave variants.
2017-04-25[ARC] Prefer NOP instead of MOV 0,0Claudiu Zissulescu5-8/+17
NOP and MOV 0,0 are having the same encoding. As MOV mnemonic is located before NOP in the instruction table, the disassembler prints MOV 0,0 for NOP. Reorder the instructions such that NOP is first. gas/ 2017-04-25 Claudiu Zissulescu <claziss@synopsys.com> * testsuite/gas/arc/b.d: Update test. * testsuite/gas/arc/noargs_hs.d: Likewise. opcode/ 2017-04-25 Claudiu Zissulescu <claziss@synopsys.com> * arc-tbl.h: Reorder NOP entry to be before MOV instructions.
2017-04-25Change gdbarch_wchar_bit for AArch64 and ARMYao Qi3-2/+6
The size of wchar_t on AArch64 and ARM is 4-byte, so we can use the default value (4*TARGET_CHAR_BIT). This patch fixes some fails in gdb.cp/wide_char_types.exp on aarch64-linux. gdb: 2017-04-25 Yao Qi <yao.qi@linaro.org> * aarch64-tdep.c (aarch64_gdbarch_init): Don't call set_gdbarch_wchar_bit. * arm-tdep.c (arm_gdbarch_init): Likewise.
2017-04-25MIPS16/opcodes: Add `-M no-aliases' disassembler option help textMaciej W. Rozycki2-0/+8
Complement commit 986e18a5a9fd ("Add a second 'pinfo' member to mips_opcode to extend number of available bits"), <https://sourceware.org/ml/binutils/2005-01/msg00261.html>, and add a help text for the `-M no-aliases' disassembler option. opcodes/ * mips-dis.c (print_mips_disassembler_options): Add `no-aliases'.
2017-04-25MIPS16/opcodes: Annotate instruction aliasesMaciej W. Rozycki7-5/+73
Complement commit 986e18a5a9fd ("Add a second 'pinfo' member to mips_opcode to extend number of available bits"), <https://sourceware.org/ml/binutils/2005-01/msg00261.html>, and annotate MIPS16 NOP, LA, DLA and the synthetic forms of LD and LW instructions as aliases. These correspond to MOVE, and the PC-relative ADDIU, DADDIU, LD and LW hardware instructions respectively. binutils/ * testsuite/binutils-all/mips/mips16-alias.d: New test. * testsuite/binutils-all/mips/mips16-noalias.d: New test. * testsuite/binutils-all/mips/mips16-alias.s: New test source. * testsuite/binutils-all/mips/mips.exp: Run the new tests. opcodes/ * mips16-opc.c (AL): New macro. (mips16_opcodes): Mark "nop", "la", "dla", and synthetic forms of "ld" and "lw" as aliases.
2017-04-25MIPS/GAS: Correct BFD_RELOC_MIPS16_16_PCREL_S1 fixup sizeMaciej W. Rozycki8-5/+108
Correct the size of a BFD_RELOC_MIPS16_16_PCREL_S1 fixup made in `md_convert_frag', fixing a bug introduced with commit c9775dde3277 ("MIPS16: Add R_MIPS16_PC16_S1 branch relocation support)". Add test cases to verify that the overflow of this fixup's in-place addend is still correctly detected. gas/ * config/tc-mips.c (md_convert_frag): Correct BFD_RELOC_MIPS16_16_PCREL_S1 fixup size. * testsuite/gas/mips/mips16-branch-addend-4.d: New test. * testsuite/gas/mips/mips16-branch-addend-5.d: New test. * testsuite/gas/mips/mips16-branch-addend-5.l: New stderr output. * testsuite/gas/mips/mips16-branch-addend-4.s: New test source. * testsuite/gas/mips/mips16-branch-addend-5.s: New test source. * testsuite/gas/mips/mips.exp: Run the new tests.
2017-04-25Fix build on gcc < 5 (std::is_trivially_copyable missing)Pedro Alves3-0/+24
Ref: https://sourceware.org/ml/gdb-patches/2017-04/msg00660.html Simply skip the poisoning on older compilers. gdb/ChangeLog: 2017-04-25 Pedro Alves <palves@redhat.com> * common/poison.h [!HAVE_IS_TRIVIALLY_COPYABLE] (IsRelocatable) (BothAreRelocatable, memcopy, memmove): Don't define. * common/traits.h (__has_feature, HAVE_IS_TRIVIALLY_COPYABLE): New macros.
2017-04-25gas: sparc: fix relaxation of CALL instruction into branches in a.out targetsJose E. Marchesi6-2/+69
This patch avoids CALL instructions to be optimized into branches if the symbols referred to in the CALL instruction are not fully resolved at the time the assembler writes its output. Tested in sparc64-linux-gnu and sparc-sun-sunos4.1.3 targets. No regressions. gas/ChangeLog: 2017-04-25 Jose E. Marchesi <jose.marchesi@oracle.com> PR gas/21407 * config/tc-sparc.c (md_apply_fix): Do not transform `call' instructions into branch instructions in fixups generating additional relocations. * testsuite/gas/sparc/call-relax.s: New file. * testsuite/gas/sparc/call-relax.d: Likewise. * testsuite/gas/sparc/call-relax-aout.d: Likewise. * testsuite/gas/sparc/sparc.exp: Test call-relax and call-relax-aout.
2017-04-25Poison non-POD memset & non-trivially-copyable memcpy/memmovePedro Alves5-37/+126
This patch catches invalid initialization of non-POD types with memset, at compile time. This is what I used to catch the problems fixed by the previous patches in the series: $ make -k 2>&1 | grep "deleted function" src/gdb/breakpoint.c:951:53: error: use of deleted function ‘void* memset(T*, int, size_t) [with T = bp_location; <template-parameter-1-2> = void; size_t = long unsigned int]’ src/gdb/breakpoint.c:7325:32: error: use of deleted function ‘void* memset(T*, int, size_t) [with T = bp_location; <template-parameter-1-2> = void; size_t = long unsigned int]’ src/gdb/btrace.c:1153:42: error: use of deleted function ‘void* memset(T*, int, size_t) [with T = btrace_insn; <template-parameter-1-2> = void; size_t = long unsigned int]’ ... gdb/ChangeLog: 2017-04-25 Pedro Alves <palves@redhat.com> * common/common-defs.h: Include "common/poison.h". * common/function-view.h: (Not, Or, Requires): Move to traits.h and adjust. * common/poison.h: New file. * common/traits.h: Include <type_traits>. (Not, Or, Requires): New, moved from common/function-view.h.
2017-04-25Don't memset non-POD types: struct breakpointPedro Alves3-42/+37
Eh, struct breakpoint was made non-POD just today, with commit d28cd78ad820e3 ("Change breakpoint event locations to event_location_up"). :-) src/gdb/breakpoint.c: In function ‘void init_raw_breakpoint_without_location(breakpoint*, gdbarch*, bptype, const breakpoint_ops*)’: src/gdb/breakpoint.c:7447:28: error: use of deleted function ‘void* memset(T*, int, size_t) [with T = breakpoint; <template-parameter-1-2> = void; size_t = long unsigned int]’ memset (b, 0, sizeof (*b)); ^ In file included from src/gdb/common/common-defs.h:85:0, from src/gdb/defs.h:28, from src/gdb/breakpoint.c:20: src/gdb/common/poison.h:56:7: note: declared here void *memset (T *s, int c, size_t n) = delete; ^ gdb/ChangeLog: 2017-04-25 Pedro Alves <palves@redhat.com> * breakpoint.h (struct breakpoint): In-class initialize all fields. Make boolean fields "bool". * breakpoint.c (init_raw_breakpoint_without_location): Remove memset call and initializations no longer necessary.
2017-04-25Don't memset non-POD types: struct btrace_insnPedro Alves2-9/+21
struct btrace_insn is not a POD [1] so we shouldn't be using memset to initialize it [2]. Use list-initialization instead, wrapped in a "pt insn to btrace insn" function, which looks like just begging to be added next to the existing pt_reclassify_insn/pt_btrace_insn_flags functions. [1] - because its field "flags" is not POD, because enum_flags has a non-trivial default ctor. gdb/ChangeLog: 2017-04-25 Pedro Alves <palves@redhat.com> * btrace.c (pt_btrace_insn_flags): Change parameter type to reference. (pt_btrace_insn): New function. (ftrace_add_pt): Remove memset call and use pt_btrace_insn.
2017-04-25Don't memset non-POD types: struct bp_locationPedro Alves4-54/+58
struct bp_location is not a POD, so we shouldn't be using memset to initialize it. Caught like this: src/gdb/breakpoint.c: In function ‘bp_location** get_first_locp_gte_addr(CORE_ADDR)’: src/gdb/breakpoint.c:950:53: error: use of deleted function ‘void* memset(T*, int, size_t) [with T = bp_location; <template-parameter-1-2> = void; size_t = long unsigned int]’ memset (&dummy_loc, 0, sizeof (struct bp_location)); ^ In file included from src/gdb/defs.h:28:0, from src/gdb/breakpoint.c:20: src/gdb/common/common-defs.h:126:7: note: declared here void *memset (T *s, int c, size_t n) = delete; ^ gdb/ChangeLog: 2017-04-25 Pedro Alves <palves@redhat.com> * ada-lang.c (ada_catchpoint_location): Now a "class". Remove "base" field and inherit from "bp_location" instead. Add non-default ctor. (allocate_location_exception): Use new non-default ctor. * breakpoint.c (get_first_locp_gte_addr): Remove memset call. (init_bp_location): Convert to ... (bp_location::bp_location): ... this new ctor, and remove memset call. (base_breakpoint_allocate_location): Use the new non-default ctor. * breakpoint.h (bp_location): Now a class. Declare default and non-default ctors. In-class initialize all members. (init_bp_location): Remove declaration.
2017-04-25Don't memcpy non-trivially-copyable types: Make enum_flags triv. copyablePedro Alves2-10/+5
The delete-memcpy-with-non-trivial-types patch exposed many instances of this problem: src/gdb/btrace.h: In function ‘btrace_insn_s* VEC_btrace_insn_s_quick_insert(VEC_btrace_insn_s*, unsigned int, const btrace_insn_s*, const char*, unsigned int)’: src/gdb/common/vec.h:948:62: error: use of deleted function ‘void* memmove(T*, const U*, size_t) [with T = btrace_insn; U = btrace_insn; <template-parameter-1-3> = void; size_t = long unsigned int]’ memmove (slot_ + 1, slot_, (vec_->num++ - ix_) * sizeof (T)); \ ^ src/gdb/common/vec.h:436:1: note: in expansion of macro ‘DEF_VEC_FUNC_O’ DEF_VEC_FUNC_O(T) \ ^ src/gdb/btrace.h:84:1: note: in expansion of macro ‘DEF_VEC_O’ DEF_VEC_O (btrace_insn_s); ^ [...] src/gdb/common/vec.h:1060:31: error: use of deleted function ‘void* memcpy(T*, const U*, size_t) [with T = btrace_insn; U = btrace_insn; <template-parameter-1-3> = void; size_t = long unsigned int]’ sizeof (T) * vec2_->num); \ ^ src/gdb/common/vec.h:437:1: note: in expansion of macro ‘DEF_VEC_ALLOC_FUNC_O’ DEF_VEC_ALLOC_FUNC_O(T) \ ^ src/gdb/btrace.h:84:1: note: in expansion of macro ‘DEF_VEC_O’ DEF_VEC_O (btrace_insn_s); ^ So, VECs (given it's C roots) rely on memcpy/memcpy of VEC elements to be well defined, in order to grow/reallocate its internal elements array. This means that we can only put trivially copyable types in VECs. E.g., if a type requires using a custom copy/move ctor to relocate, then we can't put it in a VEC (so we use std::vector instead). But, as shown above, we're violating that requirement. btrace_insn is currently not trivially copyable, because it contains an enum_flags field, and that is itself not trivially copyable. This patch corrects that, by simply removing the user-provided copy constructor and assignment operator. The compiler-generated versions work just fine. Note that std::vector relies on std::is_trivially_copyable too to know whether it can reallocate its elements with memcpy/memmove instead of having to call copy/move ctors and dtors, so if we have types in std::vectors that weren't trivially copyable because of enum_flags, this will make such vectors more efficient. gdb/ChangeLog: 2017-04-25 Pedro Alves <palves@redhat.com> * common/enum-flags.h (enum_flags): Don't implement copy ctor and assignment operator.
2017-04-25Automatic date update in version.inGDB Administrator1-1/+1
2017-04-24x86-64: Force symbol dynamic if it isn't undefined weakH.J. Lu5-22/+72
Force symbol dynamic if it isn't undefined weak. Generate relative relocation for GOT reference against non-dynamic symbol in PIC to avoid unnecessary dynamic symbols. bfd/ * elf64-x86-64.c (elf_x86_64_link_hash_entry): Add no_finish_dynamic_symbol. (elf_x86_64_link_hash_newfunc): Set no_finish_dynamic_symbol to 0. (elf_x86_64_allocate_dynrelocs): If a symbol isn't undefined weak symbol, don't make it dynamic. (elf_x86_64_relocate_section): If a symbol isn't dynamic in PIC, set no_finish_dynamic_symbol and generate R_X86_64_RELATIVE relocation for GOT reference. (elf_x86_64_finish_dynamic_symbol): Abort if no_finish_dynamic_symbol isn't 0. ld/ * testsuite/ld-x86-64/no-plt.exp: Also check no-plt-1e.nd. * testsuite/ld-x86-64/no-plt-1e.nd: New file.
2017-04-24i386: Force symbol dynamic if it isn't undefined weakH.J. Lu2-9/+17
Force symbol dynamic if it isn't undefined weak. Generate R_386_RELATIVE relocation for R_386_GOT32 relocation against non-dynamic symbol in PIC. PR ld/21402 * elf32-i386.c (elf_i386_allocate_dynrelocs): If a symbol isn't undefined weak symbol, don't make it dynamic. (elf_i386_relocate_section): If a symbol isn't dynamic in PIC, set no_finish_dynamic_symbol and generate R_386_RELATIVE relocation for R_386_GOT32.
2017-04-24Use floatformat_totalsize_bytesYao Qi2-2/+6
The code can be replaced by floatformat_totalsize_bytes. gdb: 2017-04-24 Yao Qi <yao.qi@linaro.org> * doublest.c (convert_doublest_to_floatformat): Call floatformat_totalsize_bytes.
2017-04-24i386: Skip pr12570 tests for nacl targetsH.J. Lu3-0/+7
commit f129e49f4d07f4d36319ac757fdcf3a8ce7d605b Author: H.J. Lu <hjl.tools@gmail.com> Date: Tue Jan 10 11:30:25 2017 -0800 Don't use elf_i386_eh_frame_plt directly fixed i386 PLT eh_frame generation. Skip pr12570 tests since they are for non-nacl targets. * testsuite/ld-i386/pr12570a.d: Skip for nacl targets. * testsuite/ld-i386/pr12570b.d: Likewise.
2017-04-24i386: Set ELF_MAXPAGESIZE to 0x1000 for VxWorksH.J. Lu4-1/+13
commit a27e437177412e5b52999723f3c5d5d0d37b9087 Author: Roland McGrath <roland@gnu.org> Date: Thu Jul 28 22:35:15 2011 +0000 BFD vector for elf32-i386-nacl: changed ELF_MAXPAGESIZE to 0x10000 for VxWorks. This patch fixes it and updated testsuite/ld-i386/vxworks2.sd to add space for program headers. bfd/ PR ld/21425 * elf32-i386.c (ELF_MAXPAGESIZE): Set to 0x1000 for VxWorks. ld/ PR ld/20815 * testsuite/ld-i386/vxworks2.sd: Add space for program headers.
2017-04-24[GAS/ARM] Fix expansion of ldr pseudo instructionThomas Preud'homme4-24/+40
The LDR rX, =cst pseudo-instruction suffers from two issues for loading integer constants in Thumb mode: - movs is used if the constant and register can be encoded using that instruction which leads to unexpected behavior due to its flag-setting behavior - mov.w, movw and mvn are used for r13 (sp) and r15 (pc) but these encoding are marked as UNPREDICTABLE This patch fixes those issues and update testing accordingly. 2017-04-24 Thomas Preud'homme <thomas.preudhomme@arm.com> gas/ * config/tc-arm.c (move_or_literal_pool): Remove code generating MOVS. Forbid MOV.W and MOVW if destination is SP or PC. * testsuite/gas/arm/thumb2_ldr_immediate_highregs_armv6t2.s: Explain expectation of LDR not generating a MOVS for low registers and small constants. Add tests of MOVW generation. * testsuite/gas/arm/thumb2_ldr_immediate_highregs_armv6t2.d: Update expected disassembly.
2017-04-24ld: fix regressions with rett instructions in sparc tests.Jose E. Marchesi4-3/+10
A few tests in the ld testsuite were expecting the disassembler to emit `rett' instructions in V9. This patch updates the tests to expect `return' instead. ld/ChangeLog: 2017-04-24 Jose E. Marchesi <jose.marchesi@oracle.com> * testsuite/ld-sparc/tlssunbin64.dd: Expect `return' instructions instead of `rett' in V9. * testsuite/ld-sparc/tlssunnopic64.dd: Likewise. * testsuite/ld-sparc/tlssunpic64.dd: Likewise.
2017-04-24Fix snafu in aarch64 opcodes debugging statement.Tamar Christina2-2/+7
* aarch64-opc.c (aarch64_logical_immediate_p): Update DEBUG_TRACE arguments.
2017-04-24Automatic date update in version.inGDB Administrator1-1/+1
2017-04-23PR 21418, ar -N lacks arg checkAlan Modra2-1/+12
PR 21418 * ar.c (main): Check -a, -b, -i and -N args are given.
2017-04-23PR 21417, ar arg check failureAlan Modra2-0/+7
PR 21417 * ar.c (main): Check that an archive file is given after options.
2017-04-23PR 21415, objdump fails to check bfd_get_section_contents statusAlan Modra2-1/+12
PR 21415 * objdump.c (disassemble_section): Check bfd_get_section_contents status.
2017-04-23PR 21414, null pointer deref of _bfd_elf_large_com_section symAlan Modra4-14/+36
PR 21414 * section.c (GLOBAL_SYM_INIT): Make available in bfd.h. * elf.c (lcomm_sym): New. (_bfd_elf_large_com_section): Use lcomm_sym section symbol. * bfd-in2.h: Regenerate.
2017-04-23PR 21412, get_reloc_section assumes .rel/.rela name for SHT_REL/RELA.Alan Modra5-30/+57
This patch fixes an assumption made by code that runs for objcopy and strip, that SHT_REL/SHR_RELA sections are always named starting with a .rel/.rela prefix. I'm also modifying the interface for elf_backend_get_reloc_section, so any backend function just needs to handle name mapping. PR 21412 * elf-bfd.h (struct elf_backend_data <get_reloc_section>): Change parameters and comment. (_bfd_elf_get_reloc_section): Delete. (_bfd_elf_plt_get_reloc_section): Declare. * elf.c (_bfd_elf_plt_get_reloc_section, elf_get_reloc_section): New functions. Don't blindly skip over assumed .rel/.rela prefix. Extracted from.. (_bfd_elf_get_reloc_section): ..here. Delete. (assign_section_numbers): Call elf_get_reloc_section. * elf64-ppc.c (elf_backend_get_reloc_section): Define. * elfxx-target.h (elf_backend_get_reloc_section): Update.
2017-04-23PR 21409, segfault in _bfd_dwarf2_find_nearest_lineAlan Modra2-1/+7
PR 21409 * dwarf2.c (_bfd_dwarf2_find_nearest_line): Don't segfault when no symbols.
2017-04-23PR 21408, segfault in display_debug_lines_decodedAlan Modra2-7/+11
PR 21408 * dwarf.c (display_debug_lines_decoded): Don't segfault on NULL file_table.
2017-04-23Automatic date update in version.inGDB Administrator1-1/+1
2017-04-22Fix ldn/stn multiple instructions. Fix testcases with unaligned data.Jim Wilson14-202/+454
sim/aarch64/ * simulator.c (vec_load): Add M argument. Rewrite to iterate over registers based on structure size. (LD4, LD3, LD2, LD1_2, LD1_3, LD1_4): Pass new arg to vec_load. (LD1_1): Replace with call to vec_load. (vec_store): Add new M argument. Rewrite to iterate over registers based on structure size. (ST4, ST3, ST2, ST1_2, ST1_3, ST1_4): Pass new arg to vec_store. (ST1_1): Replace with call to vec_store. sim/testsuite/sim/aarch64/ * fcvtz.s, fstur.s, ldn_single.s, ldnr.s, mla.s, mls.s, uzp.s: Align data. * sumulh.s: Delete unnecessary data alignment. * stn_single.s: Align data. Fix unaligned ldr insns. Adjust cmp arguments to match change. * ldn_multiple.s, stn_multiple.s: New.
2017-04-22Use ui_out_emit_listTom Tromey10-96/+57
This changes some spots to use ui_out_emit_list. This only touches "easy" cases, where the cleanup was used in a block-structured way. There's also one more use of ui_out_emit_tuple in here. ChangeLog 2017-04-22 Tom Tromey <tom@tromey.com> * mi/mi-cmd-file.c (mi_cmd_file_list_shared_libraries): Use ui_out_emit_list. * stack.c (print_frame): Use ui_out_emit_list. * mi/mi-symbol-cmds.c (mi_cmd_symbol_list_lines): Use ui_out_emit_list. * mi/mi-main.c (print_one_inferior) (mi_cmd_data_list_register_names) (mi_cmd_data_list_register_values, mi_cmd_list_features) (mi_cmd_list_target_features, mi_cmd_trace_frame_collected): Use ui_out_emit_list. * mi/mi-interp.c (mi_on_normal_stop_1): Use ui_out_emit_list. (mi_output_solib_attribs): Use ui_out_emit_list, ui_out_emit_tuple. * mi/mi-cmd-var.c (varobj_update_one): Use ui_out_emit_list. * mi/mi-cmd-stack.c (mi_cmd_stack_list_frames) (mi_cmd_stack_list_args, list_args_or_locals): Use ui_out_emit_list. * disasm.c (do_assembly_only): Use ui_out_emit_list. * breakpoint.c (print_solib_event, output_thread_groups): Use ui_out_emit_list.
2017-04-22Use ui_out_emit_tuple in more places in MITom Tromey4-15/+14
This patch changes a few more spots in MI to use ui_out_emit_tuple. These changes required the use of gdb::optional. ChangeLog 2017-04-22 Tom Tromey <tom@tromey.com> * mi/mi-main.c (print_variable_or_computed): Use ui_out_emit_tuple. * mi/mi-cmd-var.c (varobj_update_one): Use ui_out_emit_tuple. * mi/mi-cmd-stack.c (list_arg_or_local): Use ui_out_emit_tuple.
2017-04-22Use ui_out_emit_tuple in tracepoint.cTom Tromey2-26/+21
This changes some code in tracepoint.c to use ui_out_emit_tuple. One of these involved removing an otherwise unrelated cleanup (changing type to std::string) and the other involved introducing a new block. ChangeLog 2017-04-22 Tom Tromey <tom@tromey.com> * tracepoint.c (tvariables_info_1) (print_one_static_tracepoint_marker): Use ui_out_emit_tuple.
2017-04-22More uses of ui_out_emit_tupleTom Tromey4-20/+32
This patch adds a few more uses of ui_out_emit_tuple. In these cases a slightly more complicated change was needed. This also adds annotate_arg_emitter, for use in stack.c, to avoid having to introduce a new scope and reindent the code for a single call. ChangeLog 2017-04-22 Tom Tromey <tom@tromey.com> * stack.c (print_frame_arg): Use ui_out_emit_tuple, annotate_arg_emitter. * breakpoint.c (print_mention_watchpoint) (print_mention_masked_watchpoint): Use ui_out_emit_tuple. * annotate.h (struct annotate_arg_emitter): New.
2017-04-22Use ui_out_emit_tupleTom Tromey24-205/+126
This patch changes various places to use ui_out_emit_tuple, eliminating a number of cleanups. This patch only tackles "easy" cases, which are ones where the cleanups in question were block-structured and did not involve any changes other than the obvious replacement. ChangeLog 2017-04-22 Tom Tromey <tom@tromey.com> * record-btrace.c (record_btrace_insn_history) (record_btrace_insn_history_range, record_btrace_call_history) (record_btrace_call_history_range): Use ui_out_emit_tuple. * thread.c (do_captured_list_thread_ids, print_thread_info_1): Use ui_out_emit_tuple. * stack.c (print_frame_info): Use ui_out_emit_tuple. * solib.c (info_sharedlibrary_command): Use ui_out_emit_tuple. * skip.c (skip_info): Use ui_out_emit_tuple. * remote.c (show_remote_cmd): Use ui_out_emit_tuple. * progspace.c (print_program_space): Use ui_out_emit_tuple. * probe.c (info_probes_for_ops): Use ui_out_emit_tuple. * osdata.c (info_osdata): Use ui_out_emit_tuple. * mi/mi-symbol-cmds.c (mi_cmd_symbol_list_lines): Use ui_out_emit_tuple. * mi/mi-main.c (print_one_inferior, list_available_thread_groups) (output_register, mi_cmd_data_read_memory) (mi_cmd_data_read_memory_bytes, mi_load_progress) (mi_cmd_trace_frame_collected): Use ui_out_emit_tuple. * mi/mi-cmd-var.c (mi_cmd_var_list_children, varobj_update_one): Use ui_out_emit_tuple. * mi/mi-cmd-stack.c (mi_cmd_stack_list_args): Use ui_out_emit_tuple. * mi/mi-cmd-info.c (mi_cmd_info_ada_exceptions) (mi_cmd_info_gdb_mi_command): Use ui_out_emit_tuple. * linux-thread-db.c (info_auto_load_libthread_db): Use ui_out_emit_tuple. * inferior.c (print_inferior): Use ui_out_emit_tuple. * gdb_bfd.c (print_one_bfd): Use ui_out_emit_tuple. * disasm.c (do_mixed_source_and_assembly_deprecated) (do_mixed_source_and_assembly): Use ui_out_emit_tuple. * cp-abi.c (list_cp_abis): Use ui_out_emit_tuple. * cli/cli-setshow.c (cmd_show_list): Use ui_out_emit_tuple. * breakpoint.c (print_one_breakpoint_location) (print_one_breakpoint): Use ui_out_emit_tuple. * auto-load.c (print_script, info_auto_load_cmd): Use ui_out_emit_tuple. * ada-tasks.c (print_ada_task_info): Use ui_out_emit_tuple.
2017-04-22PowerPC VLE insn set additionsAlan Modra5-134/+159
opcodes/ * ppc-opc.c (ELEV): Define. (vle_opcodes): Add se_rfgi and e_sc. (powerpc_opcodes): Enable lbdx, lhdx, lwdx, stbdx, sthdx, stwdx for E200Z4. gas/ * testsuite/gas/ppc/vle.s: Format. Add se_rfgi and e_sc. * testsuite/gas/ppc/vle.d: Update.
2017-04-21doc: Improve documentation about MI thread outputSimon Marchi2-46/+37
I noticed that the documentation on how the info about threads is output in MI is duplicated and not up to date. The duplication is between the "GDB/MI Thread Information" page and the -thread-info result description. I improved the "GDB/MI Thread Information" page a bit and referred to it in the -thread-info doc. This way, the -thread-info doc is more precise (it did not mention the "threads" and "current-thread-id" attributes) and concise. gdb/doc/ChangeLog: * gdb.texinfo (GDB/MI Thread Information): Add missing fields, re-word some things. (GDB/MI Thread Commands): Describe fields found in the output of -thread-info, remove description of fields in the thread output tuple, replace with a cross-reference to "GDB/MI Thread Information".
2017-04-21Remove dead code and "current" field from MI thread output docSimon Marchi4-12/+10
The MI documentation says that -thread-info output contains a "current" field in the current thread tuple, with the value "*". Current GDB master does not do this, and I couldn't find any GDB version that did. I suspect that it was never the case. The code that would correspond to this in print_thread_info_1 is essentially dead code. The calls to uiout->text end up in mi_out::do_text, which is empty. This patch removes the documentation bit and the dead code. This "current" field is not necessary, since -thread-info outputs a "current-thread-id" field. gdb/ChangeLog: * thread.c (print_thread_info_1): Remove dead code. gdb/doc/ChangeLog: * gdb.texinfo (GDB/MI Thread Commands): Remove "current" field from -thread-info output.
2017-04-22Automatic date update in version.inGDB Administrator1-1/+1
2017-04-21i386: Avoid dynamic symbol with GOT reference in PIEH.J. Lu4-23/+63
GOT reference to global symbol in PIE will lead to dynamic symbol. It becomes a problem when "time" or "times" is defined as a variable in an executable, clashing with functions of the same name in libc. If a symbol isn't undefined weak symbol, don't make it dynamic in PIE and generate R_386_RELATIVE relocation. bfd/ PR ld/21402 * elf32-i386.c (elf_i386_link_hash_entry): Add no_finish_dynamic_symbol. (elf_i386_link_hash_newfunc): Set no_finish_dynamic_symbol to 0. (elf_i386_allocate_dynrelocs): If a symbol isn't undefined weak symbol, don't make it dynamic in PIE. (elf_i386_relocate_section): If a symbol isn't dynamic in PIE, set no_finish_dynamic_symbol and generate R_386_RELATIVE relocation for R_386_GOT32 (elf_i386_finish_dynamic_symbol): Abort if no_finish_dynamic_symbol isn't 0. ld/ PR ld/21402 * testsuite/ld-elf/indirect.exp: Don't skip PIE indirect5 and indirect6 tests on i386.
2017-04-21Require --no-dynamic-linker with -static -E/--dynamic-listH.J. Lu11-7/+40
When -static -E/--dynamic-list are passed to linker, linker may create executable with dynamic sections which aren't supported by run-time. We require --no-dynamic-linker together with -static -E/--dynamic-list before adding dynamic symbol table to static executable. bfd/ PR ld/19617 PR ld/21086 * elflink.c (elf_link_add_object_symbols): Require --no-dynamic-linker with -E/--dynamic-list when creating dynamic sections. ld/ PR ld/19617 PR ld/21086 * testsuite/ld-elf/pr19617a.d: Pass --no-dynamic-linker to ld. * testsuite/ld-elf/pr19617b.d: Likewise. * testsuite/ld-elf/pr19617c.d: Likewise. *testsuite/ld-i386/pr19636-4d.d: Likewise. * testsuite/ld-elf/readelf.exp: Pass --no-dynamic-linker to ld with --export-dynamic. * testsuite/ld-elf/shared.exp: Pass --no-dynamic-linker to ld with -E.
2017-04-21release branch: Fix: --enable-werrorJan Kratochvil3-0/+10
gdb-8.0-branch ./configure --enable-werror --enable-targets=all aarch64-tdep.c:3045:13: error: ‘void selftests::aarch64_process_record_test()’ declared ‘static’ but never defined [-Werror=unused-function] arm-tdep.c:9601:13: error: ‘void selftests::arm_record_test()’ declared ‘static’ but never defined [-Werror=unused-function] gdb/ChangeLog 2017-04-21 Jan Kratochvil <jan.kratochvil@redhat.com> * aarch64-tdep.c (selftests::aarch64_process_record_test): Make it #if GDB_SELF_TEST. * arm-tdep.c (selftests::arm_record_test): Likewise.
2017-04-21Simplify regcache_restoreYao Qi2-10/+13
This patches removes the 2nd argument of regcache_restore, because it is only called by regcache_cpy. In regcache_cpy, if regcache_restore is called, dst is not readonly, but src is readonly. So this patch adds an assert that src is readonly in regcache_restore. regcache_cook_read read everything from a readonly regcache cache (src)'s register_buffer, and register status is from ->register_status. gdb: 2017-04-21 Yao Qi <yao.qi@linaro.org> * regcache.c (regcache_restore): Remove argument 2. Replace argument 3 with regcache. Get register status from src->register_status and get register contents from register_buffer (src, regnum). (regcache_cpy): Update.
2017-04-21opcodes: mark SPARC RETT instructions as v6notv9.Jose E. Marchesi2-7/+11
This prevents the disassembler to show `return' instructions as `rett' in V9 and later architectures. opcodes/ChangeLog: 2017-04-21 Jose E. Marchesi <jose.marchesi@oracle.com> * sparc-opc.c (sparc_opcodes): Mark RETT instructions as v6notv9.
2017-04-21Fix shift overflow when parsing an overlarge note value.Nick Clifton2-6/+20
PR binutils/21378 * readelf.c (print_gnu_build_attribute_name): Check for an overlarge name field.