aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2015-07-24bfd_get_section_by_name_if hash chain traversalAlan Modra2-8/+10
This function stops too soon, as I found when the hash chain happened to contain two .debug_macro sections and a .bss section: .debug_macro -> .bss -> .debug_macro * section.c (bfd_get_section_by_name_if): Iterate over entire hash chain.
2015-07-24Automatic date update in version.inGDB Administrator1-1/+1
2015-07-232015-07-23 Ian Coolidge <icoolidge@google.com>Han Shen3-3/+15
Plumb --pic-veneer option for gold. gold/ChangeLog: * arm.cc (Reloc_stub::stub_type_for_reloc): Plumb to stub generation. * options.h (General_options): Add --pic-veneer option.
2015-07-23Fix DT_MIPS_RLD_MAP_REL tag for n64 target and 32-bit host.Joseph Myers2-1/+7
For the case of MIPS n64 target and 32-bit host, the computation of the DT_MIPS_RLD_MAP_REL tag involves sdyn->output_section->vma + sdyn->output_offset (64-bit) being added to b (32-bit host pointer), so losing the high part and resulting in an incorrect DT_MIPS_RLD_MAP_REL tag, and all dynamically linked glibc tests failing for n64. This patch fixes this (spot-tested with glibc tests; however, I don't have a self-contained testcase for this bug). * elfxx-mips.c (_bfd_mips_elf_finish_dynamic_sections) <DT_MIPS_RLD_MAP_REL>: Add target address to host address difference, not to host pointer.
2015-07-23Fix crash when reading dummy CUs.Doug Evans5-5/+108
Dummy CUs are used by the incremental linker to pre-allocate space in the output file. They have a DWARF header but no contents. gdb/ChangeLog: * dwarf2read.c (dwarf2_per_cu_data): Add comment. (load_cu): Handle dummy CUs. (dw2_do_instantiate_symtab, process_queuef): Ditto. (dwarf2_fetch_die_loc_sect_off, dwarf2_fetch_constant_bytes): Ditto. gdb/testsuite/ChangeLog: * gdb.dwarf2/dw2-dummy-cu.S: New file. * gdb.dwarf2/dw2-dummy-cu.exp: New file.
2015-07-23py-linetable.c: Fix doc of LineTable.source_lines' return typeCiro Santilli2-4/+12
The ltpy_get_all_source_lines function, use to implement the gdb.LineTable.source_lines method, returns a list: source_list = PyDict_Keys (source_dict); return source_list; This patch fixes the function's documentation as well as its docstring to say that it returns a list rather than a FrozenSet. gdb/ChangeLog: * py-linetable.c (ltpy_get_all_source_lines): Adjust function documentation to say that it returns a list rather than a FrozenSet. (linetable_object_methods): Update the docstring of the "source_line" entry. Tested on x86_64-linux.
2015-07-23gdb/gdbtypes: fix handling of typedef layers between array typesPierre-Marie de Rodat7-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.
2015-07-23Return zero in aarch64_linux_can_use_hw_breakpoint if target doesn't support ↵Yao Qi2-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.
2015-07-23Fix ubsan signed integer overflowAlan Modra2-3/+8
IMO a fairly useless warning in this case, but technically correct. PR 18708 * i386-dis.c (get64): Avoid signed integer overflow.
2015-07-23Automatic date update in version.inGDB Administrator1-1/+1
2015-07-22Fix memory operand size for vcvtt?ps2u?qq instructionsH.J. Lu15-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.
2015-07-23readelf display of 0x800...000 addendAlan Modra2-10/+8
* readelf.c (dump_relocations): Show MIN_INT addends as negative.
2015-07-22gas line buffer handlingAlan Modra2-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.
2015-07-22Don't compare symbol addresses directlyH.J. Lu9-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.
2015-07-22Mark global with hidden attributeH.J. Lu4-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.
2015-07-22Fix ppc64 ELFv1 assertion failureAlan Modra2-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.
2015-07-22GOLD aarch64 warning fixAlan Modra2-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.
2015-07-22Automatic date update in version.inGDB Administrator1-1/+1
2015-07-21Fix problem where __start_ and __stop_ section symbols do not honor version ↵Cary Coutant2-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.
2015-07-21Fix typo in PR number.Cary Coutant1-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().
2015-07-21Fix internal error when linking an archive library with no preceding objects.Cary Coutant3-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().
2015-07-21Move aarch64_linux_get_debug_reg_capacity to nat/aarch64-linux-hw-point.cYao Qi6-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.
2015-07-21btrace: fix case label in btrace_data_appendMarkus Metzger2-1/+5
gdb/ * common/btrace-common.c (btrace_data_append): Change case label.
2015-07-21[ARM] Support correctly spelled ARMv6KZ architecture namesMatthew Wahab9-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.
2015-07-21Automatic date update in version.inGDB Administrator1-1/+1
2015-07-20gdb.ada/info_exc.exp: Adjust expected output in "info exception" test.Joel Brobecker2-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.
2015-07-20Optimize erratum 843419 fix.Han Shen2-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.
2015-07-20Update testsuite/pr18689.sh for older GCCH.J. Lu1-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.
2015-07-20Properly set arm-specific elf flags wrt hardfp.Han Shen2-0/+7
gold/ChangeLog: * arm.cc (Target_arm::do_adjust_elf_header): Set flags into view.
2015-07-20Clear SHF_COMPRESSED flag bit from input to outputH.J. Lu6-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.
2015-07-20Makefile.in (STABS_DOC_BUILD_INCLUDES): Add gdb-cfg.texi, GDBvn.texi.Doug Evans2-1/+7
gdb/doc/ChangeLog: * Makefile.in (STABS_DOC_BUILD_INCLUDES): Add gdb-cfg.texi, GDBvn.texi.
2015-07-20Remove warning about references from shared objects to hidden symbols.Yiran Wang5-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.
2015-07-20Fix ARI warnings to nat/aarch64-linux-hw-point.{c,h}Yao Qi3-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".
2015-07-20Make binutils abort message GDB friendlyH.J. Lu3-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.
2015-07-20Regen two filesAlan Modra4-3/+12
bfd/ * po/SRC-POTFILES.in: Regenerate. binutils/ * doc/Makefile.in: Regenerate.
2015-07-20ALIGN change affects cris scriptsAlan Modra3-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.
2015-07-20ALIGN change affects standard scriptsAlan Modra3-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.
2015-07-20Automatic date update in version.inGDB Administrator1-1/+1
2015-07-19Automatic date update in version.inGDB Administrator1-1/+1
2015-07-18dwarf2read: Allow SEC_ALLOC sections to be located at address 0.Kevin Buettner2-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.
2015-07-18Automatic date update in version.inGDB Administrator1-1/+1
2015-07-17Move common aarch64 HW breakpoint/watchpoint code to nat/Yao Qi10-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.
2015-07-17Pass aarch64_debug_reg_state to functionsYao Qi4-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.
2015-07-17Use debug_printf to print debug messageYao Qi4-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.
2015-07-17int -> enum target_hw_bp_type in aarch64-linux-nat.cYao Qi2-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.
2015-07-17Call ptid_get_pid instead of get_thread_id in ↵Yao Qi2-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.
2015-07-17[AArch64] Sort TLS reloc types alphabeticallyJiong Wang2-17/+22
2015-07-17Fix using uninitialised valuesYao Qi2-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.
2015-07-17Automatic date update in version.inGDB Administrator1-1/+1
2015-07-16stabs.texinfo: @include gdb-cfg.texi.Doug Evans2-0/+8
gdb/doc/ChangeLog: * stabs.texinfo: @include gdb-cfg.texi.