aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2017-04-11gdb/thread.c: Fix whitespace throughoutPedro Alves2-31/+37
gdb/ChangeLog: 2017-04-11 Pedro Alves <palves@redhat.com> * thread.c: Fix whitespace throughout.
2017-04-11Fix read after xfree in linux-nat.c:linux_nat_detachPhilipp Rudo2-1/+4
At the end of linux_nat_detach the main_lwp is deleted (delete_lwp). This is problematic as during detach (detach_one_lwp and linux_fork_detach) main_lwp already gets freed. Thus calling delete_lwp causes a read after free. Fix it by removing the unnecessary delete_lwp. gdb/ChangeLog: 2017-04-11 Philipp Rudo <prudo@linux.vnet.ibm.com> * linux-nat.c (linux_nat_detach): Remove delete_lwp call.
2017-04-11Remove MAX_REGISTER_SIZE from arm-tdep.cAlan Hayward2-1/+5
gdb/ * arm-tdep.c (arm_store_return_value): Use FP_REGISTER_SIZE
2017-04-11PR 21274, ld segfaults linking PE DLLAlan Modra6-114/+155
Don't use fixed size buffers for symbol names. PR 21274 PR 18466 * emultempl/pe.em (pe_find_data_imports): Don't use fixed size symbol buffer. Instead, xmalloc max size needed with space for prefix. Wrap overlong lines. Formatting. Pass symbol buffer copy of name to pe_walk_relocs_of_symbol. (make_inport_fixup): Add "name" param, pass to pe_create_import_fixup. * emultempl/pe.em (pep_find_data_imports): As for pe_find_data_imports. (make_import_fixup): Add "name" param, pass to pep_create_import_fixup. Use bfd_get_signed_* and remove unnecessary casts. Formatting. * pe-dll.c (pe_walk_relocs_of_symbol): Add "name" param. Pass to callback. (make_import_fixup_mark): Add "name" param. Make use of prefix space rather than xmalloc here. (pe_create_import_fixup): Likewise. * pe-dll.h (pe_walk_relocs_of_symbol): Update prototype. (pe_create_import_fixup): Likewise. * pep-dll.h (pep_walk_relocs_of_symbol): Likewise. (pep_create_import_fixup): Likewise.
2017-04-11Automatic date update in version.inGDB Administrator1-1/+1
2017-04-11Reorder PPC_OPCODE_* and set PPC_OPCODE_TMR for e6500Alan Modra5-49/+55
PPC_OPCODE_* renumbered to fill the gaps left by previous patches, and reordered chronologically just because. I kept PPC_OPCODE_TMR because presumably it might be used in future APUinfo for e6500. include/ * opcode/ppc.h (PPC_OPCODE_*): Renumber and order chronologically. (PPC_OPCODE_SPE): Comment on this and other bits used for APUinfo. opcodes/ * ppc-dis.c (ppc_opts): Formatting. Set PPC_OPCODE_TMR for e6500. * ppc-opc.c (powerpc_opcodes <mftmr, mttmr>): Remove now unnecessary E6500.
2017-04-11Bye bye PPC_OPCODE_HTM and -mhtmAlan Modra8-17/+16
The -mhtm option is fairly useless too. include/ * opcode/ppc.h (PPC_OPCODE_HTM): Delete. gas/ * config/tc-ppc.c (md_show_usage): Delete mention of -mhtm. * testsuite/gas/ppc/htm.d: Pass -mpower8 and -Mpower8. opcodes/ * ppc-dis.c (ppc_opts): Remove PPC_OPCODE_HTM and "htm". * ppc-opc.c (PPCHTM): Define as PPC_OPCODE_POWER8.
2017-04-11Bye Bye PPC_OPCODE_VSX3Alan Modra5-10/+9
This bit is also useless as it can be replaced with PPC_OPCODE_POWER9. Defining the VSX2 and VSX3 selection based on cpu bits also lets the assembler/disassembler distinguish between the power7 VSX opcodes and the power8 ones. Note that this change means -mvsx now reverts back to just adding the power7 VSX insns. include/ * opcode/ppc.h (PPC_OPCODE_VSX3): Delete. opcodes/ * ppc-dis.c (ppc_opts): Remove PPC_OPCODE_VSX3. * ppc-opc.c (PPCVSX2): Define as PPC_OPCODE_POWER8. (PPCVSX3): Define as PPC_OPCODE_POWER9.
2017-04-11Bye bye PPC_OPCODE_ALTIVEC2Alan Modra5-10/+17
This bit is worse than useless. Using it prevents the assembler and disassembler distinguishing between opcodes added for power8 and those added for power9. include/ * opcode/ppc.h (PPC_OPCODE_ALTIVEC2): Delete. opcodes/ * ppc-dis.c (ppc_opts): Remove PPC_OPCODE_ALTIVEC2. * ppc-opc.c (PPCVEC2): Define as PPC_OPCODE_POWER8|PPC_OPCODE_E6500. (PPCVEC3): Define as PPC_OPCODE_POWER9.
2017-04-10Fix PR gdb/21364: Dead code due to an unreachable condition in osdata.cSergio Durigan Junior2-1/+7
Pedro's recent commits enabling -Wwrite-strings has changed a bit the logic of info_osdata. Now, 'type' is always non-NULL, so we have to check if it's an empty string instead of NULL. One of the checks was fixed, but there is another that was left behind. This commit fixes it. gdb/ChangeLog: 2017-04-10 Sergio Durigan Junior <sergiodj@redhat.com> PR gdb/21364 * osdata.c (info_osdata): Check if 'type' is an empty string instead of NULL.
2017-04-10Prevent a bigus warning from readelf about a gdb-index table being too big.John Delsignor2-1/+7
PR binutils/21319 * dwarf.c (display_gdb_index): Correct test for a corrupt address table size.
2017-04-10Document undocumented linker command line options.Nick Clifton2-0/+32
ld * ld.texinfo (--strip-discarded): Document. (--embedded-relocs): Document. (--spare-dynamic-tags): Document. (--task-link): Document.
2017-04-10thread.c: ptid_equal -> operator==Pedro Alves2-28/+39
gdb/ChangeLog: 2017-04-10 Pedro Alves <palves@redhat.com> * thread.c (add_thread_silent, delete_thread_1, find_thread_ptid) (ptid_to_global_thread_id, in_thread_list) (do_captured_list_thread_ids, set_resumed, set_running) (set_executing, set_stop_requested, finish_thread_state) (validate_registers_access, can_access_registers_ptid) (print_thread_info_1, switch_to_thread) (do_restore_current_thread_cleanup) (make_cleanup_restore_current_thread, thread_command) (thread_name_command): Use operator== instead of ptid_equal.
2017-04-10GC gdb/thread.c:current_thread_cleanup_chainPedro Alves2-17/+8
Commit 803bdfe43083475c7df3db38dc96f4e20d05457d ("Don't delete thread_info if refcount isn't zero") eliminated restore_current_thread_ptid_changed, so current_thread_cleanup_chain is no longer necessary either. gdb/ChangeLog: 2017-04-10 Pedro Alves <palves@redhat.com> * thread.c (struct current_thread_cleanup) <next>: Delete field. (current_thread_cleanup_chain): Delete. (restore_current_thread_cleanup_dtor) (make_cleanup_restore_current_thread): Remove references to current_thread_cleanup_chain.
2017-04-10msp430: Don't use REG_UNKNOWNAlan Hayward2-4/+7
gdb/ * msp430-tdep.c (msp430_pseudo_register_read): Never return REG_UNKNOWN.
2017-04-10Don't delete thread_info if refcount isn't zeroYao Qi4-62/+101
I build GDB with asan, and run test case hook-stop.exp, and threadapply.exp, I got the following asan error, =================================================================^M ^[[1m^[[31m==2291==ERROR: AddressSanitizer: heap-use-after-free on address 0x6160000999c4 at pc 0x000000826022 bp 0x7ffd28a8ff70 sp 0x7ffd28a8ff60^M ^[[1m^[[0m^[[1m^[[34mREAD of size 4 at 0x6160000999c4 thread T0^[[1m^[[0m^M #0 0x826021 in release_stop_context_cleanup ../../binutils-gdb/gdb/infrun.c:8203^M #1 0x72798a in do_my_cleanups ../../binutils-gdb/gdb/common/cleanups.c:154^M #2 0x727a32 in do_cleanups(cleanup*) ../../binutils-gdb/gdb/common/cleanups.c:176^M #3 0x826895 in normal_stop() ../../binutils-gdb/gdb/infrun.c:8381^M #4 0x815208 in fetch_inferior_event(void*) ../../binutils-gdb/gdb/infrun.c:4011^M #5 0x868aca in inferior_event_handler(inferior_event_type, void*) ../../binutils-gdb/gdb/inf-loop.c:44^M .... ^[[1m^[[32m0x6160000999c4 is located 68 bytes inside of 568-byte region [0x616000099980,0x616000099bb8)^M ^[[1m^[[0m^[[1m^[[35mfreed by thread T0 here:^[[1m^[[0m^M #0 0x7fb0bc1312ca in __interceptor_free (/usr/lib/x86_64-linux-gnu/libasan.so.2+0x982ca)^M #1 0xb8c62f in xfree(void*) ../../binutils-gdb/gdb/common/common-utils.c:100^M #2 0x83df67 in free_thread ../../binutils-gdb/gdb/thread.c:207^M #3 0x83dfd2 in init_thread_list() ../../binutils-gdb/gdb/thread.c:223^M #4 0x805494 in kill_command ../../binutils-gdb/gdb/infcmd.c:2595^M .... Detaching from program: /home/yao.qi/SourceCode/gnu/build-with-asan/gdb/testsuite/outputs/gdb.threads/threadapply/threadapply, process 2399^M =================================================================^M ^[[1m^[[31m==2387==ERROR: AddressSanitizer: heap-use-after-free on address 0x6160000a98c0 at pc 0x00000083fd28 bp 0x7ffd401c3110 sp 0x7ffd401c3100^M ^[[1m^[[0m^[[1m^[[34mREAD of size 4 at 0x6160000a98c0 thread T0^[[1m^[[0m^M #0 0x83fd27 in thread_alive ../../binutils-gdb/gdb/thread.c:741^M #1 0x844277 in thread_apply_all_command ../../binutils-gdb/gdb/thread.c:1804^M .... ^M ^[[1m^[[32m0x6160000a98c0 is located 64 bytes inside of 568-byte region [0x6160000a9880,0x6160000a9ab8)^M ^[[1m^[[0m^[[1m^[[35mfreed by thread T0 here:^[[1m^[[0m^M #0 0x7f59a7e322ca in __interceptor_free (/usr/lib/x86_64-linux-gnu/libasan.so.2+0x982ca)^M #1 0xb8c62f in xfree(void*) ../../binutils-gdb/gdb/common/common-utils.c:100^M #2 0x83df67 in free_thread ../../binutils-gdb/gdb/thread.c:207^M #3 0x83dfd2 in init_thread_list() ../../binutils-gdb/gdb/thread.c:223^M This patch fixes the issue by deleting thread_info object if it is deletable, otherwise, mark it as exited (by set_thread_exited). Function set_thread_exited is shared from delete_thread_1. This patch also moves field "refcount" to private and methods incref and decref. Additionally, we stop using "ptid_t" in "struct current_thread_cleanup" to reference threads, instead we use "thread_info" directly. Due to this change, we don't need restore_current_thread_ptid_changed anymore. gdb: 2017-04-10 Yao Qi <yao.qi@linaro.org> PR gdb/19942 * gdbthread.h (thread_info::deletable): New method. (thread_info::incref): New method. (thread_info::decref): New method. (thread_info::refcount): Move it to private. * infrun.c (save_stop_context): Call inc_refcount. (release_stop_context_cleanup): Likewise. * thread.c (set_thread_exited): New function. (init_thread_list): Delete "tp" only it is deletable, otherwise call set_thread_exited. (delete_thread_1): Call set_thread_exited. (current_thread_cleanup) <inferior_pid>: Remove. <thread>: New field. (restore_current_thread_ptid_changed): Removed. (do_restore_current_thread_cleanup): Adjust. (restore_current_thread_cleanup_dtor): Don't call find_thread_ptid. (set_thread_refcount): Use dec_refcount. (make_cleanup_restore_current_thread): Adjust. (thread_apply_all_command): Call inc_refcount. (_initialize_thread): Don't call observer_attach_thread_ptid_changed.
2017-04-10Hoist code on marking thread as exitedYao Qi2-21/+17
This patch hoists code on marking thread as exited, so more code is shared for two different paths (thread_info is deleted or is not deleted). gdb: 2017-04-10 Yao Qi <yao.qi@linaro.org> * thread.c (delete_thread_1): Hoist code on marking thread as exited.
2017-04-10gas: xtensa: fix incorrect code generated with auto litpoolsMax Filippov8-32/+95
* config/tc-xtensa.c (xtensa_maybe_create_literal_pool_frag): Initialize lps->frag_count with auto_litpool_limit. (xg_promote_candidate_litpool): New function. (xtensa_move_literals): Extract candidate litpool promotion code into separate function. Call it for all possible found candidates. (xtensa_switch_to_literal_fragment): Drop 'recursive' flag and call to xtensa_mark_literal_pool_location that it guards. Replace it with call to xtensa_maybe_create_literal_pool_frag. Initialize pool_location with created literal pool candidate. * testsuite/gas/xtensa/all.exp: Add new tests. * testsuite/gas/xtensa/auto-litpools-first1.d: New test results. * testsuite/gas/xtensa/auto-litpools-first1.s: New test. * testsuite/gas/xtensa/auto-litpools-first2.d: New test results. * testsuite/gas/xtensa/auto-litpools-first2.s: New test. * testsuite/gas/xtensa/auto-litpools.d: Fix offsets changed due to additional jump instruction.
2017-04-10Port the bug fix for PR 19704 (Missing dynamic relocation against undefined ↵Qing Zhao5-28/+228
weak symbol) to the SPARC architecture. * elf32-sparc.c (elf_backend_fixup_symbol): New. * elf64-sparc.c (elf_backend_fixup_symbol): New. * elfxx-sparc.c (UNDEFINED_WEAK_RESOLVED_TO_ZERO): New. (_bfd_sparc_elf_link_hash_entry): Add has_got_reloc and has_non_got_reloc. (link_hash_newfunc): Initialize has_got_reloc and has_non_got_reloc. (_bfd_sparc_elf_size_dynamic_sections): Set interp to .interp section. (_bfd_sparc_elf_copy_indirect_symbol): Copy has_got_reloc and has_non_got_reloc. (_bfd_sparc_elf_check_relocs): Set has_got_reloc and has_non_got_reloc. (_bfd_sparc_elf_fixup_symbol): New function. (allocate_dynrelocs): Don't allocate space for dynamic relocations and discard relocations against resolved undefined weak symbols in executable. Don't make resolved undefined weak symbols in executable dynamic. Keep dynamic non-GOT/non-PLT relocation against undefined weak symbols in PIE. (_bfd_sparc_elf_relocate_section): Don't generate dynamic relocations against resolved undefined weak symbols in PIE (_bfd_sparc_elf_finish_dynamic_symbol): Keep PLT/GOT entries without ynamic PLT/GOT relocations for resolved undefined weak symbols. Don't generate dynamic relocation against resolved undefined weak symbol in executable. (pie_finish_undefweak_symbol): New function. (_bfd_sparc_elf_finish_dynamic_sections): Call pie_finish_undefweak_symbol on all symbols in PIE. * elfxx-sparc.h (_bfd_sparc_elf_link_hash_table): Add interp. (_bfd_sparc_elf_fixup_symbol): New function.
2017-04-10Remove the ns32k target from the obsolete list.Nick Clifton2-1/+4
* config.bfd: Remove ns32k from obsolete list.
2017-04-10Tidy ppc476 opcodesAlan Modra3-43/+50
PPC_OPCODE_440 being set for ppc476 meant that many opcodes needed to be deprecated for ppc476. There are far fewer to add specially for ppc476 if PPC_OPCODE_440 is not set for ppc476. * ppc-dis.c (ppc_opts <476>): Remove PPC_OPCODE_440. * ppc-opc.c (MULHW): Add PPC_OPCODE_476. (powerpc_opcodes): Adjust PPC440, PPC464 and PPC476 insns to suit removal of PPC_OPCODE_440 from ppc476 cpu selection bits.
2017-04-10PR21287, Inconsistent section type for .init_array and .init_array.42Alan Modra6-24/+41
PR21287 notes that .init_array is correctly given a type of SHT_INIT_ARRAY while .init_array.nnn gets SHT_PROGBITS. This patch fixes that problem, and properly drops warnings from the compiler that would cause the testsuite to fail. My a44d0bd78 change to check ld_compile status, necessary to pick up compile errors, also meant warnings were not ignored. bfd/ PR 21287 * elf.c (special_sections_f): Match .fini_array and .fini_array.*. (special_sections_i): Likewise for .init_array. (special_sections_p): Likewise for .preinit_array. ld/ PR 21287 * testsuite/ld-elf/init-fini-arrays.d: Match INIT_ARRAY and FINI_ARRAY. * testsuite/ld-elf/init-fini-arrays.s: Use %init_array and %fini_array section types. * testsuite/lib/ld-lib.exp (default_ld_compile): Trim assembler warnings about "ignoring incorrect section type". (run_ld_link_exec_tests, run_cc_link_tests): Delete old comment.
2017-04-10Clean elfvsb files left over from previous runsAlan Modra2-2/+14
My mips-linux and mips64-linux testsuite runs have been failing a bunch of visibility tests, seemingly randomly. It turns out the problem occurs when object files are left over in ld/tmpdir from a previous run. * testsuite/ld-elfvsb/elfvsb.exp (visibility_run): Delete sh1p.o, sh2p.o, sh1np.o and sh2np.o before compiling. Use remote_file host exists rather than file exists.
2017-04-10WebAssembly disassembler supportPip Cet2-3/+7
* wasm32-dis.c (print_insn_wasm32): Avoid DECIMAL_DIG, specify appropriate floating-point precision directly.
2017-04-09windows-nat.c: Fix bad initialization of ptidSimon Marchi2-1/+6
When trying to build for x86_64-w64-mingw32: /home/simark/src/binutils-gdb/gdb/windows-nat.c: In function ‘void windows_detach(target_ops*, const char*, int)’: /home/simark/src/binutils-gdb/gdb/windows-nat.c:1915:20: error: converting to ‘ptid_t’ from initializer list would use explicit constructor ‘constexpr ptid_t::ptid_t(int, long int, long int)’ ptid_t ptid = {-1}; ^ Fixed by initializing ptid with the minus_one_ptid variable. gdb/ChangeLog: * windows-nat.c (windows_detach): Initialize ptid with minus_one_ptid.
2017-04-10Automatic date update in version.inGDB Administrator1-1/+1
2017-04-09Automatic date update in version.inGDB Administrator1-1/+1
2017-04-08Add support for fcvtl and fcvtl2.Jim Wilson4-0/+112
sim/aarch64/ * simulator.c (do_vec_FCVTL): New. (do_vec_op1): Call do_vec_FCVTL. sim/testsuite/sim/aarch64/ * fcvtl.s: New.
2017-04-08Support the fcmXX zero instructions.Jim Wilson4-0/+232
sim/aarch64/ * simulator.c (do_scalar_FCMGE_zero): New. (do_scalar_FCMLE_zero, do_scalar_FCMGT_zero, do_scalar_FCMEQ_zero) (do_scalar_FCMLT_zero): Likewise. (do_scalar_vec): Add calls to new functions. sim/testsuite/sim/aarch64/ * fcmXX.s: New.
2017-04-08Automatic date update in version.inGDB Administrator1-1/+1
2017-04-07Use NOPIE_CFLAGS and NOPIE_LDFLAGS to disable PIEH.J. Lu2-1/+10
Since not all compilers support -no-pie, NOPIE_CFLAGS and NOPIE_LDFLAGS should be used to disable PIE. PR ld/21090 * testsuite/ld-x86-64/x86-64.exp (undefined_weak): Use NOPIE_CFLAGS and NOPIE_LDFLAGS to disable PIE for the non-pie version of the test.
2017-04-07ELF: Check ELF_COMMON_DEF_P for common symbolsH.J. Lu7-9/+25
Since common symbols that are turned into definitions don't have the DEF_REGULAR flag set, we need to check ELF_COMMON_DEF_P for common symbols. bfd/ PR ld/19579 PR ld/21306 * elf32-s390.c (elf_s390_finish_dynamic_symbol): Check ELF_COMMON_DEF_P for common symbols. * elf64-s390.c (elf_s390_finish_dynamic_symbol): Likewise. * elf64-x86-64.c (elf_x86_64_relocate_section): Likewise. * elflink.c (_bfd_elf_merge_symbol): Revert commits 202ac193bbbecc96a4978d1ac3d17148253f9b01 and 07492f668d2173da7a2bda3707ff0985e0f460b6. ld/ PR ld/19579 PR ld/21306 * testsuite/ld-elf/pr19579a.c (main): Updated.
2017-04-07ptid-selftests: Fix erroneous assert messagesSimon Marchi2-9/+13
gdb/ChangeLog: * unittests/ptid-selftests.c: Fix erroneous assert messages.
2017-04-07Fix building the BFD library for Win64 by reqorking the ↵Pedro Alves2-94/+163
find_separate_debug_file interface. * opncls.c (bfd_get_debug_link_info): Rename to... (bfd_get_debug_link_info_1): ... this. Change type of second parameter to void pointer. Adjust. (bfd_get_debug_link_info): Reimplement on top of bfd_get_debug_link_info_1. (separate_debug_file_exists, separate_alt_debug_file_exists): Change type of second parameter to void pointer. Adjust. (get_func_type, check_func_type): Change type of second parameter to void pointer. (find_separate_debug_file): Add 'func_data' parameter. Pass it to the callback functions instead of passing the address of a local. (bfd_follow_gnu_debuglink): Pass address of unsigned long local to find_separate_debug_file. (get_alt_debug_link_info_shim): Change type of second parameter to void pointer. Adjust. (bfd_follow_gnu_debugaltlink): Adjust to pass NULL to find_separate_debug_file. (get_build_id_name, bfd_boolean check_build_id_file): Change type of second parameter to void pointer. Adjust. (bfd_follow_build_id_debuglink): Pass address of bfd_build_id pointer local to find_separate_debug_file.
2017-04-07Fix failure in x86_64 linker tests when compiling with a PIE enabled compiler.Nick Clifton2-1/+7
PR 21090 * testsuite/ld-x86-64/x86-64.exp (undefined_weak): Explicitly disable PIE for the non-pie version of the test.
2017-04-07Remove E6500 insns from PPC_OPCODE_ALTIVEC2Alan Modra5-188/+105
This isn't losing anything from the testsuite. All of these insns appear in testsuite/gas/ppc/e6500.s opcodes/ * ppc-opc.c (powerpc_opcodes <mviwsplt, mvidsplt, lvexbx, lvepxl, lvexhx, lvepx, lvexwx, stvexbx, stvexhx, stvexwx, lvtrx, lvtlx, lvswx, stvfrx, stvflx, stvswx, lvsm, stvepxl, lvtrxl, stvepx, lvtlxl, lvswxl, stvfrxl, stvflxl, stvswxl>): Enable E6500 only vector instructions with E6500 not PPCVEC2. gas/ * testsuite/gas/ppc/altivec2.s: Delete E6500 vector insns. * testsuite/gas/ppc/altivec2.d: Adjust to suit.
2017-04-07Tweak MBIND ld test for ARM.Alan Modra2-4/+8
* testsuite/ld-elf/mbind2a.s: Don't use @, the ARM comment char.
2017-04-07MBIND gas test tweakAlan Modra2-2/+7
score-elf aligns text sections. * testsuite/gas/elf/section12a.d: Don't expect alignment of 1 for .mbind.text.
2017-04-07Add BFIN_MAX_REGISTER_SIZEAlan Hayward2-2/+10
gdb/ * bfin-tdep.c (BFIN_MAX_REGISTER_SIZE): Add. (bfin_pseudo_register_read): Use BFIN_MAX_REGISTER_SIZE. (bfin_pseudo_register_write): Likewise
2017-04-07pe/coff: handle weak defined symbol for gc-sections.Tristan Gingold6-2/+57
bfd/ * coffgen.c (_bfd_coff_gc_mark_hook): Handle PE weak external symbols with a definition. (_bfd_coff_gc_mark_extra_sections): Fix typo. ld/ * testsuite/ld-pe/pe.exp: New test. * testsuite/ld-pe/weakdef-1.s: New test source. * testsuite/ld-pe/weakdef-1.d: New test.
2017-04-06Class-ify ptid_tSimon Marchi7-77/+350
I grew a bit tired of using ptid_get_{lwp,pid,tid} and friends, so I decided to make it a bit easier to use by making it a proper class. The fields are now private, so it's not possible to change a ptid_t field by mistake. The new methods of ptid_t map to existing functions/practice like this: ptid_t (pid, lwp, tid) -> ptid_build (pid, lwp, tid) ptid_t (pid) -> pid_to_ptid (pid) ptid.is_pid () -> ptid_is_pid (ptid) ptid == other -> ptid_equal (ptid, other) ptid != other -> !ptid_equal (ptid, other) ptid.pid () -> ptid_get_pid (ptid) ptid.lwp_p () -> ptid_lwp_p (ptid) ptid.lwp () -> ptid_get_lwp (ptid) ptid.tid_p () -> ptid_tid_p (ptid) ptid.tid () -> ptid_get_tid (ptid) ptid.matches (filter) -> ptid_match (ptid, filter) I've replaced the implementation of the existing functions with calls to the new methods. People are encouraged to gradually switch to using the ptid_t methods instead of the functions (or we can change them all in one pass eventually). Also, I'm not sure if it's worth it (because of ptid_t's relatively small size), but I have made the functions and methods take ptid_t arguments by const reference instead of by value. gdb/ChangeLog: * common/ptid.h (struct ptid): Change to... (class ptid_t): ... this. <ptid_t>: New constructors. <pid, lwp_p, lwp, tid_p, tid, is_pid, operator==, operator!=, matches>: New methods. <make_null, make_minus_one>: New static methods. <pid>: Rename to... <m_pid>: ...this. <lwp>: Rename to... <m_lwp>: ...this. <tid>: Rename to... <m_tid>: ...this. (ptid_build, ptid_get_pid, ptid_get_lwp, ptid_get_tid, ptid_equal, ptid_is_pid, ptid_lwp_p, ptid_tid_p, ptid_match): Take ptid arguments as references, move comment to class ptid_t. * common/ptid.c (null_ptid, minus_one_ptid): Initialize with ptid_t static methods. (ptid_build, pid_to_ptid, ptid_get_pid, ptid_get_tid, ptid_equal, ptid_is_pid, ptid_lwp_p, ptid_tid_p, ptid_match): Take ptid arguments as references, implement using ptid_t methods. * unittests/ptid-selftests.c: New file. * Makefile.in (SUBDIR_UNITTESTS_SRCS): Add unittests/ptid-selftests.c. (SUBDIR_UNITTESTS_OBS): Add unittests/ptid-selftests.o. gdb/gdbserver/ChangeLog: * server.c (handle_v_cont): Initialize thread_resume::thread with null_ptid.
2017-04-07Automatic date update in version.inGDB Administrator1-1/+1
2017-04-06Add support for disassembling WebAssembly opcodes.Pip Cet20-41/+654
include * dis-asm.h: Add prototypes for wasm32 disassembler. opcodes * Makefile.am: Add wasm32-dis.c. * configure.ac: Add wasm32-dis.c to wasm32 target. * disassemble.c: Add wasm32 disassembler code. * wasm32-dis.c: New file. * Makefile.in: Regenerate. * configure: Regenerate. * po/POTFILES.in: Regenerate. * po/opcodes.pot: Regenerate. gas * testsuite/gas/wasm32/allinsn.d: Adjust test for disassembler changes. * testsuite/gas/wasm32/disass.d: New test. * testsuite/gas/wasm32/disass.s: New test. * testsuite/gas/wasm32/disass-2.d: New test. * testsuite/gas/wasm32/disass-2.s: New test. * testsuite/gas/wasm32/reloc.d: Adjust test for changed reloc names. * testsuite/gas/wasm32/reloc.s: Update test for changed assembler syntax. * testsuite/gas/wasm32/wasm32.exp: Run new tests. Expect allinsn test to succeed.
2017-04-06Fix Windows gdb build failure with Python 2 supportThomas Preud'homme2-1/+6
GDB fails to build for Windows host with Python 2 support enabled due to PyFile_FromString's second argument being of type char * and being passed a (const) string literal. This parameter is input only so this commit fixes the issue by casting to char *. 2017-04-06 Thomas Preud'homme <thomas.preudhomme@arm.com> gdb/ * python/python.c (python_run_simple_file): Cast mode literal to non-const char pointer as expected by PyFile_FromString.
2017-04-07mbind tests: don't check PT_LOAD headersAlan Modra4-24/+6
On powerpc-linux, the second PT_LOAD header is RWE. On hppa64-linux, only one PT_LOAD header is present. Since the tests are really about the new GNU_MBIND headers, ignore PT_LOAD and its section mapping. * testsuite/ld-elf/mbind1a.d: Remove matches for PT_LOAD segments. * testsuite/ld-elf/mbind1b.d: Likewise. * testsuite/ld-elf/mbind1c.d: Likewise.
2017-04-07Regen SRC-POTFILES.inAlan Modra2-0/+5
Missed when elf-properties.c was added. * po/SRC-POTFILES.in: Regenerate.
2017-04-06[objcopy] Fix quadratic-time when handling --redefine-symsJiong Wang2-33/+88
objcopy/ * objcopy.c (struct redefine_node): Delete the field "next". (redefine_sym_list): Deleted. (redefine_specific_htab): New hash table. (redefine_specific_reverse_htab): Likewise. (eq_string_redefnode): New function. (htab_hash_redefnode): Likewise. (create_symbol2redef_htab): Likewise. (add_specific_symbol_node): Likewise. (create_symbol_htabs): Create redefine_specific_htab and redefine_specific_reverse_htab. (lookup_sym_redefinition): Use hash table instead of list. (redefine_list_append): Likewise, and rename to add_redefine_and_check. (copy_main): Use redefine_specific_htab instead of redefine_sym_list. Update comments.
2017-04-06Automatic date update in version.inGDB Administrator1-1/+1
2017-04-05PR ld/21233: change xfails to kfails, fix the indentation issueHans-Peter Nilsson2-3/+20
2017-04-05ptid_{lwp,tid}_p: Remove unnecessary checksSimon Marchi2-8/+5
The calls to ptid_equal in ptid_lwp_p and ptid_tid_p that compare the argument to minus_one_ptid and null_ptid are not necessary. The calls in question are: if (ptid_equal (minus_one_ptid, ptid) || ptid_equal (null_ptid, ptid)) return 0; minus_one_ptid is { .pid = -1, .lwp = 0, .tid = 0 } null_ptid is { .pid = 0, .lwp = 0, .tid = 0 } If the ptid argument is either of them, the statements return (ptid_get_lwp (ptid) != 0); and return (ptid_get_tid (ptid) != 0); will yield the same result (0/false). gdb/ChangeLog: * common/ptid.c (ptid_lwp_p, ptid_tid_p): Remove comparison with minus_one_ptid and null_ptid.