summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* gdbserver/s390: Add support for compiled agent expressions.users/mwk/ftrace-s390Marcin Kościelnicki2016-03-142-1/+1425
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | These sequences assume a z900+ CPU, like the rest of fast tracepoint support. gdb/gdbserver/ChangeLog: * linux-s390-low.c (add_insns): New function. (s390_emit_prologue): New function. (s390_emit_epilogue): New function. (s390_emit_add): New function. (s390_emit_sub): New function. (s390_emit_mul): New function. (s390_emit_lsh): New function. (s390_emit_rsh_signed): New function. (s390_emit_rsh_unsigned): New function. (s390_emit_ext): New function. (s390_emit_log_not): New function. (s390_emit_bit_and): New function. (s390_emit_bit_or): New function. (s390_emit_bit_xor): New function. (s390_emit_bit_not): New function. (s390_emit_equal): New function. (s390_emit_less_signed): New function. (s390_emit_less_unsigned): New function. (s390_emit_ref): New function. (s390_emit_if_goto): New function. (s390_emit_goto): New function. (s390_write_goto_address): New function. (s390_emit_litpool): New function. (s390_emit_const): New function. (s390_emit_call): New function. (s390_emit_reg): New function. (s390_emit_pop): New function. (s390_emit_stack_flush): New function. (s390_emit_zero_ext): New function. (s390_emit_swap): New function. (s390_emit_stack_adjust): New function. (s390_emit_set_r2): New function. (s390_emit_int_call_1): New function. (s390_emit_void_call_2): New function. (s390_emit_eq_goto): New function. (s390_emit_ne_goto): New function. (s390_emit_lt_goto): New function. (s390_emit_le_goto): New function. (s390_emit_gt_goto): New function. (s390_emit_ge_goto): New function. (s390x_emit_prologue): New function. (s390x_emit_epilogue): New function. (s390x_emit_add): New function. (s390x_emit_sub): New function. (s390x_emit_mul): New function. (s390x_emit_lsh): New function. (s390x_emit_rsh_signed): New function. (s390x_emit_rsh_unsigned): New function. (s390x_emit_ext): New function. (s390x_emit_log_not): New function. (s390x_emit_bit_and): New function. (s390x_emit_bit_or): New function. (s390x_emit_bit_xor): New function. (s390x_emit_bit_not): New function. (s390x_emit_equal): New function. (s390x_emit_less_signed): New function. (s390x_emit_less_unsigned): New function. (s390x_emit_ref): New function. (s390x_emit_if_goto): New function. (s390x_emit_const): New function. (s390x_emit_call): New function. (s390x_emit_reg): New function. (s390x_emit_pop): New function. (s390x_emit_stack_flush): New function. (s390x_emit_zero_ext): New function. (s390x_emit_swap): New function. (s390x_emit_stack_adjust): New function. (s390x_emit_int_call_1): New function. (s390x_emit_void_call_2): New function. (s390x_emit_eq_goto): New function. (s390x_emit_ne_goto): New function. (s390x_emit_lt_goto): New function. (s390x_emit_le_goto): New function. (s390x_emit_gt_goto): New function. (s390x_emit_ge_goto): New function. (s390_emit_ops): New function. (struct linux_target_ops): Fill in emit_ops hook.
* gdbserver/s390: Add fast tracepoint support.Marcin Kościelnicki2016-03-146-63/+1335
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fast tracepoints will only work on 6-byte intructions, and assume at least a z900 CPU. s390 also has 4-byte jump instructions, which also work on pre-z900, but their range is limitted to +-64kiB, which is not very useful (and wouldn't work at all with current jump pad allocation). There's a little problem with s390_relocate_instruction function: it converts BRAS/BRASL instructions to LARL of the return address + JG to the target address. On 31-bit, this sets the high bit of the target register to 0, while BRAS/BRASL would set it to 1. While this is not a problem when the result is only used to address memory, it could possibly break something that expects to compare such addresses for equality without first masking the bit off. In particular, I'm not sure whether leaving the return address high bit unset is ABI-compliant (could confuse some unwinder?). If that's a problem, it could be fixed by handling it in the jump pad (since at that point we can just modify the GPRs in the save area without having to worry about preserving CCs and only having that one GPR to work with - I'm not sure if it's even possible to set the high bit with such constraints). gdb/gdbserver/ChangeLog: * Makefile.in: Add s390 IPA files. * configure.srv: Build IPA for s390. * linux-s390-ipa.c: New file. * linux-s390-low.c: New includes - inttypes.h and linux-s390-tdesc.h. (init_registers_s390_linux32): Move declaration to linux-s390-tdesc.h. (tdesc_s390_linux32): Likewise. (init_registers_s390_linux32v1): Likewise. (tdesc_s390_linux32v1): Likewise. (init_registers_s390_linux32v2): Likewise. (tdesc_s390_linux32v2): Likewise. (init_registers_s390_linux64): Likewise. (tdesc_s390_linux64): Likewise. (init_registers_s390_linux64v1): Likewise. (tdesc_s390_linux64v1): Likewise. (init_registers_s390_linux64v2): Likewise. (tdesc_s390_linux64v2): Likewise. (init_registers_s390_te_linux64): Likewise. (tdesc_s390_te_linux64): Likewise. (init_registers_s390_vx_linux64): Likewise. (tdesc_s390_vx_linux64): Likewise. (init_registers_s390_tevx_linux64): Likewise. (tdesc_s390_tevx_linux64): Likewise. (init_registers_s390x_linux64): Likewise. (tdesc_s390x_linux64): Likewise. (init_registers_s390x_linux64v1): Likewise. (tdesc_s390x_linux64v1): Likewise. (init_registers_s390x_linux64v2): Likewise. (tdesc_s390x_linux64v2): Likewise. (init_registers_s390x_te_linux64): Likewise. (tdesc_s390x_te_linux64): Likewise. (init_registers_s390x_vx_linux64): Likewise. (tdesc_s390x_vx_linux64): Likewise. (init_registers_s390x_tevx_linux64): Likewise. (tdesc_s390x_tevx_linux64): Likewise. (have_hwcap_s390_vx): New static variable. (s390_arch_setup): Fill have_hwcap_s390_vx. (s390_get_thread_area): New function. (s390_ft_entry_gpr_esa): New const. (s390_ft_entry_gpr_zarch): New const. (s390_ft_entry_misc): New const. (s390_ft_entry_fr): New const. (s390_ft_entry_vr): New const. (s390_ft_main_31): New const. (s390_ft_main_64): New const. (s390_ft_exit_fr): New const. (s390_ft_exit_vr): New const. (s390_ft_exit_misc): New const. (s390_ft_exit_gpr_esa): New const. (s390_ft_exit_gpr_zarch): New const. (append_insns): New function. (s390_relocate_instruction): New function. (s390_install_fast_tracepoint_jump_pad): New function. (s390_get_min_fast_tracepoint_insn_len): New function. (s390_get_ipa_tdesc_idx): New function. (struct linux_target_ops): Wire in the above functions. (initialize_low_arch) [!__s390x__]: Don't initialize s390x tdescs. * linux-s390-tdesc.h: New file.
* gdbserver/s390: Switch on tracepoint support.Marcin Kościelnicki2016-03-148-7/+68
| | | | | | | | | | | | | | | | | | Also adds s390 support to gdb.trace testsuite. gdb/gdbserver/ChangeLog: * linux-s390-low.c (s390_supports_tracepoints): New function. (struct linux_target_ops): Fill supports_tracepoints hook. gdb/testsuite/ChangeLog: * gdb.trace/ftrace.exp: Set arg0exp for s390. * gdb.trace/mi-trace-frame-collected.exp: Expect 4 registers on s390. * gdb.trace/mi-trace-unavailable.exp: Set pcnum for s390, add gpr0num variable for GPR 0 instead of assuming it is register 0. * gdb.trace/trace-common.h: Add s390 fast tracepoint placeholder. * lib/trace-support.exp: Add s390 registers.
* Regenerate bfd-in2.hH.J. Lu2016-03-142-1/+5
| | | | * bfd-in2.h: Regenerated.
* gdb.base/default.exp: Add missing $_as_string to "show convenience" testSimon Marchi2016-03-142-0/+6
| | | | | | | | | | | | | | | When adding the $_as_string convenience function, I missed a new test failure in default.exp. The tests lists the convenience functions, so $_as_string should be added to the expected list. Fixes: +FAIL: gdb.base/default.exp: show convenience ($_caller_is = <internal function _caller_is> not found) gdb/testsuite/ChangeLog: * gdb.base/default.exp: Add $_as_string to the list of expected convenience functions.
* Automatic date update in version.inGDB Administrator2016-03-141-1/+1
|
* Add more tests for PR ld/19539H.J. Lu2016-03-1310-0/+53
| | | | | | | | | | | | | PR ld/19539 * testsuite/ld-i386/i386.exp: Run pr19539. * testsuite/ld-i386/pr19539.d: New file. * testsuite/ld-i386/pr19539.s: Likewise. * testsuite/ld-i386/pr19539.t: Likewise. * testsuite/ld-x86-64/pr19539.s: Likewise. * testsuite/ld-x86-64/pr19539.t: Likewise. * testsuite/ld-x86-64/pr19539a.d: Likewise. * testsuite/ld-x86-64/pr19539b.d: Likewise. * testsuite/ld-x86-64/x86-64.exp: Run pr19539a and pr19539b.
* gdb/s390: Fill gen_return_address hook.Marcin Kościelnicki2016-03-132-0/+20
| | | | | | | gdb/ChangeLog: * s390-linux-tdep.c (s390_gen_return_address): New function. (s390_gdbarch_init): Fill gen_return_address hook.
* Automatic date update in version.inGDB Administrator2016-03-131-1/+1
|
* Automatic date update in version.inGDB Administrator2016-03-121-1/+1
|
* gdb: New maint info line-table command.Andrew Burgess2016-03-117-0/+138
| | | | | | | | | | | | | | | | | | | | | | Add a new command 'maint info line-table' to display the contents of GDB's internal line table structure. Useful when trying to understand problems (within gdb) relating to line tables. gdb/ChangeLog: * symmisc.c (maintenance_info_line_tables): New function. (maintenance_print_one_line_table): New function. (_initialize_symmisc): Register 'maint info line-table' command. * NEWS: Mention new command. gdb/doc/ChangeLog: * gdb.texinfo (Symbols): Document new 'maint info line-table' command. gdb/testsuite/ChangeLog: * gdb.base/maint.exp: New tests for 'maint info line-table'.
* gdb/s390: Fill pseudo register agent expression hooks.Marcin Kościelnicki2016-03-112-0/+91
| | | | | | | | | gdb/ChangeLog: * s390-linux-tdep.c (s390_ax_pseudo_register_collect): New function. (s390_ax_pseudo_register_push_stack): New function. (s390_gdbarch_init): Fill ax_pseudo_register_collect and ax_pseudo_register_push_stack hooks.
* Fix some places where octet to byte conversions are needed.Dan Gissel2016-03-116-19/+60
| | | | | | | | | | | | | | | | | PR 19713 * elf.c (_bfd_elf_section_offset): Ensure that the returned offset uses bytes not octets. * elflink.c (resolve_section): Likewise. Add a bfd parameter. (eval_section): Pass the input_bfd to resolve_section. (bfd_elf_perform_complex_relocation): Convert byte offset to octets before read and writing values. (elf_link_input_bfd): Add byte to octet conversions. (elf_reloc_link_order): Likewise. (elf_fixup_link_order): Likewise. (bfd_elf_final_link): Likewise. * reloc.c (_bfd_final_link_relocate): Likewise. * syms.c (_bfd_stab_section_find_nearest_line): Likewise.
* Automatic date update in version.inGDB Administrator2016-03-111-1/+1
|
* Add $_as_string convenience functionSimon Marchi2016-03-109-0/+145
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch is a follow-up to "Add printf format specifier for printing enumerator": https://sourceware.org/ml/gdb-patches/2016-02/msg00144.html Instead of having a solution specific to the printf command, Pedro suggested adding a general purpose function $_as_string() that would cover this use case and more. So, in order to print the textual label of an enum, one can use: (gdb) printf "Visiting node of type %s\n", $_as_string(node) Visiting node of type NODE_INTEGER gdb/ChangeLog: * data-directory/Makefile.in (PYTHON_FILE_LIST): Install gdb/function/as_string.py. * python/lib/gdb/function/as_string.py: New file. * NEWS: Mention the new $_as_string function. gdb/testsuite/ChangeLog: * gdb.python/py-as-string.exp: New file. * gdb.python/py-as-string.c: New file. gdb/doc/ChangeLog: * gdb.texinfo (Convenience Functions): Document $_as_string.
* PR gas/19744: Thumb-1 pcrop relocations don't work on Thumb-2 targetsMickael Guene2016-03-1011-8/+200
| | | | | | | | | | | | | | | | | | | | | gas/ * config/tc-arm.c (do_arit): Protect against bad relocations usage. (do_mov): Likewise. (do_t_add_sub): Allow pcrop relocations for Thumb-2 targets. (do_t_mov_cmp): Likewise. (do_t_add_sub): Protect against bad relocations usage. (do_t_mov_cmp): Likewise. gas/testsuite/ * gas/arm/adds-thumb1-reloc-local-armv7-m.s: New. * gas/arm/adds-thumb1-reloc-local-armv7-m.d: New. * gas/arm/movs-thumb1-reloc-local-armv7-m.s: New. * gas/arm/movs-thumb1-reloc-local-armv7-m.d: New. ld/ * testsuite/ld-arm/arm-elf.exp: New tests. * testsuite/ld-arm/thumb1-adds-armv7-m.s: New. * testsuite/ld-arm/thumb1-movs-armv7-m.s: New.
* Mark the i370 target as obsolete.Nick Clifton2016-03-102-0/+6
| | | | * config.bfd: Mark the i370 target as obsolete.
* Remove bogus LONG(0) from MSP430 built in linker script.Nick Clifton2016-03-102-1/+4
| | | | ld * scripttempl/elf32msp430.sc (.rodata): Remove spurious LONG(0).
* Automatic date update in version.inGDB Administrator2016-03-101-1/+1
|
* More "Program" -> "Thread NN received signal" testsuite adjustmentPedro Alves2016-03-0910-11/+24
| | | | | | | | | | | | | | | | | | | | These tests should have been adjusted by f303dbd60d9c (Fix PR threads/19422 - show which thread caused stop), but clearly I had missed grepping for potential-fail cases. gdb/testsuite/ChangeLog 2016-03-09 Pedro Alves <palves@redhat.com> * gdb.threads/attach-into-signal.exp: Adjust to "Program received signal" -> "Thread NN received signal" output change. * gdb.threads/ia64-sigill.exp: Likewise. * gdb.threads/linux-dp.exp: Likewise. * gdb.threads/manythreads.exp: Likewise. * gdb.threads/pending-step.exp: Likewise. * gdb.threads/print-threads.exp: Likewise. * gdb.threads/sigstep-threads.exp: Likewise. * gdb.threads/staticthreads.exp: Likewise. * gdb.threads/tls.exp: Likewise.
* gdb: fix doc string of target_can_use_hardware_watchpoint.Jose E. Marchesi2016-03-092-1/+6
| | | | | | | | gdb/ChangeLog 2016-03-09 Jose E. Marchesi <jose.marchesi@oracle.com> * target.h: Fix doc string of target_can_use_hardware_watchpoint.
* Command line input handling TLCPedro Alves2016-03-095-318/+219
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | I didn't manage to usefully split this further into smaller independent pieces, so: - Use "struct buffer" more. - Split out the responsibility of composing a complete command line from multiple input lines split with backslash ( E.g.: (gdb) print \ 1 + \ 2 $1 = 3 (gdb) ) to a separate function. Note we don't need the separate readline_input_state and more_to_come globals at all. They were just obfuscating the logic. - Factor out the tricky mostly duplicated code in command_line_handler and command_line_input. gdb/ChangeLog 2016-03-09 Pedro Alves <palves@redhat.com> * event-top.c (more_to_come): Delete. (struct readline_input_state): Delete. (readline_input_state): Delete. (get_command_line_buffer): New function. (command_handler): Update comments. Don't handle NULL commands here. Do not execute commented lines. (command_line_append_input_line): New function. (handle_line_of_input): New function, partly based on command_line_handler and command_line_input. (command_line_handler): Rewrite. * event-top.h (command_handler): New declaration. (command_loop): Defer command execution to command_handler. (command_line_input): Update comments. Simplify, using struct buffer and handle_line_of_input. * top.h (struct buffer): New forward declaration. (handle_line_of_input): New declaration.
* Simplify saved_command_line handlingPedro Alves2016-03-095-21/+19
| | | | | | | | | | | | | | | | | | | | There doesn't seem to be much point in trying to reuse this buffer. Prefer simplicity instead. (In case you're wondering whether this fixes an off-by-one: linelength is misnamed; it's really a size including terminating null char.) gdb/ChangeLog: 2016-03-09 Pedro Alves <palves@redhat.com> * event-top.c (command_line_handler): Use xfree + xstrdup instead of xrealloc + strcpy. * main.c (captured_main): Use xstrdup instead of xmalloc plus manual clear. * top.c (saved_command_line): Rewrite comment. (saved_command_line_size): Delete. (command_line_input): Use xfree + xstrdup instead of xrealloc + strcpy. * top.h (saved_command_line_size): Delete declaration.
* Use struct buffer in gdb_readline_no_editing_callbackPedro Alves2016-03-092-20/+25
| | | | | | | | gdb/ChangeLog: 2016-03-09 Pedro Alves <palves@redhat.com> * event-top.c: Include buffer.h. (gdb_readline_no_editing_callback): Use struct buffer instead of xrealloc.
* Use struct buffer in gdb_readline_no_editingPedro Alves2016-03-093-22/+34
| | | | | | | | | gdb/ChangeLog: 2016-03-09 Pedro Alves <palves@redhat.com> * common/buffer.h (buffer_grow_char): New function. * top.c: Include buffer.h. (gdb_readline_no_editing): Rename 'prompt_arg' parameter to 'prompt'. Use struct buffer instead of xrealloc.
* gdb_readline -> gdb_readline_no_editingPedro Alves2016-03-093-5/+10
| | | | | | | | | | | | Name this such that it's clearer that this is not a wrapper for the real readline, but instead a replacement that provides no command line editing features. gdb/ChangeLog: 2016-03-09 Pedro Alves <palves@redhat.com> * defs.h (gdb_readline): Delete declaration. * top.c (gdb_readline): Rename to ... (gdb_readline_no_editing): ... this, and make static.
* Update prompt_for_continue commentsPedro Alves2016-03-092-14/+12
| | | | | | | | | | | These comments are out of date -- we no longer call gdb_readline. And I think that mentioning the event loop is more useful here than whatever GO32 issue had with gdb_readline, which may even no longer be an issue. gdb/ChangeLog: 2016-03-09 Pedro Alves <palves@redhat.com> * utils.c (prompt_for_continue): Update comments.
* Eliminate async_annotation_suffixPedro Alves2016-03-094-43/+16
| | | | | | | | | | | | | | | The comments and existence of this global are a bit of misleading obfuscation, since this is only ever used to print the prompt annotation, and never changes. Just hardcode "prompt" where necessary, as done for most other annotations. gdb/ChangeLog: 2016-03-09 Pedro Alves <palves@redhat.com> * event-top.c (async_annotation_suffix): Delete. (top_level_prompt, command_line_handler): Don't use 'async_annotation_suffix' and simplify. * event-top.h (async_annotation_suffix): Delete declaration. (init_main): Remove reference to 'async_annotation_suffix'.
* gdb_readline2 -> gdb_readline_no_editing_callbackPedro Alves2016-03-094-20/+31
| | | | | | | | | | | | | | | | The "2" in "gdb_readline2" doesn't really convey much. Rename for clarity. gdb/ChangeLog: 2016-03-09 Pedro Alves <palves@redhat.com> * event-top.c (gdb_readline2): Rename to ... (gdb_readline_no_editing_callback): ... this. (change_line_handler, stdin_event_handler) (gdb_setup_readline): Adjust. * event-top.h (gdb_readline2): Rename to ... (gdb_readline_no_editing_callback): ... this, and move closer to other readline-related declarations. * mi/mi-interp.c (mi_interpreter_resume): Adjust.
* Garbage collect window_hookPedro Alves2016-03-092-9/+5
| | | | | | | | | I checked, and Insight doesn't set this. gdb/ChangeLog: 2016-03-09 Pedro Alves <palves@redhat.com> * top.c (window_hook): Delete. (command_loop): Remove references to window_hook.
* Test issuing a command split in multiple lines with continuation charsPedro Alves2016-03-092-0/+40
| | | | | | | | | I happened to break this locally and the testsuite didn't notice it. Add some tests. gdb/ChangeLog: 2016-03-09 Pedro Alves <palves@redhat.com> * gdb.base/command-line-input.exp: New file.
* gdb: Add tracepoint support for powerpc.Marcin Kościelnicki2016-03-098-3/+31
| | | | | | | | | | | | | | | gdb/gdbserver/ChangeLog: * linux-ppc-low.c (ppc_supports_tracepoints): New function. (struct linux_target_ops): Wire in the above. gdb/testsuite/ChangeLog: * gdb.trace/ftrace.exp: Set arg0exp for ppc. * gdb.trace/mi-trace-unavailable.exp: Set pcnum for ppc. * gdb.trace/pending.exp: Accept leading dot before function name. * gdb.trace/trace-common.h: Add fast tracepoint dummy insn for ppc. * lib/trace-support.exp: Set registers for ppc.
* gdb.trace/entry-values.exp: Fixes for powerpc64.Marcin Kościelnicki2016-03-092-4/+14
| | | | | | | | | | | | | On powerpc64, "disassemble foo" doesn't work properly on object files (it can't process the relocations in .opd section) - instead, let's link it into an executable and load that. Also, backtrace displays .main, not main. Accept both. gdb/testsuite/ChangeLog: * gdb.trace/entry-values.exp: Link ${binfile}1.o to ${binfile}1 and use it for disassembly; accept .main in addition to main in backtrace.
* gdb.trace/tfind.exp: Force call via global entry point on ppc64le.Marcin Kościelnicki2016-03-092-2/+16
| | | | | | | | | | | | | | | | | | | | | tfind.exp sets a breakpoint on *gdb_recursion_test, which is the global entry point on ppc64le, and won't be hit, since the call uses the local entry. Fix by calling the function via a pointer in a global variable, forcing use of the global entry. This patch is a slightly modified hunk extracted from https://sourceware.org/ml/gdb-patches/2015-07/msg00353.html gdb/testsuite/ChangeLog: 2016-03-09 Wei-cheng Wang <cole945@gmail.com> Marcin Kościelnicki <koriakin@0x04.net> * gdb.trace/actions.c (gdb_recursion_test_fp): New typedef. (gdb_recursion_test_ptr): New global variable. (gdb_recursion_test): Call gdb_recursion_test_ptr instead of gdb_recursion_test. (gdb_c_test): Ditto.
* gdb.trace/change-loc.exp: Don't depend on tracepoint ordering.Marcin Kościelnicki2016-03-092-4/+21
| | | | | | | | | | | | powerpc (32-bit) loads shared libraries below the main executable, so the PENDING location is the first one, which the current regex doesn't match. Split it into two tests instead, one looking for the pending tracepoint location, and the other for two installed locations. gdb/testsuite/ChangeLog: * gdb.trace/change-loc.exp: Don't depend on tracepoint location ordering.
* gdb.trace: Use manually-defined start labels in unavailable-dwarf-piece.expMarcin Kościelnicki2016-03-093-4/+13
| | | | | | | | | | | | | | | On powerpc64, foo/bar point to a function descriptor, not to function code. Since there are no global labels pointing at the actual function code, let's make our own. Regression-tested on x86_64. gdb/testsuite/ChangeLog: * gdb.trace/unavailable-dwarf-piece.c (foo): Add foo_start_lbl label. (bar): Add bar_start_lbl label. * gdb.trace/unavailable-dwarf-piece.exp: Use foo/bar_start_lbl instead of foo/bar for emitting DWARF and tracing.
* gdb/rs6000: Read backchain as unsigned.Marcin Kościelnicki2016-03-094-3/+30
| | | | | | | | | | | | | | | | Previously, backchain was read as a signed quantity, resulting in addresses like 0xfffffffffffeded0 instead of 0xfffeded0 returned by unwinder on 32-bit powerpc. While normally such addresses are masked off, this causes problems for tracepoints, since 0xfffffffffffeded0 is considered unavailable. Fixes a test failure in gdb.trace/entry-values.exp. gdb/ChangeLog: * corefile.c (safe_read_memory_unsigned_integer): New function. * gdbcore.h (safe_read_memory_unsigned_integer): New prototype. * rs6000-tdep.c (rs6000_frame_cache): Read backchain as unsigned.
* gdb: Add gen_return_address for powerpc.Marcin Kościelnicki2016-03-092-0/+23
| | | | | | | | gdb/ChangeLog: * rs6000-tdep.c: Add "ax.h" and "ax-gdb.h" includes. (rs6000_gen_return_address): New function. (rs6000_gdbarch_init): Wire in the above.
* gdb: Add ax_pseudo_register_collect for powerpc.Marcin Kościelnicki2016-03-092-0/+51
| | | | | | | gdb/ChangeLog: * rs6000-tdep.c (rs6000_ax_pseudo_register_collect): New function. (rs6000_gdbarch_init): Wire in the above.
* Workaround a C++ bug in GCC 4.2 in gold testH.J. Lu2016-03-094-7/+15
| | | | | | | | | | | | | | | | | | | | | | G++ in GCC 4.2 silently ignores --- __attribute__ ((section(".rodata.v1_a2"))) const short rodata_item1 = 101; --- which leads to plugin_layout_with_alignment test failure with Expected 12 sections, found 8 sections since 4 .rodata sections are missing. As a workaround, this patch changes plugin_layout_with_alignment test from C++ to C. * testsuite/plugin_layout_with_alignment.cc: Renamed to .. * testsuite/plugin_layout_with_alignment.c: This. * testsuite/Makefile.am (plugin_layout_with_alignment.o): Updated. (plugin_layout_with_alignment): Likewise. * testsuite/Makefile.in: Regenerated.
* S390: Recognize special jumps in prologue parserAndreas Arnez2016-03-092-2/+19
| | | | | | | | | | | | | | | | Functions compiled with the gcc option `-mhotpatch' may start with a branch-never BRCL instruction as a 6-byte NOP. And functions compiled with `-mstack-size' contain a BRC instruction in their prologue that is actually a conditional trap. Both of these special jumps cause the prologue parser to stop and yield bad unwinding results. This change makes the prologue analyzer recognize such special jumps and ignore them. gdb/ChangeLog: * s390-linux-tdep.c (s390_analyze_prologue): Ignore BRC and BRCL instructions that do nothing or are conditional traps.
* S390: Add use of unavailable-stack frame IDAndreas Arnez2016-03-092-5/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | When determining the frame ID of an inline frame, GDB currently asserts that a valid ID of the underlying real frame is found, and that it does not match outer_frame_id. From inline_frame_this_id(): /* For now, require we don't match outer_frame_id either (see comment above). */ gdb_assert (!frame_id_eq (*this_id, outer_frame_id)); However, this assertion may fail when the real frame's unwinder can not determine the frame ID. This happened on an s390x target with a binary that lacked call frame information and also confused the prologue analyzer, because then s390_frame_this_id() left the frame ID at its default. To fix this, this change enhances s390_frame_this_id such that an unavailable-stack frame ID is built if no frame base can be determined but the function address is available. gdb/ChangeLog: * s390-linux-tdep.c (s390_prologue_frame_unwind_cache): Store frame func's PC in info->func before any other failure can occur. (s390_frame_this_id): Use frame_id_build_unavailable_stack if info->func has been filled out.
* Avoid spaces in osabi namesPedro Alves2016-03-092-9/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | It's not possible today to select some of the osabis by name. Specifically, those that have spaces in their names and then the first word is ambiguous... For example: (gdb) set osabi <TAB> [...] FreeBSD ELF FreeBSD a.out [...] (gdb) set osabi FreeBSD ELF Ambiguous item "FreeBSD ELF". In reality, because "set osabi" is an enum command, that was equivalent to trying "set osabi FreeBSD", which is then obviously ambiguous, because of "FreeBSD ELF" and "FreeBSD a.out". Also, even if the first word is not ambiguous, we actually ignore whatever comes after the first word: (gdb) set osabi GNU/Linux (gdb) show osabi The current OS ABI is "GNU/Linux". The default OS ABI is "GNU/Linux". (gdb) set osabi Windows SomeNonsense ^^^^^^^^^^^^ (gdb) show osabi The current OS ABI is "Windows CE". The default OS ABI is "GNU/Linux". (gdb) Fix this by avoiding spaces in osabi names. We could instead make "set osabi" have a custom set hook, or alternatively make the enum set hook (in cli-setshow.c) handle values with spaces, but OTOH, I have a feeling that could cause trouble. E.g., in cases where we might want to write more than one enum value in the same line. We could support quoting as workaround, but, not sure we want that. "No spaces" seems like a simpler rule. gdb/ChangeLog: 2016-03-09 Pedro Alves <palves@redhat.com> * osabi.c (gdb_osabi_names): Avoid spaces in osabi names.
* [FR-V] Handle FR300Pedro Alves2016-03-092-0/+6
| | | | | | | | | | | | | | | | | | | | | | Even though "set architecture" presents fr300 as option: (gdb) set architecture fr<TAB> fr300 fr400 fr450 fr500 fr550 frv Actually selecting fr300 doesn't work: (gdb) set architecture fr300 Architecture `fr300' not recognized. The target architecture is set automatically (currently i386) (gdb) This just looks like an obvious oversight. Looking around gcc and binutils sources, FR300 is basically a FR500 specialized for DSP and low power. gdb/ChangeLog: 2016-03-09 Pedro Alves <palves@redhat.com> * frv-tdep.c (frv_gdbarch_init): Handle bfd_mach_fr300.
* Fix v850 bfd arch info printable namesPedro Alves2016-03-096-4/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently, it's not possible to manually set some of the v850 archs in gdb: (gdb) set architecture v850<TAB> v850 (using old gcc ABI) v850-rh850 v850e v850e (using old gcc ABI) v850e1 [...] (gdb) set architecture v850 (using old gcc ABI) Ambiguous item "v850 (using old gcc ABI)". The problem is that "set architecture" is a GDB "enum command", and GDB only considers an enum value to be the string up until the first space. So writing "v850 (using old gcc ABI)" is the same as writing "v850", and then that's not an unambiguous arch printable name prefix. v850 is actually the only arch that has spaces in its printable name. One can conveniently see that with e.g.: (gdb) set max-completions unlimited (gdb) complete set architecture ... Rather than hack GDB into accepting this somehow, make v850 arch printable names more like the printable names of the other archs, and put the abi variant in the "machine" part, after a ':'. We now get: (gdb) set architecture v850<TAB> v850:old-gcc-abi v850:rh850 v850e v850e1 v850e1:old-gcc-abi v850e2 v850e2:old-gcc-abi [...] And now "set architecture v850:old-gcc-abi" works as expected. I ran the binutils/gas/ld testsuites, and found no regressions. I don't have a cross compiler handy, but I ran the gdb tests anyway, which covers at least some snoke testing. I think that the OUTPUT_ARCH in ld/scripttempl/v850.sc may have got broken with the previous 2012 change, since I hacked v850_rh850.sc to output "v850" and ld failed to grok it. I think it only works if the old GCC ABI is the configured v850 default ABI. That's now fixed by changing to use explicit v850:old-gcc-abi. Also, this actually "fixes" an existing GDB test, which isn't likewise expecting spaces in arch names, when GDB is configured for --target=v850: (gdb) FAIL: gdb.xml/tdesc-arch.exp: read valid architectures bfd/ChangeLog: 2016-03-09 Pedro Alves <palves@redhat.com> * cpu-v850.c (N): Append ":old-gcc-abi" instead of " (using old gcc ABI)" to printable name. * cpu-v850_rh850.c (bfd_v850_rh850_arch): Use "v850:rh850" instead of "v850-rh850" as printable name. ld/ChangeLog: 2016-03-09 Pedro Alves <palves@redhat.com> * scripttempl/v850.sc: Use "v850:old-gcc-abi" as OUTPUT_ARCH. * scripttempl/v850_rh850.sc: Use "v850:rh850" as OUTPUT_ARCH.
* For COFF and COFF/PE targets, skip relocations against absolute symbols.Leon Winter2016-03-092-0/+12
| | | | | | PR ld/19623 * cofflink.c (_bfd_coff_generic_relocate_section): Do not apply relocations against absolute symbols.
* fixup -Wshadow warnings on gcc-4.7Trevor Saunders2016-03-092-17/+25
| | | | | | | | | | | | | | | | gcc 4.7 complains about variables that shadow function names, which now happens in tc-arm.c because there is a global function do_align (), and local variables do_align. The simplest fix for this seems to be to rename those variables to do_alignment. gas/ChangeLog: 2016-03-09 Trevor Saunders <tbsaunde+binutils@tbsaunde.org> * config/tc-arm.c (neon_alignment_bit): Rename do_align to do_alignment. (do_neon_ld_st_lane): Likewise. (do_neon_ld_dup): Likewise.
* Allow zero length archive elementsAlan Modra2016-03-092-1/+7
| | | | | | PR binutils/19775 * coff-alpha.c (alpha_ecoff_openr_next_archived_file): Allow zero length elements in the archive.
* Don't create dynamic sections when relocatableH.J. Lu2016-03-085-2/+33
| | | | | | | | | | | | | | | | | Since dynamic sections aren't applicable to relocatable file, don't create dynamic sections for -E/--dynamic-list when relocatable. bfd/ PR ld/19789 * elflink.c (elf_link_add_object_symbols): Create dynamic sections for -E/--dynamic-list only when not relocatable. ld/ PR ld/19789 * testsuite/ld-elf/pr19789.d: New file. * testsuite/ld-elf/pr19789.s: Likewise.
* Remove checks for constructors that might have been eliminated by GCC.Cary Coutant2016-03-085-4/+9
| | | | | | | | | | | | | GCC 6 does not generate constructors for two of gold's test cases. This patch simply removes the checks for them. gold/ PR 19751 * testsuite/Makefile.am (retain_symbols_file_test): Remove check for constructor. * testsuite/Makefile.in: Regenerate. * testsuite/dynamic_list.sh: Likewise. * testsuite/retain_symbols_file_test.sh: Likewise.