aboutsummaryrefslogtreecommitdiff
path: root/gdb
AgeCommit message (Collapse)AuthorFilesLines
2017-09-27Constify some linespec functionsTom Tromey15-56/+95
This changes a few linespec functions to work on "const char *" and then fixes up all the callers. This allows further constification elsewhere. gdb/ChangeLog 2017-09-27 Tom Tromey <tom@tromey.com> * tracepoint.c (info_scope_command): Constify. * python/python.c (gdbpy_decode_line): Constify. * python/py-breakpoint.c (bppy_init): Constify. * mi/mi-cmd-break.c (mi_cmd_break_insert_1): Constify. * location.h: (new_linespec_location) (string_to_event_location_basic, string_to_event_location): Constify. * location.c (new_linespec_location) (string_to_event_location_basic, string_to_event_location): Constify. * linespec.h (decode_line_with_current_source) (decode_line_with_last_displayed, linespec_lex_to_end): Constify. * linespec.c (linespec_lex_to_end) (decode_line_with_current_source) (decode_line_with_last_displayed): Constify. * guile/scm-breakpoint.c (gdbscm_register_breakpoint_x): Constify. * cli/cli-cmds.c (edit_command, list_command): Constify. * breakpoint.h (until_break_command, watch_command_wrapper) (awatch_command_wrapper, rwatch_command_wrapper) (init_ada_exception_breakpoint): Constify. * breakpoint.c (break_command_1, dprintf_command) (break_range_command, watch_command_wrapper) (rwatch_command_wrapper, awatch_command_wrapper) (until_break_command, init_ada_exception_breakpoint) (strace_marker_create_sals_from_location, trace_command) (ftrace_command, strace_command, struct tracepoint): Constify. * ax-gdb.c (agent_command_1): Constify. * ada-lang.c (ada_exception_sal): Constify.
2017-09-27Constify some commands in record.cTom Tromey2-17/+29
gdb/ChangeLog 2017-09-27 Tom Tromey <tom@tromey.com> * record.c (cmd_record_delete, cmd_record_stop, cmd_record_save) (cmd_record_goto_begin, cmd_record_goto_end, get_insn_number) (get_context_size, no_chunk, get_insn_history_modifiers) (cmd_record_insn_history, get_call_history_modifiers) (cmd_record_call_history): Constify.
2017-09-27Constify some commands in source.cTom Tromey2-3/+9
gdb/ChangeLog 2017-09-27 Tom Tromey <tom@tromey.com> * source.c (show_substitute_path_command) (unset_substitute_path_command, set_substitute_path_command): Constify.
2017-09-27Constify commands maint.c, plus maintenance_print_typeTom Tromey4-26/+28
In addition to the constification, this fixes a command-repeat bug. gdb/ChangeLog 2017-09-27 Tom Tromey <tom@tromey.com> * typeprint.c (maintenance_print_type): Constify. * maint.c (maintenance_dump_me, maintenance_demangle) (maintenance_time_display, maintenance_info_sections) (maintenance_print_statistics, maintenance_deprecate) (maintenance_undeprecate): Constify. (maintenance_do_deprecate): Constify. Use std::string. (maintenance_selftest): Constify. * gdbtypes.h (maintenance_print_type): Constify.
2017-09-27Constify unwind_commandTom Tromey2-1/+5
gdb/ChangeLog 2017-09-27 Tom Tromey <tom@tromey.com> * hppa-tdep.c (unwind_command): Constify.
2017-09-27Constify some commands in target-descriptions.cTom Tromey2-3/+9
gdb/ChangeLog 2017-09-27 Tom Tromey <tom@tromey.com> * target-descriptions.c (unset_tdesc_filename_cmd) (maint_print_c_tdesc_cmd, maintenance_check_xml_descriptions): Constify.
2017-09-27Constify maintenance_print_dummy_framesTom Tromey2-1/+5
gdb/ChangeLog 2017-09-27 Tom Tromey <tom@tromey.com> * dummy-frame.c (maintenance_print_dummy_frames): Constify.
2017-09-27Constify some commands in tui.cTom Tromey2-2/+6
gdb/ChangeLog 2017-09-27 Tom Tromey <tom@tromey.com> * tui/tui.c (tui_enable_command, tui_disable_command): Constify.
2017-09-27Constify tui_reg_commandTom Tromey2-1/+5
gdb/ChangeLog 2017-09-27 Tom Tromey <tom@tromey.com> * tui/tui-regs.c (tui_reg_command): Constify.
2017-09-27Constify some commands in skip.cTom Tromey2-5/+11
gdb/ChangeLog 2017-09-27 Tom Tromey <tom@tromey.com> * skip.c (skip_file_command, skip_function_command) (skip_enable_command, skip_disable_command, skip_delete_command): Constify.
2017-09-27Constify some commands in record-btrace.cTom Tromey2-2/+7
gdb/ChangeLog 2017-09-27 Tom Tromey <tom@tromey.com> * record-btrace.c (cmd_record_btrace_bts_start) (cmd_record_btrace_pt_start): Constify.
2017-09-27Constify some commands in symmisc.cTom Tromey2-7/+15
gdb/ChangeLog 2017-09-27 Tom Tromey <tom@tromey.com> * symmisc.c (maintenance_print_symbols) (maintenance_print_msymbols, maintenance_print_objfiles) (maintenance_info_symtabs, maintenance_check_symtabs) (maintenance_expand_symtabs, maintenance_info_line_tables): Constify.
2017-09-27Constify new_ui_commandTom Tromey2-1/+5
gdb/ChangeLog 2017-09-27 Tom Tromey <tom@tromey.com> * top.c (new_ui_command): Constify.
2017-09-27Constify some commands in symfile.cTom Tromey2-19/+17
gdb/ChangeLog 2017-09-27 Tom Tromey <tom@tromey.com> * symfile.c (add_symbol_file_command) (remove_symbol_file_command, list_overlays_command) (map_overlay_command, unmap_overlay_command) (overlay_auto_command, overlay_manual_command) (overlay_off_command, overlay_load_command): Constify.
2017-09-27Constify some commands in spu-tdep.cTom Tromey2-5/+11
gdb/ChangeLog 2017-09-27 Tom Tromey <tom@tromey.com> * spu-tdep.c (info_spu_event_command, info_spu_signal_command) (info_spu_mailbox_command, info_spu_dma_command) (info_spu_proxydma_command): Constify.
2017-09-27Constify some commands in cli-logging.cTom Tromey2-3/+7
gdb/ChangeLog 2017-09-27 Tom Tromey <tom@tromey.com> * cli/cli-logging.c (set_logging_on, set_logging_off): Constify.
2017-09-27Constify user_defined_commandTom Tromey2-1/+5
gdb/ChangeLog 2017-09-27 Tom Tromey <tom@tromey.com> * cli/cli-script.c (user_defined_command): Constify.
2017-09-27Constify commands in cli-dump.cTom Tromey2-16/+27
gdb/ChangeLog 2017-09-27 Tom Tromey <tom@tromey.com> * cli/cli-dump.c (dump_memory_command, dump_value_command) (dump_srec_memory, dump_srec_value, dump_ihex_memory) (dump_ihex_value, dump_verilog_memory, dump_verilog_value) (dump_tekhex_memory, dump_tekhex_value, dump_binary_memory) (dump_binary_value, append_binary_memory, append_binary_value): Constify. (struct dump_context) <func>: Constify. (add_dump_command): Update.
2017-09-27Constify some commands in cli-cmds.cTom Tromey2-9/+10
gdb/ChangeLog 2017-09-27 Tom Tromey <tom@tromey.com> * cli/cli-cmds.c (show_version, show_configuration) (source_command, show_user): Constify.
2017-09-27Constify maintenance_print_target_stackTom Tromey2-1/+5
gdb/ChangeLog 2017-09-27 Tom Tromey <tom@tromey.com> * target.c (maintenance_print_target_stack): Constify.
2017-09-27Constify interpreter_exec_cmdTom Tromey2-1/+5
gdb/ChangeLog 2017-09-27 Tom Tromey <tom@tromey.com> * interps.c (interpreter_exec_cmd): Constify.
2017-09-27Constify cmd_record_full_restoreTom Tromey2-1/+5
gdb/ChangeLog 2017-09-27 Tom Tromey <tom@tromey.com> * record-full.c (cmd_record_full_restore): Constify.
2017-09-27Constify some functions in memattr.cTom Tromey2-3/+8
gdb/ChangeLog 2017-09-27 Tom Tromey <tom@tromey.com> * memattr.c (enable_mem_command, disable_mem_command) (delete_mem_command): Constify.
2017-09-27Constify show_convenienceTom Tromey2-3/+5
gdb/ChangeLog 2017-09-27 Tom Tromey <tom@tromey.com> * value.c (show_convenience): Constify.
2017-09-27Constify core_file_commandTom Tromey3-2/+7
gdb/ChangeLog 2017-09-27 Tom Tromey <tom@tromey.com> * gdbcore.h (core_file_command): Update. * corefile.c (core_file_command): Constify.
2017-09-27Constify maintenance_print_user_registersTom Tromey2-1/+5
gdb/ChangeLog 2017-09-27 Tom Tromey <tom@tromey.com> * user-regs.c (maintenance_print_user_registers): Constify.
2017-09-27Constify maintenance_cplus_namespaceTom Tromey2-1/+5
gdb/ChangeLog 2017-09-27 Tom Tromey <tom@tromey.com> * cp-namespace.c (maintenance_cplus_namespace): Constify.
2017-09-27Constify first_component_commandTom Tromey2-2/+5
gdb/ChangeLog 2017-09-27 Tom Tromey <tom@tromey.com> * cp-support.c (first_component_command): Constify.
2017-09-27Constify some functions in psymtab.cTom Tromey2-3/+9
gdb/ChangeLog 2017-09-27 Tom Tromey <tom@tromey.com> * psymtab.c (maintenance_print_psymbols) (maintenance_info_psymtabs, maintenance_check_psymtabs): Constify.
2017-09-27Constify display_tibTom Tromey2-1/+5
gdb/ChangeLog 2017-09-27 Tom Tromey <tom@tromey.com> * windows-tdep.c (display_tib): Constify.
2017-09-27Constify two functions in linux-fork.cTom Tromey2-2/+7
gdb/ChangeLog 2017-09-27 Tom Tromey <tom@tromey.com> * linux-fork.c (delete_checkpoint_command) (detach_checkpoint_command): Constify.
2017-09-27Constify two functions in cp-abi.cTom Tromey2-2/+6
gdb/ChangeLog 2017-09-27 Tom Tromey <tom@tromey.com> * cp-abi.c (set_cp_abi_cmd, show_cp_abi_cmd): Constify.
2017-09-27Constify dump_arc_instruction_commandTom Tromey2-1/+5
gdb/ChangeLog 2017-09-27 Tom Tromey <tom@tromey.com> * arc-tdep.c (dump_arc_instruction_command): Constify.
2017-09-27Constify two functions in valprint.cTom Tromey2-6/+6
gdb/ChangeLog 2017-09-27 Tom Tromey <tom@tromey.com> * valprint.c (set_radix, show_radix): Constify.
2017-09-27Constify info_probes_dtrace_commandTom Tromey2-1/+5
gdb/ChangeLog 2017-09-27 Tom Tromey <tom@tromey.com> * dtrace-probe.c (info_probes_dtrace_command): Constify.
2017-09-27Constify not_just_help_class_commandTom Tromey4-3/+9
gdb/ChangeLog 2017-09-27 Tom Tromey <tom@tromey.com> * command.h (not_just_help_class_command): Update. * cli/cli-decode.h (not_just_help_class_command): Update. * cli/cli-decode.c (not_just_help_class_command): Constify.
2017-09-27Constify add_cmd gdb_bfd.cTom Tromey2-1/+5
This constifies a command function in gdb_bfd.c. gdb/ChangeLog 2017-09-27 Tom Tromey <tom@tromey.com> * gdb_bfd.c (maintenance_info_bfds): Constify.
2017-09-27Add add_cmd function overloadsTom Tromey11-31/+124
This adds two add_cmd overloads: one whose callback takes a const char *, and one that doesn't accept a function at all. The no-function overload was introduced to avoid ambiguity when NULL was passed as the function. Long term the goal is for all commands to take const arguments, and for the non-const variants to be removed entirely. gdb/ChangeLog 2017-09-27 Tom Tromey <tom@tromey.com> * cli/cli-decode.c (add_cmd, set_cmd_cfunc): New function overloads. (do_add_cmd): Rename from add_cmd. Don't call set_cmd_cfunc. (do_const_cfunc): New function. (cmd_cfunc_eq): New overload. (cli_user_command_p): Check do_const_cfunc. * cli/cli-decode.h (struct cmd_list_element) <function>: New field const_cfunc. * command.h (add_cmd): Add const overload and no-function overload. (set_cmd_cfunc): Add const overload. (cmd_const_cfunc_ftype): Declare. (cmd_cfunc_eq): Add const overload. * breakpoint.c, cli-cmds.c, cli-dump.c, guile/scm-cmd.c, python/py-cmd.c, target.c, tracepoint.c: Use no-function add_cmd overload.
2017-09-27Add support for __VA_OPT__Tom Tromey4-10/+157
C++2a adds a "__VA_OPT__" feature that can be used to control the pesky "," emission when the final (variable) argument of a variadic macro is empty. This patch implements this feature for gdb. (A patch to implement it for gcc is pending.) gdb/ChangeLog 2017-09-27 Tom Tromey <tom@tromey.com> * macroexp.c (get_next_token_for_substitution): New function. (substitute_args): Call it. Check for __VA_OPT__. gdb/testsuite/ChangeLog 2017-09-27 Tom Tromey <tom@tromey.com> * gdb.base/macscp.exp: Add __VA_OPT__ tests.
2017-09-26dwarf2read: Restrict ICC workaround to ICC<14Walfred Tedeschi4-17/+200
GDB has a workaround for DWARF output by ICC, related to missing DW_AT_declaration on incomplete types. The bug was fixed in ICC 14, so this commit adjusts GDB accordingly. For the version check, this adds a new parser function for the ICC producer string. While at it, it also adds unit tests for the producer parsing covering the new function and preexisting parsers. gdb/ChangeLog: 2017-09-26 Walfred Tedeschi <walfred.tedeschi@intel.com> Pedro Alves <palves@redhat.com> * dwarf2read.c (dwarf2_cu): Remove field producer_is_icc and add producer_is_icc_lt_14. (producer_is_icc_lt_14): New function. (check_producer): Add code for checking version of ICC. (producer_is_icc): Move to producer.c. (read_structure_type): Restrict ICC workaround to ICC<14. * producer.c: Include selftest.h. (producer_is_icc, producer_parsing_tests, _initialize_producer): New functions. * producer.h (producer_is_icc): New declaration.
2017-09-26Move GDB producer parsing routines to a separate fileWalfred Tedeschi8-57/+123
gdb/ChangeLog: 2017-09-26 Walfred Tedeschi <walfred.tedeschi@intel.com> * Makefile.in (SFILES): Add producer.c. (COMMON_OBS): Add producer.o * amd64-tdep.c (producer.h): Add new include. * dwarf2read.c (producer.h): Add new include. * producer.c: New file. * producer.h: New file. * utils.c (producer_is_gcc, producer_is_gcc_ge_4): Move to producer.c. * utils.h (producer_is_gcc, producer_is_gcc_ge_4): Move to producer.h.
2017-09-26Use "switch_to_thread" more thoroughly on gdbserverSergio Durigan Junior5-4/+15
This is a technical debt that I left when I ported "switch_to_thread" to gdbserver. It's a simple patch that converts occurences of: current_thread = find_thread_ptid (ptid); to: switch_to_thread (ptid); This patch also converts a simple "if" to a "gdb_assert" on gdbserver's version of "switch_to_thread": gdb_assert (ptid != minus_one_ptid); This change makes the code more similar to what GDB already does. Regtested on BuildBot. gdb/gdbserver/ChangeLog: 2017-09-26 Sergio Durigan Junior <sergiodj@redhat.com> * gdbthread.h: Include "common-gdbthread.h". * inferiors.c (switch_to_thread): Use "gdb_assert" instead of "if" when validating the ptid. * remote-utils.c: Include "gdbthread.h". (prepare_resume_reply): Use "switch_to_thread". * target.c (done_accessing_memory): Likewise.
2017-09-26Allow linking GDB with ncurseswMatthias Klose5-7/+19
Triggered by https://launchpad.net/bugs/1275210, to be able to cope with UTF-8 characters in gdbtui. Reference: https://sourceware.org/ml/gdb-patches/2017-09/msg00356.html gdb/ChangeLog: 2017-09-26 Matthias Klose <doko@ubuntu.com> * configure.ac: Search ncursesw before ncurses. Check ncursesw/ncurses.h before ncurses/ncurses.h. * gdb_curses.h: Include <ncursesw/ncurses.h> * config.in, configure: Regenerate.
2017-09-26Remove support for Solaris < 10 (PR gdb/22185)Rainer Orth10-364/+83
Given that GCC has obsoleted/removed support for Solaris 9 in GCC 4.9/5 in 2013: https://gcc.gnu.org/gcc-4.9/changes.html https://gcc.gnu.org/ml/gcc-patches/2013-05/msg00728.html and the last gdb version that can be compiled with gcc 4.9 is 7.12.1 only when configured with --disable-build-with-cxx, it's time to obsolete/remove support for Solaris < 10. This patch does this, simplifying configure.nat along the way (only a single sol2 configuration with variants for i386 and sparc). Some configure checks for older Solaris versions can go, too, and the check for libthread_db.so.1 removed: * Since Solaris 10, dlopen has moved to libc and libdl.so is just a filter on ld.so.1, so no need to check. * $RDYNAMIC is already handled above (and is a no-op with Solaris ld anyway). Both proc-service.c and sol-thread.c lose support for (Solaris-only) PROC_SERVICE_IS_OLD. The attached revised patch has been tested on sparcv9-sun-solaris2.10, sparcv9-sun-solaris2.11.4, amd64-pc-solaris2.10, amd64-pc-solaris2.11.4, and x86_64-pc-linux-gnu. I've also started an i386-pc-solaris2.9 build to check that it really stops as expected. PR gdb/22185 * configure.host <*-*-solaris2.[01], *-*-solaris2.[2-9]*>: Mark as obsolete. Use gdb_host sol2 for i[34567]86-*-solaris2*, x86_64-*-solaris2*. Remove i386sol2 support. * configure.nat <i386sol2>: Remove. <sol2-64>: Fold into ... <sol2>: ... this. Move common settings to default section. Add sol-thread.o. * configure.tgt <i[34567]86-*-solaris2.1[0-9]*, x86_64-*-solaris2.1[0-9]*>: Rename to ... <i[34567]86-*-solaris2*, x86_64-*-solaris2*>: ... this. <i[34567]86-*-solaris*>: Remove. <sparc-*-solaris2.[0-6], sparc-*-solaris2.[0-6].*>: Remove. * configure.ac: Remove wctype in libw check. (_MSE_INT_H): Don't define on Solaris 7-9. <solaris*>: Remove libthread_db.so.1 check. * configure: Regenerate. * config.in: Regenerate. * proc-service.c: Remove PROC_SERVICE_IS_OLD handling. (gdb_ps_prochandle_t, gdb_ps_read_buf_t, gdb_ps_write_buf_t) (gdb_ps_size_t): Remove. Use base types in users. * sol-thread.c: Likewise, also for gdb_ps_addr_t. * NEWS (Changes since GDB 8.0): Document Solaris 2.0-9 removal.
2017-09-26Fix gdb 8.1 Solaris/SPARC compilation (PR build/22206)Rainer Orth2-2/+14
When testing my Solaris < 10 removal patch on Solaris/SPARC, I found that gdb mainline is currently broken there due to the recent SPARC M7 ADI patches: /vol/src/gnu/gdb/gdb/local/gdb/sparc64-tdep.c:1876:0: error: "PSR_ICC" redefined [-Werror] #define PSR_ICC 0x00f00000 ^ In file included from /usr/include/v7/sys/privregs.h:24:0, from /usr/include/sys/regset.h:420, from /usr/include/sys/ucontext.h:21, from /usr/include/sys/signal.h:231, from /usr/include/sys/procset.h:23, from /usr/include/sys/wait.h:25, from /usr/include/stdlib.h:21, from build-gnulib/import/stdlib.h:36, from /vol/src/gnu/gdb/gdb/local/gdb/common/common-defs.h:53, from /vol/src/gnu/gdb/gdb/local/gdb/defs.h:28, from /vol/src/gnu/gdb/gdb/local/gdb/sparc64-tdep.c:20: /usr/include/v7/sys/psr.h:35:0: note: this is the location of the previous definition #define PSR_ICC 0x00F00000 /* integer condition codes */ ^ /vol/src/gnu/gdb/gdb/local/gdb/sparc64-tdep.c:1878:0: error: "PSR_IMPL" redefined [-Werror] #define PSR_IMPL 0xf0000000 ^ In file included from /usr/include/v7/sys/privregs.h:24:0, from /usr/include/sys/regset.h:420, from /usr/include/sys/ucontext.h:21, from /usr/include/sys/signal.h:231, from /usr/include/sys/procset.h:23, from /usr/include/sys/wait.h:25, from /usr/include/stdlib.h:21, from build-gnulib/import/stdlib.h:36, from /vol/src/gnu/gdb/gdb/local/gdb/common/common-defs.h:53, from /vol/src/gnu/gdb/gdb/local/gdb/defs.h:28, from /vol/src/gnu/gdb/gdb/local/gdb/sparc64-tdep.c:20: /usr/include/v7/sys/psr.h:41:0: note: this is the location of the previous definition #define PSR_IMPL 0xF0000000 /* implementation */ ^ Comparing Solaris 11.4 <v7/sys/psr.h> and sparc64-tdep.c, there are more inconsistencies: <v7/sys/psr.h>: #define PSR_S 0x00000080 /* supervisor mode */ #define PSR_ICC 0x00F00000 /* integer condition codes */ #define PSR_VER 0x0F000000 /* mask version */ #define PSR_IMPL 0xF0000000 /* implementation */ #define PSR_RSV 0x000FC000 /* reserved */ sparc64-tdep.c: #define PSR_S 0x00000080 #define PSR_ICC 0x00f00000 #define PSR_VERS 0x0f000000 #define PSR_IMPL 0xf0000000 #define PSR_V8PLUS 0xff000000 #define PSR_XCC 0x000f0000 Apart from the capitalization differences that trip g++, the names differ (PSR_VER vs. PSR_VERS), PSR_XCC is included in Solaris' PSR_RSV, and there's no PSR_V8PLUS on Solaris either. /vol/src/gnu/gdb/gdb/local/gdb/sparc64-tdep.c: In function `int adi_tag_fd()': /vol/src/gnu/gdb/gdb/local/gdb/sparc64-tdep.c:296:63: error: format `%d' expects argument of type `int', but argument 4 has type `pid_t {aka long int}' [-Werror=format=] snprintf (cl_name, sizeof(cl_name), "/proc/%d/adi/tags", pid); ^ /vol/src/gnu/gdb/gdb/local/gdb/sparc64-tdep.c: In function `bool adi_is_addr_mapped(CORE_ADDR, std::size_t)': /vol/src/gnu/gdb/gdb/local/gdb/sparc64-tdep.c:314:64: error: format `%d' expects argument of type `int', but argument 4 has type `pid_t {aka long int}' [-Werror=format=] snprintf (filename, sizeof filename, "/proc/%d/adi/maps", pid); ^ You cannot always print a pid_t, which can be either int or long on Solaris, as an int. Obviously, the ADI patch which modifies code shared between all SPARC targets, hasn't been tested on anything but Linux/SPARC. The patch below includes the minimal fixes necessary to unbreak the Solaris/SPARC build. However, as detailed in the PR, there's more breakage here: apart from not bothering to implement ADI support on Solaris, the code contains several more changes to shared/common SPARC code that are simply wrong on anything but Linux/SPARC. The patch was tested on sparcv9-sun-solaris2.10 and sparcv9-sun-solaris2.11.4 (build and gdb/gdb gdb/gdb smoke test only). PR build/22206 * sparc64-tdep.c (adi_tag_fd): Print pid as long. (adi_is_addr_mapped): Likewise. (PSR_ICC): Don't redefine. (PSR_IMPL): Likewise.
2017-09-26Fix FAILs in compare-sections.expThomas Preud'homme2-2/+13
compare-sections.exp has two cases that are not handled appropriately: 1) value read with msb set 2) error while patching that section This patch adapts the "get value of read-only section" test to print the value as an unsigned integer to fix 1) and test for the error message to not set the written variable if read-only section cannot be written to so as to solve 2). 2017-09-26 Thomas Preud'homme <thomas.preudhomme@arm.com> Pedro Alves <palves@redhat.com> gdb/testsuite/ * gdb.base/compare-sections.exp (get value of read-only section): Read as unsigned value. (corrupt read-only section): Likewise and don't set written if patching failed.
2017-09-25Remove the last cleanup from regcache.cTom Tromey2-7/+8
This removes the last cleanup from regcache.c by changing one function to use std::string. gdb/ChangeLog 2017-09-25 Tom Tromey <tom@tromey.com> * regcache.c (regcache::dump): Use string_printf.
2017-09-25Remove make_cleanup_regcache_invalidateTom Tromey2-26/+37
This removes make_cleanup_regcache_invalidate in favor of a simple RAII class that handles register invalidation. gdb/ChangeLog 2017-09-25 Tom Tromey <tom@tromey.com> * regcache.c (class regcache_invalidator): New. (struct register_to_invalidate): Remove. (make_cleanup_regcache_invalidate): Remove. (regcache::raw_write): Use regcache_invalidator.
2017-09-25Remove make_cleanup_regcache_xfreeTom Tromey8-42/+34
This removes make_cleanup_regcache_xfree in favor of using std::unique_ptr as the return type of frame_save_as_regcache. gdb/ChangeLog 2017-09-25 Tom Tromey <tom@tromey.com> * spu-tdep.c (spu2ppu_sniffer): Update. * regcache.h (make_cleanup_regcache_xfree): Don't declare. * regcache.c (do_regcache_xfree, make_cleanup_regcache_xfree): Remove. * ppc-linux-tdep.c (ppu2spu_sniffer): Update. * mi/mi-main.c (mi_cmd_data_list_changed_registers): Update. * frame.h (frame_save_as_regcache): Return std::unique_ptr. * frame.c (frame_save_as_regcache): Return std::unique_ptr. (frame_pop): Update.
2017-09-25Remove regcache_xfreeTom Tromey8-17/+19
This removes regcache_xfree in favor of plain "delete". gdb/ChangeLog 2017-09-25 Tom Tromey <tom@tromey.com> * spu-tdep.c (spu2ppu_dealloc_cache): Use delete. * regcache.h (regcache_xfree): Don't declare. * regcache.c (regcache_xfree): Remove. (do_regcache_xfree): Use delete. * ppc-linux-tdep.c (ppu2spu_dealloc_cache): Use delete. * linux-fork.c (free_fork): Use delete. (fork_save_infrun_state): Likewise. * jit.c (jit_dealloc_cache): Use delete. * infrun.c (discard_infcall_suspend_state): Use delete.