aboutsummaryrefslogtreecommitdiff
path: root/gdb/doc
AgeCommit message (Collapse)AuthorFilesLines
2015-08-24gdb manual: Remove references to deleted targetsPedro Alves2-398/+16
Support for target dbug/picobug/dink32/m32r/mon2000/ppcbug was just removed, but support for ARM RDI, Sparclet, Sparclite, Z8000, target r3900, target array, target sds, target op50n and target w89k had already been removed many years ago. Drop it all in one go. gdb/doc/ChangeLog: 2015-08-24 Pedro Alves <palves@redhat.com> * gdb.texinfo (Embedded Processors) <ARM>: Remove references to RDI. <M32R>: Remove references to M32R/D. <M68K>: Remove references to target dbug. <MIPS Embedded>: Remove references to target r3900 and target array. <PowerPC Embedded>: Remove references to target dink32 and target ppcbug, target sds <PA, Sparclet, Sparclite, Z8000>: Delete nodes.
2015-08-18gdb/doc: Fix build of 'info' manual.Andrew Burgess2-0/+5
In commit 18989b3c5642e2ba533e02737797dcf06134229b I broke the creation of gdb's info manual; I added a new section without adding a suitable menu entry. This commit adds the missing menu entry and fixes the build of gdb's info manual. gdb/doc/ChangeLog: * gdb.texinfo (GDB Files): Add 'File Caching' menu entry.
2015-08-18gdb: Add debug tracing for bfd cache activity.Andrew Burgess2-0/+14
This patch adds a new debug flag bfd-cache, which when set to non-zero produces debugging log messages relating to gdb's bfd cache. gdb/ChangeLog: * gdb_bfd.c (debug_bfd_cache): New variable. (show_bfd_cache_debug): New function. (gdb_bfd_open): Add debug logging. (gdb_bfd_ref): Likewise. (gdb_bfd_unref): Likewise. (_initialize_gdb_bfd): Add new set/show command. * NEWS: Mention new command. gdb/doc/ChangeLog: * gdb.texinfo (File Caching): Document "set/show debug bfd-cache".
2015-08-18gdb: New maintenance command to disable bfd sharing.Andrew Burgess2-5/+37
In some rare maintainer cases it is desirable to be able to disable bfd sharing. This patch adds new commands maintenance set/show commands for bfd-sharing, allowing gdb's bfd cache to be turned off. gdb/ChangeLog: * gdb_bfd.c (bfd_sharing): New variable. (show_bfd_sharing): New function. (gdb_bfd_open): Check bfd_sharing variable. (_initialize_gdb_bfd): Add new set/show command. * NEWS: Mention new command. gdb/doc/ChangeLog: * gdb.texinfo (Maintenance Commands): Move documentation of "main info bfds" to... (File Caching): A New section. Outline bfd caching, and add new description for "main set/show bfd-sharing".
2015-08-14New /s modifier for the disassemble command.Doug Evans2-9/+118
The "source centric" /m option to the disassemble command is often unhelpful, e.g., in the presence of optimized code. This patch adds a /s modifier that is better. For one, /m only prints instructions from the originating source file, leaving out instructions from e.g., inlined functions from other files. gdb/ChangeLog: PR gdb/11833 * NEWS: Document new /s modifier for the disassemble command. * cli/cli-cmds.c (disassemble_command): Add support for /s. (_initialize_cli_cmds): Update online docs of disassemble command. * disasm.c: #include "source.h". (struct deprecated_dis_line_entry): Renamed from dis_line_entry. All uses updated. (dis_line_entry): New struct. (hash_dis_line_entry, eq_dis_line_entry): New functions. (allocate_dis_line_table): New functions. (maybe_add_dis_line_entry, line_has_code_p): New functions. (dump_insns): New arg end_pc. All callers updated. (do_mixed_source_and_assembly_deprecated): Renamed from do_mixed_source_and_assembly. All callers updated. (do_mixed_source_and_assembly): New function. (gdb_disassembly): Handle /s (DISASSEMBLY_SOURCE). * disasm.h (DISASSEMBLY_SOURCE_DEPRECATED): Renamed from DISASSEMBLY_SOURCE. All uses updated. (DISASSEMBLY_SOURCE): New macro. * mi/mi-cmd-disas.c (mi_cmd_disassemble): New modes 4,5. gdb/doc/ChangeLog: * gdb.texinfo (Machine Code): Update docs for mixed source/assembly disassembly. (GDB/MI Data Manipulation): Update docs for new disassembly modes. gdb/testsuite/ChangeLog: * gdb.mi/mi-disassemble.exp: Update. * gdb.base/disasm-optim.S: New file. * gdb.base/disasm-optim.c: New file. * gdb.base/disasm-optim.h: New file. * gdb.base/disasm-optim.exp: New file.
2015-08-11Explicit locations: documentation updatesKeith Seitz2-86/+175
This patch adds documentation for explicit locations to both the User Manual and gdb's online help system. gdb/ChangeLog: * NEWS: Mention explicit locations. * breakpoint.c [LOCATION_HELP_STRING]: New macro. [BREAK_ARGS_HELP]: Use LOCATION_HELP_STRING. (_initialize_breakpoint): Update documentation for "clear", "break", "trace", "strace", "ftrace", and "dprintf". gdb/doc/ChangeLog: * gdb.texinfo (Thread-Specific Breakpoints, Printing Source Lines): Use "location(s)"instead of "linespec(s)". (Specifying a Location): Rewrite. Add subsections describing linespec, address, and explicit locations. Add node/menu for each subsection. (Source and Machine Code, C Preprocessor Macros) (Create and Delete Trace points) (Extensions for Ada Tasks): Use "location(s)" instead of "linespec(s)". (Continuing at a Different Address): Remove "linespec" examples. Add reference to "Specify a Location" (The -break-insert Command): Rewrite. Add anchor. Add reference to appropriate manual section discussing locations. (The -dprintf-insert Command): Refer to -break-insert for specification of 'location'. gdb/testsuite/ChangeLog: * gdb.base/help.exp: Update help_breakpoint_text.
2015-08-07Implement all-stop on top of a target running non-stop modePedro Alves2-0/+29
This finally implements user-visible all-stop mode running with the target_ops backend always in non-stop mode. This is a stepping stone towards finer-grained control of threads, being able to do interesting things like thread groups, associating groups with breakpoints, etc. From the user's perspective, all-stop mode is really just a special case of being able to stop and resume specific sets of threads, so it makes sense to do this step first. With this, even in all-stop, the target is no longer in charge of stopping all threads before reporting an event to the core -- the core takes care of it when it sees fit. For example, when "next"- or "step"-ing, we can avoid stopping and resuming all threads at each internal single-step, and instead only stop all threads when we're about to present the stop to the user. The implementation is almost straight forward, as the heavy lifting has been done already in previous patches. Basically, we replace checks for "set non-stop on/off" (the non_stop global), with calls to a new target_is_non_stop_p function. In a few places, if "set non-stop off", we stop all threads explicitly, and in a few other places we resume all threads explicitly, making use of existing methods that were added for teaching non-stop to step over breakpoints without displaced stepping. This adds a new "maint set target-non-stop on/off/auto" knob that allows both disabling the feature if we find problems, and force-enable it for development (useful when teaching a target about this. The default is "auto", which means the feature is enabled if a new target method says it should be enabled. The patch implements the method in linux-nat.c, just for illustration, because it still returns false. We'll need a few follow up fixes before turning it on by default. This is a separate target method from indicating regular non-stop support, because e.g., while e.g., native linux-nat.c is close to regression free with all-stop-non-stop (with following patches will fixing the remaining regressions), remote.c+gdbserver will still need more fixing, even though it supports "set non-stop on". Tested on x86_64 Fedora 20, native, with and without "set displaced off", and with and without "maint set target-non-stop on"; and also against gdbserver. gdb/ChangeLog: 2015-08-07 Pedro Alves <palves@redhat.com> * NEWS: Mention "maint set/show target-non-stop". * breakpoint.c (update_global_location_list): Check target_is_non_stop_p instead of non_stop. * infcmd.c (attach_command_post_wait, attach_command): Likewise. * infrun.c (show_can_use_displaced_stepping) (can_use_displaced_stepping_p, start_step_over_inferior): Likewise. (internal_resume_ptid): New function. (resume): Use it. (proceed): Check target_is_non_stop_p instead of non_stop. If in all-stop mode but the target is always in non-stop mode, start all the other threads that are implicitly resumed too. (for_each_just_stopped_thread, fetch_inferior_event) (adjust_pc_after_break, stop_all_threads): Check target_is_non_stop_p instead of non_stop. (handle_inferior_event): Likewise. Handle detach-fork in all-stop with the target always in non-stop mode. (handle_signal_stop) <random signal>: Check target_is_non_stop_p instead of non_stop. (switch_back_to_stepped_thread): Check target_is_non_stop_p instead of non_stop. (keep_going_stepped_thread): Use internal_resume_ptid. (stop_waiting): If in all-stop mode, and the target is in non-stop mode, stop all threads. (keep_going_pass): Likewise, when starting a new in-line step-over sequence. * linux-nat.c (get_pending_status, select_event_lwp) (linux_nat_filter_event, linux_nat_wait_1, linux_nat_wait): Check target_is_non_stop_p instead of non_stop. (linux_nat_always_non_stop_p): New function. (linux_nat_stop): Check target_is_non_stop_p instead of non_stop. (linux_nat_add_target): Install linux_nat_always_non_stop_p. * target-delegates.c: Regenerate. * target.c (target_is_non_stop_p): New function. (target_non_stop_enabled, target_non_stop_enabled_1): New globals. (maint_set_target_non_stop_command) (maint_show_target_non_stop_command): New functions. (_initilize_target): Install "maint set/show target-non-stop" commands. * target.h (struct target_ops) <to_always_non_stop_p>: New field. (target_non_stop_enabled): New declaration. (target_is_non_stop_p): New declaration. gdb/doc/ChangeLog: 2015-08-07 Pedro Alves <palves@redhat.com> * gdb.texinfo (Maintenance Commands): Document "maint set/show target-non-stop".
2015-08-07btrace: indicate speculative executionMarkus Metzger2-2/+13
Indicate speculatively executed instructions with a leading '?'. We use the space that is normally used for the PC prefix. In the case where the instruction at the current PC had been executed speculatively before, the PC prefix will be partially overwritten resulting in "?> ". As a side-effect, the /p modifier to omit the PC prefix in the "record instruction-history" command now uses a 3-space PC prefix " " in order to have enough space for the speculative execution indication. gdb/ * btrace.c (btrace_compute_ftrace_bts): Clear insn flags. (pt_btrace_insn_flags): New. (ftrace_add_pt): Call pt_btrace_insn_flags. * btrace.h (btrace_insn_flag): New. (btrace_insn) <flags>: New. * record-btrace.c (btrace_insn_history): Print insn prefix. * NEWS: Announce it. doc/ * gdb.texinfo (Process Record and Replay): Document prefixing of speculatively executed instructions in the "record instruction-history" command. testsuite/ * gdb.btrace/instruction_history.exp: Update. * gdb.btrace/tsx.exp: New. * gdb.btrace/tsx.c: New. * lib/gdb.exp (skip_tsx_tests, skip_btrace_pt_tests): New.
2015-07-24Remove leading/trailing white spaces in ChangeLogH.J. Lu1-28/+28
2015-07-20Makefile.in (STABS_DOC_BUILD_INCLUDES): Add gdb-cfg.texi, GDBvn.texi.Doug Evans2-1/+7
gdb/doc/ChangeLog: * Makefile.in (STABS_DOC_BUILD_INCLUDES): Add gdb-cfg.texi, GDBvn.texi.
2015-07-16stabs.texinfo: @include gdb-cfg.texi.Doug Evans2-0/+8
gdb/doc/ChangeLog: * stabs.texinfo: @include gdb-cfg.texi.
2015-07-15Revert the previous 7 commits of: Validate binary before useJan Kratochvil2-48/+13
ddc98fbf2fd9e244a215a4d09e559180dc573a14 Create empty nat/linux-maps.[ch] and common/target-utils.[ch] 6e5b4429db0d66e2d0b27e1bcfe4709f3dae73ed Move gdb_regex* to common/ f7af1fcd759fa126612018a5916cf808df7bb8bc Prepare linux_find_memory_regions_full & co. for move 9904185cfde13d6c6849f1f042c8e3b74974cf08 Move linux_find_memory_regions_full & co. 700ca40f6fc1addd7238f4ab57f76c095ad3c99f gdbserver build-id attribute generator ca5268b6be265580b91ef75c1a1a9815f581ae42 Validate symbol file using build-id 0a94970d663a053c523f23ac0d71deb25a77f709 Tests for validate symbol file using build-id gdb/ChangeLog 2015-07-15 Jan Kratochvil <jan.kratochvil@redhat.com> Revert the previous 6 commits: Create empty nat/linux-maps.[ch] and common/target-utils.[ch]. Move gdb_regex* to common/ Prepare linux_find_memory_regions_full & co. for move Move linux_find_memory_regions_full & co. gdbserver build-id attribute generator Validate symbol file using build-id gdb/gdbserver/ChangeLog 2015-07-15 Jan Kratochvil <jan.kratochvil@redhat.com> Revert the previous 3 commits: Move gdb_regex* to common/ Move linux_find_memory_regions_full & co. gdbserver build-id attribute generator gdb/doc/ChangeLog 2015-07-15 Jan Kratochvil <jan.kratochvil@redhat.com> Revert the previous 2 commits: gdbserver build-id attribute generator Validate symbol file using build-id gdb/testsuite/ChangeLog 2015-07-15 Jan Kratochvil <jan.kratochvil@redhat.com> Revert the previous commit: Tests for validate symbol file using build-id.
2015-07-15Validate symbol file using build-idJan Kratochvil2-0/+43
Consumer part of the "build-id" attribute. gdb/ChangeLog 2015-07-15 Aleksandar Ristovski <aristovski@qnx.com Jan Kratochvil <jan.kratochvil@redhat.com> Validate symbol file using build-id. * NEWS (Changes since GDB 7.10): Add 'set validate-build-id' and 'show validate-build-id'. Add build-id attribute. * solib-darwin.c (_initialize_darwin_solib): Assign validate value. * solib-dsbt.c (_initialize_dsbt_solib): Ditto. * solib-frv.c (_initialize_frv_solib): Ditto. * solib-spu.c (set_spu_solib_ops): Ditto. * solib-svr4.c: Include rsp-low.h. (NOTE_GNU_BUILD_ID_NAME): New define. (svr4_validate): New function. (svr4_copy_library_list): Duplicate field build_id. (library_list_start_library): Parse 'build-id' attribute. (svr4_library_attributes): Add 'build-id' attribute. (_initialize_svr4_solib): Assign validate value. * solib-target.c (solib.h): Include. (_initialize_solib_target): Assign validate value. * solib.c (validate_build_id, show_validate_build_id): New. (solib_map_sections): Use ops->validate. (clear_so): Free build_id. (default_solib_validate): New function. (_initialize_solib): Add "validate-build-id". * solib.h (default_solib_validate): New declaration. * solist.h (struct so_list): New fields 'build_idsz' and 'build_id'. (target_so_ops): New field 'validate'. gdb/doc/ChangeLog 2015-07-15 Jan Kratochvil <jan.kratochvil@redhat.com> * gdb.texinfo (Files): Add 'set validate-build-id' and 'show validate-build-id'.
2015-07-15gdbserver build-id attribute generatorJan Kratochvil2-7/+17
Producer part of the new "build-id" XML attribute. gdb/ChangeLog 2015-07-15 Aleksandar Ristovski <aristovski@qnx.com Jan Kratochvil <jan.kratochvil@redhat.com> gdbserver build-id attribute generator. * features/library-list-svr4.dtd (library-list-svr4): New 'build-id' attribute. gdb/doc/ChangeLog 2015-07-15 Aleksandar Ristovski <aristovski@qnx.com Jan Kratochvil <jan.kratochvil@redhat.com> gdbserver build-id attribute generator. * gdb.texinfo (Library List Format for SVR4 Targets): Add 'build-id' in description, example, new attribute in dtd. gdb/gdbserver/ChangeLog 2015-07-15 Aleksandar Ristovski <aristovski@qnx.com Jan Kratochvil <jan.kratochvil@redhat.com> gdbserver build-id attribute generator. * linux-low.c (nat/linux-maps.h, search.h, rsp-low.h): Include. (ElfXX_Ehdr, ElfXX_Phdr, ElfXX_Nhdr): New. (ELFXX_FLD, ELFXX_SIZEOF, ELFXX_ROUNDUP, BUILD_ID_INVALID): New. (find_phdr): New. (get_dynamic): Use find_pdhr to traverse program headers. (struct mapping_entry, mapping_entry_s, free_mapping_entry_vec) (compare_mapping_entry_range, struct find_memory_region_callback_data) (read_build_id, find_memory_region_callback, lrfind_mapping_entry) (get_hex_build_id): New. (linux_qxfer_libraries_svr4): Add optional build-id attribute to reply XML document.
2015-07-08gdb/doc: Update 'frame' command documentation.Andrew Burgess2-13/+10
The documentation for the 'frame' command has gotten a little out of date, it still mentions architecturally specific details that are no longer relevant. This commit removes the old details that no longer apply, and tries to expand the existing text a little to make the usage clearer for some cases. gdb/doc/ChangeLog: * gdb.texinfo (Selection): Update documentation for 'frame' command.
2015-07-06gdb: Rewrite documentation for layout and focus commands.Andrew Burgess1-16/+31
Changes the documentation for the layout and focus commands. Instead of documenting each layout (or focus) sub-command as a separate command, document a single layout (and focus) command which takes a parameter, then list the possible parameters in a table nested under each command. The documentation for the layout command has been extended little to make it clearer which windows are shown in each layout. gdb/ChangeLog: * doc/gdb.texinfo (TUI): Restructure documentation on TUI layout and focus commands.
2015-07-06gdb/doc: Fix incorrect use of @xref.Andrew Burgess1-1/+1
All uses of @xref must be followed by either '.' or ','. In commit a4ea0946c an incorrect use of @xref was introduced. This commit adds a comma after the use of @xref. gdb/ChangeLog: * doc/gdb.texinfo (TUI): Add comma after @xref.
2015-07-02btrace: maintenance commandsMarkus Metzger2-0/+65
Add maintenance commands that help debugging the btrace record target. The following new commands are added: maint info btrace Print information about branch tracing internals. maint btrace packet-history Print the raw branch tracing data. maint btrace clear-packet-history Discard the stored raw branch tracing data. maint btrace clear Discard all branch tracing data. It will be fetched and processed anew by the next "record" command. maint set|show btrace pt skip-pad Set and show whether PAD packets are skipped when computing the packet history. gdb/ * btrace.c: Include gdbcmd.h, cli/cli-utils.h, and ctype.h. (maint_btrace_cmdlist, maint_btrace_set_cmdlist) (maint_btrace_show_cmdlist, maint_btrace_pt_set_cmdlist) (maint_btrace_pt_show_cmdlist, maint_btrace_pt_skip_pad) (btrace_maint_clear): New. (btrace_fetch, btrace_clear): Call btrace_maint_clear. (pt_print_packet, btrace_maint_decode_pt) (btrace_maint_update_pt_packets, btrace_maint_update_packets) (btrace_maint_print_packets, get_uint, get_context_size, no_chunk) (maint_btrace_packet_history_cmd) (maint_btrace_clear_packet_history_cmd, maint_btrace_clear_cmd) (maint_btrace_cmd, maint_btrace_set_cmd, maint_btrace_show_cmd) (maint_btrace_pt_set_cmd, maint_btrace_pt_show_cmd) (maint_info_btrace_cmd, _initialize_btrace): New. * btrace.h (btrace_pt_packet, btrace_pt_packet_s) (btrace_maint_packet_history, btrace_maint_info): New. (btrace_thread_info) <maint>: New. * NEWS: Announce it. doc/ * gdb.texinfo (Maintenance Commands): Document "maint btrace" commands.
2015-07-02btrace: support Intel(R) Processor TraceMarkus Metzger2-8/+126
Adds a new command "record btrace pt" to configure the kernel to use Intel(R) Processor Trace instead of Branch Trace Strore. The "record btrace" command chooses the tracing format automatically. Intel(R) Processor Trace support requires Linux 4.1 and libipt. gdb/ * NEWS: Announce new commands "record btrace pt" and "record pt". Announce new options "set|show record btrace pt buffer-size". * btrace.c: Include "rsp-low.h". Include "inttypes.h". (btrace_add_pc): Add forward declaration. (pt_reclassify_insn, ftrace_add_pt, btrace_pt_readmem_callback) (pt_translate_cpu_vendor, btrace_finalize_ftrace_pt) (btrace_compute_ftrace_pt): New. (btrace_compute_ftrace): Support BTRACE_FORMAT_PT. (check_xml_btrace_version): Update version check. (parse_xml_raw, parse_xml_btrace_pt_config_cpu) (parse_xml_btrace_pt_raw, parse_xml_btrace_pt) (btrace_pt_config_cpu_attributes, btrace_pt_config_children) (btrace_pt_children): New. (btrace_children): Add support for "pt". (parse_xml_btrace_conf_pt, btrace_conf_pt_attributes): New. (btrace_conf_children): Add support for "pt". * btrace.h: Include "intel-pt.h". (btrace_pt_error): New. * common/btrace-common.c (btrace_format_string, btrace_data_fini) (btrace_data_empty): Support BTRACE_FORMAT_PT. * common/btrace-common.h (btrace_format): Add BTRACE_FORMAT_PT. (struct btrace_config_pt): New. (struct btrace_config)<pt>: New. (struct btrace_data_pt_config, struct btrace_data_pt): New. (struct btrace_data)<pt>: New. * features/btrace-conf.dtd (btrace-conf)<pt>: New. (pt): New. * features/btrace.dtd (btrace)<pt>: New. (pt, pt-config, cpu): New. * nat/linux-btrace.c (perf_event_read, perf_event_read_all) (perf_event_pt_event_type, kernel_supports_pt) (linux_supports_pt): New. (linux_supports_btrace): Support BTRACE_FORMAT_PT. (linux_enable_bts): Free tinfo on error. (linux_enable_pt): New. (linux_enable_btrace): Support BTRACE_FORMAT_PT. (linux_disable_pt): New. (linux_disable_btrace): Support BTRACE_FORMAT_PT. (linux_fill_btrace_pt_config, linux_read_pt): New. (linux_read_btrace): Support BTRACE_FORMAT_PT. * nat/linux-btrace.h (struct btrace_tinfo_pt): New. (struct btrace_target_info)<pt>: New. * record-btrace.c (set_record_btrace_pt_cmdlist) (show_record_btrace_pt_cmdlist): New. (record_btrace_print_pt_conf): New. (record_btrace_print_conf): Support BTRACE_FORMAT_PT. (btrace_ui_out_decode_error): Support BTRACE_FORMAT_PT. (cmd_record_btrace_pt_start): New. (cmd_record_btrace_start): Support BTRACE_FORMAT_PT. (cmd_set_record_btrace_pt, cmd_show_record_btrace_pt): New. (_initialize_record_btrace): Add new commands. * remote.c (PACKET_Qbtrace_pt, PACKET_Qbtrace_conf_pt_size): New. (remote_protocol_features): Add "Qbtrace:pt". Add "Qbtrace-conf:pt:size". (remote_supports_btrace): Support BTRACE_FORMAT_PT. (btrace_sync_conf): Support PACKET_Qbtrace_conf_pt_size. (remote_enable_btrace): Support BTRACE_FORMAT_PT. (_initialize_remote): Add new commands. gdbserver/ * linux-low.c: Include "rsp-low.h" (linux_low_encode_pt_config, linux_low_encode_raw): New. (linux_low_read_btrace): Support BTRACE_FORMAT_PT. (linux_low_btrace_conf): Support BTRACE_FORMAT_PT. (handle_btrace_enable_pt): New. (handle_btrace_general_set): Support "pt". (handle_btrace_conf_general_set): Support "pt:size". doc/ * gdb.texinfo (Process Record and Replay): Spell out that variables and registers are not available during btrace replay. Describe the new "record btrace pt" command. Describe the new "set|show record btrace pt buffer-size" options. (General Query Packets): Describe the new Qbtrace:pt and Qbtrace-conf:pt:size packets. Expand "bts" to "Branch Trace Store". Update the branch trace DTD.
2015-06-26Add option to remove duplicate command history entriesPatrick Palka2-0/+20
This patch implements the new option "history remove-duplicates", which controls the removal of duplicate history entries ("off" by default). The motivation for this option is to be able to reduce the prevalence of basic commands such as "up" and "down" in the history file. These common commands crowd out more unique commands in the history file (when the history file has a fixed size), and they make navigation of the history file via ^P, ^N and ^R more inconvenient. The option takes an integer denoting the number of history entries to look back at for a history entry that is a duplicate of the latest one. "history remove-duplicates 1" is equivalent to bash's ignoredups option, and "history remove-duplicates unlimited" is equivalent to bash's erasedups option. [ I decided to go with this integer approach instead of a tri-state enum because it's slightly more flexible and seemingly more intuitive than leave/erase/ignore. ] gdb/ChangeLog: * NEWS: Mention the new option "history remove-duplicates". * top.c (history_remove_duplicates): New static variable. (show_history_remove_duplicates): New static function. (gdb_add_history): Conditionally remove duplicate history entries. (init_main): Add "history remove-duplicates" option. gdb/doc/ChangeLog: * gdb.texinfo (Command History): Document the new option "history remove-duplicates". gdb/testsuite/ChangeLog: * gdb.base/history-duplicates.exp: New test.
2015-06-19Remove special support in gdb for Sun's version of stabs.Doug Evans2-3/+9
Discussion: https://sourceware.org/ml/gdb-patches/2015-05/msg00169.html gdb/ChangeLog: * NEWS: Mention Sun's version of stabs is no longer supported. * elfread.c (free_elfinfo): Delete. All uses updated. (elfstab_offset_sections): Delete. All uses updated. * gdb-stabs.h (stab_section_info): Delete. All uses updated. * psympriv.h (partial_symtab) <section_offsets>: Delete. All uses updated. * psymtab.c (start_psymtab_common): Delete arg section_offsets. All callers updated. gdb/doc/ChangeLog: * stabs.texinfo (ELF Linker Relocation): Mention Sun stabs is no longer supported.
2015-06-17Make NEWS entry and manual regarding GDBHISTSIZE more consistentPatrick Palka2-3/+8
... by mentioning in the manual that setting GDBHISTSIZE to the empty string disables truncation, like the NEWS entry does. gdb/doc/ChangeLog: * gdb.texinfo (Command History): Mention that setting GDBHISTSIZE to the empty string disables history truncation.
2015-06-17Tweak the handling of $GDBHISTSIZE edge cases [PR gdb/16999]Patrick Palka2-4/+11
When GDB reads a nonsensical value for the GDBHISTSIZE environment variable, i.e. one that is non-numeric or negative, GDB then sets its history size to 0. This behavior is annoying and also inconsistent with the behavior of bash. This patch makes the behavior of invalid GDBHISTSIZE consistent with how bash handles HISTSIZE. When we encounter a null or out-of-range GDBHISTSIZE (outside of [0, INT_MAX]) we now set the history size to unlimited instead of 0. When we encounter a non-numeric GDBHISTSIZE we do nothing. gdb/ChangeLog: PR gdb/16999 * NEWS: Mention new GDBHISTSIZE behavior. * top.c (init_history): For null or out-of-range GDBHISTSIZE, set history size to unlimited. Ignore non-numeric GDBHISTSIZE. gdb/doc/ChangeLog: PR gdb/16999 * gdb.texinfo (Command History): Mention new GDBHISTSIZE behavior. gdb/testsuite/ChangeLog: PR gdb/16999 * gdb.base/gdbhistsize-history.exp: New test.
2015-06-17Read $GDBHISTSIZE instead of $HISTSIZEPatrick Palka2-2/+7
The HISTSIZE environment variable is generally expected to be read by shells, not by applications. Some distros for example globally export HISTSIZE in /etc/profile -- with the intention that it only affects shells -- and by doing so it renders useless GDB's own mechanism for setting the history size via .gdbinit. Also, annoyances may arise when HISTSIZE is not interpreted the same way by the shell and by GDB, e.g. PR gdb/16999. That can always be fixed on a shell-by-shell basis but it may be impossible to be consistent with the behavior of all shells at once. Finally it just makes sense to not confound shell environment variables with application environment variables. gdb/ChangeLog: * NEWS: Mention that GDBHISTSIZE is read instead of HISTSIZE. * top.c (init_history): Read from GDBHISTSIZE instead of HISTSIZE. (init_main): Refer to GDBHISTSIZE instead of HISTSIZE. gdb/doc/ChangeLog: * gdb.texinfo (Command History): Replace occurrences of HISTSIZE with GDBHISTSIZE. gdb/testsuite/ChangeLog: * gdb.base/gdbinit-history.exp: Replace occurrences of HISTSIZE with GDBHISTSIZE. * gdb.base/readline.exp: Likewise.
2015-06-15Clarify doc about memory read/write and non-8-bits addressable memory unit sizesSimon Marchi3-29/+58
New in v3: * Change RSP documentation as well. The m, M and X packets now use lengths in addressable memory units. New in v2: * Change wording: use byte for 8-bits chunks and addressable memory unit for the unit of data associated to a single address. * Introduce definition of addressable memory unit in the Memory section. This patch modifies the manual to clarify the MI, RSP and Python APIs in regard to reading/writing memory on architectures with addressable memory unit that are not 8 bits. Care is taken to use the word "addressable memory unit" or "memory unit" when referring to one piece of the smallest addressable size on the current architecture and the word "byte" when referring to an 8-bits data piece. For MI, -data-{read,write}-memory are not modified, since they are deprecated. gdb/doc/ChangeLog: * gdb.texinfo (GDB/MI Data Manipulation): Clarify usage of bytes and memory units for -data-{read,write}-memory-bytes. (Packets): Same for m, M and X packets. * python.texi (Inferiors In Python): Same for read_memory and write_memory.
2015-06-15Allow gdb to find debug symbols file by build-id for PE file format alsoJon Turney2-1/+6
This promotes BFD's struct elf_build_id to the generic struct bfd_build_id, populated when an ELF or PE BFD is read. gdb is updated to use that, and to use the build-id to find symbols for PE files also. There is currently no generic way to extract the build-id from an object file, perhaps an option to objdump to do this might make sense? On x86_64-pc-cygwin, gdb's sepdebug.exp changes: -# of unsupported tests 1 +# of expected passes 90 I don't seem to get consistent testsuite runs on i686-linux-gnu, but there don't appear to be any regressions. bfd/ChangeLog: 2015-06-10 Jon Turney <jon.turney@dronecode.org.uk> * elf-bfd.h : Remove struct elf_build_id. * bfd.c : Add struct bfd_build_id. * bfd-in2.h: Regenerate. * elf.c (elfobj_grok_gnu_build_id): Update to use bfd_build_id. * libpei.h: Add protoype and macros for bfd_XXi_slurp_codeview_record. * peXXigen.c (_bfd_XXi_slurp_codeview_record): Make public * peicode.h (pe_bfd_read_buildid): Add. (pe_bfd_object_p): Use pe_bfd_read_buildid(). gdb/ChangeLog: 2015-06-10 Jon Turney <jon.turney@dronecode.org.uk> * build-id.c: Don't include elf-bfd.h. (build_id_bfd_get): Use bfd_build_id. (build_id_verify): Ditto. * build-id.h: Ditto. (find_separate_debug_file_by_buildid): Ditto. * python/py-objfile.c: Don't include elf-bfd.h. (objfpy_get_build_id) Use bfd_build_id. (objfpy_build_id_matches, objfpy_lookup_objfile_by_build_id): Ditto. * coffread.c: Include build-id.h. (coff_symfile_read): Try find_separate_debug_file_by_buildid. gdb/doc/ChangeLog: 2015-06-10 Jon Turney <jon.turney@dronecode.org.uk> * gdb.texinfo (Separate Debug Files): Document that PE is also supported. gdb/testsuite/ChangeLog: 2015-06-10 Jon Turney <jon.turney@dronecode.org.uk> * gdb.base/sepdebug.exp: Add EXEEXT where needed. * lib/gdb.exp (get_build_id): Teach how to extract build-id from a PE file. * lib/future.exp (gdb_find_objdump): Add gdb_find_objdump. Signed-off-by: Jon Turney <jon.turney@dronecode.org.uk>
2015-06-13gdb: Rework command completion on 'tui reg'.Andrew Burgess2-20/+32
We previously specified a few known register groups for the 'tui reg' command. Other register groups could be accessed, but only by using the 'tui reg next' command and cycling through all the groups. This commit removes the hard coded sub-commands of 'tui reg' and instead adds dynamic completion of sub-commands based on the architecturally defined register groups, giving immediate access to all available register groups. There is still the 'next' and 'prev' commands for cycling through the register groups if that's wanted. The new code maintains the ability to only enter partial names for register groups, which is something we got for free when using the standard sub-command mechanism. The register (and register group) completer has been changed to use get_current_arch rather than using the architecture of the currently selected frame. When the target is running, this is equivalent, however, when the target is not running, using get_current_arch will provide results from the default architecture. gdb/ChangeLog: * completer.c: Add arch-utils.h include. (enum reg_completer_targets): New enum. (reg_or_group_completer_1): New function containing old reg_or_group_completer, add and use new parameter to control what is completed on. Use get_current_arch rather than architecture of currently selected frame. (reg_or_group_completer): Call new reg_or_group_completer_1. (reggroup_completer): Call new reg_or_group_completer_1. * completer.h (reggroup_completer): Add declaration. * tui/tui-regs.c: Add 'completer.h' include. (tui_reg_next_command): Renamed to... (tui_reg_next): ...this. Adjust parameters and return rather than display new group. (tui_reg_prev_command): Renamed to... (tui_reg_prev): ...this. Adjust parameters and return rather than display new group. (tui_reg_float_command): Delete. (tui_reg_general_command): Delete. (tui_reg_system_command): Delete. (tui_reg_command): Rewrite to perform switching of register group. Add header comment. (tuireglist): Remove. (tui_reggroup_completer): New function. (_initialize_tui_regs): Remove 'tui reg' sub-commands, update creation of 'tui reg' command. * NEWS: Add comment about 'tui reg' changes. gdb/doc/ChangeLog: * gdb.texinfo (TUI Commands): Bring all 'tui reg' commands into a single table entry.
2015-06-12Fix broken GDB build after adding Bound table support for i386.Walfred Tedeschi2-0/+7
Types used for some variables could not be used for 32 bits, causing a compilation failure. This patch adds a cast to force a quite compilation, but at the same time it bails out in the case that the cast performed is not safe, i.e. in the case where the debuggee is 64bit and debugger is 32bit. Documentation was also affected, once a different version of texinfo the docs could not be build. 2015-06-10 Walfred Tedeschi <walfred.tedeschi@intel.com> * i386-tdep.c (i386_mpx_get_bt_entry): Add a cast for mpx_bd_mask and bt_mask to CORE_ADDR. doc: * gdb.textinfo (i386): Fix "@end table" end and "@table" placement.
2015-06-10Implement multiple-filesystem support for remote targetsGary Benson2-0/+24
This commit allows GDB to access executables and shared libraries on remote targets where the remote stub does not share a common filesystem with the inferior(s). A new packet "vFile:setfs" is added to the remote protocol and the three remote hostio functions with filename arguments are modified to send "vFile:setfs" packets as necessary. gdb/ChangeLog: * remote.c (struct remote_state) <fs_pid>: New field. (new_remote_state): Initialize the above. (PACKET_vFile_setfs): New enum value. (remote_hostio_set_filesystem): New function. (remote_hostio_open): Call the above. (remote_hostio_unlink): Likewise. (remote_hostio_readlink): Likewise. (_initialize_remote): Register new "set/show remote hostio-setfs-packet" command. * NEWS: Announce new vFile:setfs packet. gdb/doc/ChangeLog: * gdb.texinfo (Remote Configuration): Document the "set/show remote hostio-setfs-packet" command. (Host I/O Packets): Document the vFile:setfs packet.
2015-06-10Implement mount namespace support for native Linux targetsGary Benson2-0/+10
This commit allows GDB to access executables and shared libraries on native Linux targets where GDB and the inferior have different mount namespaces. gdb/ChangeLog: * linux-nat.c (nat/linux-namespaces.h): New include. (fileio.h): Likewise. (linux_nat_filesystem_is_local): New function. (linux_nat_fileio_pid_of): Likewise. (linux_nat_fileio_open): Likewise. (linux_nat_fileio_readlink): Likewise. (linux_nat_fileio_unlink): Likewise. (linux_nat_add_target): Initialize to_filesystem_is_local, to_fileio_open, to_fileio_readlink and to_fileio_unlink. (_initialize_linux_nat): New "set/show debug linux-namespaces" commands. * NEWS: Mention new "set/show debug linux-namespaces" commands. gdb/doc/ChangeLog: * gdb.texinfo (Debugging Output): Document the "set/show debug linux-namespaces" command.
2015-06-10Missing Changelogs for last commitsWalfred Tedeschi1-0/+6
Signed-off-by: Walfred Tedeschi <walfred.tedeschi@intel.com>
2015-06-10Add support for bound table in the Intel MPX context.Walfred Tedeschi1-1/+19
Intel(R) Memory protection bound information are located in register to be tested using the MPX new instructions. Since the number of bound registers are limited a table is used to provide storage for bounds during run-time. In order to investigate the contents of the MPX bound table two new commands are added to GDB. "show mpx bound" and "set mpx bound" are used to display and set values on the MPX bound table. 2015-04-20 Walfred Tedeschi <walfred.tedeschi@intel.com> Mircea Gherzan <mircea.gherzan@intel.com> * i386-tdep.c (MPX_BASE_MASK, MPX_BD_MASK, MPX_BT_MASK, MPX_BD_MASK_32, MPX_BT_MASK_32): New macros. (i386_mpx_set_bounds): New function that implements the command "set-mpx-bound". (i386_mpx_enabled) Helper function to test MPX availability. (i386_mpx_bd_base) Helper function to calculate the base directory address. (i386_mpx_get_bt_entry) Helper function to access a bound table entry. (i386_mpx_print_bounds) Effectively display bound information. (_initialize_i386_tdep): Qdd new commands to commands "set mpx" and "show mpx". (_initialize_i386_tdep): Add "bound" to the commands "show mpx" and "set mpx" commands. (mpx_set_cmdlist and mpx_show_cmdlist): list for the new prefixed "set mpx" and "show mpx" commands. * NEWS: List new commands for MPX support. testsuite: * gdb.arch/i386-mpx-map.c: New file. * gdb.arch/i386-mpx-map.exp: New File. doc: * gdb.texinfo (i386): Add documentation about "show mpx bound" and "set mpx bound".
2015-05-27Add set/show debug dwarf-line.Doug Evans2-0/+12
gdb/ChangeLog: * NEWS: Mention "set debug dwarf-line". * dwarf2read.c (dwarf_line_debug): New static global. (add_include_dir): Add debug dwarf-line support. (add_file_name, dwarf_record_line, dwarf_finish_line): Ditto. (_initialize_dwarf2_read): New parameter "debug dwarf-line". gdb/doc/ChangeLog: * gdb.texinfo (Debugging Output): Mention set/show debug dwarf-line.
2015-05-26Rename dwarf2 to dwarf in "set debug" and maintenance commands.Doug Evans2-20/+26
gdb/ChangeLog: * NEWS: Add entries for command renamings. * dwarf2read.c (dwarf_read_debug): Renamed from dwarf2_read_debug. All uses updated. (dwarf_die_debug): Renamed from dwarf2_die_debug. All uses updated. (dwarf_max_cache_age): Renamed from dwarf2_max_cache_age. All uses updated. (show_dwarf_max_cache_age): Renamed from show_dwarf2_max_cache_age. All callers updated. Fix spelling of DWARF in help text. (set_dwarf_cmdlist): Renamed from set_dwarf2_cmdlist. All uses updated. (show_dwarf_cmdlist): Renamed from show_dwarf2_cmdlist. All uses updated. (set_dwarf_cmd): Renamed from set_dwarf2_cmd. All callers updated. (show_dwarf_cmd): Renamed from show_dwarf2_cmd. All callers updated. (dwarf_always_disassemble): Renamed from dwarf_always_disassemble. All uses updated. (show_dwarf_always_disassemble): Renamed from show_dwarf2_always_disassemble. All callers updated. (_initialize_dwarf2_read): Rename "set/show dwarf2" prefix to "set/show dwarf". Rename "set/show dwarf2 max-cache-age" to "set/show dwarf max-cache-age". Rename "set/show dwarf2 always-disassemble" to "set/show dwarf always-disassemble". Rename "set/show debug dwarf2-read" to "set/show debug dwarf-read". Rename "set/show debug dwarf2-die" to "set/show debug dwarf-die". gdb/doc/ChangeLog: * gdb.texinfo (Debugging Output): Update for DWARF "set debug" command renamings. (Maintenance Commands): Update for DWARF "set debug" command renamings. gdb/testsuite/ChangeLog: * gdb.dwarf2/dw2-op-call.exp: Update. * gdb.dwarf2/dw4-sig-types.exp: Update. * gdb.dwarf2/implptr.exp: Update. * gdb.mi/mi-cmd-param-changed.exp: Update.
2015-05-26gdb: Add 'tui reg prev' command.Andrew Burgess2-0/+10
There is already a 'tui reg next' command, this adds a symmetric 'tui reg prev' command. gdb/ChangeLog: * tui/tui-regs.c (tui_reg_prev_command): New function. (_initialize_tui_regs): Add 'prev' command for 'tui reg'. * reggroups.c (reggroup_prev): New function. * reggroups.h (reggroup_prev): Add declaration. Update comment. gdb/doc/ChangeLog: * gdb.texinfo (TUI Commands): Add 'tui reg prev' details.
2015-05-22gdb: New 'tui enable' and 'tui disable' commands.Andrew Burgess2-2/+18
Add new commands to specifically enable and disable tui mode. This is in addition to the readline bindings, but might be easier for a user to discover if they accidentally end up in tui mode. gdb/ChangeLog: * NEWS: Mention 'tui enable' and 'tui disable'. * tui/tui.c (tui_enable_command): New function. (tui_disable_command): New function. (_initialize_tui): New function. gdb/doc/ChangeLog: * gdb.texinfo (TUI): Include 'tui enable' in the introduction. (TUI Commands): Add 'tui enable' and 'tui disable' details.
2015-05-16Add support for unbuffered and zero sized Guile ports.Doug Evans2-5/+12
gdb/ChangeLog * NEWS: Mention support for unbuffered Guile memory ports. * scm-ports.c (ioscm_memory_port): Update comments on end, size. (ioscm_lseek_address): Improve overflow calculation. (gdbscm_memory_port_fill_input): Add assert. (gdbscm_memory_port_write): Handle unbuffered ports. Handle large writes identical to Guile's fport_write. (gdbscm_memory_port_seek): Fix seeking past end check. (gdbscm_memory_port_close): Handle closing unbuffered port. (ioscm_parse_mode_bits): Recognize "0" for unbuffered ports. (ioscm_init_memory_port): Handle unbuffered ports. (ioscm_reinit_memory_port): Ditto. (ioscm_init_memory_port): Update size calculation. (gdbscm_open_memory): Support zero sized ports. gdb/testsuite/ChangeLog * gdb.guile/scm-ports.c: New file. * gdb.guile/scm-ports.exp: Add memory port tests. gdb/doc/ChangeLog * guile.texi (Memory Ports in Guile): Document support for unbuffered memory ports.
2015-05-16compile: New 'compile print'Jan Kratochvil2-0/+23
It is planned the existing GDB command 'print' will be able to evaluate its expressions using the compiler. There will be some option to choose between the existing GDB evaluation and the compiler evaluation. But as an intermediate step this patch provides the expression printing feature as a new command. I can imagine it could be also called 'maintenance compile print' as in the future one should be able to use its functionality by the normal 'print' command. There was a discussion with Eli about the command name: https://sourceware.org/ml/gdb-patches/2015-03/msg00880.html As there were no other comments yet I haven't renamed it yet, before there is some confirmation about settlement on the final name. Support for the GDB '@' operator to create arrays has been submitted for GCC: [gcc patch] libcc1: '@' GDB array operator https://gcc.gnu.org/ml/gcc-patches/2015-03/msg01451.html gdb/ChangeLog 2015-05-16 Jan Kratochvil <jan.kratochvil@redhat.com> Phil Muldoon <pmuldoon@redhat.com> * NEWS (Changes since GDB 7.9): Add compile print. * compile/compile-c-support.c (add_code_header, add_code_footer) (c_compute_program): Add COMPILE_I_PRINT_ADDRESS_SCOPE and COMPILE_I_PRINT_VALUE_SCOPE. * compile/compile-internal.h (COMPILE_I_PRINT_OUT_ARG_TYPE) (COMPILE_I_PRINT_OUT_ARG, COMPILE_I_EXPR_VAL, COMPILE_I_EXPR_PTR_TYPE): New. * compile/compile-object-load.c: Include block.h. (get_out_value_type): New function. (compile_object_load): Handle COMPILE_I_PRINT_ADDRESS_SCOPE and COMPILE_I_PRINT_VALUE_SCOPE. Set compile_module's OUT_VALUE_ADDR and OUT_VALUE_TYPE. * compile/compile-object-load.h (struct compile_module): Add fields out_value_addr and out_value_type. * compile/compile-object-run.c: Include valprint.h and compile.h. (struct do_module_cleanup): Add fields out_value_addr and out_value_type. (do_module_cleanup): Handle COMPILE_I_PRINT_ADDRESS_SCOPE and COMPILE_I_PRINT_VALUE_SCOPE. (compile_object_run): Propagate out_value_addr and out_value_type. Pass OUT_VALUE_ADDR. * compile/compile.c: Include valprint.h. (compile_print_value, compile_print_command): New functions. (eval_compile_command): Handle failed COMPILE_I_PRINT_ADDRESS_SCOPE. (_initialize_compile): Update compile code help text. Install compile_print_command. * compile/compile.h (compile_print_value): New prototype. * defs.h (enum compile_i_scope_types): Add COMPILE_I_PRINT_ADDRESS_SCOPE and COMPILE_I_PRINT_VALUE_SCOPE. gdb/doc/ChangeLog 2015-05-16 Jan Kratochvil <jan.kratochvil@redhat.com> * gdb.texinfo (Compiling and Injecting Code): Add compile print. gdb/testsuite/ChangeLog 2015-05-16 Jan Kratochvil <jan.kratochvil@redhat.com> * gdb.compile/compile-print.c: New file. * gdb.compile/compile-print.exp: New file.
2015-05-12Extended-remote fork event docsDon Breazeal2-0/+95
This patch contains the accumulated documentation changes for the rest of the extended-remote follow fork patchset. gdb/ChangeLog: * NEWS: Announce fork support in the RSP and support for fork debugging in extended mode. gdb/doc/ChangeLog: * gdb.texinfo (Forks): Note that fork debugging is supported in extended mode. (Remote Configuration): Add fork event features to table of packet settings. (Stop Reply Packets): Add fork events to list of stop reasons. (General Query Packets): Add fork events to tables of 'gdbfeatures' and 'stub features' supported in the qSupported packet, as well as to the list containing stub feature details.
2015-05-12Locate executables on remote stubs without multiprocess extensionsGary Benson2-1/+7
This commit allows GDB to determine filenames of main executables when debugging using remote stubs without multiprocess extensions. The qXfer:exec-file:read packet is extended to allow an empty annex, with the meaning that the remote stub should supply the filename of whatever it thinks is the current process. gdb/ChangeLog: * remote.c (remote_add_inferior): Call exec_file_locate_attach for fake PIDs as well as real ones. (remote_pid_to_exec_file): Send empty annex if PID is fake. gdb/doc/ChangeLog: * gdb.texinfo (General Query Packets): Document qXfer:exec-file:read with empty annex. gdb/gdbserver/ChangeLog: * server.c (handle_qxfer_exec_file): Use current process if annex is empty.
2015-05-09[Python] Add methods reference_value and const_value to gdb.Value.Siva Chandra2-0/+15
gdb/ChangeLog: * NEWS (Python Scripting): Mention the new gdb.Value methods. * python/py-value.c (valpy_reference_value): New function. (valpy_const_value): Likewise. (value_object_methods): Add new methods. * value.c (make_cv_value): New function. * value.h (make_cv_value): Declare. gdb/doc/ChangeLog: * python.texi (Values From Inferior): Add descriptions of new methods gdb.Value.reference_value and gdb.Value.const_value. gdb/testsuite/ChangeLog: * gdb.python/py-xmethods.cc: Enhance test case. * gdb.python/py-xmethods.exp: New tests. * gdb.python/py-xmethods.py (A_indexoper): New xmethod worker function. (B_indexoper): Likewise. (global_dm_list) : Add new xmethod worker functions.
2015-05-06Make the "info dll" command available on all platform.Joel Brobecker2-4/+9
The "info dll", an alias of the "info sharedlibrary" command, is currently only defined in windows native versions. This patch makes it universally available by moving the alias declaration to solib.c, and adjusts the documentation accordingly. Making it universally available has two benefits: - Windows users moving to a Unix platforms are still able to use the same command for getting the list of shared libraries; - Unix to Windows cross debuggers now provide that command also. gdb/ChangeLog: * solib.c (_initialize_solib): Add "info dll" alias creation. * windows-nat.c (set_windows_aliases): Delete. (_initialize_windows_nat): Remove deprecated_init_ui_hook assignment. * NEWS: Add news entry about "info dll" now being available on all platforms. gdb/doc/ChangeLog: * gdb.texinfo (Files): Add "info dll" documentation. (Cygwin Native): Remove "info dll" documentation.
2015-04-29PR python/18285Doug Evans2-2/+24
gdb/ChangeLog: PR python/18285 * NEWS: Document new gdb.XMethodWorker.get_result_type method. * eval.c (evaluate_subexp_standard) <OP_FUNCALL>: Handle EVAL_AVOID_SIDE_EFFECTS for xmethods. * extension-priv.h (struct extension_language_ops) <get_xmethod_result_type>: New member. * extension.c (get_xmethod_result_type): New function. * extension.h (get_xmethod_result_type): Declare. * python/py-xmethods.c (get_result_type_method_name): New static global. (py_get_result_type_method_name): Ditto. (gdbpy_get_xmethod_result_type): New function. (gdbpy_initialize_xmethods): Initialize py_get_result_type_method_name. * python/python-internal.h (gdbpy_get_xmethod_result_type): Declare. * python/python.c (python_extension_ops): Add gdbpy_get_xmethod_result_type. * python/lib/gdb/xmethod.py (XMethodWorker): Add get_result_type. * valarith.c (value_x_binop): Handle EVAL_AVOID_SIDE_EFFECTS for xmethods. (value_x_unop): Ditto. * value.c (result_type_of_xmethod): New function. * value.h (result_type_of_xmethod): Declare. gdb/testsuite/ChangeLog: * gdb.python/py-xmethods.exp: Add ptype tests. * gdb.python/py-xmethods.py (E_method_char_worker): Add get_result_type method. gdb/doc/ChangeLog: * python.texi (Xmethod API) <gdb.XMethodWorker.get_result_type>: Document. (Writing an Xmethod): Add get_result_type to example.
2015-04-28Add gdb.Type.optimized_out method.Sasha Smundak2-0/+9
gdb/ChangeLog: * NEWS: Mention gdb.Type.optimized_out method. * python/py-type.c (typy_optimized_out): New function. gdb/doc/ChangeLog: * python.texi: New method documented. gdb/testsuite/ChangeLog: * gdb.python/py-type.exp: New test.
2015-04-24gdb: Add support for dumping to verilog hex format.Andrew Burgess2-3/+10
Extend the gdb 'dump' command to allow creating output in verilog hex format. Add some tests to cover new functionality. As bfd does not currently support reading in verilog hex formats the tests only cover the 'dump' command, not the 'restore' command. gdb/ChangeLog: * cli/cli-dump.c (verilog_cmdlist): New variable. (dump_verilog_memory): New function. (dump_verilog_value): New function. (verilog_dump_command): New function. (_initialize_cli_dump): Add new commands to support verilog dump format. * NEWS: Add entry for "dump verilog". gdb/doc/ChangeLog: * gdb.texinfo (Dump/Restore Files): Add detail about verilog dump format. gdb/testsuite/ChangeLog: * gdb.base/dump.exp: Add *.verilog files to all_files list. Add new tests for verilog output.
2015-04-24* python.texi (Xmethods In Python): Fix name of method to call the xmethod.Doug Evans2-1/+6
gdb/doc/ChangeLog: * python.texi (Xmethods In Python): Fix name of method to call the xmethod.
2015-04-17Access executable from remote system when first inferior appearsGary Benson2-4/+15
This commit modifies remote_add_inferior to take an extra argument try_open_exec. If this is nonzero, remote_add_inferior will attempt to open this inferior's executable as the main executable if no main executable is open already. Callers are updated appropriately. With this commit, remote debugging can now be initiated using only a "target remote" or "target extended-remote" command; no "set sysroot" or "file" commands are required, e.g. bash$ gdb -q (gdb) target remote | gdbserver - /bin/sh Remote debugging using | gdbserver - /bin/sh Process /bin/sh created; pid = 32166 stdin/stdout redirected Remote debugging using stdio Reading symbols from target:/bin/bash... One testcase required updating as a result of this commit. The test checked that GDB's "info files" command does not crash if no main executable is open, and relied on GDB's inability to access the main executable over the remote protocol. The test was updated to inhibit this new behavior. gdb/ChangeLog: * remote.c (remote_add_inferior): New argument try_open_exec. If nonzero, attempt to open the inferior's executable file as the main executable if no main executable is open already. All callers updated. * NEWS: Mention that GDB now supports automatic location and retrieval of executable + files from remote targets. gdb/doc/ChangeLog: * gdb.texinfo (Connecting to a Remote Target): Mention that GDB can access program files from remote targets that support qXfer:exec-file:read and Host I/O packets. gdb/testsuite/ChangeLog: * gdb.server/server-exec-info.exp: Inhibit GDB from accessing the main executable over the remote protocol.
2015-04-17Implement remote_pid_to_exec_file using qXfer:exec-file:readGary Benson2-0/+30
This commit adds a new packet "qXfer:exec-file:read" to the remote protocol that can be used to obtain the pathname of the file that was executed to create a process on the remote system. Support for this packet is added to GDB and remote_ops.to_pid_to_exec_file is implemented using it. gdb/ChangeLog: * target.h (TARGET_OBJECT_EXEC_FILE): New enum value. * remote.c (PACKET_qXfer_exec_file): Likewise. (remote_protocol_features): Register the "qXfer:exec-file:read" feature. (remote_xfer_partial): Handle TARGET_OBJECT_EXEC_FILE. (remote_pid_to_exec_file): New function. (init_remote_ops): Initialize to_pid_to_exec_file. (_initialize_remote): Register new "set/show remote pid-to-exec-file-packet" command. * NEWS: Announce new qXfer:exec-file:read packet. gdb/doc/ChangeLog: * gdb.texinfo (Remote Configuration): Document the "set/show remote pid-to-exec-file-packet" command. (General Query Packets): Document the qXfer:exec-file:read qSupported features. Document the qXfer:exec-file:read packet.
2015-04-17Use gdb_sysroot for main executable on attachGary Benson2-8/+17
This commit updates exec_file_locate_attach to use exec_file_find to compute the full pathname of the main executable in some cases. The net effect of this is that the main executable's path will be prefixed with gdb_sysroot in the same way that shared library paths currently are. gdb/ChangeLog: * exec.c (solist.h): New include. (exec_file_locate_attach): Prefix absolute executable paths with gdb_sysroot if set. * NEWS: Mention that executable paths may be prepended with sysroot. gdb/doc/ChangeLog: * gdb.texinfo (set sysroot): Document that "set sysroot" also applies to executable paths if supplied to GDB as absolute.
2015-04-11Remove --xdbJan Kratochvil2-7/+4
Pedro Alves: The commands that enables aren't even documented in the manual. Judging from that, I assume that only wdb users would ever really be using the --xdb switch. I think it's time to drop "support" for the --xdb switch too. I looked through the commands that that exposes, the only that looked potentially interesting was "go", but then it's just an alias for "tbreak+jump", which can easily be done with "define go...end". I'd rather free up the "go" name for something potentially more interesting (either run control, or maybe even unrelated, e.g., for golang). gdb/ChangeLog 2015-04-11 Jan Kratochvil <jan.kratochvil@redhat.com> * NEWS (Changes since GDB 7.9): Add removed -xdb. * breakpoint.c (command_line_is_silent): Remove xdb_commands conditional. (_initialize_breakpoint): Remove xdb_commands for bc, ab, sb, db, ba and lb. * cli/cli-cmds.c (_initialize_cli_cmds): Remove xdb_commands for v and va. * cli/cli-decode.c (find_command_name_length): Remove xdb_commands conditional. * defs.h (xdb_commands): Remove declaration. * f-valprint.c (_initialize_f_valprint): Remove xdb_commands for lc. * guile/scm-cmd.c (command_classes): Remove xdb from comment. * infcmd.c (run_no_args_command, go_command): Remove. (_initialize_infcmd): Remove xdb_commands for S, go, g, R and lr. * infrun.c (xdb_handle_command): Remove. (_initialize_infrun): Remove xdb_commands for lz and z. * main.c (xdb_commands): Remove variable. (captured_main): Remove "xdb" from long_options. (print_gdb_help): Remove --xdb from help. * python/py-cmd.c (gdbpy_initialize_commands): Remove xdb from comment. * source.c (_initialize_source): Remove xdb_commands for D, ld, / and ?. * stack.c (backtrace_full_command, args_plus_locals_info) (current_frame_command): Remove. (_initialize_stack): Remove xdb_commands for t, T and l. * symtab.c (_initialize_symtab): Remove xdb_commands for lf and lg. * thread.c (_initialize_thread): Remove xdb_commands condition. * tui/tui-layout.c (tui_toggle_layout_command) (tui_toggle_split_layout_command, tui_handle_xdb_layout): Remove. (_initialize_tui_layout): Remove xdb_commands for td and ts. * tui/tui-regs.c (tui_scroll_regs_forward_command) (tui_scroll_regs_backward_command): Remove. (_initialize_tui_regs): Remove xdb_commands for fr, gr, sr, +r and -r. * tui/tui-win.c (tui_xdb_set_win_height_command): Remove. (_initialize_tui_win): Remove xdb_commands for U and w. * utils.c (pagination_on_command, pagination_off_command): Remove. (initialize_utils): Remove xdb_commands for am and sm. gdb/doc/ChangeLog 2015-04-11 Jan Kratochvil <jan.kratochvil@redhat.com> * gdb.texinfo (Mode Options): Remove -xdb.