aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2015-03-02S390: Vector register test caseAndreas Arnez3-0/+303
Add a test case for S/390 vector registers support. gdb/testsuite/ChangeLog: * gdb.arch/s390-vregs.exp: New test. * gdb.arch/s390-vregs.S: New file.
2015-03-02S390: Add vector register support to gdbserverAndreas Arnez4-4/+137
On S/390 targets with vector registers, enable gdbserver to advertise and handle the feature "org.gnu.gdb.s390.vx". gdb/gdbserver/ChangeLog: * Makefile.in (s390-vx-linux64.c, s390-tevx-linux64.c) (s390x-vx-linux64.c, s390x-tevx-linux64.c): New rules. (clean): Add "rm -f" for above C files. * configure.srv (srv_regobj): Add s390-vx-linux64.o, s390-tevx-linux64.o, s390x-vx-linux64.o, and s390x-tevx-linux64.o. (srv_xmlfiles): Add s390-vx-linux64.xml, s390-tevx-linux64.xml, s390x-vx-linux64.xml, s390x-tevx-linux64.xml, and s390-vx.xml. * linux-s390-low.c (HWCAP_S390_VX): New macro. (init_registers_s390_vx_linux64, init_registers_s390_tevx_linux64) (init_registers_s390x_vx_linux64) (init_registers_s390x_tevx_linux64) (tdesc_s390_vx_linux64, tdesc_s390_tevx_linux64) (tdesc_s390x_vx_linux64, tdesc_s390x_tevx_linux64): New extern declarations. (s390_fill_vxrs_low, s390_store_vxrs_low, s390_fill_vxrs_high) (s390_store_vxrs_high): New functions. (s390_regsets): Add entries for NT_S390_VXRS_LOW and NT_S390_VXRS_HIGH. (s390_arch_setup): Add logic for selecting one of the new target descriptions. Activate the new vector regsets if applicable. (initialize_low_arch): Also invoke init_registers_s390_vx_linux64, init_registers_s390_tevx_linux64, init_registers_s390x_vx_linux64, and init_registers_s390x_tevx_linux64.
2015-03-02S390: Add vector register support to gdbAndreas Arnez5-60/+359
Recognize S/390 targets with the new vector feature and present their vector registers appropriately: as 32 new 128-bit wide registers v0-v31, where the first 16 embed the floating point registers f0-f15. Each of the full registers v0-v15 is modelled as a pseudo register. gdb/ChangeLog: * s390-linux-nat.c (have_regset_vxrs): New static variable. (s390_linux_fetch_inferior_registers): Handle vector registers, if present. (s390_linux_store_inferior_registers): Likewise. (s390_get_hwcap): Remove function. Embed its logic... (s390_read_description): ...here. Yield a target description with vector registers if applicable. * s390-linux-tdep.c: Include "features/s390-vx-linux64.c", "features/s390-tevx-linux64.c", "features/s390x-vx-linux64.c", and "features/s390x-tevx-linux64.c". (struct gdbarch_tdep) <v0_full_regnum>: New field. (s390_dwarf_regmap): Add vector registers. Remove bogus entries for "GNU/Linux-specific registers". (s390_dwarf_reg_r0l): New enum value. (s390_dwarf_reg_to_regnum): Support vector registers. (s390_adjust_frame_regnum): Adjust pseudo DWARF register numbers of GPR lower halves. (regnum_is_vxr_full): New function. (s390_register_name): New function. (s390_pseudo_register_name): Handle v0-v15, which are composed of f0-f15 and v0l-v15l. (s390_pseudo_register_type): Likewise. (s390_pseudo_register_read): Likewise. (s390_pseudo_register_write): Likewise. (s390_value_from_register): Account for the fact that values are placed left-justified in vector registers. (s390_pseudo_register_reggroup_p): Add pseudo registers v0-v15 to the vector reggroup and omit them from the general reggroup. (s390_regmap_vxrs_low, s390_regmap_vxrs_high): New register maps. (s390_vxrs_low_regset, s390_vxrs_high_regset): New regsets. (s390_iterate_over_regset_sections): Add iterations for the two new vector regsets. (s390_core_read_description): Yield a target description with vector registers if applicable. (s390_gdbarch_init): Handle target descriptions with vector registers. Add "register_name" gdbarch method. (_initialize_s390_tdep): Call new tdesc initialization functions. * s390-linux-tdep.h (HWCAP_S390_VX): New macro. (S390_V0_LOWER_REGNUM, S390_V1_LOWER_REGNUM, S390_V2_LOWER_REGNUM) (S390_V3_LOWER_REGNUM, S390_V4_LOWER_REGNUM, S390_V5_LOWER_REGNUM) (S390_V6_LOWER_REGNUM, S390_V7_LOWER_REGNUM, S390_V8_LOWER_REGNUM) (S390_V9_LOWER_REGNUM, S390_V10_LOWER_REGNUM) (S390_V11_LOWER_REGNUM, S390_V12_LOWER_REGNUM) (S390_V13_LOWER_REGNUM, S390_V14_LOWER_REGNUM) (S390_V15_LOWER_REGNUM, S390_V16_REGNUM, S390_V17_REGNUM) (S390_V18_REGNUM, S390_V19_REGNUM, S390_V20_REGNUM) (S390_V21_REGNUM, S390_V22_REGNUM, S390_V23_REGNUM) (S390_V24_REGNUM, S390_V25_REGNUM, S390_V26_REGNUM) (S390_V27_REGNUM, S390_V28_REGNUM, S390_V29_REGNUM) (S390_V30_REGNUM, S390_V31_REGNUM): New macros. (S390_NUM_REGS): Adjust value. (s390_vxrs_low_regset, s390_vxrs_high_regset): Declare. (tdesc_s390_vx_linux64, tdesc_s390_tevx_linux64) (tdesc_s390x_vx_linux64, tdesc_s390x_tevx_linux64): Likewise. * NEWS: Announce S/390 vector register support.
2015-03-02S390: Add target descriptions for vector register setsAndreas Arnez17-1/+1311
The IBM z13 has new vector registers v0-v31 which are presented by the Linux kernel as two additional register sets. This patch adds XML descriptions and the respective autogenerated .c and .dat files for S390 targets with this feature. Note that supported combinations include targets with and without a transactional execution facility. gdb/ChangeLog: * features/s390-tevx-linux64.xml: New file. * features/s390-vx-linux64.xml: New file. * features/s390-vx.xml: New file. * features/s390x-tevx-linux64.xml: New file. * features/s390x-vx-linux64.xml: New file. * features/Makefile (WHICH): Add s390-vx-linux64, s390x-vx-linux64, s390-tevx-linux64, and s390x-tevx-linux64. (s390-vx-linux64-expedite, s390-tevx-linux64-expedite) (s390x-vx-linux64-expedite, s390x-tevx-linux64-expedite): New macros. * features/s390-tevx-linux64.c: New generated file. * features/s390-vx-linux64.c: Likewise. * features/s390x-tevx-linux64.c: Likewise. * features/s390x-vx-linux64.c: Likewise. * regformats/s390-tevx-linux64.dat: Likewise. * regformats/s390-vx-linux64.dat: Likewise. * regformats/s390x-tevx-linux64.dat: Likewise. * regformats/s390x-vx-linux64.dat: Likewise. gdb/doc/ChangeLog: * gdb.texinfo (S/390 and System z Features): Describe new feature "org.gnu.gdb.s390.vx".
2015-03-02Correct -z nocopyreloc docAlan Modra2-1/+6
This option is misnamed. It should probably be called -z nodynbss, but it's too late to change now. * ld.texinfo (Options <-z nocopyreloc>): Rewrite.
2015-03-02Automatic date update in version.inGDB Administrator1-1/+1
2015-03-01Fix 32-bit x86 in-process agent buildPedro Alves2-1/+6
Git commit 3c14e5a39bb4fddd added a declaration for gdb_agent_get_raw_reg to tracepoint.h, and this now caught that the 32-bit x86 implementation has the wrong prototype: ../../../src/gdb/gdbserver/linux-i386-ipa.c:103:1: error: conflicting types for ‘gdb_agent_get_raw_reg’ gdb_agent_get_raw_reg (unsigned char *raw_regs, int regnum) ^ In file included from ../../../src/gdb/gdbserver/linux-i386-ipa.c:24:0: ../../../src/gdb/gdbserver/tracepoint.h:168:31: note: previous declaration of ‘gdb_agent_get_raw_reg’ was here IP_AGENT_EXPORT_FUNC ULONGEST gdb_agent_get_raw_reg ^ make[2]: *** [linux-i386-ipa.o] Error 1 gdb/gdbserver/ 2015-03-01 Pedro Alves <palves@redhat.com> * linux-i386-ipa.c (gdb_agent_get_raw_reg): Constify 'raw_regs' parameter.
2015-03-01Automatic date update in version.inGDB Administrator1-1/+1
2015-02-28objcopy: Add --update-section option.Andrew Burgess10-0/+249
New option for objcopy --update-section allows the contents of a section to be updated while maintaining the section flags, and, for ELF files, the section to segment mapping. New test uses --dump-section and --update-section to check that a section can be made larger and smaller with an update. binutils/ChangeLog: * objcopy.c (update_sections): New list. (command_line_switch): Add OPTION_UPDATE_SECTION. (copy_options): Add update-section. (copy_usage): Document new option. (is_update_section): New function. (is_strip_section_1): Add check for attempt to update and remove the same section. (copy_object): Update size and content of requested sections. (skip_section): Don't copy for updated sections. (copy_main): Handle --update-section. * doc/binutils.texi (objcopy): Add description of --update-section option. * NEWS: Mention --update-section option. binutils/testsuite/ChangeLog: * binutils-all/update-1.s: New file. * binutils-all/update-2.s: New file. * binutils-all/update-3.s: New file. * binutils-all/update-4.s: New file. * binutils-all/update-section.exp: New file.
2015-02-28symtab.h (struct symtab) <next>: Fix comment.Doug Evans2-1/+6
gdb/ChangeLog: * symtab.h (struct symtab) <next>: Fix comment.
2015-02-28Pad only text sections at end by defaultAlan Modra12-39/+56
gas/ * write.c (SUB_SEGMENT_ALIGN): Don't pad non-code sections at end to their alignment. gas/testsuite/ * gas/sparc/pcrel.d: Update for changed padding in data sections. * gas/sparc/pcrel64.d: Likewise. ld/testsuite/ * ld-sparc/gotop32.rd: Update for changed padding in data sections. * ld-sparc/gotop32.td: Likewise. * ld-sparc/gotop64.rd: Likewise. * ld-sparc/gotop64.td: Likewise. * ld-tilegx/external.s: Align .data. * ld-tilepro/external.s: Likewise.
2015-02-28Tweak ppc32 tls_get_addr optimisationAlan Modra2-0/+8
This patch is cosmetic. It prevents references to __tls_get_addr_opt (an alias for __tls_get_addr) when the optimisation isn't possible. * elf32-ppc.c (ppc_elf_tls_setup): Set no_tls_get_addr_opt if not PLT_NEW.
2015-02-28Automatic date update in version.inGDB Administrator1-1/+1
2015-02-27Fix Python 3 build: rename GdbMethodsSimon Marchi2-1/+6
Rename forgotten GdbMethods to python_GdbMethods. gdb/ChangeLog: * python/python.c (python_GdbModuleDef): Rename GdbMethods to python_GdbMethods.
2015-02-27Convert mov to lea only if neededH.J. Lu3-4/+31
We can convert mov to lea only if there are R_386_GOT32/R_X86_64_GOTPCREL relocations against non IFUNC symbols. * elf32-i386.c (need_convert_mov_to_lea): New. (elf_i386_check_relocs): Set need_convert_mov_to_lea if needed. (elf_i386_convert_mov_to_lea): Return TRUE if need_convert_mov_to_lea is unset. * elf64-x86-64.c (need_convert_mov_to_lea): New. (elf_x86_64_check_relocs): Set need_convert_mov_to_lea if needed. (elf_x86_64_convert_mov_to_lea): Return TRUE if need_convert_mov_to_lea is unset.
2015-02-27More redefinition errors in C++ modePedro Alves2-2/+6
In C++, we can't forward declare objects like in C. The compiler complains about symbol redefinition. Most cases of this were fixed in e36122e9, but dtrace probes introduced a new one meanwhile. This patch fixes it the same way e36122e9 fixed the others. gdb/ 2015-02-27 Pedro Alves <palves@redhat.com> * dtrace-probe.c (dtrace_probe_ops): Make extern.
2015-02-27Move exception_none to common code, and use itPedro Alves5-8/+17
gdb/ChangeLog: 2015-02-27 Pedro Alves <palves@redhat.com> * common/common-exceptions.h (exception_none): Declare. * common/common-exceptions.c (exception_none): Moved from exceptions.c. (exceptions_state_mc_init): Use exception_none. * exceptions.c (exception_none): Move to common/common-exceptions.c. * exceptions.h (exception_none): Move to common/common-exceptions.h.
2015-02-27catch_command_errors: Remove 'mask' parameterPedro Alves5-29/+37
All callers of catch_command_errors pass RETURN_MASK_ALL as mask argument. This patch eliminates the mask parameter as unnecessary. gdb/ChangeLog: 2015-02-27 Pedro Alves <palves@redhat.com> * main.c (catch_command_errors, catch_command_errors_const): Remove 'mask' argument. Adjust. (captured_main): Adjust callers. gdb/testsuite/ChangeLog: 2015-02-27 Pedro Alves <palves@redhat.com> * gdb.gdb/python-interrupts.exp (test_python_interrupts): Adjust call to catch_command_errors. * gdb.gdb/python-selftest.exp (selftest_python): Adjust call to catch_command_errors.
2015-02-27Adjust self tests to cope with GDB built as a C++ programPedro Alves3-3/+16
gdb/testsuite/ 2015-02-27 Pedro Alves <palves@redhat.com> * gdb.gdb/complaints.exp (test_initial_complaints): Also accept "true" for boolean result. * gdb.gdb/selftest.exp (test_with_self): Also accept full prototype of main.
2015-02-27python/python-internal.h: enum ‘ext_lang_rc’ not definedPedro Alves2-0/+5
Fixes this in C++ mode: src/gdb/python/python-internal.h: At global scope: src/gdb/python/python-internal.h:313:13: error: use of enum ‘ext_lang_rc’ without previous declaration extern enum ext_lang_rc gdbpy_apply_val_pretty_printer ^ src/gdb/python/python-internal.h:320:41: error: invalid type in declaration before ‘;’ token const struct language_defn *language); ^ gdb/ChangeLog: 2015-02-27 Pedro Alves <palves@redhat.com> * python/python-internal.h: Include "extension-priv.h".
2015-02-27breakpoint.h: move enum ‘print_stop_action’Pedro Alves2-20/+25
Building GDB in C++, we get: src/gdb/breakpoint.h:529:8: error: use of enum ‘print_stop_action’ without previous declaration We can't forward declare enums in C++. gdb/ChangeLog: 2015-02-27 Pedro Alves <palves@redhat.com> * breakpoint.h (enum print_stop_action): Move further up in the file.
2015-02-27gdbarch.h: include regcache.hPedro Alves3-0/+9
Building GDB in C++ mode, I got: src/gdb/gdbarch.h:240:149: error: invalid type in declaration before ‘;’ token src/gdb/gdbarch.h:240:14: error: use of enum ‘register_status’ without previous declaration src/gdb/gdbarch.h:241:13: error: use of enum ‘register_status’ without previous declaration src/gdb/gdbarch.h:241:140: error: invalid type in declaration before ‘;’ token That's because 'enum register_status' has not been declared (and we can't forward declare enums in C++). gdb/ChangeLog: 2015-02-27 Pedro Alves <palves@redhat.com> * gdbarch.sh: Include regcache.h. * gdbarch.h: Regenerate.
2015-02-27Remove duplicate constPedro Alves3-3/+10
Building --enable-targets=all in C++ mode fails with: gdb/sparc-sol2-tdep.c:179:7: error: duplicate ‘const’ gdb/arm-tdep.c:13878:33: error: duplicate ‘const’ gdb/arm-tdep.c:13891:33: error: duplicate ‘const’ gdb/ChangeLog: 2015-02-27 Pedro Alves <palves@redhat.com> * arm-tdep.c (decode_insn) <arm_handle_insn, thumb_handle_insn>: Remove duplicate const. * sparc-sol2-tdep.c (sparc_sol2_static_transform_name): Remove duplicate const.
2015-02-27Exported const objectsPedro Alves4-3/+16
const works different in C vs C++. In C++, a global "const" variable has internal linkage by default, resulting in link errors like: ... extension.o: In function `get_ext_lang_defn(extension_language)': gdb/extension.c:126: undefined reference to `extension_language_guile' gdb/extension.c:124: undefined reference to `extension_language_guile' ... The fix is to define exported const objects with "extern const". But that in C would not be a definition. So we need to #ifdef C vs C++ in this case. EXPORTED_CONST comes from include/ansidecl.h, but in the feature_to_c.sh case I think it's better to leave the script with no dependencies. gdb/ChangeLog: 2015-02-27 Pedro Alves <palves@redhat.com> * cp-valprint.c (vtbl_ptr_name): Use EXPORTED_CONST. * guile/guile.c (extension_language_guile): Use EXPORTED_CONST. * features/feature_to_c.sh: Tag the generated xml_builtin array with extern const in C++ mode.
2015-02-27Rename struct lzma_stream to avoid clash with system headerTom Tromey2-11/+17
/home/pedro/gdb/mygit/src/gdb/minidebug.c: At global scope: /home/pedro/gdb/mygit/src/gdb/minidebug.c:55:8: error: using typedef-name ‘lzma_stream’ after ‘struct’ struct lzma_stream ^ In file included from /usr/include/lzma.h:281:0, from /home/pedro/gdb/mygit/src/gdb/minidebug.c:28: /usr/include/lzma/base.h:498:3: note: ‘lzma_stream’ has a previous declaration here } lzma_stream; ^ gdb/ChangeLog: 2015-02-27 Tom Tromey <tromey@redhat.com> * minidebug.c (struct lzma_stream): Rename to ... (struct gdb_lzma_stream): ... this. (lzma_open, lzma_pread, lzma_close, lzma_stat): Adjust.
2015-02-27mi/mi-cmd-stack.c|frame filters: print_values <-> ext_lang_frame_argsPedro Alves2-7/+31
The enums are value compatible by design, but building in C++ mode trips on them, like: ... gdb/mi/mi-cmd-stack.c:363:34: error: cannot convert ‘print_values’ to ‘ext_lang_frame_args’ for argument ‘3’ to ‘ext_lang_bt_status apply_ext_lang_frame_filter(frame_info*, int, ext_lang_frame_args, ui_out*, int, int)’ ... Fix this by adding a helper function. gdb/ChangeLog: 2015-02-27 Pedro Alves <palves@redhat.com> * mi/mi-cmd-stack.c (mi_apply_ext_lang_frame_filter): New function. (mi_cmd_stack_list_locals, mi_cmd_stack_list_args) (mi_cmd_stack_list_variables): Use it.
2015-02-27x86 Linux/ptrace: fix offsetof usage in C++ modePedro Alves4-8/+37
In C++ mode, we get: gdb/gdbserver/linux-x86-low.c: In function ‘void x86_linux_dr_set(ptid_t, int, long unsigned int)’: gdb/gdbserver/linux-x86-low.c:558:38: error: ‘regnum’ cannot appear in a constant-expression offsetof (struct user, u_debugreg[regnum]), value); ^ gdb/gdbserver/ChangeLog: 2015-02-27 Pedro Alves <palves@redhat.com> * linux-x86-low.c (u_debugreg_offset): New function. (x86_linux_dr_get, x86_linux_dr_set): Use it. gdb/ChangeLog: 2015-02-27 Pedro Alves <palves@redhat.com> * x86-linux-nat.c (u_debugreg_offset): New function. (x86_linux_dr_get, x86_linux_dr_set): Use it.
2015-02-27Don't forward declare enum target_hw_bp_typePedro Alves2-2/+7
Can't do that in C++. 2015-02-27 Pedro Alves <palves@redhat.com> * nat/x86-dregs.h (enum target_hw_bp_type): Remove forward declaration. Include break-common.h.
2015-02-27Do not increment of decrement enumsTom Tromey9-17/+32
In C++, we can't do arithmetic on enums. This patch fixes build errors like: src/gdb/i386-tdep.c: In function ‘int i386_stap_parse_special_token(gdbarch*, stap_parse_info*)’: src/gdb/i386-tdep.c:4309:7: error: no match for ‘operator++’ (operand type is ‘i386_stap_parse_special_token(gdbarch*, stap_parse_info*)::<anonymous enum>’) ++current_state; ^ ... src/gdb/rs6000-tdep.c:4265:18: error: no match for ‘operator++’ (operand type is ‘powerpc_vector_abi’) src/gdb/arm-tdep.c:9428:71: error: no match for ‘operator++’ (operand type is ‘arm_float_model’) src/gdb/arm-tdep.c:9465:64: error: no match for ‘operator++’ (operand type is ‘arm_abi_kind’) ... gdb/ChangeLog: 2015-02-27 Tom Tromey <tromey@redhat.com> Pedro Alves <palves@redhat.com> * arm-tdep.c (set_fp_model_sfunc, arm_set_abi): Use 'int' for local used to iterate over enums. * completer.c (signal_completer): Likewise. * i386-tdep.c (i386_stap_parse_special_token): Likewise. * rs6000-tdep.c (powerpc_set_vector_abi): Likewise. * tui/tui-data.c (tui_next_win, tui_prev_win): Likewise. * tui/tui-layout.c (next_layout, prev_layout): Likewise. * tui/tui-win.c (tui_refresh_all_win, tui_rehighlight_all) (tui_resize_all, tui_set_focus_command, tui_all_windows_info): Likewise. * tui-wingeneral.c (tui_refresh_all): Likewise.
2015-02-27target.h: Include infrun.hPedro Alves2-0/+6
Fixes: src/gdb/target.h:753:10: error: use of enum ‘exec_direction_kind’ without previous declaration in C++ mode. We can't forward declare enums. gdb/ChangeLog: 2015-02-27 Pedro Alves <palves@redhat.com> * target.h: Include "infrun.h".
2015-02-27proc-service, extern "C"Pedro Alves5-2/+107
libthread_db.so calls symbols in the client (GDB), through the proc-service interface. These routines must have extern "C" linkage so their symbol names are not mangled when GDB is built as a C++ program. On the GDBserver side, we were missing fallback declarations for all these symbols. gdb/ChangeLog: 2015-02-27 Pedro Alves <palves@redhat.com> * gdb_proc_service.h: Wrap with EXTERN_C_PUSH/EXTERN_C_POP. gdb/gdbserver/ChangeLog: 2015-02-27 Pedro Alves <palves@redhat.com> * gdb_proc_service.h: Wrap with EXTERN_C_PUSH/EXTERN_C_POP. [!HAVE_PROC_SERVICE_H] (struct ps_prochandle): Forward declare. [!HAVE_PROC_SERVICE_H] (ps_pdread, ps_pdwrite, ps_ptread) ps_ptwrite, ps_lgetregs, ps_lsetregs, ps_lgetfpregs) (ps_lsetfpregs, ps_getpid) (ps_get_thread_area, ps_pglobal_lookup, ps_pstop, ps_pcontinue) (ps_lstop, ps_lcontinue, ps_lgetxregsize, ps_lgetxregs) (ps_lsetxregs, ps_plog): Declare.
2015-02-27Make functions and variables exported by the IPA be extern "C"Pedro Alves8-103/+201
Functions and variables that are exported by the IPA DSO (that GDBserver needs to look up) should have "C" mangling, thus be declared with extern "C". Function and variable declarations need the extern "C" marker, but variable definitions can't be marked extern, so the patch splits IP_AGENT_EXPORT into three. Building in C++ mode revealed that a few variables were missing IP_AGENT_EXPORT, thus the IPA has been broken when stripped, even in C mode... So this ends being a bug fix as well. gdb/ChangeLog: 2015-02-27 Pedro Alves <palves@redhat.com> * common/agent.h (IPA_SYM_EXPORTED_NAME): New. (IPA_SYM): Use it. * common/common-defs.h (EXTERN_C_PUSH, EXTERN_C_POP): New macros. gdb/gdbserver/ChangeLog: 2015-02-27 Pedro Alves <palves@redhat.com> * linux-amd64-ipa.c (gdb_agent_get_raw_reg): Use IP_AGENT_EXPORT_FUNC. * linux-i386-ipa.c (gdb_agent_get_raw_reg): Use IP_AGENT_EXPORT_FUNC. * tracepoint.c (ATTR_USED, ATTR_NOINLINE, ATTR_CONSTRUCTOR) (IP_AGENT_EXPORT): Delete. (gdb_tp_heap_buffer, gdb_jump_pad_buffer, gdb_jump_pad_buffer_end) (gdb_trampoline_buffer, gdb_trampoline_buffer_end) (gdb_trampoline_buffer_error, collecting, gdb_collect) (stop_tracing, flush_trace_buffer, about_to_request_buffer_space) (trace_buffer_is_full, stopping_tracepoint, expr_eval_result) (error_tracepoint, tracepoints, tracing, trace_buffer_ctrl) (trace_buffer_ctrl_curr, trace_buffer_lo, trace_buffer_hi) (traceframe_read_count, traceframe_write_count) (traceframes_created, trace_state_variables, get_raw_reg) (get_trace_state_variable_value, set_trace_state_variable_value) (ust_loaded, helper_thread_id, cmd_buf): Use IPA_SYM_EXPORTED_NAME. (stop_tracing, flush_trace_buffer): Use IP_AGENT_EXPORT_FUNC. (tracepoints) Use IP_AGENT_EXPORT_VAR. (stopping_tracepoint, trace_buffer_is_full, expr_eval_result): Use IP_AGENT_EXPORT_VAR and wrap in EXTERN_C_PUSH/EXTERN_C_POP. (last_tracepoint): Move into !IN_PROCESS_AGENT block. (error_tracepoint): Use IP_AGENT_EXPORT_VAR and wrap in EXTERN_C_PUSH/EXTERN_C_POP. (trace_state_variables): Use IP_AGENT_EXPORT_VAR. (trace_buffer_lo, trace_buffer_hi): Use IP_AGENT_EXPORT_VAR and wrap in EXTERN_C_PUSH/EXTERN_C_POP. (trace_buffer_ctrl, trace_buffer_ctrl_curr) (traceframe_write_count, traceframe_read_count) (traceframes_created, tracing): Use IP_AGENT_EXPORT_VAR. (about_to_request_buffer_space, get_trace_state_variable_value) (set_trace_state_variable_value): Use IP_AGENT_EXPORT_FUNC. (collecting): Use IP_AGENT_EXPORT_VAR and wrap in EXTERN_C_PUSH/EXTERN_C_POP. (gdb_collect): Use IP_AGENT_EXPORT_FUNC. (ust_loaded, cmd_buf): Use IP_AGENT_EXPORT_VAR. (helper_thread_id, gdb_agent_capability): Use IP_AGENT_EXPORT_VAR and wrap in EXTERN_C_PUSH/EXTERN_C_POP. (gdb_tp_heap_buffer, gdb_jump_pad_buffer, gdb_jump_pad_buffer_end) (gdb_trampoline_buffer, gdb_trampoline_buffer_end) (gdb_trampoline_buffer_error): Use IP_AGENT_EXPORT_VAR. * tracepoint.h (ATTR_USED, ATTR_NOINLINE, EXPORTED_SYMBOL): Define. (IP_AGENT_EXPORT_FUNC, IP_AGENT_EXPORT_VAR) (IP_AGENT_EXPORT_VAR_DECL): Define. (tracing): Declare. (gdb_agent_get_raw_reg): Declare.
2015-02-27Add extern "C" to declarations of C symbolsPedro Alves7-13/+40
These symbols are defined in C code, so in C++ mode we need to use extern "C" to declare them. As extern "C" can't be used inside a function's scope, we move the declarations to the global scope at the same time. gdb/ChangeLog: 2015-02-27 Pedro Alves <palves@redhat.com> * cli-out.c (_rl_erase_entire_line): Move declaration out of cli_mld_erase_entire_line, and make it extern "C". * common/common-defs.h (EXTERN_C): New. * completer.c (_rl_completion_prefix_display_length) (_rl_print_completions_horizontally, QSFUNC): Move declarations out of gdb_display_match_list_1. (_rl_qsort_string_compare): Move declaration out of gdb_display_match_list_1, and make it extern "C". * defs.h (re_comp): Use EXTERN_C. * maint.c (_mcleanup): Move declaration out of mcleanup_wrapper, and make it extern "C". (monstartup): Move declaration out of maintenance_set_profile_cmd, and make it extern "C". (main): Move declaration out of maintenance_set_profile_cmd. * nat/linux-ptrace.c (linux_ptrace_attach_fail_reason_string): Use EXTERN_C.
2015-02-27Make array object externPedro Alves2-6/+13
Compiling python.c in C++ mode, we get: ...src/gdb/python/python.c: At global scope: ...src/gdb/python/python.c:106:31: error: storage size of ‘GdbMethods’ isn’t known static PyMethodDef GdbMethods[]; ^ Fix it by making the affected array objects extern. gdb/ChangeLog: 2015-02-27 Pedro Alves <palves@redhat.com> * python/python.c (GdbMethods): Rename to ... (python_GdbMethods): ... this and make extern. (GdbModuleDef): Rename to ... (python_GdbModuleDef): ... this and make extern.
2015-02-27record-btrace.c: Remove redefinitionsPedro Alves2-4/+5
The set_record_btrace_cmdlist and show_record_btrace_cmdlist objects are declared twice in the file, seemingly a simply copy/paste oversight. In C, the first time counts as forward declaration, but in C++, they are all definitions. That results in: src/gdb/record-btrace.c:80:33: error: redefinition of ‘cmd_list_element* set_record_btrace_cmdlist’ src/gdb/record-btrace.c:61:33: error: ‘cmd_list_element* set_record_btrace_cmdlist’ previously declared here src/gdb/record-btrace.c:81:33: error: redefinition of ‘cmd_list_element* show_record_btrace_cmdlist’ src/gdb/record-btrace.c:62:33: error: ‘cmd_list_element* show_record_btrace_cmdlist’ previously declared here gdb/ChangeLog: 2015-02-27 Pedro Alves <palves@redhat.com> * record-btrace.c (set_record_btrace_cmdlist) (show_record_btrace_cmdlist): Remove redefinitions. --- gdb/record-btrace.c | 4 ---- 1 file changed, 4 deletions(-)
2015-02-27Fix struct, union, and enum nesting in C++Tom Tromey15-534/+649
In C, an enum or structure defined inside other structure has global scope just like it had been defined outside the struct in the first place. However, in C++, such a nested structure is given a name that is nested inside the structure. This patch moves such affected structures/enums out to global scope, so that code using them works the same in C++ as it works today in C. gdb/ChangeLog: 2015-02-27 Tom Tromey <tromey@redhat.com> Pedro Alves <palves@redhat.com> * dwarf2-frame.c (enum cfa_how_kind, struct dwarf2_frame_state_reg_info): Move out of struct dwarf2_frame_state. * dwarf2read.c (struct tu_stats): Move out of struct dwarf2_per_objfile. (struct file_entry): Move out of struct line_header. (struct nextfield, struct nextfnfield, struct fnfieldlist, struct typedef_field_list): Move out of struct field_info. * gdbtypes.h (enum dynamic_prop_kind, union dynamic_prop_data): Move out of struct dynamic_prop. (union type_owner, union field_location, struct field, struct range_bounds, union type_specific): Move out of struct main_type. (struct fn_fieldlist, struct fn_field, struct typedef_field) (VOFFSET_STATIC): Move out of struct cplus_struct_type. (struct call_site_target, union call_site_parameter_u, struct call_site_parameter): Move out of struct call_site. * m32c-tdep.c (enum m32c_prologue_kind): Move out of struct m32c_prologue. (enum srcdest_kind): Move out of struct srcdest. * main.c (enum cmdarg_kind): Move out of struct cmdarg. * prologue-value.h (enum prologue_value_kind): Move out of struct prologue_value. * s390-linux-tdep.c (enum s390_abi_kind): Move out of struct gdbarch_tdep. * stabsread.c (struct nextfield, struct next_fnfieldlist): Move out of struct field_info. * symfile.h (struct other_sections): Move out of struct section_addr_info. * symtab.c (struct symbol_cache_slot): Move out struct block_symbol_cache. * target-descriptions.c (enum tdesc_type_kind): Move out of typedef struct tdesc_type. * tui/tui-data.h (enum tui_line_or_address_kind): Move out of struct tui_line_or_address. * value.c (enum internalvar_kind, union internalvar_data): Move out of struct internalvar. * xtensa-tdep.h (struct ctype_cache): Move out of struct gdbarch_tdep.
2015-02-27C++ keyword cleanliness, mostly auto-generatedPedro Alves99-1127/+1140
This patch renames symbols that happen to have names which are reserved keywords in C++. Most of this was generated with Tromey's cxx-conversion.el script. Some places where later hand massaged a bit, to fix formatting, etc. And this was rebased several times meanwhile, along with re-running the script, so re-running the script from scratch probably does not result in the exact same output. I don't think that matters anyway. gdb/ 2015-02-27 Tom Tromey <tromey@redhat.com> Pedro Alves <palves@redhat.com> Rename symbols whose names are reserved C++ keywords throughout. gdb/gdbserver/ 2015-02-27 Tom Tromey <tromey@redhat.com> Pedro Alves <palves@redhat.com> Rename symbols whose names are reserved C++ keywords throughout.
2015-02-27Add --enable-build-with-cxx configure switchPedro Alves11-31/+908
This new option, disabled by default for now, allows specifying whether to build GDB, GDBserver, and friends with a C++ (98/03) compiler. The name of the switch should be familiar to those who followed GCC's own C++ conversion process. . Adding -fpermissive to COMPILER in C++ mode (see the new build-with-cxx.m4 file) makes errors like these be warnings instead: gdb/infrun.c:6597:1: error: initializing argument 1 of ‘void sig_print_info(gdb_signal)’ [-fpermissive] sig_print_info (enum gdb_signal oursig) ^ gdb/infrun.c: In function ‘void do_restore_infcall_suspend_state_cleanup(void*)’: gdb/infrun.c:7164:39: error: invalid conversion from ‘void*’ to ‘infcall_suspend_state*’ [-fpermissive] restore_infcall_suspend_state (state); ^ so that the compiler carries on compiling the file. -Werror still catches the warnings, so nothing is lost, only our lifes are made easier by concentrating on getting other more important things out of the way first. There's no way to quiet those warnings. Until they're all fixed, when building in C++ mode, -Werror is disabled by default. . Adding -Wno-narrowing suppresses thousands of instances of this warning: gdb/arm-linux-tdep.c:439:1: error: narrowing conversion of ‘-1’ from ‘int’ to ‘ULONGEST {aka long unsigned int}’ inside { } is ill-formed in C++11 [-Werror=narrowing] gdb/arm-linux-tdep.c:439:1: error: narrowing conversion of ‘-1l’ from ‘LONGEST {aka long int}’ to ‘ULONGEST {aka long unsigned int}’ inside { } is ill-formed in C++11 [-Werror=narrowing] gdb/arm-linux-tdep.c:450:1: error: narrowing conversion of ‘-1’ from ‘int’ to ‘ULONGEST {aka long unsigned int}’ inside { } is ill-formed in C++11 [-Werror=narrowing] We can defer handling those until we target C++11. . Adding -Wno-sign-compare suppresses thousands of instances of this warning: gdb/linux-record.c:1763:32: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] if (tmpulongest == tdep->fcntl_F_GETLK64) ^ . Adding -Wno-write-strings suppresses thousands of instances of this warning: gdb/mi/mi-cmd-var.c: In function ‘void mi_cmd_var_show_attributes(char*, char**, int)’: gdb/mi/mi-cmd-var.c:514:12: warning: deprecated conversion from string constant to ‘char*’ [-Wwrite-strings] attstr = "editable"; ^ gdb/mi/mi-cmd-var.c:516:12: warning: deprecated conversion from string constant to ‘char*’ [-Wwrite-strings] attstr = "noneditable"; ^ For now, it's best to hide these warnings from view until we're '-fpermissive'-clean, and can thus start building with -Werror. The C compiler has always managed to build working GDBs with these issues in the code, so a C++ compiler should too. gdb/ChangeLog: 2015-02-27 Pedro Alves <palves@redhat.com> * Makefile.in (COMPILER): New, get it from autoconf. (COMPILE.pre, CC_LD): Use COMPILER. (CXX): Get from autoconf instead. (CXX_FOR_TARGET): Default to g++ instead of gcc. * acinclude.m4: Include build-with-cxx.m4. * build-with-cxx.m4: New file. * configure.ac: Call AC_PROG_CXX and GDB_AC_BUILD_WITH_CXX. Disable -Werror by default if building in C++ mode. (build_warnings): Add -Wno-sign-compare, -Wno-write-strings and -Wno-narrowing in C++ mode. Only enable -Wpointer-sign in C mode. Run supported-warning-flags tests with the C++ compiler. Save/restore CXXFLAGS too. * configure: Regenerate. gdb/gdbserver/ChangeLog: 2015-02-27 Pedro Alves <palves@redhat.com> * Makefile.in (COMPILER): New, get it from autoconf. (CXX): Get from autoconf instead. (COMPILE.pre): Use COMPILER. (CC-LD): Rename to ... (CC_LD): ... this. Use COMPILER. (gdbserver$(EXEEXT), gdbreplay$(EXEEXT), $(IPA_LIB)): Adjust. (CXX_FOR_TARGET): Default to g++ instead of gcc. * acinclude.m4: Include build-with-cxx.m4. * configure.ac: Call AC_PROG_CXX and GDB_AC_BUILD_WITH_CXX. Disable -Werror by default if building in C++ mode. (build_warnings): Add -Wno-sign-compare, -Wno-write-strings and -Wno-narrowing in C++ mode. Run supported-warning-flags tests with the C++ compiler. Save/restore CXXFLAGS too. * configure: Regenerate.
2015-02-27Fixes a problem with the linker script parser not always handling the ! ↵Nick Clifton2-1/+15
character in memort region attributes. PR ld/17900 * ldlang.c (lang_set_flags): Allow exclamation mark to reverse the sense of the following memory region attribute characters.
2015-02-27Create libiberty.m4, have GDB and GDBserver use itPedro Alves11-54/+694
Converting GDB to be a C++ program, I stumbled on 'basename' issues, like: src/gdb/../include/ansidecl.h:169:64: error: new declaration ‘char* basename(const char*)’ /usr/include/string.h:597:26: error: ambiguates old declaration ‘const char* basename(const char*)’ which I believe led to this bit in gold's configure.ac: dnl We have to check these in C, not C++, because autoconf generates dnl tests which have no type information, and current glibc provides dnl multiple declarations of functions like basename when compiling dnl with C++. AC_CHECK_DECLS([basename, ffs, asprintf, vasprintf, snprintf, vsnprintf, strverscmp]) These checks IIUC intend to generate all the HAVE_DECL_FOO symbols that libiberty.h and ansidecl.h check. GDB is missing these checks currently, which results in the conflict shown above. This adds an m4 file that both GDB and GDBserver's configury use to pull in the autoconf checks that libiberty clients needs done in order to use these libiberty.h/ansidecl.h. gdb/ChangeLog: 2015-02-27 Pedro Alves <palves@redhat.com> * libiberty.m4: New file. * acinclude.m4: Include libiberty.m4. * configure.ac: Call libiberty_INIT. * config.in, configure: Regenerate. gdb/gdbserver/ 2015-02-27 Pedro Alves <palves@redhat.com> * acinclude.m4: Include libiberty.m4. * configure.ac: Call libiberty_INIT. * config.in, configure: Regenerate.
2015-02-27Fixes a problem recognizing libraries created by Visual Studio.Nick Clifton2-1/+11
PR binutils/17910 * coffgen.c (_bfd_coff_internal_syment_name): Only check for string length overflow when the string table length is actually set.
2015-02-27Add "../lib/unbuffer_output.c" and use it in gdb.base/interrupt.cPedro Alves3-0/+50
In some scenarios, GDB or GDBserver can be spawned with input _not_ connected to a tty, and then tests that rely on stdio fail with timeouts, because the inferior's stdout and stderr streams end up fully buffered. See discussion here: https://sourceware.org/ml/gdb-patches/2015-02/msg00809.html We have a hack in place that works around this for Windows testing, that forces every test program to link with an .o file that does (lib/set_unbuffered_mode.c): static int __gdb_set_unbuffered_output (void) __attribute__ ((constructor)); static int __gdb_set_unbuffered_output (void) { setvbuf (stdout, NULL, _IONBF, BUFSIZ); setvbuf (stderr, NULL, _IONBF, BUFSIZ); } That's a bit hacky; it ends up done for _all_ tests. This patch adds a way to do this unbuffering explicitly from the test code itself, so it is done only when necessary, and for all targets/hosts. For starters, it adjusts gdb.base/interrupt.c to use it. Tested on x86_64 Fedora 20, native, and against a remote gdbserver board file that connects to the target with ssh, with and without -t (create pty). gdb/testsuite/ 2015-02-27 Pedro Alves <palves@redhat.com> * lib/unbuffer_output.c: New file. * gdb.base/interrupt.c: Include "../lib/unbuffer_output.c". (main): Call gdb_unbuffer_output.
2015-02-27Don't skip catch-syscall.exp on hppa*-hp-hpux* targetYao Qi2-7/+6
As far as I know, "catch syscall" is supported on hppa*-hp-hpux*, but the test catch-syscall.exp is skipped on this target by mistake. This patch is to fix it. However, I don't have a hpux machine to test. gdb/testsuite: 2015-02-27 Yao Qi <yao.qi@linaro.org> * gdb.base/catch-syscall.exp: Don't skip it on hppa*-hp-hpux* target.
2015-02-27Regenerate bfd-in2.h and libbfd.hMarcus Shawcroft3-0/+9
2015-02-27Fixes problems building the V850 simulator introduced with the previous delta.Nick Clifton6-206/+305
* sim-main.h (reg64_t): New type. (v850_regs): Add selID_sregs field. (VR, SAT16, SAT32, ABS16, ABS32 ): New macros. * v850-dc: Add fields for v850e3v5 instructions. * v850.igen (cvtf.dl): Use correctly signed local value. (cvtf.dw, cvtf.sw, trncf.dul, trncf.dl, trncf.sul, trncf.sw): Likewise. * interp.c: Fix old style function declarations. * simops.c: Likewise.
2015-02-27S390: Fix compiler invocation with "compile" commandAndreas Arnez2-3/+25
On 64-bit S390 platforms the "compile" command always failed because gcc was not invoked correctly. This patch fixes the compiler invocation. gdb/ChangeLog: * s390-linux-tdep.c (s390_gcc_target_options): Not just handle 31-bit targets, but 64-bit targets as well. (s390_gnu_triplet_regexp): New function. (s390_gdbarch_init): Set the gcc_target_options gdbarch method for 64-bit targets as well. Set the gnu_triplet_regexp gdbarch method.
2015-02-27Mark latest entry in gdb/ChangeLog as "(tiny patch)".Joel Brobecker1-1/+1
2015-02-27Retrieve segment registers on Windows amd64Jon TURNEY2-3/+9
For amd64, CONTEXT_FULL does not contain CONTEXT_SEGMENTS, which seems to be needed to retrieve all the segment registers. Add it explicitly, with a little de-cruftification. The value of the segment registers isn't terribly useful on amd64, but at least this makes the output of 'info registers' correct. Before: (gdb) i r cs ss ds es fs gs cs 0x33 51 ss 0x2b 43 ds 0x0 0 es 0x0 0 fs 0x0 0 gs 0x0 0 After: (gdb) i r cs ss ds es fs gs cs 0x33 51 ss 0x2b 43 ds 0x2b 43 es 0x2b 43 fs 0x53 83 gs 0x2b 43 gdb/ChangeLog 2015-02-27 Jon TURNEY <jon.turney@dronecode.org.uk> * windows-nat.c (CONTEXT_DEBUGGER): Remove. (CONTEXT_DEBUGGER_DR): Add CONTEXT_SEGMENTS. Incorporate flags from CONTEXT_DEBUGGER.
2015-02-27Adjust ChangeLog entry.Marcus Shawcroft1-1/+2
2015-02-26Add missing CHECK_TYPEDEF calls to recent vptr_{fieldno,basetype} cleanup.Doug Evans8-1/+83
gdb/ChangeLog: * gdbtypes.c (internal_type_vptr_fieldno): Add missing call to CHECK_TYPEDEF. (set_type_vptr_fieldno): Ditto. (internal_type_vptr_basetype, set_type_vptr_basetype): Ditto. * gnu-v3-abi.c (gnuv3_dynamic_class): Ditto. gdb/testsuite/ChangeLog: * gdb.cp/class2.cc (Dbase, D): New classes. (main): New local delta. * gdb.cp/class2.exp: Test printing delta. * gdb.cp/classes.cc (DynamicBase2, DynamicBar): New classes. (dynbar): New global. * gdb.cp/classes.exp (test_ptype_class_objects): Test ptype DynamicBar.