aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2015-11-09bfd: Fix left shift of negative value.Dominik Vogt6-7/+16
This patch fixes all occurences of left-shifting negative constants in C code which is undefined by the C standard. bfd/ChangeLog: * elf64-ppc.c (ppc64_elf_size_stubs, ppc64_elf_build_stubs): Fix left shift of negative value. * libbfd.c (safe_read_leb128): Likewise. * dwarf2.c (place_sections): Likewise. * bfd-in.h (align_power): Likewise. * bfd-in2.h (align_power): Likewise.
2015-11-09Use ELF_STRING_ARM_unwind in arm-tdep.cYao Qi2-1/+6
We've already has the definition like this, #define ELF_STRING_ARM_unwind ".ARM.exidx" so it is better to use the macro rather than the string. gdb: 2015-11-09 Yao Qi <yao.qi@linaro.org> * arm-tdep.c (arm_exidx_new_objfile): Use ELF_STRING_ARM_unwind.
2015-11-09New function displaced_step_in_progress_threadYao Qi2-3/+24
This patch adds a new function displaced_step_in_progress_thread, which returns whether the thread is in progress of displaced stepping. gdb: 2015-11-09 Yao Qi <yao.qi@linaro.org> * infrun.c (displaced_step_in_progress_thread): New function. (handle_inferior_event_1): Call it.
2015-11-09Move copy_u.w to MSA64 ASE, remove copy_u.d.Robert Suchanek8-46/+37
opcodes/ChangeLog: * mips-opc.c (mips_builtin_opcodes): Change "copy_u.w" to MSA64 ASE, remove "copy_u.d". gas/testsuite/ChangeLog: * gas/mips/micromips@msa.d: Remove "copy_u.w". * gas/mips/msa.d: Likewise. * gas/mips/msa.s: Likweise. * gas/mips/mipsr6@msa.d: Likewise. Replace addresses with regex. * gas/mips/msa64.d: Add "copy_u.w". Remove "copy_u.d". * gas/mips/msa64.s: Likewise. * gas/mips/micromips@msa64.d: Likewise.
2015-11-09Configury changes for obstack optimizationAlan Modra4-0/+44
Provides defines used to determine whether glibc obstacks are compatible. Generally speaking, 32-bit targets won't need to use obstack.o from libiberty if glibc is used, while 64-bit targets will, until glibc gets the new obstack code. libiberty/ * configure.ac: Get size of size_t. * config.in: Regenerate. * configure: Regenerate.
2015-11-09Silence obstack.c -Wc++compat warningAlan Modra2-2/+9
Fixes warning: request for implicit conversion from ‘void *’ to ‘struct _obstack_chunk *’ not permitted in C++ [-Wc++-compat] I moved the assignment to h->chunk to fix an overlong line, then decided it would be better after the alloc failure check just to do things the same way as in _obstack_newchunk. * obstack.c (_obstack_newchunk): Silence -Wc++compat warning. (_obstack_begin_worker): Likewise. Move assignment to h->chunk after alloc failure check.
2015-11-09Modify obstack.[hc] to avoid having to include other gnulib filesAlan Modra5-14/+55
Using the standard gnulib obstack source requires importing quite a lot of other files from gnulib, and requires build changes. include/ PR gdb/17133 * obstack.h (__attribute_pure__): Expand _GL_ATTRIBUTE_PURE. libiberty/ PR gdb/17133 * obstack.c (__alignof__): Expand alignof_type from alignof.h. (obstack_exit_failure): Don't use exitfail.h. (_): Include libintl.h when HAVE_LIBINTL_H and nls enabled. Provide default. Don't include gettext.h. (_Noreturn): Define. * obstacks.texi: Adjust node references to external libc info files.
2015-11-09Copy gnulib obstack filesAlan Modra5-939/+794
This copies obstack.[ch] from gnulib, and updates the docs. The next patch should be applied if someone repeats the import at a later date. include/ PR gdb/17133 * obstack.h: Import current gnulib file. libiberty/ PR gdb/17133 * obstack.c: Import current gnulib file. * obstacks.texi: Updated doc, from glibc's manual/memory.texi.
2015-11-09Automatic date update in version.inGDB Administrator1-1/+1
2015-11-08Automatic date update in version.inGDB Administrator1-1/+1
2015-11-07gdb.dwarf2: Don't hardcode certain constants in Dwarf::assemble constructsKevin Buettner3-6/+16
Two tests in gdb.dwarf2, data-loc.exp and dynarr-ptr.exp assume that sizeof(int) is 4. This patch looks up the integer size and uses this constant for DW_AT_byte_size, DW_AT_lower_bound, and DW_AT_upper_bound. I discovered this problem while looking at test results for this msp430 multilib: msp430-sim/-msim/-mcpu=msp430x/-mlarge/-mdata-region=either/-mcode-region=either It fixes the following set of failures: FAIL: gdb.dwarf2/dynarr-ptr.exp: print foo.three_ptr.all'first FAIL: gdb.dwarf2/dynarr-ptr.exp: print foo.three_ptr'first FAIL: gdb.dwarf2/dynarr-ptr.exp: print foo.three_ptr_tdef.all'first FAIL: gdb.dwarf2/dynarr-ptr.exp: print foo.three_ptr_tdef'first FAIL: gdb.dwarf2/dynarr-ptr.exp: print foo.five_ptr.all'first FAIL: gdb.dwarf2/dynarr-ptr.exp: print foo.five_ptr'first FAIL: gdb.dwarf2/dynarr-ptr.exp: print foo.five_ptr_tdef.all'first FAIL: gdb.dwarf2/dynarr-ptr.exp: print foo.five_ptr_tdef'first FAIL: gdb.dwarf2/data-loc.exp: print foo.three FAIL: gdb.dwarf2/data-loc.exp: print foo.three(1) FAIL: gdb.dwarf2/data-loc.exp: print foo.three(2) FAIL: gdb.dwarf2/data-loc.exp: print foo.three(3) FAIL: gdb.dwarf2/data-loc.exp: print foo.three_tdef FAIL: gdb.dwarf2/data-loc.exp: print foo.three_tdef(1) FAIL: gdb.dwarf2/data-loc.exp: print foo.three_tdef(2) FAIL: gdb.dwarf2/data-loc.exp: print foo.three_tdef(3) FAIL: gdb.dwarf2/data-loc.exp: print foo.five FAIL: gdb.dwarf2/data-loc.exp: print foo.five(2) FAIL: gdb.dwarf2/data-loc.exp: print foo.five(3) FAIL: gdb.dwarf2/data-loc.exp: print foo.five(4) FAIL: gdb.dwarf2/data-loc.exp: print foo.five(5) FAIL: gdb.dwarf2/data-loc.exp: print foo.five(6) FAIL: gdb.dwarf2/data-loc.exp: print foo.five_tdef FAIL: gdb.dwarf2/data-loc.exp: print foo.five_tdef(2) FAIL: gdb.dwarf2/data-loc.exp: print foo.five_tdef(3) FAIL: gdb.dwarf2/data-loc.exp: print foo.five_tdef(4) FAIL: gdb.dwarf2/data-loc.exp: print foo.five_tdef(5) FAIL: gdb.dwarf2/data-loc.exp: print foo.five_tdef(6) FAIL: gdb.dwarf2/data-loc.exp: print foo__three FAIL: gdb.dwarf2/data-loc.exp: print foo__three_tdef FAIL: gdb.dwarf2/data-loc.exp: print foo__five FAIL: gdb.dwarf2/data-loc.exp: print foo__five_tdef As I recall, there are still (other) problems with msp430 multilibs which don't use -mlarge. gdb/testsuite/ChangeLog: * gdb.dwarf2/data-loc.exp (Dwarf::assemble): Don't hardcode value associated with DW_AT_byte_size. * gdb.dwarf2/dynarr-ptr.exp (Dwarf::assemble): Don't hardcode constants for DW_AT_byte_size, DW_AT_lower_bound, and DW_AT_upper_bound.
2015-11-07testsuite: Define and use gdb_target_symbol_prefix_flags_asm.Kevin Buettner18-49/+194
Some of the source code for the test cases in the GDB testsuite reside in .S files containing assembly code. These files typically define a symbol - such as main - which may, depending on the target, require a prefix such as underscore. For example, gdb.dwarf2/dw-compdir-oldgcc.S defines the symbol main: main: .globl main Some targets, such as rx-elf, require main to have an underscore prefix. (If it doesn't, a linker error results due to not being able to find _main required by crt0.o.) So, instead, the above should look like this for rx-elf and other targets with this same requirement: _main: .globl _main This patch defines a new tcl proc in lib/gdb named gdb_target_symbol_prefix_flags_asm. This proc returns a string which will - assuming everything else is wired up correctly - cause -DSYMBOL_PREFIX=_ to be passed on the command line to the compiler. The test cases are augmented with a macro definition for SYMBOL as follows: #define CONCAT1(a, b) CONCAT2(a, b) #define CONCAT2(a, b) a ## b #ifdef SYMBOL_PREFIX # define SYMBOL(str) CONCAT1(SYMBOL_PREFIX, str) #else # define SYMBOL(str) str #endif Symbols, such as main shown in the example earlier are then wrapped with SYMBOL like this: SYMBOL(main): .globl SYMBOL(main) The net effect will be to add a prefix for those targets which need it and add no prefix for those targets which do not. It should be noted that there was already a proc in lib/gdb.exp called gdb_target_symbol_prefix_flags. It still exists, but has been significantly rewritten. (There is only one small difference between the two versions.) That proc used to explicitly list targets which were known to require an underscore prefix. This is no longer done; the recently added proc, gdb_target_symbol_prefix, is now invoked to dynamically discover whether or not a prefix is required for that particular target. The difference between gdb_target_symbol_prefix_flags_asm and gdb_target_symbol_prefix_flags is that the former returns a bare prefix while the latter returns the prefix enclosed in double quotes. I.e. assuming that the discovered prefix is underscore, gdb_target_symbol_prefix_flags_asm returns: additional_flags=-DSYMBOL_PREFIX=_ while gdb_target_symbol_prefix_flags returns: additional_flags=-DSYMBOL_PREFIX="_" The double-quoted version is not suitable for using with .S files containing assembly code; there is no way to strip the double quotes using C preprocessor constructs. It would be possible to use the bare (non double quoted) version in C source code. However, the supporting macros become more complicated and therefore more difficult to maintain. gdb/testsuite/ChangeLog: * lib/gdb (gdb_target_symbol_prefix_flags_asm): New proc. (gdb_target_symbol_prefix_flags): Define in terms of _asm version. * gdb.arch/i386-float.exp, gdb.arch/i386-permbkpt.exp, gdb.dwarf2/dw2-canonicalize-type.exp, gdb.dwarf2/dw2-compdir-oldgcc.exp, gdb.dwarf2/dw2-minsym-in-cu.exp, gdb.dwarf2/dw2-op-stack-value.exp, gdb.dwarf2/dw2-unresolved.exp, gdb.dwarf2/fission-reread.exp, gdb.dwarf2/pr13961.exp: Use flags provided by gdb_target_symbol_prefix_flags_asm. * gdb.dwarf2/dw2-canonicalize-type.S, gdb.dwarf2/dw2-compdir-oldgcc.S, testsuite/gdb.dwarf2/dw2-minsym-in-cu.S, testsuite/gdb.dwarf2/dw2-unresolved-main.c, testsuite/gdb.dwarf2/dw2-unresolved.S, gdb.dwarf2/fission-reread.S, gdb.dwarf2/pr13961.S: Define and use SYMBOL macro (and supporting macros where needed). Use this macro for symbols which require the prefix provided by SYMBOL_PREFIX.
2015-11-07Automatic date update in version.inGDB Administrator1-1/+1
2015-11-06Do not use libiberty's getpagesize on AndroidJoel Brobecker3-0/+18
Building libiberty on Android currently fails with the error message shown below. This was discovered by trying to build GDBserver for Android, which stopped building after libiberty became a GDBserver dependency. Here is the error message: [...]/getpagesize.c:64:1: error: redefinition of 'getpagesize' In file included from /[...]/getpagesize.c:34:0: /[...]/usr/include/unistd.h:171:23: note: previous definition of 'getpagesize' was here And looking at the definition, one can see that it defined as a static inline function... static __inline__ int getpagesize(void) { extern unsigned int __page_size; return __page_size; } ... which explains why the AC_CHECK_FUNCS test failed to detect the function, since there is no associated symbol to be linked in. This patch prevents getpagesize.c to be compiled in by hard-coding the fact that getpagesize is available on android hosts. libiberty/ChangeLog: * configure.ac: Set AC_CV_FUNC_GETPAGESIZE to "yes" on Android hosts. * configure: Regenerate.
2015-11-06Automatic date update in version.inGDB Administrator1-1/+1
2015-11-05gdb.dwarf2: Define and use gdb_target_symbol for symbol prefixesKevin Buettner9-18/+96
Some of the tests in gdb.dwarf2 which use Dwarf::assemble refer to (minimal/linker) symbols created in the course of building a small test program. Some targets use a prefix such as underscore ("_") on these symbols. Many of the tests in gdb.dwarf2 do not take this into account. As a consequence, these tests fail to build, resulting either in failures or untested testcases. Here is an example from gdb.dwarf2/dw2-regno-invalid.exp: Dwarf::assemble $asm_file { cu {} { compile_unit { {low_pc main DW_FORM_addr} {high_pc main+0x10000 DW_FORM_addr} } { ... } For targets which require an underscore prefix on linker symbols, the two occurrences of "main" would have to have a prepended underscore, i.e. _main instead of main. For the above case, a call to the new proc gdb_target_symbol is used prepend the correct prefix to the symbol. I.e. the above code is rewritten (as shown in the patch) as follows: Dwarf::assemble $asm_file { cu {} { compile_unit { {low_pc [gdb_target_symbol main] DW_FORM_addr} {high_pc [gdb_target_symbol main]+0x10000 DW_FORM_addr} } { ... } I also found it necessary to make an adjustment to lib/dwarf.exp so that expressions of more than just one list element can be used in DW_TAG_... constructs. Both atomic-type.exp and dw2-bad-mips-linkage-name.exp require this new functionality. gdb/testsuite/ChangeLog: * lib/gdb.exp (gdb_target_symbol_prefix, gdb_target_symbol): New procs. * lib/dwarf.exp (_handle_DW_TAG): Handle attribute values, representing expressions, of more than one list element. * gdb.dwarf2/atomic-type.exp (Dwarf::assemble): Use gdb_target_symbol to prepend linker symbol prefix to f. * gdb.dwarf2/data-loc.exp (Dwarf::assemble): Likewise, for table_1 and table_2. * gdb.dwarf2/dw2-bad-mips-linkage-name.exp (Dwarf::assemble): Likewise, for f and g. * gdb.dwarf2/dw2-ifort-parameter.exp (Dwarf::assemble): Likewise, for ptr. * gdb.dwarf2/dw2-regno-invalid.exp (Dwarf::assemble): Likewise, for main. * gdb.dwarf2/dynarr-ptr.exp (Dwarf::assemble): Likewise, for table_1_ptr and table_2_ptr.
2015-11-05Revert patch for PR 19119, which led to PR 19172 and 19197.Cary Coutant3-11/+12
Gold does not support all the emulations that Gnu ld does, and supports only one spelling per target. The -m option is used only in the rare case where there are no ELF input files, and we produce an empty output file. In those cases, users are expected to supply a -m option naming one of the supported emulations. In the many cases where a build script provides an unnecessary -m option naming an emulation that gold does not support, we will simply ignore the option, as we did before the reverted patch. gold/ PR gold/19119 PR gold/19172 PR gold/19197 Revert commit 6457197210144f50a696097c0d308d81d46d5510: 2015-10-16 H.J. Lu <hongjiu.lu@intel.com> * options.h (General_options): Remove "obsolete" from -m. * parameters.cc (set_parameters_target): Check if input target is compatible with output emulation set by "-m emulation".
2015-11-05Add aarch64-specific --no-apply-dynamic-relocs option.Cary Coutant3-0/+37
With --no-apply-dynamic-relocs on aarch64 targets, gold will not apply link-time values for absolute relocations that become dynamic relocations. This provides a workaround for broken Android dynamic linkers that use the link-time value as an extra addend to the relocation. gold/ PR gold/19163 * aarch64.cc (Target_aarch64::Relocate::relocate): Don't apply certain relocations if --no-apply-dynamic-relocs is set. * options.h (--apply-dynamic-relocs): New aarch64-specific option.
2015-11-05Use aarch64_decode_insn in aarch64_displaced_step_copy_insnYao Qi2-1/+10
gdb: 2015-11-05 Yao Qi <yao.qi@linaro.org> * aarch64-tdep.c (aarch64_displaced_step_copy_insn): Call aarch64_decode_insn and decode instruction by aarch64_inst.
2015-11-05Use aarch64_decode_insn in aarch64_analyze_prologueYao Qi2-343/+98
This patch convert aarch64_analyze_prologue to using aarch64_decode_insn to decode instructions. After this change, aarch64_analyze_prologue looks much simple, and some aarch64_decode_* functions are removed accordingly. gdb: 2015-11-05 Yao Qi <yao.qi@linaro.org> * aarch64-tdep.c (extract_signed_bitfield): Remove. (decode_masked_match): Remove. (aarch64_decode_add_sub_imm): Remove. (aarch64_decode_br): Remove. (aarch64_decode_eret): Remove. (aarch64_decode_movz): Remove. (aarch64_decode_orr_shifted_register_x): Remove. (aarch64_decode_ret): Remove. (aarch64_decode_stp_offset): Remove. (aarch64_decode_stur): Remove. (aarch64_analyze_prologue): Call aarch64_decode_insn and use aarch64_inst to decode instructions.
2015-11-05Combine aarch64_decode_stp_offset_wb and aarch64_decode_stp_offsetYao Qi2-59/+22
This patch combines both aarch64_decode_stp_offset_wb and aarch64_decode_stp_offset together. gdb: 2015-11-05 Yao Qi <yao.qi@linaro.org> * aarch64-tdep.c (aarch64_decode_stp_offset): New argument wback. (aarch64_decode_stp_offset_wb): Removed. (aarch64_analyze_prologue): Don't use aarch64_decode_stp_offset_wb.
2015-11-05Regenerate ld/Makefile.inAlan Modra2-0/+6
* Makefile.in: Regenerate.
2015-11-05Automatic date update in version.inGDB Administrator1-1/+1
2015-11-04Fortran: allocate()d memory is uninitializedJan Kratochvil2-1/+6
allocate (vla1 (5)) ! vla1-not-allocated l = allocated(vla1) ! vla1-allocated <------------------ Expecting: ^(510-data-evaluate-expression vla1[^M ]+)?(510\^done,value="\(0, 0, 0, 0, 0\)"[^M ]+[(]gdb[)] ^M [ ]*) 510-data-evaluate-expression vla1^M 510^done,value="(1.82987403e-09, 7.8472714e-44, 1.82987403e-09, 7.8472714e-44, 2.67929926e+20)"^M (gdb) ^M FAIL: gdb.mi/mi-vla-fortran.exp: evaluate allocated vla gcc-4.9.2-6.fc21.x86_64 I think some older gfortran did initialize allocated memory but that is an unspecified behavior. I haven't found any initialization mentioned in Fortran 90 standard (draft) and it is also clearly stated here: https://software.intel.com/en-us/forums/intel-fortran-compiler-for-linux-and-mac-os-x/topic/268786 Initialization to 0 of allocated arrays (of integers) is an implementation issue. i.e. do not rely on it. Joel Brobecker wrote: I am wondering if it might be better to just relax instead the regexp to allow any number rather than just remove the test altogether. The test allows us to verify that, as soon as we're past the "allocate" call, we no longer say "not allocated". gdb/testsuite/ChangeLog 2015-11-03 Jan Kratochvil <jan.kratochvil@redhat.com> Joel Brobecker <brobecker@adacore.com> * gdb.mi/mi-vla-fortran.exp (evaluate allocated vla): Permit any data.
2015-11-04gdb/s390-linux: Step over MVCLE+JO (and similiar) as a unit.Marcin Kościelnicki2-0/+123
This is needed to avoid O(n**2) complexity when recording MVCLE and other partial execution instructions. gdb/ChangeLog: PR/18376 * gdb/s390-linux-tdep.c (s390_is_partial_instruction): New function. (s390_software_single_step): New function. (s390_displaced_step_hw_singlestep): New function. (s390_gdbarch_init): Fill gdbarch slots with the above.
2015-11-04gdb: Add process record and replay support for s390.Marcin Kościelnicki7-3/+4552
gdb/ChangeLog: PR/18376 * gdb/configure.tgt: Add linux-record.o to s390*-linux. * gdb/s390-linux-tdep.c: #include "linux-record.h", "record-full.h" (s390_linux_record_tdep): New static global variable. (s390x_linux_record_tdep): New static global variable. (s390_all_but_pc_registers_record): New function. (s390_canonicalize_syscall): New function. (s390_linux_syscall_record): New function. (s390_linux_record_signal): New function. (s390_record_calc_disp_common): New function. (s390_record_calc_disp): New function. (s390_record_calc_disp_vsce): New function. (s390_record_calc_rl): New function. (s390_record_gpr_g): New function. (s390_record_gpr_h): New function. (s390_record_vr): New function. (s390_process_record): New function. (s390_init_linux_record_tdep): New function. (s390_gdbarch_init): Fill record function slots. gdb/testsuite/ChangeLog: * gdb.reverse/s390-mvcle.c: New test. * gdb.reverse/s390-mvcle.exp: New file. * lib/gdb.exp: Enable reverse tests on s390*-linux.
2015-11-04gdb/record-full: Use xmalloc instead of alloca for temporary memory storage.Marcin Kościelnicki2-1/+9
On the newly added s390 target, it's possible for a single instruction to write practically unbounded amount of memory (eg. MVCLE). This caused a stack overflow when alloca was used. gdb/ChangeLog: * record-full.c (record_full_exec_insn): Use xmalloc for temporary memory storage.
2015-11-05DATA_SEGMENT_ALIGN documentation is not consistent with behaviourAlan Modra2-1/+7
PR ld/19203 * ld.texinfo (DATA_SEGMENT_ALIGN): Correct second expression.
2015-11-04Fix non stopping breakpoint on newer compilers.Walfred Tedeschi1-2/+3
The breakpoint presented in the return statement was not activated while compiling the test with gcc 4.9.2. Added a dummy statement to allow the breakpoint again. 2015-10-14 Walfred Tedeschi <walfred.tedeschi@intel.com> gdb/testsuite: * i386-mpx-map.c (foo): Add dummy statement to trigger breakpoint. Change-Id: I5293ca1c7f82a631e1e41cb650c30dd2d09ef3c2 Signed-off-by: Walfred Tedeschi <walfred.tedeschi@intel.com>
2015-11-04Changing compiler flags for MPX tests.Walfred Tedeschi2-2/+2
Adapts tests to use actual GCC flags, previous used flags were related to an internal GCC release. 2015-06-18 Walfred Tedeschi <walfred.tedeschi@intel.com> gdb/testsuite: * gdb.arch/i386-mpx-map.exp (comp_flags): Use released GCC flags. * gdb.arch/i386-mpx.exp (comp_flags): Use released GCC flags. Change-Id: Id4c4551693a8df071ed4b71bb5dfb46a526ed5db Signed-off-by: Walfred Tedeschi <walfred.tedeschi@intel.com>
2015-11-04Improve error message for MPX bound table examinations.Walfred Tedeschi1-1/+2
Error was introduced to fix a build issue caused by a mismatching variable size. The error message is changed to explicitly report what goes wrong and how user might still investigate the issue. 2015-06-18 Walfred Tedeschi <walfred.tedeschi@intel.com> * i386-tdep.c (i386_mpx_get_bt_entry) Improves error message. Change-Id: I6e9c7475eba663f49bd8e720b84ad0265bcb0e92 Signed-off-by: Walfred Tedeschi <walfred.tedeschi@intel.com>
2015-11-04btrace: add instruction-history /s and fix documentationMarkus Metzger5-2/+32
Add support for the /s modifier of the "record instruction-history" command. It behaves exactly like /m and prints disassembled instructions in the order in which they were recorded with interleaved sources. We accept /s in addition to /m to align with the "disassemble" command. The "record instruction-history" modifiers were not documented. Document all of them. gdb/ * record.c (get_insn_history_modifiers): Set DISASSEMBLY_SOURCE instead of DISASSEMBLY_SOURCE_DEPRECATED. Also accept /s. (_initialize_record): Document the /s modifier. * NEWS: Announce record instruction-history's new /s modifier. doc/ * gdb.texinfo (Process Record and Replay): Document "record instruction-history" modifiers.
2015-11-04btrace: change record instruction-history /mMarkus Metzger2-22/+186
The /m modifier interleaves source lines with the disassembly of recorded instructions. This calls disasm.c's gdb_disassembly once for each recorded instruction to be printed. This doesn't really work because gdb_disassembly may choose not to print anything in some situations. And if it does print something, the output interferes with btrace_insn_history's output around it. It further results in a separate asm_insns list for each instruction in MI. Even though there is no MI support for target record, yet, we fix this obvious issue. Change record instruction-history /m to use the new gdb_pretty_print_insn function for printing a single instruction and interleave source lines as appropriate. We cannot reuse the new disasm.c do_mixed_source_and_assembly function without significant changes to it. gdb/ * record-btrace.c (struct btrace_line_range): New. (btrace_mk_line_range, btrace_line_range_add) (btrace_line_range_is_empty, btrace_line_range_contains_range) (btrace_find_line_range, btrace_print_lines): New. (btrace_insn_history): Add source interleaving algorithm.
2015-11-04disasm: add struct disasm_insn to describe to-be-disassembled instructionMarkus Metzger3-9/+72
The "record instruction-history" command prints for each instruction in addition to the instruction's disassembly: - the instruction number in the recorded execution trace - a '?' before the instruction if it was executed speculatively To allow the "record instruction-history" command to use GDB's disassembly infrastructure, we extend gdb_pretty_print_insn to optionally print those additional fields and export the function. Add a new struct disasm_insn to add additional fields describing the to-be-disassembled instruction. The additional fields are: number an optional instruction number, zero if omitted. is_speculative a predicate saying whether the instruction was executed speculatively. If non-zero, the instruction number is printed first. It will also appear as a new optional field "insn-number" in MI. The field will be present if insn_num is non-zero. If is_speculative is set, speculative execution will be indicated by a "?" following the new instruction number field. Unless the PC is omitted, it will overwrite the first byte of the PC prefix. It will appear as a new optional field "is-speculative" in MI. The field will contain "?" and will be present if is_speculative is set. The speculative execution indication is guarded by a new flag DISASSEMBLY_SPECULATION. Replace the PC parameter of gdb_pretty_print_insn with a pointer to the above struct. GDB's "disassemble" command does not use the new fields. gdb/ * disasm.h (DISASSEMBLY_SPECULATION): New. (struct disasm_insn): New. (gdb_pretty_print_insn): New. * disasm.c (gdb_pretty_print_insn): Replace parameter PC with INSN. Update users. Print instruction number and indicate speculative execution, if requested.
2015-11-04disasm: split dump_insnsMarkus Metzger2-77/+101
Split disasm.c's dump_insn into two parts: - print a single instruction - loop over the specified address range The first part will be refined in subsequent patches so it can be reused. gdb/ * disasm.c (dump_insns): Split into this and ... (gdb_pretty_print_insn): ... this.
2015-11-04Automatic date update in version.inGDB Administrator1-1/+1
2015-11-03xtensa: Add missing staticsSimon Marchi2-3/+9
This actually fixes the build in C: /home/simark/src/binutils-gdb/gdb/xtensa-linux-nat.c:100:1: error: no previous prototype for ‘supply_gregset_reg’ [-Werror=missing-prototypes] supply_gregset_reg (struct regcache *regcache, ^ /home/simark/src/binutils-gdb/gdb/xtensa-linux-nat.c:257:1: error: no previous prototype for ‘xtensa_linux_fetch_inferior_registers’ [-Werror=missing-prototypes] xtensa_linux_fetch_inferior_registers (struct target_ops *ops, ^ /home/simark/src/binutils-gdb/gdb/xtensa-linux-nat.c:272:1: error: no previous prototype for ‘xtensa_linux_store_inferior_registers’ [-Werror=missing-prototypes] xtensa_linux_store_inferior_registers (struct target_ops *ops, ^ cc1: all warnings being treated as errors These functions are local to this file, so they should be static. gdb/ChangeLog: * xtensa-linux-nat.c (supply_gregset_reg): Make static. (xtensa_linux_fetch_inferior_registers): Likewise. (xtensa_linux_store_inferior_registers): Likewise.
2015-11-03linux-mips-low.c: Add castsSimon Marchi2-4/+11
Fixes a bunch of: /home/simark/src/binutils-gdb/gdb/gdbserver/linux-mips-low.c: In function ‘void mips_store_fpregset(regcache*, const void*)’: /home/simark/src/binutils-gdb/gdb/gdbserver/linux-mips-low.c:809:39: error: invalid conversion from ‘const void*’ to ‘const mips_register*’ [-fpermissive] const union mips_register *regset = buf; ^ gdb/gdbserver/ChangeLog: * linux-mips-low.c (mips_fill_gregset): Add cast. (mips_store_gregset): Likewise. (mips_fill_fpregset): Likewise. (mips_store_fpregset): Likewise.
2015-11-03linux-mips-low.c: Change "private" variable nameSimon Marchi2-2/+7
Fixes: /home/simark/src/binutils-gdb/gdb/gdbserver/linux-mips-low.c:359:48: error: expected ‘,’ or ‘...’ before ‘private’ mips_add_watchpoint (struct arch_process_info *private, CORE_ADDR addr, ^ gdb/gdbserver/ChangeLog: * linux-mips-low.c (mips_add_watchpoint): Rename private to priv.
2015-11-03linux-mips-low.c: Fix type of mips_add_watchpoint parameterSimon Marchi2-2/+7
Fixes /home/simark/src/binutils-gdb/gdb/gdbserver/linux-mips-low.c: In function ‘void mips_add_watchpoint(arch_process_info*, CORE_ADDR, int, int)’: /home/simark/src/binutils-gdb/gdb/gdbserver/linux-mips-low.c:368:19: error: invalid conversion from ‘int’ to ‘target_hw_bp_type’ [-fpermissive] new_watch->type = watch_type; ^ gdb/gdbserver/ChangeLog: * linux-mips-low.c (mips_linux_new_thread): Change type of watch_type to enum target_hw_bp_type.
2015-11-03arm-linux-nat.c: Add castSimon Marchi2-1/+5
Fixes: /home/simark/src/binutils-gdb/gdb/arm-linux-nat.c: In function ‘const target_desc* arm_linux_read_description(target_ops*)’: /home/simark/src/binutils-gdb/gdb/../include/libiberty.h:711:38: error: invalid conversion from ‘void*’ to ‘char*’ [-fpermissive] # define alloca(x) __builtin_alloca(x) ^ /home/simark/src/binutils-gdb/gdb/arm-linux-nat.c:578:13: note: in expansion of macro ‘alloca’ buf = alloca (VFP_REGS_SIZE); ^ gdb/ChangeLog: * arm-linux-nat.c (arm_linux_read_description): Add cast.
2015-11-03Change return type of raw_bkpt_type_to_arm_hwbp_typeSimon Marchi2-1/+6
Fixes: /home/simark/src/binutils-gdb/gdb/gdbserver/linux-arm-low.c: In function ‘int arm_linux_hw_point_initialize(raw_bkpt_type, CORE_ADDR, int, arm_linux_hw_breakpoint*)’: /home/simark/src/binutils-gdb/gdb/gdbserver/linux-arm-low.c:459:55: error: invalid conversion from ‘int’ to ‘arm_hwbp_type’ [-fpermissive] hwbp_type = raw_bkpt_type_to_arm_hwbp_type (raw_type); ^ gdb/gdbserver/ChangeLog: * linux-arm-low.c (raw_bkpt_type_to_arm_hwbp_type): Change return type to arm_hwbp_type.
2015-11-03gdbserver arm: Add castsSimon Marchi3-4/+11
Trivial casts for C++. Fixes things like In file included from /home/simark/src/binutils-gdb/gdb/gdbserver/../common/common-defs.h:39:0, from /home/simark/src/binutils-gdb/gdb/gdbserver/server.h:22, from /home/simark/src/binutils-gdb/gdb/gdbserver/linux-arm-low.c:19: /home/simark/src/binutils-gdb/gdb/gdbserver/linux-arm-low.c: In function ‘int arm_get_hwcap(long unsigned int*)’: /home/simark/src/binutils-gdb/gdb/gdbserver/../../include/libiberty.h:711:38: error: invalid conversion from ‘void*’ to ‘unsigned char*’ [-fpermissive] # define alloca(x) __builtin_alloca(x) ^ /home/simark/src/binutils-gdb/gdb/gdbserver/linux-arm-low.c:807:25: note: in expansion of macro ‘alloca’ unsigned char *data = alloca (8); ^ gdb/gdbserver/ChangeLog: * linux-aarch32-low.c (arm_fill_gregset): Add cast. (arm_store_gregset): Likewise. * linux-arm-low.c (arm_get_hwcap): Likewise. (arm_read_description): Likewise.
2015-11-03linux-aarch32-low.c: Use NULL_REGSETSimon Marchi2-1/+5
Fixes /home/simark/src/binutils-gdb/gdb/gdbserver/linux-aarch32-low.c:124:1: error: invalid conversion from ‘int’ to ‘regset_type’ [-fpermissive] }; ^ gdb/gdbserver/ChangeLog: * linux-aarch32-low.c (aarch32_regsets): Use NULL_REGSET.
2015-11-03target_ops mask_watchpoint: change int to target_hw_bp_typeSimon Marchi5-16/+35
Fixes: /home/simark/src/binutils-gdb/gdb/ppc-linux-nat.c: In function ‘int ppc_linux_insert_mask_watchpoint(target_ops*, CORE_ADDR, CORE_ADDR, int)’: /home/simark/src/binutils-gdb/gdb/ppc-linux-nat.c:1730:40: error: invalid conversion from ‘int’ to ‘target_hw_bp_type’ [-fpermissive] p.trigger_type = get_trigger_type (rw); ^ gdb/ChangeLog: * ppc-linux-nat.c (ppc_linux_insert_mask_watchpoint): Change type of rw to enum target_hw_bp_type. (ppc_linux_remove_mask_watchpoint): Likewise. * target.c (target_insert_mask_watchpoint): Likewise. (target_remove_mask_watchpoint): Likewise. * target.h (target_insert_mask_watchpoint): Likewise. (target_remove_mask_watchpoint): Likewise. (struct target_ops) <to_insert_mask_watchpoint>: Likewise. (struct target_ops) <to_remove_mask_watchpoint>: Likewise. * target-delegates.c: Regenerate.
2015-11-03remote-sim.c: Add castsSimon Marchi2-11/+25
Mostly some casts from "generic arg" void* to the actual type. There are two (enum gdb_signal) casts. I tried to see if it would have been better to change the type of sigrc, but it has a double role, as an enum and as an integer, so I left it as is. gdb/ChangeLog: * remote-sim.c (check_for_duplicate_sim_descriptor): Add casts. (get_sim_inferior_data): Likewise. (sim_inferior_data_cleanup): Likewise. (gdbsim_close_inferior): Likewise. (gdbsim_resume_inferior): Likewise. (gdbsim_wait): Likewise. (simulator_command): Likewise. (sim_command_completer): Likewise.
2015-11-03linux-ppc-low.c: Add castsSimon Marchi2-7/+17
Trivial casts for C++. gdb/gdbserver/ChangeLog: * linux-ppc-low.c (ppc_get_hwcap): Add cast. (ppc_fill_vsxregset): Likewise. (ppc_store_vsxregset): Likewise. (ppc_fill_vrregset): Likewise. (ppc_store_vrregset): Likewise. (ppc_fill_evrregset): Likewise. (ppc_store_evrregset): Likewise.
2015-11-03linux-ppc-low.c: Remove forward declaration, move ppc_arch_setup lowerSimon Marchi2-98/+103
g++ doesn't like that we forward-declare a variable that is initialized later in the file. It's easy enough to re-order things to fix it. Fixes /home/simark/src/binutils-gdb/gdb/gdbserver/linux-ppc-low.c:663:28: error: redefinition of ‘usrregs_info ppc_usrregs_info’ static struct usrregs_info ppc_usrregs_info = ^ /home/simark/src/binutils-gdb/gdb/gdbserver/linux-ppc-low.c:381:28: note: ‘usrregs_info ppc_usrregs_info’ previously declared here static struct usrregs_info ppc_usrregs_info; ^ gdb/gdbserver/ChangeLog: * linux-ppc-low.c (ppc_usrregs_info): Remove forward-declaration. (ppc_arch_setup): Move lower in file.
2015-11-03readelf verdef and verneedAlan Modra2-164/+143
readelf ought to notify when a symbol wrongly has both a version definition and a needed version. This patch does that, and removes the heuristic that only defined symbols in SHT_NOBITS sections have verneed entries. * readelf (process_version_sections): Check DT_VERNEED and DT_VERDEF for all symbols. Report "*both*" should a symbol have both a verneed and verdef. (get_symbol_version_string): Reduce indentation by early exits. Don't use SHT_NOBITS heuristic to detect case where a defined symbol has a verneed entry.
2015-11-03[GOLD] Regenerate POTFILES.in to add s390.ccAlan Modra2-0/+5
* po/POTFILES.in: Regenerate.