summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* Add testcases for R_386_RELAX_GOT32users/hjl/relaxH.J. Lu2015-07-2310-0/+164
|
* Add testcases for R_X86_64_RELAX_GOTPCRELH.J. Lu2015-07-2311-0/+168
|
* Convert 386 RELAX_GOT32 to 386 PC32H.J. Lu2015-07-231-21/+128
|
* Convert X86_64 RELAX_GOTPCREL to PC32H.J. Lu2015-07-231-21/+88
|
* Add R_386_RELAX_GOT32 and R_X86_64_RELAX_GOTPCRELH.J. Lu2015-07-238-12/+102
| | | | | | | | For x86-64, we covert relocation in *foo@GOTPCREL(%rip) from R_X86_64_GOTPCREL to R_X86_64_RELAX_GOTPCREL. For i386, we covert relocation in *puts@GOT[(%reg]) from R_386_GOT32 to R_386_RELAX_GOT32.
* gdb/gdbtypes: fix handling of typedef layers between array typesPierre-Marie de Rodat2015-07-237-1/+140
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When a dynamic array type contains a typedef-wrapped array, an assertion failure occurs during type resolution. This is what happens in the following Ada case: type Rec_Type is record I : Integer; B : Boolean; end record; type Vec_Type is array (1 .. 4) of Rec_Type; type Array_Type is array (Positive range <>) of Vec_Type; If users try to print or even pass to an inferior call a variable A of type Array_Type, GDB will raise an error: (gdb) print a ../../src/gdb/gdbtypes.c:1807: internal-error: resolve_dynamic_array: Assertion `TYPE_CODE (type) == TYPE_CODE_ARRAY' failed. A problem internal to GDB has been detected, further debugging may prove unreliable. Quit this debugging session? (y or n) What happens is that during dynamic array type resolution, we first peel TYPE_CODE_TYPEDEF layers wrapping the array element type and check if its type is itself TYPE_CODE_ARRAY. If it is, we pass the typedef-wrapped type to a recursive call to resolve_dynamic_array whereas this function expects only TYPE_CODE_ARRAY types. This patch makes it pass the peeled type to the recursive call so that type resolution can continue smoothly. gdb/ChangeLog: * gdbtypes.c (resolve_dynamic_array): Pass the peeled element type to the recursive call instead of the original (maybe TYPE_CODE_TYPEDEF) type. gdb/testsuite/ChangeLog: * gdb.ada/var_arr_typedef.exp: New testcase. * gdb.ada/var_arr_typedef/pack.adb: New file. * gdb.ada/var_arr_typedef/pack.ads: New file. * gdb.ada/var_arr_typedef/var_arr_typedef.adb: New file.
* Return zero in aarch64_linux_can_use_hw_breakpoint if target doesn't support ↵Yao Qi2015-07-232-8/+27
| | | | | | | | | | | | | | | | | HW watchpoint/breakpoint Nowadays aarch64_linux_can_use_hw_breakpoint always return one, but it can be smarter, say, if GDB knows target doesn't support HW watchpoint or breakpoint because HW watchpoint/breakpoint is disabled in linux kernel, for example, it can safely return zero. gdb: 2015-07-23 Yao Qi <yao.qi@linaro.org> * aarch64-linux-nat.c (aarch64_linux_can_use_hw_breakpoint): If TYPE is watchpoint, return zero if aarch64_num_wp_regs is zero. If TYPE is breakpoint, return zero if arch64_num_bp_regs is zero.
* Fix ubsan signed integer overflowAlan Modra2015-07-232-3/+8
| | | | | | | IMO a fairly useless warning in this case, but technically correct. PR 18708 * i386-dis.c (get64): Avoid signed integer overflow.
* Automatic date update in version.inGDB Administrator2015-07-231-1/+1
|
* Fix memory operand size for vcvtt?ps2u?qq instructionsH.J. Lu2015-07-2215-244/+344
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When disassembling AVX512 vcvtt?ps2u?q instructions with data broadcasting enabled, memory operand size should be DWORD. gas/testsuite/ PR binutils/18631 * gas/i386avx512dq-intel.d: Replace "QWORD" with "DWORD" in vcvtt?ps2u?qq instructions disassembly regexes. Add disassembly regex for new test. * gas/i386/avx512dq.d: Likewise. * gas/i386/avx512dq_vl-intel.d: Likewise. * gas/i386/avx512dq_vl.d: Likewise. * gas/i386/x86-64-avx512dq-intel.d: Likewise. * gas/i386/x86-64-avx512dq.d: Likewise. * gas/i386/x86-64-avx512dq_vl-intel.d: Likewise. * gas/i386/x86-64-avx512dq_vl.d: Likewise. * gas/i386/avx512dq.s: Add new test for Intel syntax with memory operand and broadcasting enabled. * gas/i386/avx512dq_vl.s: Likewise. * gas/i386/x86-64-avx512dq.s: Likewise. * gas/i386/x86-64-avx512dq_vl.s: Likewise. opcodes/ PR binutils/18631 * i386-dis-evex.h (EVEX_W_0F78_P_2): Replace "EXxmmq" with "EXEvexHalfBcstXmmq" for the second operand. (EVEX_W_0F79_P_2): Likewise. (EVEX_W_0F7A_P_2): Likewise. (EVEX_W_0F7B_P_2): Likewise.
* readelf display of 0x800...000 addendAlan Modra2015-07-232-10/+8
| | | | * readelf.c (dump_relocations): Show MIN_INT addends as negative.
* gas line buffer handlingAlan Modra2015-07-222-55/+54
| | | | | | | | | | | | | | | This fixes a segfault when macro definitions end on the last line of a file, and that line isn't properly terminated with a newline. gas used to throw away the last line in cases like this, whereas in other cases gas added the missing newline. So I've also made gas consistently provide a missing newline. PR gas/18687 * input-scrub.c (input_scrub_next_buffer): Rearrange and simplify loop. Don't drop lines at end of file lacking a newline, add a newline instead. Ensure partial_size is zero whenever partial_where is NULL. Adjust buffer size for extra char. (input_scrub_push, input_scrub_begin): Adjust buffer size here too.
* Don't compare symbol addresses directlyH.J. Lu2015-07-229-25/+127
| | | | | | | | | | | | | | | | | | | | | | | | | | | | GCC 5 will fold symbol address comparison, assuming each symbol has a different address, which leads to abort. We should use separate functions to compare symbol address. PR gold/18663 * testsuite/Makefile.am (script_test_1_SOURCES): Set to script_test_1a.cc script_test_1b.cc. (script_test_11_r.o): Replace script_test_11.o with script_test_11a.o script_test_11b.o. (script_test_11.o): Removed. (script_test_11a.o): New. (script_test_11b.o): Likewise. * testsuite/Makefile.in: Regenerated. * testsuite/script_test_1.h: New file. * testsuite/script_test_1b.cc: Likewise. * testsuite/script_test_11.h: Likewise. * testsuite/script_test_11b.c: Likewise. * testsuite/script_test_1.cc: Renamed to ... * testsuite/script_test_1a.cc: This. Include "script_test_1.h". (main): Call check_int and check_ptr. * testsuite/script_test_11.c: Renamed to ... * testsuite/script_test_11a.c: This. Include "script_test_11.h". (main): Call ptr_equal.
* Mark global with hidden attributeH.J. Lu2015-07-224-3/+10
| | | | | | | | | | | | | | GCC 5 will generate a relocation for protected symbol: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65248 when compiling for a shared library. It is undefined to access protected symbol in IFUNC selector function inside a shared library. PR gold/18628 * testsuite/ifuncdep2.c (global): Change protected to hidden. * testsuite/ifuncmod1.c (global): Likewise. * testsuite/ifuncmod5.c (global): Likewise.
* Fix ppc64 ELFv1 assertion failureAlan Modra2015-07-222-7/+11
| | | | | | | | | | | Bogus assembly can hit an assertion in opd_entry_value when the symbol referenced by a function descriptor is undefined. Worse, the code after the assert copies unitialised memory to return the code section. This uninitialised pointer can later be dereferencd, possibly causing a linker segmentation fault. * elf64-ppc.c (opd_entry_value): Remove assertion. Instead, return -1 if symbol referenced is not defined. Tidy.
* GOLD aarch64 warning fixAlan Modra2015-07-222-1/+5
| | | | | | | aarch64.cc:2026:50: error: integer overflow in expression [-Werror=overflow] Insntype adr_insn = adrp_insn & ((1 << 31) - 1); * aarch64.cc (try_fix_erratum_843419_optimized): Warning fix.
* Automatic date update in version.inGDB Administrator2015-07-221-1/+1
|
* Fix problem where __start_ and __stop_ section symbols do not honor version ↵Cary Coutant2015-07-212-0/+17
| | | | | | | | | | | | | | | | | script. When creating the special __start_ and __stop_ section symbols, gold does not check the version script to see if they should be local instead of global. 2015-07-21 Cary Coutant <ccoutant@gmail.com> gold/ PR gold/18548 * symtab.cc (Symbol_table::do_define_in_output_data): Check for forced local symbol even when oldsym != NULL. (Symbol_table::do_define_in_output_segment): Likewise. (Symbol_table::do_define_as_constant): Likewise.
* Fix typo in PR number.Cary Coutant2015-07-211-1/+1
| | | | | | | | | | Fix internal error when linking an archive library with no preceding objects. gold/ PR gold/18698 * archive.cc (Library_base::should_include_member): Don't use entry point for relocatable links, or if target is not yet valid. * parameters.cc (Parameters::entry): Check target_valid().
* Fix internal error when linking an archive library with no preceding objects.Cary Coutant2015-07-213-5/+16
| | | | | | | | gold/ PR gold/18696 * archive.cc (Library_base::should_include_member): Don't use entry point for relocatable links, or if target is not yet valid. * parameters.cc (Parameters::entry): Check target_valid().
* Move aarch64_linux_get_debug_reg_capacity to nat/aarch64-linux-hw-point.cYao Qi2015-07-216-103/+72
| | | | | | | | | | | | | | | | | | | | | | | | | | | | There are also some duplication on getting HW watchpoint/breakpoint registers info between GDB and GDBserver. This patch moves them to nat/aarch64-linux-hw-point.c. Note that ENABLE_NLS is not defined in GDBserver, so it should be OK to use _( markup. gdb: 2015-07-21 Yao Qi <yao.qi@linaro.org> * aarch64-linux-nat.c (aarch64_linux_get_debug_reg_capacity): Move it to nat/aarch64-linux-hw-point.c. (aarch64_linux_child_post_startup_inferior): Update. * nat/aarch64-linux-hw-point.c (aarch64_linux_get_debug_reg_capacity): New function. * nat/aarch64-linux-hw-point.h (aarch64_linux_get_debug_reg_capacity): Declare it. gdb/gdbserver: 2015-07-21 Yao Qi <yao.qi@linaro.org> * linux-aarch64-low.c (aarch64_arch_setup): Remove code and call aarch64_linux_get_debug_reg_capacity.
* btrace: fix case label in btrace_data_appendMarkus Metzger2015-07-212-1/+5
| | | | | gdb/ * common/btrace-common.c (btrace_data_append): Change case label.
* [ARM] Support correctly spelled ARMv6KZ architecture namesMatthew Wahab2015-07-219-9/+66
| | | | | | | | | | | | | | | | | | | | | | | 2015-07-20 Matthew Wahab <matthew.wahab@arm.com> gas/ * NEWS: Mention corrected spelling of armv6kz. * config/tc-arm.c (arm_cpus): Replace ARM_ARCH_V6ZK with ARM_ARCH_V6KZ. (arm_archs): Likewise. Also add "armv6kz" and "armv6kzt2". * doc/c-arm.texi: Replace "armv6zk" with "armv6kz". gas/testsuite * gas/arm/attr-march-armv6kz.d: New. * gas/arm/attr-march-armv6kzt2.d: New. include/opcode * arm.h (ARM_AEXT_V6ZK): Rename to ARM_AEXT_V6KZ. (ARM_AEXT_V6ZKT2): Rename to ARM_AEXT_V6KZT2. (ARM_ARCH_V6ZK): Rename to ARM_ARCH_V6KZ. (ARM_ARCH_V6ZKT2): Rename to ARM_ARCH_V6KZT2.
* Automatic date update in version.inGDB Administrator2015-07-211-1/+1
|
* gdb.ada/info_exc.exp: Adjust expected output in "info exception" test.Joel Brobecker2015-07-202-3/+5
| | | | | | | | | | | | | | | Since multi_line was moved to gdb.exp in a slightly stricter form, The gdb.ada/info_exc.exp:info exceptions test has been failing. This is because it now expects a new-line sequence at the end of each argument given to multi_line, including ".*". But the intent when writing the test was to signify "could-be-nothing-at-all". As a result, the test fails on x86_64-linux with a runtime built as recommended, because of that extra new-line sequence. gdb/testsuite/ChangeLog: * gdb.ada/info_exc.exp: Adjust "info exceptions" expected output.
* Optimize erratum 843419 fix.Han Shen2015-07-202-12/+166
| | | | | | | | | | | | gold/ChangeLog: * aarch64.cc (AArch64_insn_utilities::is_adr): New method. (AArch64_insn_utilities::aarch64_adr_encode_imm): New method. (AArch64_insn_utilities::aarch64_adrp_decode_imm): New method. (E843419_stub): New sub-class of Erratum_stub. (AArch64_relobj::try_fix_erratum_843419_optimized): New method. (AArch64_relobj::section_needs_reloc_stub_scanning): Try optimized fix. (AArch64_relobj::create_erratum_stub): Add 1 argument. (Target_aarch64::scan_erratum_843419_span): Pass in adrp insn offset.
* Update testsuite/pr18689.sh for older GCCH.J. Lu2015-07-201-1/+1
| | | | | | Older GCC, like 4.2, generates .debug_macinfo section instead of .debug_macro section. This patch updates testsuite/pr18689.sh to support it.
* Properly set arm-specific elf flags wrt hardfp.Han Shen2015-07-202-0/+7
| | | | | gold/ChangeLog: * arm.cc (Target_arm::do_adjust_elf_header): Set flags into view.
* Clear SHF_COMPRESSED flag bit from input to outputH.J. Lu2015-07-206-7/+88
| | | | | | | | | | | | | | | | | | | For relocatable link, we should clear the SHF_COMPRESSED flag bit from input group section. PR gold/18689 * layout.cc (Layout::layout): Clear the SHF_COMPRESSED flag bit from input group section for relocatable link. * testsuite/Makefile.am (check_SCRIPTS): Add pr18689.sh. (check_DATA): Add pr18689.stdout. (MOSTLYCLEANFILES): Add pr18689a.o pr18689b.o. (pr18689.stdout): New rule. (pr18689a.o): Likewise. (pr18689b.o): Likewise. (pr18689.o): Likewise. * testsuite/pr18689.c: New file. * testsuite/pr18689.sh: Likewise. * testsuite/Makefile.in: Regenerated.
* Makefile.in (STABS_DOC_BUILD_INCLUDES): Add gdb-cfg.texi, GDBvn.texi.Doug Evans2015-07-202-1/+7
| | | | | | gdb/doc/ChangeLog: * Makefile.in (STABS_DOC_BUILD_INCLUDES): Add gdb-cfg.texi, GDBvn.texi.
* Remove warning about references from shared objects to hidden symbols.Yiran Wang2015-07-205-20/+35
| | | | | | | | | | | gold/ PR gold/15574 * resolve.cc (Symbol_table): Remove warning about references from shared objects to hidden symbols. * testsuite/Makefile.am (hidden_test): Add hidden_test.syms. * testsuite/Makefile.in: Regenerate. * testsuite/hidden_test.sh: Check dynamic symbol table; update expected error messages.
* Fix ARI warnings to nat/aarch64-linux-hw-point.{c,h}Yao Qi2015-07-203-7/+15
| | | | | | | | | | | | | This patch is to fix two ARI warnings for nat/aarch64-linux-hw-point.{c,h}. gdb: 2015-07-20 Yao Qi <yao.qi@linaro.org> * nat/aarch64-linux-hw-point.c (aarch64_handle_unaligned_watchpoint): Re-indent the code. * nat/aarch64-linux-hw-point.h: Use ULONGEST rather than "unsigned long long".
* Make binutils abort message GDB friendlyH.J. Lu2015-07-203-8/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | We used to generate abort messages like: internal error, aborting at .../bfd/elf64-x86-64.c line 1554 in elf_x86_64_check_relocs We can't cut and paste "file line ???" to GDB. This patch changes those abort messages to internal error, aborting at .../bfd/elf64-x86-64.c:1554 in elf_x86_64_check_relocs so that we can cut and paste "file:???" to GDB. bfd/ * bfd.c (_bfd_abort): Replace " line " with ":" in output message. gas/ * messages.c (as_assert): Replace " line " with ":" in output message. (as_abort): Likewise. ld/ * ldmisc.c (ld_abort): Replace " line " with ":" in output message.
* Regen two filesAlan Modra2015-07-204-3/+12
| | | | | | | bfd/ * po/SRC-POTFILES.in: Regenerate. binutils/ * doc/Makefile.in: Regenerate.
* ALIGN change affects cris scriptsAlan Modra2015-07-203-4/+12
| | | | | | | | | | More fallout from a2c59f28. This one could have been fixed by simply using ". = ALIGN (ABSOLUTE (.), 2);" but it's nicer to align the section. * emulparams/criself.sh (INIT_ADDR, FINI_ADDR): Define. (INIT_START, FINI_START): Don't ALIGN. * scriptempl/elf.sc (.init, .fini): Apply INIT_ADDR/FINI_ADDR.
* ALIGN change affects standard scriptsAlan Modra2015-07-203-26/+48
| | | | | | | | | | | a2c59f28 changed the way the unary ALIGN behaved inside output sections, resulting in cris-elf testsuite regressions. This patch pads out .bss in the same manner as it was prior to the ALIGN change. * scripttempl/elf.sc (.ldata, .bss): Align absolute value of dot. * ldexp.c (is_align_conditional): Handle binary ALIGN. (exp_fold_tree_1): Move code setting SEC_KEEP for assignments to dot inside output sections. Handle absolute expressions.
* Automatic date update in version.inGDB Administrator2015-07-201-1/+1
|
* Automatic date update in version.inGDB Administrator2015-07-191-1/+1
|
* dwarf2read: Allow SEC_ALLOC sections to be located at address 0.Kevin Buettner2015-07-182-1/+6
| | | | | | | | | | | | GDB already allows statically initialized variables, located in SEC_LOAD sections, to be placed at address 0. This change allows uninitialized variables (which are in SEC_ALLOC sections) to be placed address 0 as well. gdb/ChangeLog: * dwarf2read.c (dwarf2_locate_sections): Allow has_section_at_zero to be set for SEC_ALLOC sections too.
* Automatic date update in version.inGDB Administrator2015-07-181-1/+1
|
* Move common aarch64 HW breakpoint/watchpoint code to nat/Yao Qi2015-07-1710-1218/+767
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When I look at test fails related to watchpoint on aarch64-linux, I find there are some code duplicates between GDB and GDBserver. This patch is to move some of them to a nat/aarch64-linux-hw-point.{h,c}. The only change I do is about the dr_changed_t typedef, which was ULONGEST in GDB and 'unsigned long long' in GDBserver. Each bit of dr_changed_t represents a status of each HW breakpoint or watchpoint register, and the max number of HW breakpoint or watchpoint registers is 16, so the width of 'unsigned long long' is sufficient. gdb: 2015-07-17 Yao Qi <yao.qi@linaro.org> * Makefile.in (HFILES_NO_SRCDIR): Add nat/aarch64-linux-hw-point.h. (aarch64-linux-hw-point.o): New rule. * nat/aarch64-linux-hw-point.h: New file. * nat/aarch64-linux-hw-point.c: New file. * aarch64-linux-nat.c: Include nat/aarch64-linux-hw-point.h. (AARCH64_HBP_MAX_NUM): Move to nat/aarch64-linux-hw-point.h. (AARCH64_HWP_MAX_NUM, AARCH64_HBP_ALIGNMENT): Likewise. (AARCH64_HWP_ALIGNMENT): Likewise. (AARCH64_HWP_MAX_LEN_PER_REG): Likewise. (AARCH64_DEBUG_NUM_SLOTS, AARCH64_DEBUG_ARCH): Likewise. (AARCH64_DEBUG_ARCH_V8, DR_MARK_ALL_CHANGED): Likewise. (DR_MARK_N_CHANGED, DR_CLEAR_CHANGED): Likewise. (DR_HAS_CHANGED, DR_N_HAS_CHANGE): Likewise. (aarch64_num_bp_regs, aarch64_num_wp_regs): Likewise. (struct aarch64_debug_reg_state): Likewise. (struct arch_lwp_info): Likewise. (aarch64_linux_set_debug_regs): Likewise. (aarch64_notify_debug_reg_change): Remove static. (aarch64_align_watchpoint): Likewise. (DR_CONTROL_ENABLED, DR_CONTROL_LENGTH): Likewise. (aarch64_watchpoint_length): Likewise. (aarch64_point_encode_ctrl_reg): Likewise (aarch64_point_is_aligned): Likewise. (aarch64_dr_state_insert_one_point): Likewise. (aarch64_dr_state_remove_one_point): Likewise. (aarch64_handle_breakpoint): Likewise. (aarch64_handle_aligned_watchpoint): Likewise. (aarch64_handle_unaligned_watchpoint): Likewise. (aarch64_handle_watchpoint): Likewise. * config/aarch64/linux.mh (NAT_FILE): Add aarch64-linux-hw-point.o. gdb/gdbserver: 2015-07-17 Yao Qi <yao.qi@linaro.org> * Makefile.in (aarch64-linux-hw-point.o): New rule. * configure.srv (srv_tgtobj): Append aarch64-linux-hw-point.o. * linux-aarch64-low.c: Include nat/aarch64-linux-hw-point.h. (AARCH64_HBP_MAX_NUM): Move to nat/aarch64-linux-hw-point.h. (AARCH64_HWP_MAX_NUM, AARCH64_HBP_ALIGNMENT): Likewise. (AARCH64_HWP_ALIGNMENT): Likewise. (AARCH64_HWP_MAX_LEN_PER_REG): Likewise. (AARCH64_DEBUG_NUM_SLOTS, AARCH64_DEBUG_ARCH): Likewise. (aarch64_num_bp_regs, aarch64_num_wp_regs): Likewise. (AARCH64_DEBUG_ARCH_V8, DR_MARK_ALL_CHANGED): Likewise. (DR_MARK_N_CHANGED, DR_CLEAR_CHANGED): Likewise. (DR_HAS_CHANGED, DR_N_HAS_CHANGE): Likewise. (struct aarch64_debug_reg_state): Likewise. (struct arch_lwp_info): Likewise. (aarch64_align_watchpoint): Likewise. (DR_CONTROL_ENABLED, DR_CONTROL_LENGTH): Likewise. (aarch64_watchpoint_length): Likewise. (aarch64_point_encode_ctrl_reg): Likewise (aarch64_point_is_aligned): Likewise. (aarch64_align_watchpoint): Likewise. (aarch64_linux_set_debug_regs): (aarch64_dr_state_insert_one_point): Likewise. (aarch64_dr_state_remove_one_point): Likewise. (aarch64_handle_breakpoint): Likewise. (aarch64_handle_aligned_watchpoint): Likewise. (aarch64_handle_unaligned_watchpoint): Likewise. (aarch64_handle_watchpoint): Likewise.
* Pass aarch64_debug_reg_state to functionsYao Qi2015-07-174-53/+72
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Some functions on handling HW watchpoint in GDB and GDBserver looks the same except the code getting debug register state from current inferior. In GDB, we get debug register state like this: state = aarch64_get_debug_reg_state (ptid_get_pid (inferior_ptid)); while in GDBserver, we get debug register state like this: state = aarch64_get_debug_reg_state (); This patch is to move two lines above out of some functions, and pass aarch64_debug_reg_state to these functions, in this way, these functions are the same, and can be moved to a common place. gdb: 2015-07-17 Yao Qi <yao.qi@linaro.org> * aarch64-linux-nat.c (aarch64_handle_breakpoint): Add argument state and don't call aarch64_get_debug_reg_state. All callers update. (aarch64_linux_insert_hw_breakpoint): Call aarch64_get_debug_reg_state earlier. (aarch64_linux_remove_hw_breakpoint): Likewise. (aarch64_handle_aligned_watchpoint): Add argument state and don't call aarch64_get_debug_reg_state. All callers update. (aarch64_handle_unaligned_watchpoint): Likewise. (aarch64_handle_watchpoint): Add argument state. (aarch64_linux_insert_watchpoint): Call aarch64_get_debug_reg_state earlier. (aarch64_linux_remove_watchpoint): Likewise. gdb/gdbserver: 2015-07-17 Yao Qi <yao.qi@linaro.org> * linux-aarch64-low.c (aarch64_handle_breakpoint): Add argument state and don't aarch64_get_debug_reg_state. All callers update. (aarch64_handle_aligned_watchpoint): Likewise. (aarch64_handle_unaligned_watchpoint): Likewise. (aarch64_handle_watchpoint): Likewise. (aarch64_insert_point): Call aarch64_get_debug_reg_state earlier. (aarch64_remove_point): Likewise.
* Use debug_printf to print debug messageYao Qi2015-07-174-40/+50
| | | | | | | | | | | | | | | | | | | | | | | | | Some functions in aarch64-linux-nat.c and linux-aarch64-low.c looks the same except for the code printing debug message. In GDB, we use fprintf_unfiltered (gdb_stdlog, ...) while in GDBserver, we use fprintf (stderr, ...). This patch is to change them to use debug_printf so that these functions are the same, and I can move them to a common place in the following patch. gdb: 2015-07-17 Yao Qi <yao.qi@linaro.org> * aarch64-linux-nat.c (aarch64_show_debug_reg_state): Use debug_printf. (aarch64_handle_unaligned_watchpoint): Likewise. gdb/gdbserver: 2015-07-17 Yao Qi <yao.qi@linaro.org> * linux-aarch64-low.c (aarch64_show_debug_reg_state): Use debug_printf. (aarch64_handle_unaligned_watchpoint): Likewise.
* int -> enum target_hw_bp_type in aarch64-linux-nat.cYao Qi2015-07-172-7/+20
| | | | | | | | | | | | | | | | | | This patch is to use 'enum target_hw_bp_type' instead of int for breakpoint type, in order to make some functions in GDB and GDBserver looks similar. gdb: 2015-07-17 Yao Qi <yao.qi@linaro.org> * aarch64-linux-nat.c (aarch64_dr_state_insert_one_point): Change argument type's type to 'enum target_hw_bp_type'. (aarch64_dr_state_remove_one_point): Likewise. (aarch64_handle_breakpoint): Likewise. (aarch64_linux_insert_hw_breakpoint): Likewise. (aarch64_linux_remove_hw_breakpoint): Likewise. (aarch64_handle_aligned_watchpoint): Likewise.
* Call ptid_get_pid instead of get_thread_id in ↵Yao Qi2015-07-172-1/+6
| | | | | | | | | | | | | | | | | | | | | | aarch64_linux_get_debug_reg_capacity aarch64_linux_get_debug_reg_capacity is called by aarch64_linux_child_post_startup_inferior, and argument ptid is created in inf-ptrace.c:inf_ptrace_create_inferior, /* On some targets, there must be some explicit actions taken after the inferior has been started up. */ target_post_startup_inferior (pid_to_ptid (pid)); so in aarch64_linux_get_debug_reg_capacity, we can get pid by ptid_get_pid, and don't need to use get_thread_id. gdb: 2015-07-17 Yao Qi <yao.qi@linaro.org> * aarch64-linux-nat.c (aarch64_linux_get_debug_reg_capacity): Call ptid_get_pid instead of get_thread_id.
* [AArch64] Sort TLS reloc types alphabeticallyJiong Wang2015-07-172-17/+22
|
* Fix using uninitialised valuesYao Qi2015-07-172-2/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We did a code refacotr here https://sourceware.org/ml/gdb-patches/2013-11/msg00063.html > (get_current_thread): New function, factored out from ... > (add_current_inferior_and_thread): ... this. Adjust. > >@@ -3332,18 +3371,8 @@ add_current_inferior_and_thread (char *wait_status) > > inferior_ptid = null_ptid; > >- /* Now, if we have thread information, update inferior_ptid. First >- if we have a stop reply handy, maybe it's a T stop reply with a >- "thread" register we can extract the current thread from. If >- not, ask the remote which is the current thread, with qC. The >- former method avoids a roundtrip. Note we don't use >- remote_parse_stop_reply as that makes use of the target >- architecture, which we haven't yet fully determined at this >- point. */ >- if (wait_status != NULL) >- ptid = stop_reply_extract_thread (wait_status); >- if (ptid_equal (ptid, null_ptid)) >- ptid = remote_current_thread (inferior_ptid); >+ /* Now, if we have thread information, update inferior_ptid. */ >+ ptid = get_current_thread (wait_status); but after the refactor, local variable ptid is used without initialisation. However, before this change, ptid is initialised to null_ptid. This error can be found by valgrind too... ==3298== at 0x6B99BA: ptid_equal (ptid.c:80) ==3298== by 0x4C67FF: get_current_thread (remote.c:3484) ==3298== by 0x4C6951: add_current_inferior_and_thread (remote.c:3511) ==3298== by 0x4C762C: extended_remote_create_inferior (remote.c:8506) ==3298== by 0x5A5312: run_command_1 (infcmd.c:606) ==3298== by 0x68B4FB: execute_command (top.c:463) ==3298== by 0x5C7214: command_handler (event-top.c:494) ==3298== by 0x5C78A3: command_line_handler (event-top.c:692) ==3298== by 0x6DEB57: rl_callback_read_char (callback.c:220) ==3298== by 0x5C7278: rl_callback_read_char_wrapper (event-top.c:171) ==3298== by 0x5C72C2: stdin_event_handler (event-top.c:432) ==3298== by 0x5C6194: gdb_wait_for_event (event-loop.c:834) This patch initialises local variable ptid to null in get_current_thread. We don't need to initialise ptid in add_current_inferior_and_thread, so this patch also removes the ptid initialisation. gdb: 2015-07-17 Yao Qi <yao.qi@linaro.org> * remote.c (get_current_thread): Initialise ptid to null_ptid. (add_current_inferior_and_thread): Don't initialise ptid.
* Automatic date update in version.inGDB Administrator2015-07-171-1/+1
|
* stabs.texinfo: @include gdb-cfg.texi.Doug Evans2015-07-162-0/+8
| | | | | | gdb/doc/ChangeLog: * stabs.texinfo: @include gdb-cfg.texi.
* Fix gdb.arch/i386-biarch-core.exp FAIL on i386.Jan Kratochvil2015-07-162-9/+26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This new test fails on i686 buildbot slaves, (gdb) core-file /home/gdb-buildbot-2/fedora-x86-64-2/fedora-i686/build/gdb/testsuite/gdb.arch/i386-biarch-core.core "/home/gdb-buildbot-2/fedora-x86-64-2/fedora-i686/build/gdb/testsuite/gdb.arch/i386-biarch-core.core" is not a core dump: File format not recognized (gdb) FAIL: gdb.arch/i386-biarch-core.exp: core-file There are two problems: (1) The testcase did not really test if elf64-i386 is supported by GDB (BFD). That was OK for a Fedora testcase but I forgot about it when submitting it upstream. I haven't really verified if the GNU target is elf64-little but it seems so, no other one seems suitable from: elf32-x86-64 elf64-big elf64-k1om elf64-l1om elf64-little elf64-x86-64 pei-x86-64 (2) The output of the "core-file" command itself can be arbitrary as the elf64-i386 file with x86_64 registers is really broken; but that does not matter much, important is the following test whether core file memory is readable. ./configure --enable-64-bit-bfd (gdb) core-file /home/jkratoch/redhat/gdb-test-build32-plus64/gdb/testsuite/gdb.arch/i386-biarch-core.core^M warning: Couldn't find general-purpose registers in core file.^M Failed to read a valid object file image from memory.^M warning: Couldn't find general-purpose registers in core file.^M #0 <unavailable> in ?? ()^M (gdb) FAIL: gdb.arch/i386-biarch-core.exp: core-file x/i 0x400078^M 0x400078: hlt ^M (gdb) PASS: gdb.arch/i386-biarch-core.exp: .text is readable I do not know much dejagnu but I expect 'istarget' tests against the site.exp 'target_triplet' content which is set to the primary GDB target (--target=...). GDB is normally never configured for primary target elf64-i386, I think BFD does not know such explicit target, it gets recognized as elf64-little. In fact many testfiles of the GDB testsuite are wrong as they require 'istarget' (therefore primary GDB target) even for just loading arch specific files which would be sufficient with secondary target (--enable-targets=...) support. This my new patch removes this 'istarget' check as it is IMO unrelated to what we need to test. Although you are right we do 'x/i' and test for 'hlt' so I think we should test also for available 'set architecture i386'. We could also test by 'x/bx' instead of 'x/i' to avoid such additional test/requirement. This testcase comes from a different bug from 2009: https://bugzilla.redhat.com/show_bug.cgi?id=457187 http://pkgs.fedoraproject.org/cgit/gdb.git/commit/?id=94cd124608bf0dd359cb48a710800d72c21b30c3 That bug has been fixed in the meantime but the same testcase was reproducing this new different bug - internal error regression - so I submitted it. We can remove the "x/bx $address" test but it was useful for the previous bug from 2009 as that time the internal error regression did not happen, just the core file was not recognized (which would not be detected by the proposed ignoring of the "core-file" command output) and so the core file was not available. That can be tested by the "x/bx $address" test. gdb/testsuite/ChangeLog 2015-07-16 Jan Kratochvil <jan.kratochvil@redhat.com> * gdb.arch/i386-biarch-core.exp: Replace istarget by "complete set gnutarget". Remove expectation for the "core-file" command.