aboutsummaryrefslogtreecommitdiff
path: root/gdb/doc
AgeCommit message (Collapse)AuthorFilesLines
2017-03-28arc: Add prologue analysisAnton Kolesov2-2/+5
Add a prologue analysis that recognizes all instructions that may happen in compiler-generated prologue, including various stores, core register moves, subtraction and ENTER_S instruction that does a lot of prologue actions through microcode. Testcases cover various prologue scenarios, including instructions that are spread across multiple 16-bit encodings (for example there are 7 encodings of store instruction). gdb/ChangeLog: yyyy-mm-dd Anton Kolesov <anton.kolesov@synopsys.com> * arc-tdep.c (arc_frame_cache): Add support for prologue analysis. (arc_skip_prologue): Likewise. (arc_make_frame_cache): Likewise. (arc_pv_get_operand): New function. (arc_is_in_prologue): Likewise. (arc_analyze_prologue): Likewise. (arc_print_frame_cache): Likewise. (MAX_PROLOGUE_LENGTH): New constant. gdb/doc/ChangeLog: yyyy-mm-dd Anton Kolesov <anton.kolesov@synopsys.com> * gdb.texinfo (Synopsys ARC): Document "set debug arc 2". gdb/testsuite/ChangeLog: yyyy-mm-dd Anton Kolesov <anton.kolesov@synopsys.com> * gdb.arch/arc-analyze-prologue.S: New file. * gdb.arch/arc-analyze-prologue.exp: Likewise.
2017-03-28arc: Add disassembler helperAnton Kolesov2-0/+8
Add disassembler helper for GDB, that uses opcodes structure arc_instruction and adds convenience functions to handle instruction operands. This interface solves at least those problems with arc_instruction: * Some instructions, like "push_s", have implicit operands which are not directly present in arc_instruction. * Operands of particular meaning, like branch/jump targets, have various locations and meaning depending on type of branch/target. * Access to operand value is abstracted into a separate function, so callee code shouldn't bother if operand value is an immediate value or in a register. Testcases included in this commit are fairly limited - they test exclusively branch instructions, something that will be used in software single stepping. Most of the other parts of this disassembler helper are tested during prologue analysis testing. gdb/ChangeLog: yyyy-mm-dd Anton Kolesov <anton.kolesov@synopsys.com> * configure.tgt: Add arc-insn.o. * arc-tdep.c (arc_delayed_print_insn): Make non-static. (dump_arc_instruction_command): New function. (arc_fprintf_disasm): Likewise. (arc_disassemble_info): Likewise. (arc_insn_get_operand_value): Likewise. (arc_insn_get_operand_value_signed): Likewise. (arc_insn_get_memory_base_reg): Likewise. (arc_insn_get_memory_offset): Likewise. (arc_insn_get_branch_target): Likewise. (arc_insn_dump): Likewise. (arc_insn_get_linear_next_pc): Likewise. * arc-tdep.h (arc_delayed_print_insn): Add function declaration. (arc_disassemble_info): Likewise. (arc_insn_get_branch_target): Likewise. (arc_insn_get_linear_next_pc): Likewise. * NEWS: Mention new "maint print arc arc-instruction". gdb/doc/ChangeLog: yyyy-mm-dd Anton Kolesov <anton.kolesov@synopsys.com> * gdb.texinfo (Synopsys ARC): Add "maint print arc arc-instruction". gdb/testsuite/ChangeLog: yyyy-mm-dd Anton Kolesov <anton.kolesov@synopsys.com> * gdb.arch/arc-decode-insn.S: New file. * gdb.arch/arc-decode-insn.exp: Likewise.
2017-03-22Remove @code for pythonYao Qi2-1/+5
There's no reason to use @code for Python the name of a programming language. gdb/doc: 2017-03-22 Yao Qi <yao.qi@linaro.org> * python.texi (Inferiors In Python): Remove @code from Python.
2017-03-21Fix break on Python 2Tim Wiederhake2-1/+7
This changes the return type of "gdb.BtraceInstruction.data ()" from "memoryview" to "buffer" on Python 2.7 and below, similar to what "gdb.Inferior.read_memory ()" does.
2017-03-20Add rvalue reference tests and docsArtemiy Volkov1-3/+3
This patch adds tests for the initial rvalue reference support patchset. All of the new tests are practically mirrored regular references tests and, except for the demangler ones, are introduced in new files, which are set to be compiled with -std=gnu++11. Tested are printing of rvalue reference types and values, rvalue reference parameters in function overloading, demangling of function names containing rvalue reference parameters, casts to rvalue reference types, application of the sizeof operator to rvalue reference types and values, and support for rvalue references within the gdb python module. gdb/ChnageLog PR gdb/14441 * NEWS: Mention support for rvalue references in GDB and python. * doc/gdb.texinfo (C Plus Plus Expressions): Mention that GDB supports both lvalue and rvalue references. gdb/testsuite/ChangeLog PR gdb/14441 * gdb.cp/demangle.exp: Add rvalue reference tests. * gdb.cp/rvalue-ref-casts.cc: New file. * gdb.cp/rvalue-ref-casts.exp: New file. * gdb.cp/rvalue-ref-overload.cc: New file. * gdb.cp/rvalue-ref-overload.exp: New file. * gdb.cp/rvalue-ref-params.cc: New file. * gdb.cp/rvalue-ref-params.exp: New file. * gdb.cp/rvalue-ref-sizeof.cc: New file. * gdb.cp/rvalue-ref-sizeof.exp: New file. * gdb.cp/rvalue-ref-types.cc: New file. * gdb.cp/rvalue-ref-types.exp: New file. * gdb.python/py-rvalue-ref-value-cc.cc: New file. * gdb.python/py-rvalue-ref-value-cc.exp: New file.
2017-03-20Support rvalue references in the gdb python module (includes doc/)Artemiy Volkov1-0/+4
This patch adds the ability to inspect rvalue reference types and values using the gdb python module. This is achieved by creating two wrappers for valpy_reference_value(), using the ReferenceExplorer class to handle the objects of rvalue reference types and placing necessary checks for a TYPE_CODE_RVALUE_REF type code next to the checks for a TYPE_CODE_REF type code. gdb/ChangeLog PR gdb/14441 * doc/python.texi (Types in Python): Add TYPE_CODE_RVALUE_REF to table of constants. * python/lib/gdb/command/explore.py: Support exploring values of rvalue reference types. * python/lib/gdb/types.py: Implement get_basic_type() for rvalue reference types. * python/py-type.c (pyty_codes) <TYPE_CODE_RVALUE_REF>: New constant. * python/py-value.c (valpy_getitem): Add an rvalue reference check. (valpy_reference_value): Add new parameter "refcode". (valpy_lvalue_reference_value, valpy_rvalue_reference_value): New wrappers for valpy_reference_value(). * python/py-xmethods.c (gdbpy_get_xmethod_result_type) (gdbpy_invoke_xmethod): Likewise.
2017-03-20Add -file-list-shared-libraries MI commandMarc-Andre Laperle2-7/+34
This change adds the MI equivalent for the "info sharedlibrary" command. The command was already partially documented but ignored as it was not implemented. The new MI command works similarly to the CLI command, taking an optional regular expression as an argument and outputting the library information. I included a test for the new command in mi-solib.exp. gdb/doc/ChangeLog: * gdb.texinfo (gdb/mi Symbol Query Commands): Document new MI command file-list-shared-libraries (GDB/MI Async Records): Update documentation of library-loaded with new field. gdb/ChangeLog: * NEWS: Add an entry about new '-file-list-shared-libraries' command. * mi/mi-cmd-file.c (mi_cmd_file_list_shared_libraries): New function definition. * mi/mi-cmds.c (mi_cmds): Add -file-list-shared-libraries command. * mi/mi-cmds.h (mi_cmd_file_list_shared_libraries): New function declaration. * mi/mi-interp.c (mi_output_solib_attribs): New Function. * mi/mi-interp.h: New file. * solib.c (info_sharedlibrary_command): Replace for loop with ALL_SO_LIBS macro * solib.h (update_solib_list): New function declaration. (so_list_head): Move macro. * solist.h (ALL_SO_LIBS): New macro. gdb/testsuite/ChangeLog: * gdb.mi/mi-solib.exp (test_file_list_shared_libraries): New procedure. Signed-off-by: Marc-Andre Laperle <marc-andre.laperle@ericsson.com>
2017-03-16Lazy strings can be made from arrays too.Doug Evans3-2/+7
gdb/doc/ChangeLog: * guile.texi (Lazy Strings In Guile): Mention arrays. * python.texi (Lazy Strings In Python): Ditto.
2017-03-08[gdb, doc] Add missing escape character '@'Jiong Wang2-1/+6
gdb/doc/ * gdb.texinfo (Memory Protection Extensions): Add missing escape character "@".
2017-03-07amd64-mpx: initialize BND register before performing inferior calls.Walfred Tedeschi2-0/+34
This patch initializes the BND registers before executing the inferior call. BND registers can be in arbitrary values at the moment of the inferior call. In case the function being called uses as part of the parameters BND register, e.g. when passing a pointer as parameter, the current value of the register will be used. This can cause boundary violations that are not due to a real bug or even desired by the user. In this sense the best to be done is set the BND registers to allow access to the whole memory, i.e. initialized state, before pushing the inferior call. 2017-03-07 Walfred Tedeschi <walfred.tedeschi@intel.com> gdb/ChangeLog: * i387-tdep.h (i387_reset_bnd_regs): Add function definition. * i387-tdep.c (i387_reset_bnd_regs): Add function implementation. * i386-tdep.c (i386_push_dummy_call): Call i387_reset_bnd_regs. * amd64-tdep (amd64_push_dummy_call): Call i387_reset_bnd_regs. gdb/testsuite/ChangeLog: * i386-mpx-call.c: New file. * i386-mpx-call.exp: New file. gdb/doc/ChangeLog: * Memory Protection Extensions: Add information about inferior calls.
2017-02-28GDB: Add support for the new set/show disassembler-options commands.Peter Bergner1-0/+21
This commit adds support to GDB so that it can modify the disassembler-options value that is passed to the disassembler, similar to objdump's -M option. Currently, the only supported targets are ARM, PowerPC and S/390, but adding support for a new target(s) is not difficult. include/ * dis-asm.h (disasm_options_t): New typedef. (parse_arm_disassembler_option): Remove prototype. (set_arm_regname_option): Likewise. (get_arm_regnames): Likewise. (get_arm_regname_num_options): Likewise. (disassemble_init_s390): New prototype. (disassembler_options_powerpc): Likewise. (disassembler_options_arm): Likewise. (disassembler_options_s390): Likewise. (remove_whitespace_and_extra_commas): Likewise. (disassembler_options_cmp): Likewise. (next_disassembler_option): New inline function. (FOR_EACH_DISASSEMBLER_OPTION): New macro. opcodes/ * disassemble.c Include "safe-ctype.h". (disassemble_init_for_target): Handle s390 init. (remove_whitespace_and_extra_commas): New function. (disassembler_options_cmp): Likewise. * arm-dis.c: Include "libiberty.h". (NUM_ELEM): Delete. (regnames): Use long disassembler style names. Add force-thumb and no-force-thumb options. (NUM_ARM_REGNAMES): Rename from this... (NUM_ARM_OPTIONS): ...to this. Use ARRAY_SIZE. (get_arm_regname_num_options): Delete. (set_arm_regname_option): Likewise. (get_arm_regnames): Likewise. (parse_disassembler_options): Likewise. (parse_arm_disassembler_option): Rename from this... (parse_arm_disassembler_options): ...to this. Make static. Use new FOR_EACH_DISASSEMBLER_OPTION macro to scan over options. (print_insn): Use parse_arm_disassembler_options. (disassembler_options_arm): New function. (print_arm_disassembler_options): Handle updated regnames. * ppc-dis.c: Include "libiberty.h". (ppc_opts): Add "32" and "64" entries. (ppc_parse_cpu): Use ARRAY_SIZE and disassembler_options_cmp. (powerpc_init_dialect): Add break to switch statement. Use new FOR_EACH_DISASSEMBLER_OPTION macro. (disassembler_options_powerpc): New function. (print_ppc_disassembler_options): Use ARRAY_SIZE. Remove printing of "32" and "64". * s390-dis.c: Include "libiberty.h". (init_flag): Remove unneeded variable. (struct s390_options_t): New structure type. (options): New structure. (init_disasm): Rename from this... (disassemble_init_s390): ...to this. Add initializations for current_arch_mask and option_use_insn_len_bits_p. Remove init_flag. (print_insn_s390): Delete call to init_disasm. (disassembler_options_s390): New function. (print_s390_disassembler_options): Print using information from struct 'options'. * po/opcodes.pot: Regenerate. binutils/ * objdump.c (main): Use remove_whitespace_and_extra_commas. gdb/ * NEWS: Mention new set/show disassembler-options commands. * doc/gdb.texinfo: Document new set/show disassembler-options commands. * disasm.c: Include "arch-utils.h", "gdbcmd.h" and "safe-ctype.h". (prospective_options): New static variable. (gdb_disassembler::gdb_disassembler): Initialize m_di.disassembler_options. (gdb_buffered_insn_length_init_dis): Initilize di->disassembler_options. (get_disassembler_options): New function. (set_disassembler_options): Likewise. (set_disassembler_options_sfunc): Likewise. (show_disassembler_options_sfunc): Likewise. (disassembler_options_completer): Likewise. (_initialize_disasm): Likewise. * disasm.h (get_disassembler_options): New prototype. (set_disassembler_options): Likewise. * gdbarch.sh (gdbarch_disassembler_options): New variable. (gdbarch_verify_disassembler_options): Likewise. * gdbarch.c: Regenerate. * gdbarch.h: Likewise. * arm-tdep.c (num_disassembly_options): Delete. (set_disassembly_style): Likewise. (arm_disassembler_options): New static variable. (set_disassembly_style_sfunc): Convert short style name into long option name. Call set_disassembler_options. (show_disassembly_style_sfunc): New function. (arm_gdbarch_init): Call set_gdbarch_disassembler_options and set_gdbarch_verify_disassembler_options. (_initialize_arm_tdep): Delete regnames variable and update callers. (arm_disassembler_options): Initialize. (disasm_options): New variable. (num_disassembly_options): Rename from this... (num_disassembly_styles): ...to this. Compute by scanning through disasm_options. (valid_disassembly_styles): Initialize using disasm_options. Remove calls to parse_arm_disassembler_option, get_arm_regnames and set_arm_regname_option. Pass show_disassembly_style_sfunc to the "disassembler" setshow command. * rs6000-tdep.c (powerpc_disassembler_options): New static variable. (rs6000_gdbarch_init): Call set_gdbarch_disassembler_options and set_gdbarch_verify_disassembler_options. * s390-tdep.c (s390_disassembler_options): New static variable. (s390_gdbarch_init):all set_gdbarch_disassembler_options and set_gdbarch_verify_disassembler_options. gdb/testsuite/ * gdb.arch/powerpc-power.exp: Delete test. * gdb.arch/powerpc-power.s: Likewise. * gdb.disasm/disassembler-options.exp: New test. * gdb.arch/powerpc-altivec.exp: Likewise. * gdb.arch/powerpc-altivec.s: Likewise. * gdb.arch/powerpc-altivec2.exp: Likewise. * gdb.arch/powerpc-altivec2.s: Likewise. * gdb.arch/powerpc-altivec3.exp: Likewise. * gdb.arch/powerpc-altivec3.s: Likewise. * gdb.arch/powerpc-power7.exp: Likewise. * gdb.arch/powerpc-power7.s: Likewise. * gdb.arch/powerpc-power8.exp: Likewise. * gdb.arch/powerpc-power8.s: Likewise. * gdb.arch/powerpc-power9.exp: Likewise. * gdb.arch/powerpc-power9.s: Likewise. * gdb.arch/powerpc-vsx.exp: Likewise. * gdb.arch/powerpc-vsx.s: Likewise. * gdb.arch/powerpc-vsx2.exp: Likewise. * gdb.arch/powerpc-vsx2.s: Likewise. * gdb.arch/powerpc-vsx3.exp: Likewise. * gdb.arch/powerpc-vsx3.s: Likewise. * gdb.arch/arm-disassembler-options.exp: Likewise. * gdb.arch/powerpc-disassembler-options.exp: Likewise. * gdb.arch/s390-disassembler-options.exp: Likewise.
2017-02-20DWARF-5: call sitesJan Kratochvil2-5/+10
this patch updates all call sites related DWARF-5 renames. gdb/ChangeLog 2017-02-20 Jan Kratochvil <jan.kratochvil@redhat.com> * block.c (call_site_for_pc): Rename DW_OP_GNU_*, DW_TAG_GNU_* and DW_AT_GNU_*. * common/common-exceptions.h (enum errors): Likewise. * dwarf2-frame.c (class dwarf_expr_executor): Likewise. * dwarf2expr.c (dwarf_block_to_dwarf_reg) (dwarf_expr_context::execute_stack_op): Likewise. * dwarf2expr.h (struct dwarf_expr_context, struct dwarf_expr_piece): Likewise. * dwarf2loc.c (dwarf_evaluate_loc_desc::get_base_type) (dwarf_evaluate_loc_desc::push_dwarf_reg_entry_value) (show_entry_values_debug, call_site_to_target_addr) (func_addr_to_tail_call_list, func_verify_no_selftailcall) (dwarf_expr_reg_to_entry_parameter, dwarf_entry_parameter_to_value) (entry_data_value_free_closure, value_of_dwarf_reg_entry) (value_of_dwarf_block_entry, indirect_pieced_value) (symbol_needs_eval_context::push_dwarf_reg_entry_value): (disassemble_dwarf_expression): Likewise. * dwarf2read.c (process_die, inherit_abstract_dies) (read_call_site_scope): Likewise. * gdbtypes.h (struct func_type, struct call_site_parameter) (struct call_site): Likewise. * stack.c (read_frame_arg): Likewise. * std-operator.def (OP_VAR_ENTRY_VALUE): Likewise. gdb/doc/ChangeLog 2017-02-20 Jan Kratochvil <jan.kratochvil@redhat.com> * gdb.texinfo (Print Settings, Tail Call Frames): Rename DW_OP_GNU_*, DW_TAG_GNU_* and DW_AT_GNU_*. gdb/testsuite/ChangeLog 2017-02-20 Jan Kratochvil <jan.kratochvil@redhat.com> * gdb.arch/amd64-entry-value-param-dwarf5.S: New file. * gdb.arch/amd64-entry-value-param-dwarf5.c: New file. * gdb.arch/amd64-entry-value-param-dwarf5.exp: New file. * gdb.arch/amd64-entry-value.exp: Rename DW_OP_GNU_*, DW_TAG_GNU_* and DW_AT_GNU_*.
2017-02-17Add support for Intel PKRU register to GDB and GDBserver.Michael Sturm1-0/+4
This patch adds support for the registers added by the Memory Protection Keys for Userspace (PKU aka PKEYs) feature. Native and remote debugging are covered by this patch. The XSAVE area is extended with a new state containing the 32-bit wide PKRU register. The new register is added to amd64-avx-mpx_avx512-* tdesc, thus it is renamed accordingly. Also, respective xstate mask X86_XSTATE_AVX_MPX_AVX512_MASK is renamed to X86_XSTATE_AVX_MPX_AVX512_PKU_MASK to reflect the new feature set it supports. For more information, please refer to the Intel(R) 64 and IA-32 Architectures Software Developer's Manual - Septemper 2015 http://www.intel.com/content/dam/www/public/us/en/documents/ manuals/64-ia-32-architectures-software-developer-manual-325462.pdf gdb/Changelog: 2015-12-08 Michael Sturm <michael.sturm@intel.com> * NEWS: Mention addition of PKU feature. * amd64-linux-nat.c (amd64_linux_gregset32_reg_offset): Add PKRU register. * amd64-linux-tdep.c (features/i386/amd64-avx-mpx-avx512-linux.c): Rename to... (features/i386/amd64-avx-mpx-avx512-pku-linux.c): ...this. (amd64_linux_gregset_reg_offset): Add PKRU register. (amd64_linux_core_read_description): Rename X86_XSTATE_AVX_MPX_AVX512_MASK, rename tdesc_amd64_avx_mpx_avx512_pku_linux. (_initialize_amd64_linux_tdep): Rename initialize_tdesc_amd64_avx_mpx_avx512_linux. * amd64-linux-tdep.h (AMD64_LINUX_ORIG_RAX_REGNUM): Adjust regnum calculation. (tdesc_amd64_avx_mpx_avx512_linux): Rename to... (tdesc_amd64_avx_mpx_avx512_pku_linux): ...this. * amd64-tdep.c (features/i386/amd64-avx-mpx-avx512-pku.c): Rename to... (features/i386/amd64-avx-mpx-avx512-pku.c): ...this. (amd64_pkeys_names): New register name for raw register PKRU. (amd64_init_abi): Add code to initialize PKRU tdep variables if feature is present. (amd64_target_description): Rename X86_XSTATE_AVX_MPX_AVX512_MASK, rename tdesc_amd64_avx_mpx_avx512. (_initialize_amd64_tdep): Rename initialize_tdesc_amd64_avx_mpx_avx512. * amd64-tdep.h (enum amd64_regnum): Add PKRU register. (AMD64_NUM_REGS): Adjust regnum calculation. * i386-linux.nat.c (GETXSTATEREGS_SUPPLIES): Extend range of registers supplied via XSTATE by PKRU register. * common/x86-xstate.h (X86_XSTATE_PKRU): New macro. (X86_XSTATE_AVX_MPX_AVX512_MASK): Add PKRU and renamed mask. (X86_XSTATE_ALL_MASK): Rename X86_XSTATE_AVX_MPX_AVX512_MASK. (X86_XSTATE_PKRU_SIZE): New macro. (X86_XSTATE_MAX_SIZE): Adjust size. (HAS_PKRU(XCR0)): New macro. (X86_XSTATE_SIZE): Add checkfor PKRU. * features/Makefile (WHICH): Rename i386/i386-avx-mpx-avx512, i386/i386-avx-mpx-avx512-linux, i386/amd64-avx-mpx-avx512, i386/amd64-avx-mpx-avx512-linux. (i386/i386-avx-mpx-avx512-expedite): Rename expedite. (i386/i386-avx-mpx-avx512-linux-expedite): Likewise. (i386/amd64-avx-mpx-avx512-expedite): Likewise. (i386/amd64-avx-mpx-avx512-linux-expedite): Likewise. (XMLTOC): Rename i386/amd64-avx-mpx-avx512-linux.xml, i386/amd64-avx-mpx-avx512.xml, i386/i386-avx-mpx-avx512-linux.xml, i386/i386-avx-mpx-avx512.xml. ((outdir)/i386/i386-avx-mpx-avx512.dat): Rename rule, add i386/32bit-pkeys.xml. ((outdir)/i386/i386-avx-mpx-avx512-pku-linux.dat): Likewise. ((outdir)/i386/amd64-avx-mpx-avx512.dat): Rename rule, add i386/64bit-pkeys.xml. ((outdir)/i386/amd64-avx-mpx-avx512-linux.dat): Likewise. * features/i386/32bit-pkeys.xml: New file. * features/i386/64bit-pkeys.xml: Likewise. * features/i386/amd64-avx-mpx-avx512-linux-pku.c: Regenerate from renamed XML file. * features/i386/amd64-avx-mpx-avx512-linux.xml: Rename to amd64-avx-mpx-avx512-pku-linux.xml, add 64bit-pkeys.xml * features/i386/amd64-avx-mpx-avx512.c: Regenerate from renamed XML file. * features/i386/amd64-avx-mpx-avx512.xml: Rename to amd64-avx-mpx-avx512-pku.xml, add 64bit-pkeys.xml. * features/i386/i386-avx-mpx-avx512-linux.c: Regenerate from renamed XML file. * features/i386/i386-avx-mpx-avx512-linux.xml: Rename to i386-avx-mpx-avx512-pku-linux.xml, add 32bit-pkeys.xml. * features/i386/i386-avx-mpx-avx512.c: Regenerate from renamed XML file. * features/i386/i386-avx-mpx-avx512.xml: Rename to i386-avx-mpx-avx512-pku.xml, add 32bit-pkeys.xml. * i386-linux-nat.c (GETXSTATEREGS_SUPPLIES): Change to use I386_PKEYS_NUM_REGS. * i386-linux-tdep.c (features/i386/i386-avx-mpx-avx512-linux.c): Rename include. (i386_linux_gregset_reg_offset): Add PKRU register. (i386_linux_core_read_description): Rename xstate mask and returned tdesc for X86_XSTATE_AVX_MPX_AVX512_PKU_MASK. (_initialize_i386_linux_tdep): Rename initialize_tdesc_i386_avx_mpx_avx512_linux. * i386-linux-tdep.h (I386_LINUX_ORIG_EAX_REGNUM): Adjuste regnum calculation. (tdesc_i386_avx_mpx_avx512_linux): Rename prototype. (/* Format of XSAVE...): Add pkru register. * i386-tdep.c (i386-avx-mpx-avx512.c): Rename include. (i386_pkeys_names): New register name for raw register PKRU. (i386_pkru_regnum_p): Add function to look up register number of PKRU raw register. (i386_register_reggroup_p): Add code to exclude PKRU from general register group. (i386_validate_tdesc_p): Add code to handle PKRU feature, add PKRU registers if feature is present in xcr0. (i386_gdbarch_init): Adjust number of registers in architecture. Add code to initialize PKRU feature variables in tdep structure. (i386_target_description): Rename xstate mask and returned tdesc for X86_XSTATE_AVX_MPX_AVX512_PKU_MASK. (_initialize_i386_tdep): Rename initialize_tdesc_i386_avx_mpx_avx512. * i386-tdep.h (struct gdbarch_tdep): Add feature variables to tdep structure. (enum i386_regnum): Add PKRU register. (I386_PKEYS_NUM_REGS): New define for number of registers in PKRU feature. (i386_pkru_regnum_p): New prototype. * i387-tdep.c (xsave_pkeys_offset): New table for PKRU offsets in XSAVE buffer. (XSAVE_PKEYS_ADDR): New macro. (i387_supply_xsave): Add code to handle PKRU register. (i387_collect_xsave): Likewise. * i387-tdep.h (I387_NUM_PKEYS_REGS): New define for number of registers in PKRU feature. (I387_PKRU_REGNUM): New macro. (I387_PKEYSEND_REGNUM): Likewise. * regformats/i386/amd64_avx_mpx_avx512_pku_linux.dat: Regenerate from renamed XML file. * regformats/i386/amd64_avx_mpx_avx512_pku.dat: Likewise. * regformats/i386/i386/amd64-avx-mpx-avx512-pku.dat: Likewise. * regformats/i386/i386_avx_mpx_avx512_pku_linux.dat: Likewise. testsuite/Changelog: 2016-04-18 Michael Sturm <michael.sturm@intel.com> * gdb.arch/i386-pkru.c: New file. * gdb.arch/i386-pkru.exp: Likewise. gdbserver/Changelog: 2016-04-18 Michael Sturm <michael.sturm@intel.com> * Makefile.in (clean): Rename i386-avx-mpx-avx512.c, i386-avx-mpx-avx512-linux.c, amd64-avx-mpx-avx512.c, amd64-avx-mpx-avx512-linux.c. (i386-avx-mpx-avx512-linux-ipa.o:): Rename rule and source file. (amd64-avx-mpx-avx512-linux-ipa.o:): Likewise. (i386-avx-mpx-avx512.c :): Rename rule, source files and dat files. (i386-avx-mpx-avx512-linux.c :): Likewise. (amd64-avx-mpx-avx512.c :): Likewise. (amd64-avx-mpx-avx512-linux.c :): Likewise. * configure.srv (srv_i386_regobj): Rename i386-avx-mpx-avx512.o. (srv_i386_linux_regobj): Rename i386-avx-mpx-avx512-linux.o. (srv_amd64_regobj): Rename amd64-avx-mpx-avx512.o. (srv_amd64_linux_regobj): Rename amd64-avx-mpx-avx512-linux.o. (ipa_i386_linux_regobj): Rename i386-avx-mpx-avx512-linux-ipa.o. (ipa_amd64_linux_regobj): Rename amd64-avx-mpx-avx512-pku-linux-ipa.o. (srv_i386_32bit_xmlfiles): Add 32bit-pkeys.xml. (srv_i386_64bit_xmlfiles): Add 64bit-pkeys.xml. (srv_i386_xmlfiles): Rename i386/i386-avx-mpx-avx512.xml. (srv_amd64_xmlfiles): Rename i386/amd64-avx-mpx-avx512.xml. (srv_i386_linux_xmlfiles): Rename i386/i386-avx-mpx-avx512-linux.xml. (srv_amd64_linux_xmlfiles): Rename di386/amd64-avx-mpx-avx512-linux.xml. * i387-fp.c (num_pkeys_registers): New variable. (struct i387_xsave): Add space for pkru values. (i387_cache_to_fsave): Add code to handle PKRU register. (i387_xsave_to_cache): Likewise. * linux-amd64-ipa.c (get_ipa_tdesc): Rename tdesc_amd64_avx_mpx_avx512_linux. (initialize_low_tracepoint): Rename init_registers_amd64_avx_mpx_avx512_linux. * linux-i386-ipa.c (get_ipa_desc): Rename tdesc_i386_avx_mpx_avx512_linux. (initialize_low_tracepoint): Rename init_registers_i386_avx_mpx_avx512_linux. * linux-x86-low.c (x86_64_regmap[]): Add PKRU register. (x86_linux_read_description): Rename X86_XSTATE_AVX_MPX_AVX512_MASK, rename tdesc_amd64_avx_mpx_avx512_linux, rename tdesc_i386_avx_mpx_avx512_linux. (x86_get_ipa_tdesc_idx): Rename tdesc_amd64_avx_mpx_avx512_linux, rename tdesc_i386_avx_mpx_avx512_linux. (initialize_low_arch): Rename init_registers_amd64_avx_mpx_avx512_linux, rename init_registers_i386_avx_mpx_avx512_linux. * linux-x86-tdesc.h (init_registers_amd64_avx_mpx_avx512_linux): Renamed prototype. (tdesc_amd64_avx_mpx_avx512_linux): Likewise. (init_registers_i386_avx_mpx_avx512_linux): Likewise. (tdesc_i386_avx_mpx_avx512_linux): Likewise. doc/Changelog: 2016-04-18 Michael Sturm <michael.sturm@intel.com> * gdb.texinfo (i386 Features): Add description of PKRU register. Change-Id: If75ce5aba7dfd33fdbe3d8b47f04ef3f550c52be Signed-off-by: Michael Sturm <michael.sturm@intel.com>
2017-02-15Add missing ChangeLog entries.Tim Wiederhake1-0/+4
This adds the missing ChangeLog entries for the "Python bindings" patch series.
2017-02-14PR python/13598 - add before_prompt eventTom Tromey2-0/+9
This adds an event that is emitted just before GDB presents a prompt to the user. This provides Python code a way to react to whatever changes might have been made by the previous command. For example, in my GUI I use this to track changes to the selected frame and reflect them in the UI. Built and regtested on x86-64 Fedora 23. gdb/ChangeLog 2017-02-14 Tom Tromey <tom@tromey.com> PR python/13598: * python/python.c (gdbpy_before_prompt_hook): Emit before_prompt event. * python/py-evts.c (gdbpy_initialize_py_events): Add before_prompt registry. * python/py-events.h (events_object) <before_prompt>: New field. gdb/doc/ChangeLog 2017-02-14 Tom Tromey <tom@tromey.com> PR python/13598: * python.texi (Events In Python): Document events.before_prompt. gdb/testsuite/ChangeLog 2017-02-14 Tom Tromey <tom@tromey.com> PR python/13598: * gdb.python/py-events.exp: Add before_prompt event tests.
2017-02-14Add documentation for new record Python bindings.Tim Wiederhake1-0/+245
Signed-off-by: Tim Wiederhake <tim.wiederhake@intel.com> gdb/ChangeLog: * NEWS: Add record Python bindings entry. gdb/doc/ChangeLog: * python.texi (Recordings In Python): New section. Change-Id: Ibacb5930085bff36b0003fde30db9a8178cb280b
2017-02-13Improve load command's help textLuis Machado2-2/+11
This fairly obvious patch adds usage text to the load command's help text. Originally it did not have usage and mentioned things like FILE and OFFSET without explaining how those should be passed in the command. gdb/ChangeLog: 2017-02-13 Luis Machado <lgustavo@codesourcery.com> * symfile (_initialize_symfile): Add usage text to the load command's help text. gdb/doc/ChangeLog: 2017-02-13 Luis Machado <lgustavo@codesourcery.com> * gdb.texinfo (Target Commands): Document the optional offset argument for the load command.
2017-02-10PR gdb/21122: Fix documentation mistakes for breakpoint commandsMartin Galvan2-18/+29
Currently, the breakpoint documentation refers to some commands taking breakpoint "ranges" as arguments. We discussed this with Pedro and concluded that it would be more accurate to speak in terms of breakpoint "lists", whose elements can optionally be ranges. I also fixed a couple of minor mistakes in the docs. gdb/ChangeLog: * breakpoint.c (_initialize_breakpoint): Update the help description of the 'commands' command to indicate that it takes a list argument. gdb/doc/ChangeLog: * gdb.texinfo (Breakpoints): Reword documentation to speak in terms of space-separated breakpoint lists. Also add a missing @table command and @cindex for breakpoint lists. gdb/testsuite/ChangeLog: * gdb.base/help.exp: Update match pattern for testing 'help commands'.
2017-02-05gdb: provide and use sparc{32,64} target description XML files.Ivo Raisr2-0/+49
gdb/ChangeLog: 2017-02-06 Ivo Raisr <ivo.raisr@oracle.com> PR tdep/20936 Provide and use sparc32 and sparc64 target description XML files. * features/sparc/sparc32-cp0.xml, features/sparc/sparc32-cpu.xml, features/sparc/sparc32-fpu.xml: New files for sparc 32-bit. * features/sparc/sparc64-cp0.xml, features/sparc/sparc64-cpu.xml, features/sparc/sparc64-fpu.xml: New files for sparc 64-bit. * features/sparc/sparc32-solaris.xml: New file. * features/sparc/sparc64-solaris.xml: New file. * features/sparc/sparc32-solaris.c: Generated. * features/sparc/sparc64-solaris.c: Generated. * sparc-tdep.h: Account for differences in target descriptions. * sparc-tdep.c (sparc32_register_name): Use target provided registers. (sparc32_register_type): Use target provided registers. (validate_tdesc_registers): New function. (sparc32_gdbarch_init): Use tdesc_has_registers. Set pseudoregister functions. * sparc64-tdep.c (sparc64_register_name): Use target provided registers. (sparc64_register_type): Use target provided registers. (sparc64_init_abi): Set pseudoregister functions. gdb/doc/ChangeLog: 2017-02-06 Ivo Raisr <ivo.raisr@oracle.com> PR tdep/20936 * gdb.texinfo: (Standard Target Features): Document SPARC features. (Sparc Features): New node. gdb/testsuite/ChangeLog: 2017-02-06 Ivo Raisr <ivo.raisr@oracle.com> PR tdep/20936 * gdb.xml/tdesc-regs.exp: Provide sparc core registers for the tests.
2017-01-27amd64-linux: expose system register FS_BASE and GS_BASE for Linux.Walfred Tedeschi2-0/+8
This patch allows examination of the registers FS_BASE and GS_BASE for Linux Systems running on 64bit. Tests for simple read and write of the new registers is also added with this patch. 2017-01-27 Walfred Tedeschi <walfred.tedeschi@intel.com> Richard Henderson <rth@redhat.com> gdb/ChangeLog: * amd64-linux-nat.c (PTRACE_ARCH_PRCTL): New define. (amd64_linux_fetch_inferior_registers): Add case to fetch FS_BASE GS_BASE for older kernels. (amd64_linux_store_inferior_registers): Add case to store FS_BASE GS_BASE for older kernels. * amd64-linux-tdep.c (amd64_linux_gregset_reg_offset): Add FS_BASE and GS_BASE to the offset table. (amd64_linux_register_reggroup_p): Add FS_BASE and GS_BASE to the system register group. * amd64-nat.c (amd64_native_gregset_reg_offset): Implements case for older kernels. * amd64-tdep.c (amd64_init_abi): Add segment registers for the amd64 ABI. * amd64-tdep.h (amd64_regnum): Add AMD64_FSBASE_REGNUM and AMD64_GSBASE_REGNUM. (AMD64_NUM_REGS): Set to AMD64_GSBASE_REGNUM + 1. * features/Makefile (amd64-linux.dat, amd64-avx-linux.dat) (amd64-mpx-linux.dat, amd64-avx512-linux.dat, x32-linux.dat) (x32-avx-linux.dat, x32-avx512-linux.dat): Add i386/64bit-segments.xml in those rules. * features/i386/64bit-segments.xml: New file. * features/i386/amd64-avx-mpx-linux.xml: Add 64bit-segments.xml. * features/i386/amd64-avx-linux.xml: Add 64bit-segments.xml. * features/i386/amd64-avx512-linux.xml: Add 64bit-segments.xml. * features/i386/amd64-mpx-linux.xml: Add 64bit-segments.xml. * features/i386/x32-avx512-linux.xml: Add 64bit-segments.xml. * features/i386/x32-avx-linux.xml: Add 64bit-segments.xml. * features/i386/amd64-linux.xml: Add 64bit-segments.xml. * features/i386/amd64-avx-linux.c: Regenerated. * features/i386/amd64-avx-mpx-linux.c: Regenerated. * features/i386/amd64-avx-mpx.c: Regenerated. * features/i386/amd64-avx512-linux.c: Regenerated. * features/i386/amd64-linux.c: Regenerated. * features/i386/amd64-mpx-linux.c: Regenerated. * features/i386/i386-avx-mpx-linux.c: Regenerated. * features/i386/i386-avx-mpx.c: Regenerated. * features/i386/x32-avx-linux.c: Regenerated. * features/i386/x32-avx512-linux.c: Regenerated. * regformats/i386/amd64-avx-linux.dat: Regenerated. * regformats/i386/amd64-avx-mpx-linux.dat: Regenerated. * regformats/i386/amd64-avx512-linux.dat: Regenerated. * regformats/i386/amd64-linux.dat: Regenerated. * regformats/i386/amd64-mpx-linux.dat: Regenerated. * regformats/i386/x32-avx-linux.dat: Regenerated. * regformats/i386/x32-avx512-linux.dat: Regenerated. * regformats/i386/x32-linux.dat: Regenerated. gdb/doc/ChangeLog: * gdb.texinfo (i386 Features): Add system segment registers as feature. gdb/gdbserver/ChangeLog: * linux-x86-low.c (x86_64_regmap): Add fs_base and gs_base to the register table. (x86_fill_gregset): Add support for old kernels for the fs_base and gs_base system registers. (x86_store_gregset): Likewise. * configure.srv (srv_i386_64bit_xmlfiles): Add 64bit-segments.xml. gdb/testsuite/ChangeLog: * gdb.arch/amd64-gs_base.c: New file. * gdb.arch/amd64-gs_base.exp: New file. Change-Id: I2e0eeb93058a2320d4d3b045082643cfe4aff963 Signed-off-by: Walfred Tedeschi <walfred.tedeschi@intel.com>
2017-01-24Fix typo in ExitedEvent docSimon Marchi2-1/+5
The field "inferior" of the ExitedEvent object is not displayed properly. gdb/doc/ChangeLog: * python.texi (Events In Python): Fix typo.
2017-01-20Add command to erase all flash memory regionsLuis Machado2-0/+38
Changes in v4: - Replaced phex call with hex_string. Changes in v3: - Addressed comments by Pedro. - Output of memory region size now in hex format. - Misc formatting fixups. - Addressed Simon's comments on formatting. - Adjusted command text in the manual entry. - Fixed up ChangeLog. - Renamed flash_erase_all_command to flash_erase_command. Changes in v2: - Added NEWS entry. - Fixed long lines. - Address printing with paddress. Years ago we contributed flash programming patches upstream. The following patch is a leftover one that complements that functionality by adding a new command to erase all reported flash memory blocks. The command is most useful when we're dealing with flash-enabled targets (mostly bare-metal) and we need to reset the board for some reason. The wiping out of flash memory regions should help the target come up with a known clean state from which the user can load a new image and resume debugging. It is convenient enough to do this from the debugger, and there is also an MI command to expose this functionality to the IDE's. gdb/doc/ChangeLog: 2017-01-20 Mike Wrighton <mike_wrighton@codesourcery.com> Luis Machado <lgustavo@codesourcery.com> * gdb.texinfo (-target-flash-erase): New MI command description. (flash-erase): New CLI command description. gdb/ChangeLog: 2017-01-20 Mike Wrighton <mike_wrighton@codesourcery.com> Luis Machado <lgustavo@codesourcery.com> * NEWS (New commands): Mention flash-erase. (New MI commands): Mention target-flash-erase. * mi/mi-cmds.c (mi_cmd_target_flash_erase): Add target-flash-erase MI command. * mi/mi-cmds.h (mi_cmd_target_flash_erase): New declaration. * mi/mi-main.c (mi_cmd_target_flash_erase): New function. * target.c (flash_erase_command): New function. (initialize_targets): Add new flash-erase command. * target.h (flash_erase_command): New declaration.
2017-01-04Add FreeBSD/mips architecture.John Baldwin2-0/+10
This has been tested for the n64 and o32 ABIs. Signal frame unwinders for both ABIs are provided. FreeBSD/mips requires custom linkmap offsets since it contains an additional l_off member in 'struct link_map' that other FreeBSD platforms do not have. Support for collecting and supplying general purpose and floating point register sets are provided. Common routines for working with native format register sets are exported for use by the native target. gdb/ChangeLog: * Makefile.in (ALL_TARGET_OBS): Add mips-fbsd-tdep.o. (ALLDEPFILES): Add mips-fbsd-tdep.c. * NEWS: Mention new FreeBSD/mips target. * configure.tgt: Add mips*-*-freebsd*. * mips-fbsd-tdep.c: New file. * mips-fbsd-tdep.h: New file. gdb/doc/ChangeLog: * gdb.texinfo (Contributors): Add SRI International and University of Cambridge for FreeBSD/mips.
2017-01-01update copyright year range in GDB filesJoel Brobecker15-19/+19
This applies the second part of GDB's End of Year Procedure, which updates the copyright year range in all of GDB's files. gdb/ChangeLog: Update copyright year range in all GDB files.
2016-12-22New syntax for mt print symbols,msymbols,psymbols.Doug Evans2-15/+31
gdb/ChangeLog: * NEWS: Document new syntax for "mt print symbols", "mt print psymbols" and "mt print msymbols" commands. * psymtab.c (DEV_TTY): Delete. (dump_psymtab_addrmap): Don't dump if psymtabs_addrmap is NULL. (maintenance_print_psymbols): Rewrite for new syntax: mt print psymbols [-objfile objfile] [-pc address] [outfile] mt print psymbols [-objfile objfile] [-source source] [outfile] (_initialize_psymtab): Update help text. * symmisc.c (maintenance_print_symbols): Rewrite for new syntax: mt print symbols [-pc address] [outfile] mt print symbols [-objfile objfile] [-source source] [outfile] (maintenance_print_msymbols): Rewrite for new syntax: mt print msymbols [-objfile objfile] [outfile] Only print symbols for the current progspace. (_initialize_symmisc): Update help text. gdb/doc/ChangeLog: * gdb.texinfo (Symbols): Update docs for symbol printing maintenance commands. gdb/testsuite/ChangeLog: * gdb.base/maint.exp: Update tests for maint print symbols, psymbols and msymbols.
2016-12-02Support an "unlimited" number of user-defined argumentsPedro Alves2-3/+8
New in v2: - A few adjustments / simplifications were possible now that we require C++11: . Use std::unique_ptr to make the user_args_stack std::vector own its elements: static std::vector<std::unique_ptr<user_args>> user_args_stack; . use vector::emplace_back to construct elements directly in the corresponding vectors. . use std::to_string instead of adding a gdb::to_string replacement. - Now includes a test. Docs/NEWS are unchanged from v1 and have already been approved. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ I recently wrote a user-defined command that could benefit from supporting an unlimited number of arguments: http://palves.net/list-active-signal-handlers-with-gdb/ E.g., 'info signal-dispositions 1 2 3 4 5 6 7 8 9 10 11' However, we currently only support up to 10 arguments passed to user-defined commands ($arg0..$arg9). I can't find a good reason for that, other than "old code with hard coded limits". This patch removes that limit and modernizes the code along the way: - Makes the user_args struct a real C++ class that uses std::vector for storage. - Removes the "next" pointer from within user_args and uses a std::vector to maintain a stack instead. - Adds a new RAII-based scoped_user_args_level class to help push/pop user args in the stack instead of using a cleanup. gdb/ChangeLog: 2016-12-02 Pedro Alves <palves@redhat.com> * NEWS: Mention that user commands now accept an unlimited number of arguments. * cli/cli-script.c: Include <vector>. (struct string_view): New type. (MAXUSERARGS): Delete. (struct user_args): Now a C++ class. (user_args_stack): New. (struct scoped_user_args_level): New type. (execute_user_command): Use scoped_user_args_level. (arg_cleanup): Delete. (setup_user_args): Deleted, and refactored as ... (user_args::user_args): ... this new constructor. Limit of number of arguments removed. (insert_user_defined_cmd_args): Defer to user_args_stack. (user_args::insert_args): New, bits based on old insert_user_defined_cmd_args with limit of number of arguments eliminated. gdb/doc/ChangeLog: 2016-12-02 Pedro Alves <palves@redhat.com> * gdb.texinfo (User-defined Commands): Limit on number of arguments passed to user-defined commands removed; update. gdb/testsuite/ChangeLog: 2016-12-02 Pedro Alves <palves@redhat.com> * gdb.base/commands.exp (user_defined_command_manyargs_test): New procedure. (top level): Call it.
2016-12-02Fix PR 20559 - "eval" command and $arg0...$arg9/$argc substitutionPedro Alves2-0/+23
It'd be handy to be able to iterate over command arguments in user-defined commands, in order to support optional arguments ($arg0..$argN). I thought I could make it work with "eval", but alas, it doesn't work currently. E.g., with: define test set $i = 0 while $i < $argc eval "print $arg%d", $i set $i = $i + 1 end end we get: (gdb) test 1 $1 = void (gdb) test 1 2 3 $2 = void $3 = void $4 = void (gdb) The problem is that "eval" doesn't do user-defined command arguments substitution after expanding its own argument. This patch fixes that, which makes the example above work: (gdb) test 1 $1 = 1 (gdb) test 1 2 3 $2 = 1 $3 = 2 $4 = 3 (gdb) New test included, similar the above, but also exercises expanding $argc. I think this is likely to simplify many scripts out there, so I'm adding an example to the manual and mentioning it in NEWS as well. gdb/ChangeLog: 2016-12-02 Pedro Alves <palves@redhat.com> PR cli/20559 * NEWS: Mention "eval" expands user-defined command arguments. * cli/cli-script.c (execute_control_command): Adjust to rename. (insert_args): Rename to ... (insert_user_defined_cmd_args): ... this, and make extern. * cli/cli-script.h (insert_user_defined_cmd_args): New declaration. * printcmd.c: Include "cli/cli-script.h". (eval_command): Call insert_user_defined_cmd_args. gdb/doc/ChangeLog: 2016-12-02 Pedro Alves <palves@redhat.com> PR cli/20559 * gdb.texinfo (Define): Add example of using "eval" to process a variable number of arguments. (Output) <eval>: Add anchor. gdb/testsuite/ChangeLog: 2016-12-02 Pedro Alves <palves@redhat.com> PR cli/20559 * gdb.base/commands.exp (user_defined_command_args_eval): New procedure. (top level): Call it.
2016-11-30Makefiles: Disable suffix rules and implicit rulesSimon Marchi2-0/+7
Since we don't use suffix rules nor implicit rules in gdb, we can disable them. The advantage is a slightly faster make [1]. Here are some numbers about the speedup. I ran this on my trusty old Intel Q6600, so the time numbers are probably higher than what you'd get on any recent hardware. I ran "make" in the gdb/ directory of an already built repository (configured with --enable-targets=all). I recorded the time of execution (average of 5). I then ran "make -d" and recorded the number of printed lines, which gives a rough idea of the number of operations done. I compared the following configurations, to see the impact of both the empty .SUFFIXES target and the empty pattern rules, as well as running "make -r", which can be considered the "ideal" case. A - baseline B - baseline + .SUFFIXES C - baseline + pattern rules D - baseline + .SUFFIXES + pattern rules E - baseline + make -r config | time (s) | "make -d" ----------------------------- A | 5.74 | 2396643 B | 1.19 | 298469 C | 2.81 | 1266573 D | 1.13 | 245489 E | 1.01 | 163914 We can see that the empty .SUFFIXES target has a bigger impact than the empty pattern rules, but still it doesn't hurt to disable the implicit pattern rules as well. There are still some mentions of implicit rules I can't get rid of in the "make -d" output. For example, it's trying to build .c files from .w files: Looking for an implicit rule for '/home/simark/src/binutils-gdb/gdb/infrun.c'. Trying pattern rule with stem 'infrun'. Trying implicit prerequisite '/home/simark/src/binutils-gdb/gdb/infrun.w'. and trying to build Makefile.in from a bunch of extensions: Looking for an implicit rule for 'Makefile.in'. Trying pattern rule with stem 'Makefile.in'. Trying implicit prerequisite 'Makefile.in.o'. Trying pattern rule with stem 'Makefile.in'. Trying implicit prerequisite 'Makefile.in.c'. Trying pattern rule with stem 'Makefile.in'. Trying implicit prerequisite 'Makefile.in.cc'. ... many more ... If somebody knows how to disable them, we can do it, but at this point the returns are minimal, so it is not that important. I verified that both in-tree and out-of-tree builds work. [1] Switching from explicit rules to pattern rules for files in subdirectories actually made it slower, so this is kind of a way to redeem myself. But it the end it's faster than it was previously, so it was all worth it. :) gdb/ChangeLog: * disable-implicit-rules.mk: New file. * Makefile.in: Include disable-implicit-rules.mk. * data-directory/Makefile.in: Likewise. * gnulib/Makefile.in: Likewise. gdb/doc/ChangeLog: * Makefile.in: Likewise. gdb/gdbserver/ChangeLog: * Makefile.in: Include disable-implicit-rules.mk. gdb/testsuite/ChangeLog: * Makefile.in: Include disable-implicit-rules.mk.
2016-11-18gdb/doc: Add missing comma after xrefAndreas Arnez2-1/+6
Get rid of a warning for missing punctuation after xref. gdb/doc/ChangeLog: * gdb.texinfo (GDB/MI Async Records): Add missing comma after xref.
2016-10-29gdb/doc: Remove mention of vCont's default actionsPedro Alves2-3/+7
Discussion with qemu folks suggests that the vCont description could be even simpler and clearer. Given we now say: For each inferior thread, the leftmost action with a matching thread-id is applied. There's really no need to even talk about "default" actions, which raises doubts about whether "default" is special in some way (it's not). See <https://lists.gnu.org/archive/html/qemu-devel/2016-10/msg06944.html>. gdb/doc/ChangeLog: 2016-10-29 Pedro Alves <palves@redhat.com> * gdb.texinfo (Packets) <vCont>: Remove mention of default actions.
2016-10-26gdb/doc: Clarify vCont packet descriptionPedro Alves2-11/+27
Specifically, what happens with multiple actions that could match a thread, and what happens when we get a vCont action that matches a thread that was already running. E.g., what does: "vCont;s:2" "vCont;s:1;c" mean for thread 2. (Thread 2 continues stepping.) gdb/doc/ChangeLog: 2016-10-26 Pedro Alves <palves@redhat.com> * gdb.texinfo (Packets): Clarify vCont packets with multiple actions that match a thread, and what happens when an action matches a thread that is already running.
2016-10-14Fix typos in trace commands docSimon Marchi2-2/+7
gdb/doc/ChangeLog: * gdb.texinfo (Using Trace Files): Fix typo. (GDB/MI Tracepoint Commands): Likewise.
2016-10-14Document -ctf switch of -trace-saveSimon Marchi2-1/+10
The -trace-save MI command supports saving the trace in the CTF format, as its CLI counterpart, but it's not documented. gdb/doc/ChangeLog: * gdb.texinfo (GDB/MI Tracepoint Commands): Document -ctf switch of -trace-save.
2016-10-06Remove Java supportTom Tromey4-8/+15
This patch removes the Java support from gdb. gcj has not seen much development or use for years now, and was recently removed from GCC. This patch changes gdb to follow; in the unlikely event that there are still users using gcj, they can continue to use an older gdb to debug. Or, they can debug in C++ mode. Built and regtested on x86-64 Fedora 24. 2016-10-06 Tom Tromey <tom@tromey.com> * MAINTAINERS: Remove Java test maintainer. * varobj.h (java_varobj_ops): Don't declare. * valprint.h (struct value_print_options) <pascal_static_field_print>: Update comment. * utils.c (producer_is_gcc): Remove java reference. * symtab.h (struct general_symbol_info): Remove java references. (SYMBOL_SEARCH_NAME): Likewise. * objfiles.c (allocate_objfile): Update comment. * linespec.c (find_linespec_symbols): Remove java references. * gnu-v3-abi.c (gnuv3_rtti_type, gnuv3_baseclass_offset): Remove java references. * gdbtypes.h (struct cplus_struct_type) <is_java>: Remove. (TYPE_CPLUS_REALLY_JAVA): Remove. * c-varobj.c (enum vsections): Update comment. * symtab.c (symbol_set_language, symbol_set_names) (symbol_natural_name, symbol_demangled_name) (demangle_for_lookup, symbol_matches_domain) (default_make_symbol_completion_list_break_on_1): Remove java references. (JAVA_PREFIX, JAVA_PREFIX_LEN): Remove. * psymtab.c (match_partial_symbol, psymtab_search_name) (lookup_partial_symbol): Remove java references. * dwarf2read.c (find_slot_in_mapped_hash): Remove java references. (add_partial_symbol, dwarf2_compute_name, dwarf2_physname) (dwarf2_add_member_fn, is_vtable_name, read_structure_type) (process_structure_scope, read_subroutine_type) (read_subrange_type, load_partial_dies) (new_symbol_full, determine_prefix, typename_concat) (dwarf2_name): Remove java references. (set_cu_language): Treat Java as C++. * c-typeprint.c (c_type_print_args): Remove java reference. * defs.h (enum language) <language_java>: Remove. * Makefile.in (SFILES, HFILES_NO_SRCDIR, COMMON_OBS, YYFILES) (YYOBJ, local-maintainer-clean): Don't mention java files. * jv-exp.y, jv-lang.c, jv-lang.h, jv-typeprint.c, jv-valprint.c, jv-varobj.c: Remove. 2016-10-06 Tom Tromey <tom@tromey.com> * guile.texi (Types In Guile): Remove Java mentions. * python.texi (Types In Python): Remove Java mentions. * gdb.texinfo (Address Locations, Supported Languages) (Index Section Format): Remove Java mentions. 2016-10-06 Tom Tromey <tom@tromey.com> * gdb.compile/compile.exp: Change java tests to rust. * gdb.base/setshow.exp: Change java tests to rust. * gdb.base/default.exp: Remove java from language list. * README (Examples): Update language example. * gdb.python/py-lookup-type.exp (test_lookup_type): Remove java test. * lib/gdb.exp (skip_java_tests): Remove. * lib/java.exp: Remove. * gdb.java: Remove.
2016-10-06Make "end" field in feature specs required again.Doug Evans2-7/+9
Newer gdbservers may be talking to older gdbs, and older gdbs will flag a missing "end" as an error. So just make "end" required again, and for compatibility change the default field type to "bool". gdb/ChangeLog: 2016-10-06 Doug Evans <dje@google.com> * features/aarch64-core.xml (cpsr_flags): Elide "type" and specify "end" in all fields. * features/aarch64.c: Regenerate. * features/i386/32bit-mpx.xml (_bndcfgu): Specify type of "preserved" and "enabled" fields. Correct size of "enabled" field. * features/i386/64bit-mpx.xml (_bndcfgu): Specify type of "preserved" and "enabled" fields. * features/i386/i386-avx-mpx-linux.c: Regenerate. * features/i386/i386-avx-mpx.c: Regenerate. * features/i386/i386-avx512-linux.c: Regenerate. * features/i386/i386-avx512.c: Regenerate. * features/i386/i386-mpx-linux.c: Regenerate. * features/i386/i386-mpx.c: Regenerate. * features/arc-arcompact.c: Regenerate. * features/arc-v2.c: Regenerate. * xml-tdesc.c (tdesc_start_field): Require "end" spec. Single bit fields default to "bool" type. Revert 2016-03-15 Doug Evans <dje@google.com> * features/i386/32bit-core.xml (i386_eflags): Remove "end" spec. * features/i386/32bit-sse.xml (i386_eflags): Ditto. * features/i386/64bit-core.xml (i386_eflags): Ditto. * features/i386/64bit-sse.xml (i386_eflags): Ditto. * features/i386/x32-core.xml (i386_eflags): Ditto. gdb/doc/ChangeLog: 2016-10-06 Doug Evans <dje@google.com> * gdb.texinfo (Target Description Format): Update docs on "end" field spec and field default type. gdb/testsuite/ChangeLog: 2016-10-06 Doug Evans <dje@google.com> * gdb.xml/extra-regs.xml: Update, end field now required, default type for single bitfields is bool. * gdb.xml/tdesc-regs.exp: Ditto.
2016-10-03Emit inferior, thread and frame selection events to all UIsAntoine Tremblay3-14/+34
With this patch, when an inferior, thread or frame is explicitly selected by the user, notifications will appear on all CLI and MI UIs. When a GDB console is integrated in a front-end, this allows the front-end to follow a selection made by the user ont he CLI, and it informs the user about selection changes made behind the scenes by the front-end. This patch addresses PR gdb/20487. In order to communicate frame changes to the front-end, this patch adds a new field to the =thread-selected event for the selected frame. The idea is that since inferior/thread/frame can be seen as a composition, it makes sense to send them together in the same event. The vision would be to eventually send the inferior information as well, if we find that it's needed, although the "=thread-selected" event would be ill-named for that job. Front-ends need to handle this new field if they want to follow the frame selection changes that originate from the console. The format of the frame attribute is the same as what is found in the *stopped events. Here's a detailed example for each command and the events they generate: thread ------ 1. CLI command: thread 1.3 MI event: =thread-selected,id="3",frame={...} 2. MI command: -thread-select 3 CLI event: [Switching to thread 1.3 ...] 3. MI command (CLI-in-MI): thread 1.3 MI event/reply: &"thread 1.3\n" ~"#0 child_sub_function () ... =thread-selected,id="3",frame={level="0",...} ^done frame ----- 1. CLI command: frame 1 MI event: =thread-selected,id="3",frame={level="1",...} 2. MI command: -stack-select-frame 1 CLI event: #1 0x00000000004007f0 in child_function... 3. MI command (CLI-in-MI): frame 1 MI event/reply: &"frame 1\n" ~"#1 0x00000000004007f9 in ..." =thread-selected,id="3",frame={level="1"...} ^done inferior -------- Inferior selection events only go from the console to MI, since there's no way to select the inferior in pure MI. 1. CLI command: inferior 2 MI event: =thread-selected,id="3" Note that if the user selects an inferior that is not started or exited, the MI doesn't receive a notification. Since there is no threads to select, the =thread-selected event does not apply... 2. MI command (CLI-in-MI): inferior 2 MI event/reply: &"inferior 2\n" ~"[Switching to inferior 2 ...]" =thread-selected,id="4",frame={level="0"...} ^done Internal implementation detail: this patch makes it possible to suppress notifications caused by a CLI command, like what is done in mi-interp.c. This means that it's now possible to use the add_com_suppress_notification function to register a command with some event suppressed. It is used to implement the select-frame command in this patch. The function command_notifies_uscc_observer was added to extract the rather complicated logical expression from the if statement. It is also now clearer what that logic does: if the command used by the user already notifies the user_selected_context_changed observer, there is not need to notify it again. It therefore protects again emitting the event twice. No regressions, tested on ubuntu 14.04 x86 with target boards unix and native-extended-gdbserver. gdb/ChangeLog: YYYY-MM-DD Antoine Tremblay <antoine.tremblay@ericsson.com> YYYY-MM-DD Simon Marchi <simon.marchi@ericsson.com> PR gdb/20487 * NEWS: Mention new frame field of =thread-selected event. * cli/cli-decode.c (add_cmd): Initialize c->suppress_notification. (add_com_suppress_notification): New function definition. (cmd_func): Set and restore the suppress_notification flag. * cli/cli-deicode.h (struct cmd_list_element) <suppress_notification>: New field. * cli/cli-interp.c (cli_suppress_notification): New global variable. (cli_on_user_selected_context_changed): New function. (_initialize_cli_interp): Attach to user_selected_context_changed observer. * command.h (struct cli_suppress_notification): New structure. (cli_suppress_notification): New global variable declaration. (add_com_suppress_notification): New function declaration. * defs.h (enum user_selected_what_flag): New enum. (user_selected_what): New enum flag type. * frame.h (print_stack_frame_to_uiout): New function declaration. * gdbthread.h (print_selected_thread_frame): New function declaration. * inferior.c (print_selected_inferior): New function definition. (inferior_command): Remove printing of inferior/thread/frame switch notifications, notify user_selected_context_changed observer. * inferior.h (print_selected_inferior): New function declaration. * mi/mi-cmds.c (struct mi_cmd): Add user_selected_context suppression to stack-select-frame and thread-select commands. * mi/mi-interp.c (struct mi_suppress_notification) <user_selected_context>: Initialize. (mi_user_selected_context_changed): New function definition. (_initialize_mi_interp): Attach to user_selected_context_changed. * mi/mi-main.c (mi_cmd_thread_select): Print thread selection reply. (mi_execute_command): Handle notification suppression. Notify user_selected_context_changed observer on thread change instead of printing event directly. Don't send it if command already sends the notification. (command_notifies_uscc_observer): New function. (mi_cmd_execute): Don't handle notification suppression. * mi/mi-main.h (struct mi_suppress_notification) <user_selected_context>: New field. * stack.c (print_stack_frame_to_uiout): New function definition. (select_frame_command): Notify user_selected_context_changed observer. (frame_command): Call print_selected_thread_frame if there's no frame change or notify user_selected_context_changed observer if there is. (up_command): Notify user_selected_context_changed observer. (down_command): Likewise. (_initialize_stack): Suppress user_selected_context notification for command select-frame. * thread.c (thread_command): Notify user_selected_context_changed if the thread has changed, print thread info directly if it hasn't. (do_captured_thread_select): Do not print thread switch event. (print_selected_thread_frame): New function definition. * tui/tui-interp.c (tui_on_user_selected_context_changed): New function definition. (_initialize_tui_interp): Attach to user_selected_context_changed observer. gdb/doc/ChangeLog: PR gdb/20487 * gdb.texinfo (Context management): Update mention of frame change notifications. (gdb/mi Async Records): Document frame field in =thread-select event. * observer.texi (GDB Observers): New user_selected_context_changed observer. gdb/testsuite/ChangeLog: PR gdb/20487 * gdb.mi/mi-pthreads.exp (check_mi_thread_command_set): Adapt =thread-select-event check.
2016-09-28Small improvements to the remote protocol manualTom Tromey2-27/+51
I was reading the gdb RSP manual recently and I found a number of small problems in the documentation. This patch attempts to improve these areas. Specfically: * The term "memory breakpoint" is used only in this section of the manual, and there inconsistently. I found this term confusing -- initially I thought it might be a watchpoint. This patch changes it to use the term "software breakpoint", which is used in the rest of the manual. * The z0 packet didn't document how "kind" was written. And, it had a stray link to the architecture-specific protocol details node. This patch moves this link to a better spot. * The z1 patch didn't document that it accepts cmd_list. * I couldn't find any text saying what response is given to a command like vCont in non-stop mode. The answer is that OK is sent, and then a stop reply is sent as a notification. This patch adds a note about this. * The "create" stop reply did not document that the "R" argument is ignored. * The "W", "X", and "w" packets did not document how the "AA" part is formatted. * The %Stop notification example said "%%Stop", but I think this is incorrect. 2016-09-28 Tom Tromey <tom@tromey.com> * gdb.texinfo (Packets) <z0>: Use "software breakpoint" rather than "memory breakpoint". Further document "kind". Move protocol-details link earlier. <z1>: Document the cmd_list argument. Fix typo. <g>: Remove incorrect sentence. (Stop Reply Packets): Document "OK" response to requests when in non-stop mode. <swbreak>: Use "software breakpoint" rather than "memory breakpoint". <create>: Document that "R" is ignored. <W, X, w>: Document formatting of "AA". (Notification Packets): Use "%Stop", not "%%Stop".
2016-09-21arc: New Synopsys ARC portAnton Kolesov2-0/+72
ARC is a family of licensable processors developed by Synopsys. This is an initial patch that doesn't yet support some of the features, that are already available in Synopsys' fork of GDB, namely: * longjmp support * signal frame handling * prologue analysis * Linux targets support * native Linux support ARC cores are configurable and extensible, which means from debugger perspective that some registers and debug capabilities are optional, therefore it is up to the GDB stub to determine exact list of register available on target and supply it to GDB via XML target descriptions. List of registers that is known to GDB and is required is intentionally kept small to simplify requirements to GDB stub and implementation of a GDB client. gdb/ChangeLog: * Makefile.in (ALL_TARGET_OBS): Add arc-tdep.o. (HFILES_NO_SRCDIR): Add arc-tdep.h. (ALLDEPFILES): Add arc-tdep.c. * NEWS: Mention new ARC port. * configure.tgt: Add ARC. * arc-tdep.c: New file. * arc-tdep.h: New file. * features/Makefile (XMLTOC): Add arc-v2.xml and arc-arcompact.xml. * features/arc-v2.xml: New file. * features/arc-v2.c: New file (generated). * features/arc-arcompact.xml: New file. * features/arc-arcompact.c: New file (generated). gdb/doc/ChangeLog: * gdb.texinfo (Embedded Processors): Document ARC. (Synopsys ARC): New section. (Standard Target Features): Document ARC features. (ARC Features): New section. gdb/testsuite/ChangeLog: * gdb.xml/tdesc-regs.exp: set core-regs for arc*-*-elf32.
2016-09-21Update and add .gitignore'sSimon Marchi2-0/+5
This patch adds a bunch of generated files to gdb's gitignore files. There are still a bunch of "stamp" files that are not ignored, but I think the rule for them should be put in the top-level gitignore. Users and developers are encouraged to build out-of-tree, but some people prefer the simplicity to build in-tree, so it should be useful for them. gdb/ChangeLog: * .gitignore: Ignore more files. * data-directory/.gitignore: Likewise. gdb/doc/ChangeLog: * .gitignore: New file. gdb/gdbserver/ChangeLog: * .gitinore: Ignore more files. gdb/testsuite/ChangeLog: * .gitignore: New file.
2016-08-24Allow resetting an empty inferior-ttySimon Marchi2-2/+9
This patch allows the user to set the inferior-tty to "empty", in order to come back to the default behaviour of using the same tty as gdb is using. This is already supported in MI (and tested in gdb.mi/mi-basics.exp). I added a new test, set-inferior-tty.exp, where I test only the setting and unsetting of the parameter. It would be nice to actually test that the inferior output properly goes to the separate tty, but that will be for another day. gdb/ChangeLog: * infcmd.c (set_inferior_io_terminal): Set inferior terminal to NULL if terminal_name is an empty string. (_initialize_infcmd): Make the argument of "set inferior-tty" optional, mention it in the help doc. gdb/doc/ChangeLog: * gdb.texinfo (Input/Output): Mention possibility to unset inferior-tty. gdb/testsuite/ChangeLog: * gdb.base/set-inferior-tty.exp: New file. * gdb.base/set-inferior-tty.c: New file.
2016-07-25btrace: Resume recording after disconnect.Tim Wiederhake2-1/+7
This patch allows gdbserver to continue recording after disconnect. On reconnect, the recorded data is accessible to gdb as if no disconnect happened. A possible application for this feature is remotely examine bugs that occur at irregular intervals, where maintaining a gdb connection is inconvenient. This also fixes the issue mentioned here: https://sourceware.org/ml/gdb-patches/2015-11/msg00424.html Signed-off-by: Tim Wiederhake <tim.wiederhake@intel.com> gdb/ChangeLog: * NEWS: Resume btrace on reconnect. * record-btrace.c: Added record-btrace.h include. (record_btrace_open): Split into this and ... (record_btrace_push_target): ... this. (record_btrace_disconnect): New function. (init_record_btrace_ops): Use record_btrace_disconnect. * record-btrace.h: New file. * remote.c: Added record-btrace.h include. (remote_start_remote): Check recording status. (remote_btrace_maybe_reopen): New function. gdb/doc/ChangeLog: * gdb.texinfo: Resume btrace on reconnect. gdb/testsuite/ChangeLog: * gdb.btrace/reconnect.c: New file. * gdb.btrace/reconnect.exp: New file. Change-Id: I95e8b0ab8a89e58591aba0e63818cee82fd211bc
2016-07-23Implement catch syscall groupGabriel Krisman Bertazi2-1/+32
Implement support to add catchpoints for a group of related syscalls using the syntax: (gdb) catch syscall group:<group> or (gdb) catch syscall g:<group> Several groups are predefined in the xml files for all architectures supported by GDB over Linux. They are based on the groups defined by strace. gdb/ * xml-syscall.c (get_syscalls_by_group): New. (get_syscall_group_names): New. (struct syscall_group_desc): New structure to store group data. (struct syscalls_info): Include field to store the group list. (sysinfo_free_syscall_group_desc): New. (free_syscalls_info): Free group list. (syscall_group_create_syscall_group_desc): New. (syscall_group_add_syscall): New. (syscall_create_syscall_desc): Add syscall to its groups. (syscall_start_syscall): Load group attribute. (syscall_group_get_group_by_name): New. (xml_list_syscalls_by_group): New. (xml_list_of_groups): New. * xml-syscall.h (get_syscalls_by_group): Export function to retrieve a list of syscalls filtered by the group name. (get_syscall_group_names): Export function to retrieve the list of syscall groups. * break-catch-syscall.c (catch_syscall_split_args): Verify if argument is a syscall group and expand it to a list of syscalls when creating catchpoints. (catch_syscall_completer): Add word completion for system call groups. * configure.ac: Include dependency for xsltproc when building in maintainer-mode. * break-catch-syscall.c (_initialize_breakpoint): Update catch syscall command documentation. * NEWS: Include section about catching groups of syscalls. * configure: Regenerate. * data-directory/Makefile.in: Generate syscall xml when building in maintainer mode. * syscalls/gdb-syscalls.dtd: Include group attribute to the syscall element. * syscalls/apply-defaults.xsl: New. * syscalls/linux-defaults.xml.in: New. * syscalls/aarch64-linux.xml: Rename to aarch64-linux.xml.in. * syscalls/amd64-linux.xml: Rename to amd64-linux.xml.in. * syscalls/arm-linux.xml: Rename to arm-linux.xml.in. * syscalls/bfin-linux.xml: Rename to bfin-linux.xml.in. * syscalls/i386-linux.xml: Rename to i386-linux.xml.in. * syscalls/mips-n32-linux.xml: Rename to mips-n32-linux.xml.in. * syscalls/mips-n64-linux.xml: Rename to mips-n64-linux.xml.in. * syscalls/mips-o32-linux.xml: Rename to mips-o32-linux.xml.in. * syscalls/ppc-linux.xml: Rename to ppc-linux.xml.in. * syscalls/ppc64-linux.xml: Rename to ppc64-linux.xml.in. * syscalls/s390-linux.xml: Rename to s390-linux.xml.in. * syscalls/s390x-linux.xml: Rename to s390x-linux.xml.in. * syscalls/sparc-linux.xml: Rename to sparc-linux.xml.in. * syscalls/sparc64-linux.xml: Rename to sparc64-linux.xml.in. * syscalls/aarch64-linux.xml: Regenerate. * syscalls/amd64-linux.xml: Regenerate. * syscalls/arm-linux.xml: Regenerate. * syscalls/i386-linux.xml: Regenerate. * syscalls/mips-n32-linux.xml: Regenerate. * syscalls/mips-n64-linux.xml: Regenerate. * syscalls/mips-o32-linux.xml: Regenerate. * syscalls/ppc-linux.xml: Regenerate. * syscalls/ppc64-linux.xml: Regenerate. * syscalls/s390-linux.xml: Regenerate. * syscalls/s390x-linux.xml: Regenerate. * syscalls/sparc-linux.xml: Regenerate. * syscalls/sparc64-linux.xml: Regenerate. gdb/testsuite/ * gdb.base/catch-syscall.exp (do_syscall_tests): Add call to test_catch_syscall_group. (test_catch_syscall_group): New. gdb/doc/ * gdb.texinfo (Set Catchpoints): Add 'group' argument to catch syscall.
2016-07-23Support JIT debugging on MS-WindowsРуслан Ижбулатов2-0/+35
gdb/ChangeLog: 2016-06-30 Руслан Ижбулатов <lrn1986@gmail.com> PR gdb/14529 * windows-nat.c (signal_event_command): New command 'signal-event' for W32 JIT debug support. * NEWS: Add an entry about the new 'signal-event' command. gdb/doc/ChangeLog: 2016-06-30 Руслан Ижбулатов <lrn1986@gmail.com> * gdb.texinfo (Cygwin Native): Document the new 'signal-event' command.
2016-07-13PR python/15620, PR python/18620 - breakpoint events in PythonTom Tromey2-0/+20
This patch adds some breakpoint events to Python. In particular, there is a creation event that is emitted when a breakpoint is created; a modification event that is emitted when a breakpoint changes somehow; and a deletion event that is emitted when a breakpoint is deleted. In this patch, the event's payload is the breakpoint itself. I considered making a new event type to hold the breakpoint, but I didn't see a need. Still, I thought I would mention this as a spot where some other choice is possible. Built and regtested on x86-64 Fedora 23. 2016-07-13 Tom Tromey <tom@tromey.com> PR python/15620, PR python/18620: * python/py-evts.c (gdbpy_initialize_py_events): Call add_new_registry for new events. * python/py-events.h (events_object) <breakpoint_created, breakpoint_deleted, breakpoint_modified>: New fields. * python/py-breakpoint.c (gdbpy_breakpoint_created): Emit the breakpoint changed event. (gdbpy_breakpoint_deleted): Emit the breakpoint deleted event. (gdbpy_breakpoint_modified): New function. (gdbpy_initialize_breakpoints): Attach to the breakpoint modified observer. 2016-07-13 Tom Tromey <tom@tromey.com> PR python/15620, PR python/18620: * python.texi (Events In Python): Document new breakpoint events. 2016-07-13 Tom Tromey <tom@tromey.com> PR python/15620, PR python/18620: * gdb.python/py-breakpoint.exp (connect_event, check_last_event) (test_bkpt_events): New procs.
2016-07-13PR python/17698 - add Breakpoint.pendingTom Tromey2-0/+12
This patch adds a "pending" attribute to gdb.Breakpoint. Built and regtested on x86-64 Fedora 23. 2016-07-13 Tom Tromey <tom@tromey.com> PR python/17698: * NEWS: Update. * python/py-breakpoint.c (bppy_get_pending): New function. (breakpoint_object_getset): Add entry for "pending". * breakpoint.h (pending_breakpoint_p): Declare. * breakpoint.c (pending_breakpoint_p): New function. 2016-07-13 Tom Tromey <tom@tromey.com> PR python/17698: * python.texi (Breakpoints In Python): Document Breakpoint.pending. 2016-07-13 Tom Tromey <tom@tromey.com> PR python/17698: * gdb.python/py-breakpoint.exp (test_bkpt_basic): Add "pending" test. (test_watchpoints): Likewise. (test_bkpt_pending): New proc.
2016-07-13Rearrange Python breakpoint node in documentationTom Tromey2-42/+47
I noticed that the Python breakpoint documentation was ordered a bit oddly. It documented the constructor; then the stop method; then the watchpoint constants (used for the constructor); then various other methods and attributes; then the other constants used by the constructor; and then finally some more methods and attributes. This patch rearranges the node a little to move the constants to just after the constructor and before the other methods and attributes. 2016-07-13 Tom Tromey <tom@tromey.com> * python.texi (Breakpoints In Python): Move table of types and table of watchpoint types earlier in node.
2016-07-12PR python/19293 - invalidate frame cache when unwinders changeTom Tromey2-0/+15
PR python/19293 notes that when a Python unwinder is disabled, the frame cache is not invalidated. This means that disabling an unwinder doesn't have any immediate effect -- but in my experience it's often the case that I want to enable or disable an unwinder in order to see what happens. This patch adds a new gdb.invalidate_cached_frames function and arranges for the relevant bits of library code to call it. I've only partially documented this function, considering a warning sufficient without going into all the reasons ordinary code should not call it. The name of the new function was taken from a comment in frame.h next to reinit_frame_cache. No new test as I think the updates to the existing test are sufficient to show that the code is working as intended. Built and regtested on x86-64 Fedora 23. 2016-07-12 Tom Tromey <tom@tromey.com> PR python/19293: * python/lib/gdb/command/unwinders.py (do_enable_unwinder): Call gdb.invalidate_cached_frames. * python/lib/gdb/unwinder.py (register_unwinder): Call gdb.invalidate_cached_frames. * python/python.c (gdbpy_invalidate_cached_frames): New function. (python_GdbMethods): Add entry for invalidate_cached_frames. 2016-07-12 Tom Tromey <tom@tromey.com> PR python/19293: * python.texi (Frames In Python): Document gdb.invalidate_cached_frames. 2016-07-12 Tom Tromey <tom@tromey.com> PR python/19293: * gdb.python/py-unwind-maint.exp: Update tests.
2016-06-21[DOC] Document support for running interpreters on separate UIsPedro Alves2-10/+51
gdb/ChangeLog: 2016-06-21 Pedro Alves <palves@redhat.com> * NEWS: Mention support for running interpreters on separate UIs and the new new-ui command. gdb/doc/ChangeLog: 2016-06-21 Pedro Alves <palves@redhat.com> * gdb.texinfo (Interpreters): Update intepreter-exec section, document new-ui and explain use case.
2016-06-17gdb: new AndesTech NDS32 portYan-Ting Lin2-0/+28
gdb/ChangeLog: * Makefile.in (ALL_TARGET_OBS): Add nds32-tdep.o. (HFILES_NO_SRCDIR): Add nds32-tdep.h. (ALLDEPFILES): Add nds32-tdep.c. * NEWS: Mention new NDS32 port. * configure.tgt: Add NDS32. * nds32-tdep.c: New file. * nds32-tdep.h: New file. * features/Makefile (XMLTOC): Add nds32.xml. * features/nds32-core.xml: New file. * features/nds32-fpu.xml: New file. * features/nds32-system.xml: New file. * features/nds32.c: New file (generated). * features/nds32.xml: New file. gdb/doc/ChangeLog: * gdb.texinfo (Standard Target Features): Document NDS32 features. (NDS32 Features): New Section. gdb/testsuite/ChangeLog: * gdb.base/float.exp: Add target check for nds32*-*-*. * gdb.xml/tdesc-regs.exp: Set core-regs for nds32*-*-*.
2016-06-09Add negative repeat count to 'x' commandToshihito Kikuchi2-1/+18
This change adds support for specifying a negative repeat count to all the formats of the 'x' command to examine memory backward. A new testcase 'examine-backward' is added to cover this new feature. Here's the example output from the new feature: <format 'i'> (gdb) bt #0 Func1 (n=42, p=0x40432e "hogehoge") at main.cpp:5 #1 0x00000000004041fa in main (argc=1, argv=0x7fffffffdff8) at main.cpp:19 (gdb) x/-4i 0x4041fa 0x4041e5 <main(int, char**)+11>: mov %rsi,-0x10(%rbp) 0x4041e9 <main(int, char**)+15>: lea 0x13e(%rip),%rsi 0x4041f0 <main(int, char**)+22>: mov $0x2a,%edi 0x4041f5 <main(int, char**)+27>: callq 0x404147 <format 'x'> (gdb) x/-4xw 0x404200 0x4041f0 <main(int, char**)+22>: 0x00002abf 0xff4de800 0x76e8ffff 0xb8ffffff (gdb) x/-4 0x4041e0 <main(int, char**)+6>: 0x7d8910ec 0x758948fc 0x358d48f0 0x0000013e gdb/ChangeLog: * NEWS: Mention that GDB now supports a negative repeat count in the 'x' command. * printcmd.c (decode_format): Allow '-' in the parameter "string_ptr" to accept a negative repeat count. (find_instruction_backward): New function. (read_memory_backward): New function. (integer_is_zero): New function. (find_string_backward): New function. (do_examine): Use new functions to examine memory backward. (_initialize_printcmd): Mention that 'x' command supports a negative repeat count. gdb/doc/ChangeLog: * gdb.texinfo (Examining Memory): Document negative repeat count in the 'x' command. gdb/testsuite/ChangeLog: * gdb.base/examine-backward.c: New file. * gdb.base/examine-backward.exp: New file.