3 * breakpoint.c (struct counted_command_line): Remove.
4 (breakpoint_commands): Update.
5 (alloc_counted_command_line, incref_counted_command_line)
6 (decref_counted_command_line, do_cleanup_counted_command_line)
7 (make_cleanup_decref_counted_command_line): Remove.
8 (breakpoint_set_commands, commands_command_1, ~bpstats, bpstats)
9 (bpstat_clear_actions, bpstat_do_actions_1, watchpoint_check)
10 (bpstat_stop_status, print_one_breakpoint_location, ~breakpoint)
11 (save_breakpoints): Update.
12 * breakpoint.h (counted_command_line): Now a typedef to
14 (struct breakpoint) <commands>: Now a counted_command_line.
15 (struct bpstats) <command>: Likewise.
19 * breakpoint.c (struct commands_info, do_map_commands_command):
21 (commands_command_1): Update.
22 (iterate_over_related_breakpoints): Take a function_view.
23 (do_delete_breakpoint, do_map_delete_breakpoint): Remove.
24 (delete_command): Update.
25 (map_breakpoint_numbers): Take a function_view.
26 (do_disable_breakpoint, do_map_delete_breakpoint): Remove.
27 (disable_command): Update.
28 (do_enable_breakpoint, do_map_enable_breakpoint): Remove.
29 (enable_command): Update.
30 (struct disp_data, do_enable_breakpoint_disp)
31 (do_map_enable_once_breakpoint, do_map_enable_count_breakpoint)
32 (do_map_enable_delete_breakpoint): Remove.
33 (enable_once_command, enable_count_command, enable_delete_command)
34 (delete_trace_variable_command): Update.
38 * breakpoint.c (~bpstats): Rename from bpstat_free. Update.
39 (bpstat_clear): Use delete.
40 (bpstats): New constructors.
41 (bpstat_copy, bpstat_stop_status): Use new.
42 (dprintf_after_condition_true): Update.
43 * breakpoint.h (bpstats::bpstats): Add constructors.
44 (bpstats::~bpstats): Add destructor.
48 * eval.c (make_params): Delete, refactored as ...
49 (class fake_method): ... this new type's ctor.
50 (fake_method::~fake_method): New.
51 (evaluate_subexp_standard): Use 'fake_method'.
55 * windows-nat.c (get_windows_debug_event, windows_wait)
56 (do_initial_windows_stuff, windows_attach): Update.
57 * utils.c (vwarning, internal_vproblem): Update.
58 (ui_unregister_input_event_handler_cleanup)
59 (prepare_to_handle_input): Remove.
60 (class scoped_input_handler): New.
61 (defaulted_query, prompt_for_continue): Update.
62 * tui/tui-hooks.c (tui_refresh_frame_and_register_information):
64 * top.c (undo_terminal_modifications_before_exit): Update.
65 * target/target.h (target_terminal_init, target_terminal_inferior)
66 (target_terminal_ours): Don't declare.
67 (class target_terminal): New.
68 * target.h (target_terminal_is_inferior, target_terminal_is_ours)
69 (target_terminal_ours_for_output)
70 (make_cleanup_restore_target_terminal): Don't declare.
71 (target_terminal_info): Remove.
72 * target.c (enum terminal_state, terminal_state): Remove.
73 (target_terminal::terminal_state): Define.
74 (target_terminal::init): Rename from target_terminal_init.
75 (target_terminal::inferior): Rename from
76 target_terminal_inferior.
77 (target_terminal::ours): Rename from target_terminal_ours.
78 (target_terminal::ours_for_output): Rename from
79 target_terminal_ours_for_output.
80 (target_terminal::info): New method.
81 (cleanup_restore_target_terminal)
82 (make_cleanup_restore_target_terminal): Remove.
83 * solib.c (handle_solib_event): Update.
84 * remote.c (remote_serial_quit_handler): Update.
85 (remote_terminal_inferior, remote_wait_as): Update.
86 * record-full.c (record_full_wait_1): Update.
87 * nto-procfs.c (procfs_create_inferior): Update.
88 * nat/fork-inferior.c (startup_inferior): Update.
89 * mi/mi-interp.c (mi_new_thread, mi_thread_exit)
90 (mi_record_changed, mi_inferior_added, mi_inferior_appeared)
91 (mi_inferior_exit, mi_inferior_removed, mi_traceframe_changed)
92 (mi_tsv_created, mi_tsv_deleted, mi_tsv_modified)
93 (mi_breakpoint_created, mi_breakpoint_deleted)
94 (mi_breakpoint_modified, mi_on_resume, mi_solib_loaded)
95 (mi_solib_unloaded, mi_command_param_changed, mi_memory_changed)
96 (mi_user_selected_context_changed, report_initial_inferior):
98 * linux-nat.c (linux_nat_attach, linux_nat_terminal_ours)
99 (linux_nat_terminal_inferior): Update.
100 * infrun.c (follow_fork_inferior)
101 (handle_vfork_child_exec_or_exit, do_target_resume)
102 (check_curr_ui_sync_execution_done, handle_inferior_event_1)
103 (handle_signal_stop, maybe_remove_breakpoints, normal_stop):
105 * inflow.c (child_terminal_init, info_terminal_command): Update.
106 * infcmd.c (post_create_inferior, continue_1, prepare_one_step)
107 (attach_command): Update.
108 * infcall.c (call_thread_fsm_should_stop): Update.
109 * gnu-nat.c (gnu_attach): Update.
110 * extension.c (struct active_ext_lang_state)
111 (restore_active_ext_lang): Update.
112 * exceptions.c (print_flush): Update.
113 * event-top.c (async_enable_stdin, default_quit_handler): Update.
114 (struct quit_handler_cleanup_data, restore_quit_handler)
115 (restore_quit_handler_dtor, make_cleanup_override_quit_handler):
117 * cp-support.c (gdb_demangle): Update.
118 * breakpoint.c (update_inserted_breakpoint_locations)
119 (insert_breakpoint_locations, handle_jit_event)
120 (disable_breakpoints_in_unloaded_shlib): Update.
121 * annotate.c (annotate_breakpoints_invalid)
122 (annotate_frames_invalid): Update.
126 * main.c (catch_command_errors): Rename from
127 catch_command_errors_const.
128 (captured_main_1): Update.
132 * cli/cli-cmds.c (list_command): Use print_sal_location.
133 (print_sal_location): New function.
134 (ambiguous_line_spec): Use print_sal_location.
135 * linespec.c (symbol_to_sal): Record the symbol in the sal.
136 * symtab.c (find_function_start_sal): Likewise.
137 * symtab.h (symtab_and_line::symbol): New field.
141 * linespec.c (minsym_found): Handle non-text minsyms.
142 (symbol_to_sal): Record a sal.pc for non-block, non-label symbols.
146 * features/Makefile (i386-avx-mpx-avx512-pku.dat): Add missing
151 * gdb.arch/i386-avx512.c (move_zmm_data_to_reg): Use
152 vmovups instead vmovaps.
153 (move_zmm_data_to_memory): Use vmovups instead vmovaps.
157 * NEWS (Changes since GDB 8.0): Add starti.
158 * infcmd.c (enum run_break): New.
159 (run_command_1): Queue pending event for RUN_STOP_AT_FIRST_INSN
161 (run_command): Use enum run_how.
162 (start_command): Likewise.
163 (starti_command): New function.
164 (RUN_ARGS_HELP): New macro.
165 (_initialize_infcmd): Use RUN_ARGS_HELP for run and start
166 commands. Add starti command.
170 * Makefile.in (monitor.o): Remove the rule.
174 * annotate.h (struct annotate_arg_emitter): Use
175 DISABLE_COPY_AND_ASSIGN.
176 * common/refcounted-object.h (refcounted_object): Likewise.
177 * completer.h (struct completion_result): Likewise.
178 * dwarf2read.c (struct dwarf2_per_objfile): Likewise.
179 * filename-seen-cache.h (filename_seen_cache): Likewise.
180 * gdbcore.h (thread_section_name): Likewise.
181 * gdb_regex.h (compiled_regex): Likewise.
182 * gdbthread.h (scoped_restore_current_thread): Likewise.
183 * inferior.h (scoped_restore_current_inferior): Likewise.
184 * jit.c (jit_reader): Likewise.
185 * linespec.h (struct linespec_result): Likewise.
186 * mi/mi-parse.h (struct mi_parse): Likewise.
187 * nat/fork-inferior.c (execv_argv): Likewise.
188 * progspace.h (scoped_restore_current_program_space): Likewise.
189 * python/python-internal.h (class gdbpy_enter): Likewise.
190 * regcache.h (regcache): Likewise.
191 * target-descriptions.c (struct tdesc_reg): Likewise.
192 (struct tdesc_type): Likewise.
193 (struct tdesc_feature): Likewise.
194 * ui-out.h (ui_out_emit_type): Likewise.
198 * dwarf2expr.c (dwarf_expr_context::execute_stack_op): Remove
199 label abort_expression.
203 * common/buffer.c (buffer_xml_printf): Adjust.
204 * common/xml-utils.c (xml_escape_text): Change return type to
205 std::string, update code accordingly.
206 * common/xml-utils.h (xml_escape_text): Change return type to
208 * rs6000-aix-tdep.c (rs6000_aix_shared_library_to_xml): Adjust.
209 * windows-tdep.c (windows_xfer_shared_library): Adjust.
210 * unittests/xml-utils-selftests.c (test_xml_escape_text):
215 * Makefile.in (SUBDIR_UNITTESTS_SRCS): Add new source file.
216 (SUBDIR_UNITTESTS_OBS): Add new object file.
217 * unittests/xml-utils-selftests.c: New file.
221 * common/selftest.h (selftest): New struct/interface.
222 (register_test): Add name parameter, add new overload.
223 (run_tests): Add filter parameter.
224 (for_each_selftest_ftype): New typedef.
225 (for_each_selftest): New declaration.
226 * common/selftest.c (tests): Change type to
227 map<string, unique_ptr<selftest>>.
228 (simple_selftest): New struct.
229 (register_test): New function.
230 (register_test): Add name parameter and use it.
231 (run_tests): Add filter parameter and use it. Add prints.
232 Adjust to vector -> map change.
233 * aarch64-tdep.c (_initialize_aarch64_tdep): Add names when
234 registering selftests.
235 * arm-tdep.c (_initialize_arm_tdep): Likewise.
236 * disasm-selftests.c (_initialize_disasm_selftests): Likewise.
237 * dwarf2-frame.c (_initialize_dwarf2_frame): Likewise.
238 * dwarf2loc.c (_initialize_dwarf2loc): Likewise.
239 * findvar.c (_initialize_findvar): Likewise.
240 * gdbarch-selftests.c (_initialize_gdbarch_selftests): Likewise.
241 * maint.c (maintenance_selftest): Update call to run_tests.
242 (maintenance_info_selftests): New function.
243 (_initialize_maint_cmds): Register "maintenance info selftests"
244 command. Update "maintenance selftest" doc.
245 * regcache.c (_initialize_regcache): Add names when registering
247 * rust-exp.y (_initialize_rust_exp): Likewise.
248 * selftest-arch.c (gdbarch_selftest): New struct.
249 (gdbarch_tests): Remove.
250 (register_test_foreach_arch): Add name parameter. Call
252 (tests_with_arch): Remove, move most content to
253 gdbarch_selftest::operator().
254 (_initialize_selftests_foreach_arch): Remove.
255 * selftest-arch.h (register_test_foreach_arch): Add name
257 (run_tests_with_arch): New declaration.
258 * utils-selftests.c (_initialize_utils_selftests): Add names
259 when registering selftests.
260 * utils.c (_initialize_utils): Likewise.
261 * unittests/array-view-selftests.c
262 (_initialize_array_view_selftests): Likewise.
263 * unittests/environ-selftests.c (_initialize_environ_selftests):
265 * unittests/function-view-selftests.c
266 (_initialize_function_view_selftests): Likewise.
267 * unittests/offset-type-selftests.c
268 (_initialize_offset_type_selftests): Likewise.
269 * unittests/optional-selftests.c
270 (_initialize_optional_selftests): Likewise.
271 * unittests/scoped_restore-selftests.c
272 (_initialize_scoped_restore_selftests): Likewise.
273 * NEWS: Document "maintenance selftest" and "maint info
278 * mi/mi-main.c (mi_load_progress): Restore current_uiout using a
283 * mi/mi-main.c (mi_load_progress): Make uiout variable
288 * compile/compile-c-types.c (convert_enum, convert_int)
289 (convert_float): Adjust to refer to int_type_v0 and float_type_v0.
293 * dwarf2read.c (copy_string): Remove.
294 (parse_macro_definition): Replace copy_string with savestring.
298 * configure.tgt (i[34567]86-*-darwin*): Append amd64.o to
300 (i[34567]86-*-solaris2.1[0-9]* | x86_64-*-solaris2.1[0-9]*):
302 (i[34567]86-*-linux*): Likewise.
306 * dwarf2expr.h (dwarf_stack_value): Add constructor.
307 (dwarf_expr_context) <~dwarf_expr_context>: Define as default.
308 <stack>: Change type to std::vector.
309 <stack_len, stack_allocated>: Remove.
310 <grow_stack>: Remove.
311 * dwarf2expr.c (dwarf_expr_context::dwarf_expr_context): Adjust.
312 (dwarf_expr_context::~dwarf_expr_context): Remove.
313 (dwarf_expr_context::grow_stack): Remove.
314 (dwarf_expr_context::push): Adjust.
315 (dwarf_expr_context::pop): Adjust.
316 (dwarf_expr_context::fetch): Adjust.
317 (dwarf_expr_context::fetch_in_stack_memory): Adjust.
318 (dwarf_expr_context::stack_empty_p): Adjust.
319 (dwarf_expr_context::execute_stack_op): Adjust.
323 * dwarf2expr.h (dwarf_expr_context) <stack_empty_p>: Change
325 * dwarf2expr.c (dwarf_expr_context::stack_empty_p): Likewise.
329 * dwarf2expr.h (dwarf_expr_piece) <v.mem.in_stack_memory>:
331 (dwarf_stack_value) <in_stack_memory>: Likewise.
332 (dwarf_expr_context) <push_address>: Change parameter type to
334 <fetch_in_stack_memory>: Change return type to bool.
335 <push>: Change parameter type to bool.
336 * dwarf2expr.c (dwarf_expr_context::push): Change parameter type
338 (dwarf_expr_context::push_address): Likewise.
339 (dwarf_expr_context::fetch_in_stack_memory): Change return type
341 (dwarf_expr_context::execute_stack_op): Adjust.
342 * dwarf2loc.c (dwarf2_evaluate_loc_desc_full): Adjust.
346 * dwarf2expr.h (struct dwarf_expr_piece): Move up.
347 (struct dwarf_expr_context) <n_pieces>: Remove.
348 <pieces>: Change type to std::vector.
349 * dwarf2expr.c (dwarf_expr_context::dwarf_expr_context): Adjust.
350 (dwarf_expr_context::~dwarf_expr_context): Don't manually free
352 (dwarf_expr_context::add_piece): Adjust.
353 * dwarf2loc.c (struct piece_closure): Initialize fields.
355 <pieces>: Change type to std::vector.
356 (allocate_piece_closure): Adjust, change parameter to
357 std::vector rvalue and std::move it to piece_closure.
358 (rw_pieced_value): Adjust.
359 (check_pieced_synthetic_pointer): Adjust.
360 (indirect_synthetic_pointer): Adjust.
361 (coerce_pieced_ref): Adjust.
362 (free_pieced_value_closure): Adjust. Use delete to free
364 (dwarf2_evaluate_loc_desc_full): Adjust. std::move ctx.pieces
365 to allocate_piece_closure.
366 (dwarf2_loc_desc_get_symbol_read_needs): Adjust.
370 * probe.h (probe_ops_cp): Remove typedef.
371 (DEF_VEC_P (probe_ops_cp)): Remove.
372 (all_probe_ops): Change type to std::vector.
373 * probe.c (info_probes_for_ops): Adjust to vector change.
374 (probe_linespec_to_ops): Likewise.
375 (all_probe_ops): Change type to std::vector.
376 (_initialize_probe): Adjust to vector change.
377 * dtrace-probe.c (_initialize_dtrace_probe): Likewise.
378 * elfread.c (elf_get_probes): Likewise.
379 * stap-probe.c (_initialize_stap_probe): Likewise.
383 * probe.h (struct bound_probe): Define constructors.
384 * probe.c (bound_probe_s): Remove typedef.
385 (DEF_VEC_O (bound_probe_s)): Remove VEC.
386 (collect_probes): Change return type to std::vector, remove
388 (compare_probes): Return bool, change parameter type. Change
389 semantic to "less than".
390 (gen_ui_out_table_header_info): Change parameter to std::vector
392 (exists_probe_with_pops): Likewise.
393 (info_probes_for_ops): Update to std::vector change.
394 (enable_probes_command): Likewise.
395 (disable_probes_command): Likewise.
399 * probe.h (struct probe_ops) <get_probes>: Change parameter from
401 * probe.c (parse_probes_in_pspace): Update.
402 (find_probes_in_objfile): Update.
403 (find_probe_by_pc): Update.
404 (collect_probes): Update.
405 (probe_any_get_probes): Update.
406 * symfile.h (struct sym_probe_fns) <sym_get_probes> Change
407 return type to reference to std::vector.
408 * dtrace-probe.c (dtrace_process_dof_probe): Change parameter to
409 std::vector and update.
410 (dtrace_process_dof): Likewise.
411 (dtrace_get_probes): Likewise.
412 * elfread.c (elf_get_probes): Change return type to std::vector,
413 store an std::vector in bfd_data.
414 (probe_key_free): Update to std::vector.
415 * stap-probe.c (handle_stap_probe): Change parameter to
416 std::vector and update.
417 (stap_get_probes): Likewise.
418 * symfile-debug.c (debug_sym_get_probes): Change return type to
419 std::vector and update.
423 * breakpoint.c (program_breakpoint_here_p): Update.
424 * target.c (make_scoped_restore_show_memory_breakpoints): Rename
425 from make_show_memory_breakpoints_cleanup. Return a
426 scoped_restore_tmpl<int>.
427 (restore_show_memory_breakpoints): Remove.
428 * ppc-linux-tdep.c (ppc_linux_memory_remove_breakpoint): Update.
429 * mem-break.c (memory_validate_breakpoint): Update.
430 * ia64-tdep.c (ia64_memory_insert_breakpoint): Update.
431 (ia64_memory_remove_breakpoint): Update.
432 (ia64_breakpoint_from_pc): Update.
433 * target.h (make_scoped_restore_show_memory_breakpoints): Rename
434 from make_show_memory_breakpoints_cleanup.
438 * d-namespace.c (d_lookup_symbol): Use std::string.
439 (find_symbol_in_baseclass): Likewise.
443 * ctf.c (ctf_start): Use std::string.
447 * ada-lang.c (is_known_support_routine): Update.
448 (ada_unhandled_exception_name_addr_from_raise): Update.
449 * guile/scm-frame.c (gdbscm_frame_name): Update.
450 * python/py-frame.c (frapy_name): Update.
451 (frapy_function): Update.
452 * stack.h (find_frame_funname): Update.
453 * stack.c (find_frame_funname): Return unique_xmalloc_ptr.
454 (print_frame): Update.
458 * findcmd.c (put_bits): Take a gdb::byte_vector.
459 (parse_find_args): Return gdb::byte_vector. "args" now const.
460 Remove "pattern_bufp" and "pattern_lenp" parameters. Remove
462 (find_command): Update.
466 * cli/cli-script.c (class scoped_restore_hook_in): New.
467 (clear_hook_in_cleanup): Remove.
468 (execute_cmd_pre_hook, execute_cmd_post_hook): Use
469 scoped_restore_hook_in.
473 * cli/cli-script.c (restore_interp): Remove.
474 (read_command_lines): Use scoped_restore_interp.
475 * interps.c (scoped_restore_interp::set_temp): Rename from
477 * interps.h (class scoped_restore_interp): New.
478 (interp_set_temp): Remove.
482 * mi/mi-cmd-catch.c (mi_cmd_catch_assert)
483 (mi_cmd_catch_exception, mi_catch_load_unload): Update.
484 * mi/mi-cmd-break.c (setup_breakpoint_reporting): Return a
486 (mi_cmd_break_insert_1): Update.
487 * mi/mi-cmd-break.h (setup_breakpoint_reporting): Return a
492 * demangle.c (demangle_command): Update.
493 * breakpoint.c (disable_command): Update.
494 (enable_command): Update.
495 (find_location_by_number): Make "number" const. Use
497 * cli/cli-utils.c (extract_arg): Return std::string.
498 * probe.c (parse_probe_linespec): Update. Change types.
499 (collect_probes): Take string arguments.
500 (parse_probe_linespec): Likewise.
501 (info_probes_for_ops): Update.
502 (enable_probes_command): Update.
503 (disable_probes_command): Update.
504 * break-catch-sig.c (catch_signal_split_args): Update.
505 * mi/mi-parse.c (mi_parse): Update.
509 * language.h (language_enum): Make argument const.
510 * language.c (language_enum): Make argument const.
514 * common/common-utils.h (skip_to_space): Remove macro, redeclare
516 (skip_to_space): Rename from skip_to_space_const.
517 * common/common-utils.c (skip_to_space): New function.
518 (skip_to_space): Rename from skip_to_space_const.
519 * cli/cli-utils.h (get_number): Rename from get_number_const.
520 (extract_arg): Rename from extract_arg_const.
521 * cli/cli-utils.c (get_number): Rename from get_number_const.
522 (extract_arg): Rename from extract_arg_const.
523 (number_or_range_parser::get_number): Use ::get_number.
524 * aarch64-linux-tdep.c, ada-lang.c, arm-linux-tdep.c, ax-gdb.c,
525 break-catch-throw.c, breakpoint.c, cli/cli-cmds.c, cli/cli-dump.c,
526 cli/cli-script.c, cli/cli-setshow.c, compile/compile.c,
527 completer.c, demangle.c, disasm.c, findcmd.c, linespec.c,
528 linux-tdep.c, linux-thread-db.c, location.c, mi/mi-parse.c,
529 minsyms.c, nat/linux-procfs.c, printcmd.c, probe.c,
530 python/py-breakpoint.c, record.c, rust-exp.y, serial.c, stack.c,
531 stap-probe.c, tid-parse.c, tracepoint.c: Update all callers.
535 * python/python.c (do_start_initialization): Use
536 py-event-types.def to initialize types.
537 Define all object type structures.
538 * python/python-internal.h: Don't declare event initialization
540 * python/py-threadevent.c (thread_event_object_type): Don't
542 * python/py-stopevent.c (stop_event_object_type): Don't define.
543 * python/py-signalevent.c (signal_event_object_type): Don't
545 * python/py-newobjfileevent.c (new_objfile_event_object_type)
546 (clear_objfiles_event_object_type): Don't declare or define.
547 * python/py-infevents.c (inferior_call_pre_event_object_type)
548 (inferior_call_post_event_object_type)
549 (register_changed_event_object_type)
550 (memory_changed_event_object_type): Don't declare or define.
551 * python/py-inferior.c (new_thread_event_object_type)
552 (new_inferior_event_object_type)
553 (inferior_deleted_event_object_type): Don't declare or define.
554 * python/py-exitedevent.c (exited_event_object_type): Don't
556 * python/py-evts.c (gdbpy_initialize_py_events): Use
558 * python/py-events.h (thread_event_object_type): Don't declare.
559 (events_object): Use py-all-events.def.
560 * python/py-event.h (GDBPY_NEW_EVENT_TYPE): Remove. Use
562 * python/py-event-types.def: New file.
563 * python/py-continueevent.c (create_continue_event_object): Don't
565 * python/py-bpevent.c (breakpoint_event_object_type): Don't
567 * python/py-all-events.def: New file.
571 * python/py-threadevent.c (create_thread_event_object): Return
573 * python/py-stopevent.h (create_stop_event_object)
574 (create_breakpoint_event_object, create_signal_event_object):
576 * python/py-stopevent.c (create_stop_event_object): Return
578 (emit_stop_event): Update.
579 * python/py-signalevent.c (create_signal_event_object): Return
581 * python/py-infevents.c (create_inferior_call_event_object):
583 * python/py-event.h (create_event_object)
584 (create_thread_event_object): Update.
585 * python/py-event.c (create_event_object): Return gdbpy_ref.
586 * python/py-continueevent.c: Return gdbpy_ref.
587 * python/py-bpevent.c (create_breakpoint_event_object): Return
594 * python/python.c (do_start_initialization): Initialize new event
596 * python/python-internal.h (gdbpy_initialize_new_inferior_event)
597 (gdbpy_initialize_inferior_deleted_event)
598 (gdbpy_initialize_new_thread_event): Declare.
599 * python/py-threadevent.c (create_thread_event_object): Add option
601 * python/py-inferior.c (new_thread_event_object_type)
602 (new_inferior_event_object_type)
603 (inferior_deleted_event_object_type): Declare.
604 (python_new_inferior, python_inferior_deleted): New functions.
605 (add_thread_object): Emit new_thread event.
606 (gdbpy_initialize_inferior): Attach new functions to corresponding
608 (new_thread, new_inferior, inferior_deleted): Define new event
610 * python/py-evts.c (gdbpy_initialize_py_events): Add new
612 * python/py-events.h (events_object) <new_inferior,
613 inferior_deleted, new_thread>: New fields.
614 * python/py-event.h (create_thread_event_breakpoint): Add optional
619 * utils.c (abort_with_message): Don't compare gdb_stderr to NULL,
620 check current_ui instead.
621 (internal_vproblem): Likewise.
625 * thread.c (print_thread_info_1): Remove unnecessary calls to
630 * namespace.h (add_using_directive): Update.
631 * namespace.c (add_using_directive): Change type of excludes to
633 * dwarf2read.c (read_import_statement): Use std::vector.
634 (read_namespace): Update.
635 * cp-namespace.c (cp_scan_for_anonymous_namespaces): Update.
639 * linespec.c (create_sals_line_offset): Use gdb::def_vector.
643 * p-valprint.c (pascal_object_print_value): Use gdb::byte_vector.
647 * stack.c (func_command): Use gdb::def_vector.
651 * mi/mi-cmd-var.c (mi_cmd_var_list_children): Use gdb::optional,
652 ui_out_emit_list, ui_out_emit_tuple.
653 (mi_cmd_var_update): Likewise.
657 * mi/mi-interp.c (mi_user_selected_context_changed): Use
659 * guile/scm-ports.c (ioscm_with_output_to_port_worker): Use
661 * utils.c (do_ui_out_redirect_pop)
662 (make_cleanup_ui_out_redirect_pop): Remove.
663 * top.c (execute_command_to_string): Use ui_out_redirect_pop.
664 * utils.h (make_cleanup_ui_out_redirect_pop): Remove.
665 * ui-out.h (ui_out_redirect_pop): New class.
669 * mi/mi-main.c (output_cores): Use ui_out_emit_list.
670 (list_available_thread_groups, mi_cmd_list_thread_groups)
671 (mi_cmd_data_list_changed_registers, mi_cmd_data_read_memory)
672 (mi_cmd_data_read_memory_bytes, mi_cmd_trace_frame_collected):
677 * disasm.c (gdb_pretty_print_disassembler::pretty_print_insn): Use
682 * target.c (flash_erase_command): Use ui_out_emit_tuple.
683 * stack.c (print_frame): Use ui_out_emit_tuple.
684 * spu-tdep.c (info_spu_event_command): Use ui_out_emit_tuple.
685 (info_spu_mailbox_command, info_spu_dma_command)
686 (info_spu_proxydma_command): Likewise.
687 * mi/mi-main.c (mi_cmd_trace_frame_collected): Use
688 ui_out_emit_tuple, gdb::byte_vector, bin2hex.
689 * mi/mi-cmd-file.c (mi_cmd_file_list_shared_libraries): Use
691 * breakpoint.c (print_it_watchpoint): Use ui_out_emit_tuple.
695 * ui-out.h (make_cleanup_ui_out_table_begin_end): Remove.
696 (class ui_out_emit_table): Update comment.
697 * ui-out.c (do_cleanup_table_end)
698 (make_cleanup_ui_out_table_begin_end): Remove.
699 * spu-tdep.c (info_spu_mailbox_list): Use ui_out_emit_table.
700 (info_spu_dma_cmdlist): Likewise.
701 * probe.c (info_probes_for_ops): Use ui_out_emit_table.
702 * darwin-nat-info.c (darwin_debug_regions_recurse): Use
707 * thread.c (print_thread_info_1): Use ui_out_emit_table,
708 ui_out_emit_list, gdb::optional.
712 * aarch64-linux-nat.c: Remove _initialize_aarch64_linux_nat
714 * aarch64-linux-tdep.c: Remove _initialize_aarch64_linux_tdep
716 * aarch64-newlib-tdep.c: Remove _initialize_aarch64_newlib_tdep
718 * aarch64-tdep.c: Remove _initialize_aarch64_tdep prototype.
719 * ada-exp.y: Remove _initialize_ada_exp prototype.
720 * ada-lang.c: Remove _initialize_ada_language prototype.
721 * ada-tasks.c: Remove _initialize_tasks prototype.
722 * addrmap.c: Remove _initialize_addrmap prototype.
723 * agent.c: Remove _initialize_agent prototype.
724 * aix-thread.c: Remove _initialize_aix_thread prototype.
725 * alpha-bsd-nat.c: Remove _initialize_alphabsd_nat prototype.
726 * alpha-linux-nat.c: Remove _initialize_alpha_linux_nat prototype.
727 * alpha-linux-tdep.c: Remove _initialize_alpha_linux_tdep
729 * alpha-nbsd-tdep.c: Remove _initialize_alphanbsd_tdep prototype.
730 * alpha-obsd-tdep.c: Remove _initialize_alphaobsd_tdep prototype.
731 * alpha-tdep.c: Remove _initialize_alpha_tdep prototype.
732 * amd64-darwin-tdep.c: Remove _initialize_amd64_darwin_tdep
734 * amd64-dicos-tdep.c: Remove _initialize_amd64_dicos_tdep
736 * amd64-fbsd-nat.c: Remove _initialize_amd64fbsd_nat prototype.
737 * amd64-fbsd-tdep.c: Remove _initialize_amd64fbsd_tdep prototype.
738 * amd64-linux-nat.c: Remove _initialize_amd64_linux_nat prototype.
739 * amd64-linux-tdep.c: Remove _initialize_amd64_linux_tdep
741 * amd64-nbsd-nat.c: Remove _initialize_amd64nbsd_nat prototype.
742 * amd64-nbsd-tdep.c: Remove _initialize_amd64nbsd_tdep prototype.
743 * amd64-obsd-nat.c: Remove _initialize_amd64obsd_nat prototype.
744 * amd64-obsd-tdep.c: Remove _initialize_amd64obsd_tdep prototype.
745 * amd64-sol2-tdep.c: Remove _initialize_amd64_sol2_tdep prototype.
746 * amd64-tdep.c: Remove _initialize_amd64_tdep prototype.
747 * amd64-windows-nat.c: Remove _initialize_amd64_windows_nat
749 * amd64-windows-tdep.c: Remove _initialize_amd64_windows_tdep
751 * annotate.c: Remove _initialize_annotate prototype.
752 * arc-newlib-tdep.c: Remove _initialize_arc_newlib_tdep prototype.
753 * arc-tdep.c: Remove _initialize_arc_tdep prototype.
754 * arch-utils.c: Remove _initialize_gdbarch_utils prototype.
755 * arm-linux-nat.c: Remove _initialize_arm_linux_nat prototype.
756 * arm-linux-tdep.c: Remove _initialize_arm_linux_tdep prototype.
757 * arm-nbsd-tdep.c: Remove _initialize_arm_netbsd_tdep prototype.
758 * arm-obsd-tdep.c: Remove _initialize_armobsd_tdep prototype.
759 * arm-symbian-tdep.c: Remove _initialize_arm_symbian_tdep
761 * arm-tdep.c: Remove _initialize_arm_tdep prototype.
762 * arm-wince-tdep.c: Remove _initialize_arm_wince_tdep prototype.
763 * auto-load.c: Remove _initialize_auto_load prototype.
764 * auxv.c: Remove _initialize_auxv prototype.
765 * avr-tdep.c: Remove _initialize_avr_tdep prototype.
766 * ax-gdb.c: Remove _initialize_ax_gdb prototype.
767 * bfin-linux-tdep.c: Remove _initialize_bfin_linux_tdep prototype.
768 * bfin-tdep.c: Remove _initialize_bfin_tdep prototype.
769 * break-catch-sig.c: Remove _initialize_break_catch_sig prototype.
770 * break-catch-syscall.c: Remove _initialize_break_catch_syscall
772 * break-catch-throw.c: Remove _initialize_break_catch_throw
774 * breakpoint.c: Remove _initialize_breakpoint prototype.
775 * bsd-uthread.c: Remove _initialize_bsd_uthread prototype.
776 * btrace.c: Remove _initialize_btrace prototype.
777 * charset.c: Remove _initialize_charset prototype.
778 * cli/cli-cmds.c: Remove _initialize_cli_cmds prototype.
779 * cli/cli-dump.c: Remove _initialize_cli_dump prototype.
780 * cli/cli-interp.c: Remove _initialize_cli_interp prototype.
781 * cli/cli-logging.c: Remove _initialize_cli_logging prototype.
782 * cli/cli-script.c: Remove _initialize_cli_script prototype.
783 * coff-pe-read.c: Remove _initialize_coff_pe_read prototype.
784 * coffread.c: Remove _initialize_coffread prototype.
785 * compile/compile.c: Remove _initialize_compile prototype.
786 * complaints.c: Remove _initialize_complaints prototype.
787 * completer.c: Remove _initialize_completer prototype.
788 * copying.awk: Remove _initialize_copying prototype.
789 * copying.c: Regenerate.
790 * core-regset.c: Remove _initialize_core_regset prototype.
791 * corefile.c: Remove _initialize_core prototype.
792 * corelow.c: Remove _initialize_corelow prototype.
793 * cp-abi.c: Remove _initialize_cp_abi prototype.
794 * cp-namespace.c: Remove _initialize_cp_namespace prototype.
795 * cp-support.c: Remove _initialize_cp_support prototype.
796 * cp-valprint.c: Remove _initialize_cp_valprint prototype.
797 * cris-linux-tdep.c: Remove _initialize_cris_linux_tdep prototype.
798 * cris-tdep.c: Remove _initialize_cris_tdep prototype.
799 * ctf.c: Remove _initialize_ctf prototype.
800 * d-lang.c: Remove _initialize_d_language prototype.
801 * darwin-nat-info.c: Remove _initialize_darwin_info_commands
803 * darwin-nat.c: Remove _initialize_darwin_inferior prototype.
804 * dbxread.c: Remove _initialize_dbxread prototype.
805 * dcache.c: Remove _initialize_dcache prototype.
806 * demangle.c: Remove _initialize_demangler prototype.
807 * disasm-selftests.c: Remove _initialize_disasm_selftests
809 * disasm.c: Remove _initialize_disasm prototype.
810 * dtrace-probe.c: Remove _initialize_dtrace_probe prototype.
811 * dummy-frame.c: Remove _initialize_dummy_frame prototype.
812 * dwarf2-frame-tailcall.c: Remove _initialize_tailcall_frame
814 * dwarf2-frame.c: Remove _initialize_dwarf2_frame prototype.
815 * dwarf2expr.c: Remove _initialize_dwarf2expr prototype.
816 * dwarf2loc.c: Remove _initialize_dwarf2loc prototype.
817 * dwarf2read.c: Remove _initialize_dwarf2_read prototype.
818 * elfread.c: Remove _initialize_elfread prototype.
819 * exec.c: Remove _initialize_exec prototype.
820 * extension.c: Remove _initialize_extension prototype.
821 * f-lang.c: Remove _initialize_f_language prototype.
822 * f-valprint.c: Remove _initialize_f_valprint prototype.
823 * fbsd-nat.c: Remove _initialize_fbsd_nat prototype.
824 * fbsd-tdep.c: Remove _initialize_fbsd_tdep prototype.
825 * filesystem.c: Remove _initialize_filesystem prototype.
826 * findcmd.c: Remove _initialize_mem_search prototype.
827 * fork-child.c: Remove _initialize_fork_child prototype.
828 * frame-base.c: Remove _initialize_frame_base prototype.
829 * frame-unwind.c: Remove _initialize_frame_unwind prototype.
830 * frame.c: Remove _initialize_frame prototype.
831 * frv-linux-tdep.c: Remove _initialize_frv_linux_tdep prototype.
832 * frv-tdep.c: Remove _initialize_frv_tdep prototype.
833 * ft32-tdep.c: Remove _initialize_ft32_tdep prototype.
834 * gcore.c: Remove _initialize_gcore prototype.
835 * gdb_bfd.c: Remove _initialize_gdb_bfd prototype.
836 * gdbarch.c: Regenerate.
837 * gdbarch.sh: Remove _initialize_gdbarch prototype.
838 * gdbtypes.c: Remove _initialize_gdbtypes prototype.
839 * gnu-nat.c: Remove _initialize_gnu_nat prototype.
840 * gnu-v2-abi.c: Remove _initialize_gnu_v2_abi prototype.
841 * gnu-v3-abi.c: Remove _initialize_gnu_v3_abi prototype.
842 * go-lang.c: Remove _initialize_go_language prototype.
843 * go32-nat.c: Remove _initialize_go32_nat prototype.
844 * guile/guile.c: Remove _initialize_guile prototype.
845 * h8300-tdep.c: Remove _initialize_h8300_tdep prototype.
846 * hppa-linux-nat.c: Remove _initialize_hppa_linux_nat prototype.
847 * hppa-linux-tdep.c: Remove _initialize_hppa_linux_tdep prototype.
848 * hppa-nbsd-nat.c: Remove _initialize_hppanbsd_nat prototype.
849 * hppa-nbsd-tdep.c: Remove _initialize_hppanbsd_tdep prototype.
850 * hppa-obsd-nat.c: Remove _initialize_hppaobsd_nat prototype.
851 * hppa-obsd-tdep.c: Remove _initialize_hppaobsd_tdep prototype.
852 * hppa-tdep.c: Remove _initialize_hppa_tdep prototype.
853 * i386-bsd-nat.c: Remove _initialize_i386bsd_nat prototype.
854 * i386-cygwin-tdep.c: Remove _initialize_i386_cygwin_tdep
856 * i386-darwin-tdep.c: Remove _initialize_i386_darwin_tdep
858 * i386-dicos-tdep.c: Remove _initialize_i386_dicos_tdep prototype.
859 * i386-fbsd-nat.c: Remove _initialize_i386fbsd_nat prototype.
860 * i386-fbsd-tdep.c: Remove _initialize_i386fbsd_tdep prototype.
861 * i386-gnu-nat.c: Remove _initialize_i386gnu_nat prototype.
862 * i386-gnu-tdep.c: Remove _initialize_i386gnu_tdep prototype.
863 * i386-linux-nat.c: Remove _initialize_i386_linux_nat prototype.
864 * i386-linux-tdep.c: Remove _initialize_i386_linux_tdep prototype.
865 * i386-nbsd-nat.c: Remove _initialize_i386nbsd_nat prototype.
866 * i386-nbsd-tdep.c: Remove _initialize_i386nbsd_tdep prototype.
867 * i386-nto-tdep.c: Remove _initialize_i386nto_tdep prototype.
868 * i386-obsd-nat.c: Remove _initialize_i386obsd_nat prototype.
869 * i386-obsd-tdep.c: Remove _initialize_i386obsd_tdep prototype.
870 * i386-sol2-nat.c: Remove _initialize_amd64_sol2_nat prototype.
871 * i386-sol2-tdep.c: Remove _initialize_amd64_sol2_tdep prototype.
872 * i386-tdep.c: Remove _initialize_i386_tdep prototype.
873 * i386-windows-nat.c: Remove _initialize_i386_windows_nat
875 * ia64-libunwind-tdep.c: Remove _initialize_libunwind_frame
877 * ia64-linux-nat.c: Remove _initialize_ia64_linux_nat prototype.
878 * ia64-linux-tdep.c: Remove _initialize_ia64_linux_tdep prototype.
879 * ia64-tdep.c: Remove _initialize_ia64_tdep prototype.
880 * ia64-vms-tdep.c: Remove _initialize_ia64_vms_tdep prototype.
881 * infcall.c: Remove _initialize_infcall prototype.
882 * infcmd.c: Remove _initialize_infcmd prototype.
883 * inferior.c: Remove _initialize_inferiors prototype.
884 * inflow.c: Remove _initialize_inflow prototype.
885 * infrun.c: Remove _initialize_infrun prototype.
886 * interps.c: Remove _initialize_interpreter prototype.
887 * iq2000-tdep.c: Remove _initialize_iq2000_tdep prototype.
888 * jit.c: Remove _initialize_jit prototype.
889 * language.c: Remove _initialize_language prototype.
890 * linux-fork.c: Remove _initialize_linux_fork prototype.
891 * linux-nat.c: Remove _initialize_linux_nat prototype.
892 * linux-tdep.c: Remove _initialize_linux_tdep prototype.
893 * linux-thread-db.c: Remove _initialize_thread_db prototype.
894 * lm32-tdep.c: Remove _initialize_lm32_tdep prototype.
895 * m2-lang.c: Remove _initialize_m2_language prototype.
896 * m32c-tdep.c: Remove _initialize_m32c_tdep prototype.
897 * m32r-linux-nat.c: Remove _initialize_m32r_linux_nat prototype.
898 * m32r-linux-tdep.c: Remove _initialize_m32r_linux_tdep prototype.
899 * m32r-tdep.c: Remove _initialize_m32r_tdep prototype.
900 * m68hc11-tdep.c: Remove _initialize_m68hc11_tdep prototype.
901 * m68k-bsd-nat.c: Remove _initialize_m68kbsd_nat prototype.
902 * m68k-bsd-tdep.c: Remove _initialize_m68kbsd_tdep prototype.
903 * m68k-linux-nat.c: Remove _initialize_m68k_linux_tdep prototype.
904 * m68k-linux-tdep.c: Remove _initialize_m68k_linux_tdep prototype.
905 * m68k-tdep.c: Remove _initialize_m68k_tdep prototype.
906 * m88k-bsd-nat.c: Remove _initialize_m68kbsd_nat prototype.
907 * m88k-tdep.c: Remove _initialize_m68kbsd_tdep prototype.
908 * machoread.c: Remove _initialize_machoread prototype.
909 * macrocmd.c: Remove _initialize_macrocmd prototype.
910 * macroscope.c: Remove _initialize_macroscope prototype.
911 * maint.c: Remove _initialize_maint_cmds prototype.
912 * mdebugread.c: Remove _initialize_mdebugread prototype.
913 * memattr.c: Remove _initialize_mem prototype.
914 * mep-tdep.c: Remove _initialize_mep_tdep prototype.
915 * mi/mi-cmd-env.c: Remove _initialize_mi_cmd_env prototype.
916 * mi/mi-cmds.c: Remove _initialize_mi_cmds prototype.
917 * mi/mi-interp.c: Remove _initialize_mi_interp prototype.
918 * mi/mi-main.c: Remove _initialize_mi_main prototype.
919 * microblaze-linux-tdep.c: Remove
920 _initialize_microblaze_linux_tdep prototype.
921 * microblaze-tdep.c: Remove _initialize_microblaze_tdep prototype.
922 * mips-fbsd-nat.c: Remove _initialize_mips_fbsd_nat prototype.
923 * mips-fbsd-tdep.c: Remove _initialize_mips_fbsd_tdep prototype.
924 * mips-linux-nat.c: Remove _initialize_mips_linux_nat prototype.
925 * mips-linux-tdep.c: Remove _initialize_mips_linux_tdep prototype.
926 * mips-nbsd-nat.c: Remove _initialize_mipsnbsd_nat prototype.
927 * mips-nbsd-tdep.c: Remove _initialize_mipsnbsd_tdep prototype.
928 * mips-sde-tdep.c: Remove _initialize_mips_sde_tdep prototype.
929 * mips-tdep.c: Remove _initialize_mips_tdep prototype.
930 * mips64-obsd-nat.c: Remove _initialize_mips64obsd_nat prototype.
931 * mips64-obsd-tdep.c: Remove _initialize_mips64obsd_tdep
933 * mipsread.c: Remove _initialize_mipsread prototype.
934 * mn10300-linux-tdep.c: Remove _initialize_mn10300_linux_tdep
936 * mn10300-tdep.c: Remove _initialize_mn10300_tdep prototype.
937 * moxie-tdep.c: Remove _initialize_moxie_tdep prototype.
938 * msp430-tdep.c: Remove _initialize_msp430_tdep prototype.
939 * mt-tdep.c: Remove _initialize_mt_tdep prototype.
940 * nds32-tdep.c: Remove _initialize_nds32_tdep prototype.
941 * nios2-linux-tdep.c: Remove _initialize_nios2_linux_tdep
943 * nios2-tdep.c: Remove _initialize_nios2_tdep prototype.
944 * nto-procfs.c: Remove _initialize_procfs prototype.
945 * nto-tdep.c: Remove _initialize_nto_tdep prototype.
946 * objc-lang.c: Remove _initialize_objc_language prototype.
947 * objfiles.c: Remove _initialize_objfiles prototype.
948 * observer.c: Remove observer_test_first_notification_function,
949 observer_test_second_notification_function,
950 observer_test_third_notification_function, and
951 _initialize_observer prototypes.
952 * opencl-lang.c: Remove _initialize_opencl_language prototypes.
953 * osabi.c: Remove _initialize_gdb_osabi prototype.
954 * osdata.c: Remove _initialize_osdata prototype.
955 * p-valprint.c: Remove _initialize_pascal_valprint prototype.
956 * parse.c: Remove _initialize_parse prototype.
957 * ppc-fbsd-nat.c: Remove _initialize_ppcfbsd_nat prototype.
958 * ppc-fbsd-tdep.c: Remove _initialize_ppcfbsd_tdep prototype.
959 * ppc-linux-nat.c: Remove _initialize_ppc_linux_nat prototype.
960 * ppc-linux-tdep.c: Remove _initialize_ppc_linux_tdep prototype.
961 * ppc-nbsd-nat.c: Remove _initialize_ppcnbsd_nat prototype.
962 * ppc-nbsd-tdep.c: Remove _initialize_ppcnbsd_tdep prototype.
963 * ppc-obsd-nat.c: Remove _initialize_ppcobsd_nat prototype.
964 * ppc-obsd-tdep.c: Remove _initialize_ppcobsd_tdep prototype.
965 * printcmd.c: Remove _initialize_printcmd prototype.
966 * probe.c: Remove _initialize_probe prototype.
967 * proc-api.c: Remove _initialize_proc_api prototype.
968 * proc-events.c: Remove _initialize_proc_events prototype.
969 * proc-service.c: Remove _initialize_proc_service prototype.
970 * procfs.c: Remove _initialize_procfs prototype.
971 * psymtab.c: Remove _initialize_psymtab prototype.
972 * python/python.c: Remove _initialize_python prototype.
973 * ravenscar-thread.c: Remove _initialize_ravenscar prototype.
974 * record-btrace.c: Remove _initialize_record_btrace prototype.
975 * record-full.c: Remove _initialize_record_full prototype.
976 * record.c: Remove _initialize_record prototype.
977 * regcache.c: Remove _initialize_regcache prototype.
978 * reggroups.c: Remove _initialize_reggroup prototype.
979 * remote-notif.c: Remove _initialize_notif prototype.
980 * remote-sim.c: Remove _initialize_remote_sim prototype.
981 * remote.c: Remove _initialize_remote prototype.
982 * reverse.c: Remove _initialize_reverse prototype.
983 * rl78-tdep.c: Remove _initialize_rl78_tdep prototype.
984 * rs6000-aix-tdep.c: Remove _initialize_rs6000_aix_tdep prototype.
985 * rs6000-lynx178-tdep.c: Remove _initialize_rs6000_lynx178_tdep
987 * rs6000-nat.c: Remove _initialize_rs6000_nat prototype.
988 * rs6000-tdep.c: Remove _initialize_rs6000_tdep prototype.
989 * rust-exp.y: Remove _initialize_rust_exp prototype.
990 * rx-tdep.c: Remove _initialize_rx_tdep prototype.
991 * s390-linux-nat.c: Remove _initialize_s390_nat prototype.
992 * s390-linux-tdep.c: Remove _initialize_s390_tdep prototype.
993 * score-tdep.c: Remove _initialize_score_tdep prototype.
994 * selftest-arch.c: Remove _initialize_selftests_foreach_arch
996 * ser-go32.c: Remove _initialize_ser_dos prototype.
997 * ser-mingw.c: Remove _initialize_ser_windows prototype.
998 * ser-pipe.c: Remove _initialize_ser_pipe prototype.
999 * ser-tcp.c: Remove _initialize_ser_tcp prototype.
1000 * ser-unix.c: Remove _initialize_ser_hardwire prototype.
1001 * serial.c: Remove _initialize_serial prototype.
1002 * sh-linux-tdep.c: Remove _initialize_sh_linux_tdep prototype.
1003 * sh-nbsd-nat.c: Remove _initialize_shnbsd_nat prototype.
1004 * sh-nbsd-tdep.c: Remove _initialize_shnbsd_tdep prototype.
1005 * sh-tdep.c: Remove _initialize_sh_tdep prototype.
1006 * skip.c: Remove _initialize_step_skip prototype.
1007 * sol-thread.c: Remove _initialize_sol_thread prototype.
1008 * solib-aix.c: Remove _initialize_solib_aix prototype.
1009 * solib-darwin.c: Remove _initialize_darwin_solib prototype.
1010 * solib-dsbt.c: Remove _initialize_dsbt_solib prototype.
1011 * solib-frv.c: Remove _initialize_frv_solib prototype.
1012 * solib-spu.c: Remove _initialize_spu_solib prototype.
1013 * solib-svr4.c: Remove _initialize_svr4_solib prototype.
1014 * solib-target.c: Remove _initialize_solib_target prototype.
1015 * solib.c: Remove _initialize_solib prototype.
1016 * source.c: Remove _initialize_source prototype.
1017 * sparc-linux-nat.c: Remove _initialize_sparc_linux_nat prototype.
1018 * sparc-linux-tdep.c: Remove _initialize_sparc_linux_tdep
1020 * sparc-nat.c: Remove _initialize_sparc_nat prototype.
1021 * sparc-nbsd-nat.c: Remove _initialize_sparcnbsd_nat prototype.
1022 * sparc-nbsd-tdep.c: Remove _initialize_sparcnbsd_tdep prototype.
1023 * sparc-obsd-tdep.c: Remove _initialize_sparc32obsd_tdep
1025 * sparc-sol2-nat.c: Remove _initialize_sparc_sol2_nat prototype.
1026 * sparc-sol2-tdep.c: Remove _initialize_sparc_sol2_tdep prototype.
1027 * sparc-tdep.c: Remove _initialize_sparc_tdep prototype.
1028 * sparc64-fbsd-nat.c: Remove _initialize_sparc64fbsd_nat
1030 * sparc64-fbsd-tdep.c: Remove _initialize_sparc64fbsd_tdep
1032 * sparc64-linux-nat.c: Remove _initialize_sparc64_linux_nat
1034 * sparc64-linux-tdep.c: Remove _initialize_sparc64_linux_tdep
1036 * sparc64-nat.c: Remove _initialize_sparc64_nat prototype.
1037 * sparc64-nbsd-nat.c: Remove _initialize_sparc64nbsd_nat
1039 * sparc64-nbsd-tdep.c: Remove _initialize_sparc64nbsd_tdep
1041 * sparc64-obsd-nat.c: Remove _initialize_sparc64obsd_nat
1043 * sparc64-obsd-tdep.c: Remove _initialize_sparc64obsd_tdep
1045 * sparc64-sol2-tdep.c: Remove _initialize_sparc64_sol2_tdep
1047 * spu-linux-nat.c: Remove _initialize_spu_nat prototype.
1048 * spu-multiarch.c: Remove _initialize_spu_multiarch prototype.
1049 * spu-tdep.c: Remove _initialize_spu_tdep prototype.
1050 * stabsread.c: Remove _initialize_stabsread prototype.
1051 * stack.c: Remove _initialize_stack prototype.
1052 * stap-probe.c: Remove _initialize_stap_probe prototype.
1053 * std-regs.c: Remove _initialize_frame_reg prototype.
1054 * symfile-debug.c: Remove _initialize_symfile_debug prototype.
1055 * symfile-mem.c: Remove _initialize_symfile_mem prototype.
1056 * symfile.c: Remove _initialize_symfile prototype.
1057 * symmisc.c: Remove _initialize_symmisc prototype.
1058 * symtab.c: Remove _initialize_symtab prototype.
1059 * target-dcache.c: Remove _initialize_target_dcache prototype.
1060 * target-descriptions.c: Remove _initialize_target_descriptions
1062 * thread.c: Remove _initialize_thread prototype.
1063 * tic6x-linux-tdep.c: Remove _initialize_tic6x_linux_tdep
1065 * tic6x-tdep.c: Remove _initialize_tic6x_tdep prototype.
1066 * tilegx-linux-nat.c: Remove _initialize_tile_linux_nat prototype.
1067 * tilegx-linux-tdep.c: Remove _initialize_tilegx_linux_tdep
1069 * tilegx-tdep.c: Remove _initialize_tilegx_tdep prototype.
1070 * tracefile-tfile.c: Remove _initialize_tracefile_tfile prototype.
1071 * tracefile.c: Remove _initialize_tracefile prototype.
1072 * tracepoint.c: Remove _initialize_tracepoint prototype.
1073 * tui/tui-hooks.c: Remove _initialize_tui_hooks prototype.
1074 * tui/tui-interp.c: Remove _initialize_tui_interp prototype.
1075 * tui/tui-layout.c: Remove _initialize_tui_layout prototype.
1076 * tui/tui-regs.c: Remove _initialize_tui_regs prototype.
1077 * tui/tui-stack.c: Remove _initialize_tui_stack prototype.
1078 * tui/tui-win.c: Remove _initialize_tui_win prototype.
1079 * tui/tui.c: Remove _initialize_tui prototype.
1080 * typeprint.c: Remove _initialize_typeprint prototype.
1081 * user-regs.c: Remove _initialize_user_regs prototype.
1082 * utils.c: Remove _initialize_utils prototype.
1083 * v850-tdep.c: Remove _initialize_v850_tdep prototype.
1084 * valarith.c: Remove _initialize_valarith prototype.
1085 * valops.c: Remove _initialize_valops prototype.
1086 * valprint.c: Remove _initialize_valprint prototype.
1087 * value.c: Remove _initialize_values prototype.
1088 * varobj.c: Remove _initialize_varobj prototype.
1089 * vax-bsd-nat.c: Remove _initialize_vaxbsd_nat prototype.
1090 * vax-nbsd-tdep.c: Remove _initialize_vaxnbsd_tdep prototype.
1091 * vax-tdep.c: Remove _initialize_vax_tdep prototype.
1092 * windows-nat.c: Remove _initialize_windows_nat,
1093 _initialize_check_for_gdb_ini, and _initialize_loadable
1095 * windows-tdep.c: Remove _initialize_windows_tdep prototype.
1096 * xcoffread.c: Remove _initialize_xcoffread prototype.
1097 * xml-support.c: Remove _initialize_xml_support prototype.
1098 * xstormy16-tdep.c: Remove _initialize_xstormy16_tdep prototype.
1099 * xtensa-linux-nat.c: Remove _initialize_xtensa_linux_nat
1101 * xtensa-linux-tdep.c: Remove _initialize_xtensa_linux_tdep
1103 * xtensa-tdep.c: Remove _initialize_xtensa_tdep prototype.
1107 * dwarf2read.c (struct field_info) <fnfields>: Remove unused
1112 * f-valprint.c (f_val_print): Remove check for one byte
1113 sized integers. Remove printing of character type.
1119 * f-typeprint.c (f_type_print_base): Use fprintfi_filtered
1120 to maintain proper indentation when printing pointers/refs.
1128 * NEWS (Changes in GDB 7.11): Remove entry for QStartupWithShell.
1132 * parse.c (funcall_chain): Now a std::vector.
1133 (start_arglist, end_arglist): Simplify.
1134 (free_funcalls): Remove.
1135 (parse_exp_in_context_1): Remove cleanup.
1139 * go-exp.y (go_parse): Don't create a cleanup.
1143 * d-exp.y (PrimaryExpression): Use std::string.
1144 (d_parse): Don't create a cleanup.
1148 * utils.c (do_clear_parser_state): Remove.
1149 (make_cleanup_clear_parser_state): Remove.
1150 * p-exp.y (pascal_parse): Use scoped_restore.
1151 * m2-exp.y (m2_parse): Use scoped_restore.
1152 * f-exp.y (f_parse): Use scoped_restore.
1153 * d-exp.y (d_parse): Use scoped_restore.
1154 * c-exp.y (c_parse): Use scoped_restore.
1155 * ada-exp.y (ada_parse): Use scoped_restore.
1156 * utils.h (make_cleanup_clear_parser_state): Remove.
1160 * dwarf2read.c (dw2_linkage_name_attr): New function.
1161 (dw2_linkage_name): New function.
1162 (dwarf2_compute_name, dwarf2_physname, read_call_site_scope)
1163 (guess_full_die_structure_name, dwarf2_name): Use dw2_linkage_name.
1164 (anonymous_struct_prefix, dwarf2_name): Use dw2_linkage_name_attr.
1168 * config/djgpp/djconfig.sh: Correct shell portability issue.
1172 * configure.nat: Define HAVE_NATIVE_GCORE_HOST on NetBSD.
1176 * Makefile.in (ALLDEPFILES): Add mips-fbsd-nat.c.
1177 * NEWS: Mention new FreeBSD/mips native configuration.
1178 * configure.host: Add aarch64*-*-freebsd*.
1179 * configure.nat: Likewise.
1180 * aarch64-fbsd-nat.c: New file.
1184 * Makefile.in (ALL_64_TARGET_OBS): Add aarch64-fbsd-tdep.o.
1185 (ALLDEPFILES): Add aarch64-fbsd-tdep.c.
1186 * NEWS: Mention new FreeBSD/aarch64 target.
1187 * configure.tgt: Add aarch64*-*-freebsd*.
1188 * aarch64-fbsd-tdep.c: New file.
1189 * aarch64-fbsd-tdep.h: New file.
1193 * MAINTAINERS (Write After Approval): Add Kamil Rytarowski.
1197 * parse.c (find_minsym_type_and_address): Don't relocate addresses
1202 * objfiles.c (get_objfile_bfd_data): Remove useless obstack_init
1207 * infrun.c (follow_exec): Call add_thread after
1208 target_find_description.
1212 * infrun.c (handle_inferior_event_1): When exec'ing, read
1213 stop_pc after follow_exec.
1217 * remote.c (process_g_packet): Update error message.
1221 * configure.tgt (gdb_target_obs): Add i386.o for x86_64-*
1226 * eval.c (eval_call, evaluate_funcall): New functions, factored
1228 (evaluate_subexp_standard): ... this.
1232 * amd64-tdep.c (amd64_target_description): Create target
1234 (_initialize_amd64_tdep): Don't call functions
1235 initialize_tdesc_amd64_*. Add self tests.
1236 * arch/amd64.c (amd64_create_target_description): Add parameter
1237 is_linux. Call set_tdesc_osabi if is_linux is true.
1238 * arch/amd64.h (amd64_create_target_description): Update the
1240 * arch/i386.c (i386_create_target_description): Add parameter
1241 is_linux. Call set_tdesc_osabi if is_linux is true.
1242 * arch/i386.h (i386_create_target_description): Update
1244 * configure.tgt: Add i386.o to gdb_target_obs.
1245 * features/Makefile (XMLTOC): Remove i386/*.xml.
1246 * features/i386/amd64-avx-avx512.c: Remove.
1247 * features/i386/amd64-avx-mpx-avx512-pku.c: Remove.
1248 * features/i386/amd64-avx-mpx.c: Remove.
1249 * features/i386/amd64-avx.c: Remove.
1250 * features/i386/amd64-mpx.c: Remove.
1251 * features/i386/amd64.c: Remove.
1252 * features/i386/i386-avx-avx512.c: Remove.
1253 * features/i386/i386-avx-mpx-avx512-pku.c: Remove.
1254 * features/i386/i386-avx-mpx.c: Remove.
1255 * features/i386/i386-avx.c: Remove.
1256 * features/i386/i386-mmx.c: Remove.
1257 * features/i386/i386-mpx.c: Remove.
1258 * features/i386/i386.c: Remove.
1259 * i386-tdep.c: Don't include features/i386/i386*.c., include
1260 target-descriptions.h and arch/i386.h.
1261 (i386_target_description): Create target descriptions.
1262 (i386_gdbarch_init): Don't call initialize_tdesc_i386_*
1263 functions. Do self tests.
1267 * features/Makefile (XMLTOC): Remove i386/amd64XXX-linux.xml.
1268 * features/i386/amd64-avx-avx512-linux.c: Removed.
1269 * features/i386/amd64-avx-linux.c: Removed.
1270 * features/i386/amd64-avx-mpx-avx512-pku-linux.c: Removed.
1271 * features/i386/amd64-avx-mpx-linux.c: Removed.
1272 * features/i386/amd64-linux.c: Removed.
1273 * features/i386/amd64-mpx-linux.c: Removed.
1274 * features/i386/x32-avx-avx512-linux.c: Removed.
1275 * features/i386/x32-avx-linux.c: Removed.
1276 * features/i386/x32-linux.c: Removed.
1280 * amd64-linux-tdep.c: Include arch/amd64.h. Don't include
1282 (amd64_linux_read_description): Call
1283 amd64_create_target_description.
1284 * arch/amd64.c: New file.
1285 * arch/amd64.h: New file.
1286 * configure.tgt (x86_64-*-linux*): Append amd64.o.
1287 * Makefile.in (ALL_64_TARGET_OBS): Append amd64.o.
1291 * amd64-linux-tdep.c: Don't include amd64-XXX-linux and
1292 x32-XXX-linux.c. Include 64bit-XX.c and x32-XX.c.
1293 (amd64_linux_read_description): Create target descriptions.
1294 (_initialize_amd64_linux_tdep): Don't call initialize_tdesc_XXX
1295 functions. Add unit tests.
1296 * features/Makefile (FEATURE_XMLFILES): Append 64bit-XXX.xml and
1298 * features/i386/64bit-avx.c: Generated.
1299 * features/i386/64bit-avx512.c: Generated.
1300 * features/i386/64bit-core.c: Generated.
1301 * features/i386/64bit-linux.c: Generated.
1302 * features/i386/64bit-mpx.c: Generated.
1303 * features/i386/64bit-pkeys.c: Generated.
1304 * features/i386/64bit-segments.c: Generated.
1305 * features/i386/64bit-sse.c: Generated.
1306 * features/i386/x32-core.c: Generated.
1307 * target-descriptions.c (maint_print_c_tdesc_cmd): Print feature
1308 c files for amd64-linux and x32-linux.
1312 * amd64-linux-tdep.c (amd64_linux_read_description): New
1314 (amd64_linux_core_read_description): Call
1315 amd64_linux_read_description.
1316 (amd64_linux_init_abi): Likewise.
1317 (amd64_x32_linux_init_abi): Likewise.
1318 * amd64-linux-tdep.h (amd64_linux_read_description): Declare.
1319 * x86-linux-nat.c (x86_linux_read_description): Call
1320 amd64_linux_read_description.
1324 * amd64-linux-tdep.c (amd64_linux_core_read_description): Update
1329 * features/Makefile (XMLTOC): Remove i386/i386-XX-linux.xml.
1330 * features/i386/i386-avx-avx512-linux.c: Remove.
1331 * features/i386/i386-avx-linux.c: Remove.
1332 * features/i386/i386-avx-mpx-avx512-pku-linux.c: Remove.
1333 * features/i386/i386-avx-mpx-linux.c: Remove.
1334 * features/i386/i386-linux.c: Remove.
1335 * features/i386/i386-mmx-linux.c: Remove.
1336 * features/i386/i386-mpx-linux.c: Remove.
1340 * Makefile.in (ALL_TARGET_OBS): Add i386.o.
1341 (SFILES): Add arch/i386.c.
1342 (HFILES_NO_SRCDIR): Add arch/i386.h.
1343 * arch/i386.c: New file.
1344 * arch/i386.h: New file.
1345 * arch/tdesc.h (allocate_target_description): Declare.
1346 (set_tdesc_architecture): Declare.
1347 (set_tdesc_osabi): Declare.
1348 * configure.tgt (i[34567]86-*-linux*): Add i386.o.
1349 * i386-linux-tdep.c: Don't include ../features/i386/32bit-XXX.c.
1350 include arch/i386.h.
1351 (i386_linux_read_description): Remove code and call
1352 i386_create_target_description.
1353 (set_tdesc_architecture): New function.
1354 (set_tdesc_osabi): New function.
1355 * target-descriptions.h (allocate_target_description): Remove.
1359 * arch/tdesc.h (tdesc_create_feature): Add an argument xml.
1360 * target-descriptions.c (tdesc_create_feature): Likewise, and
1362 * features/i386/32bit-avx.c: Re-generated.
1363 * features/i386/32bit-avx512.c: Re-generated.
1364 * features/i386/32bit-core.c: Re-generated.
1365 * features/i386/32bit-linux.c: Re-generated.
1366 * features/i386/32bit-mpx.c: Re-generated.
1367 * features/i386/32bit-pkeys.c: Re-generated.
1368 * features/i386/32bit-sse.c: Re-generated.
1372 * regformats/regdef.h (struct reg): Override operator == and !=.
1376 * arch/tdesc.h: New file.
1377 * regformats/regdat.sh: Generate code using tdesc_create_reg.
1378 * target-descriptions.c: Update comments.
1379 * target-descriptions.h: Include "arch/tdesc.h". Remove the
1381 * features/i386/32bit-avx.c: Re-generated.
1382 * features/i386/32bit-avx512.c: Re-generated.
1383 * features/i386/32bit-core.c: Re-generated.
1384 * features/i386/32bit-linux.c: Re-generated.
1385 * features/i386/32bit-mpx.c: Re-generated.
1386 * features/i386/32bit-pkeys.c: Re-generated.
1387 * features/i386/32bit-sse.c: Re-generated.
1391 * regformats/regdat.sh: Update generated code.
1395 * regformats/regdat.sh: Adjust code order.
1399 * expprint.c (dump_subexp_body_standard): Use constant format
1400 string in fprintf_filtered call.
1404 * configure.nat: Add "x86-nat.o x86-dregs.o" for NetBSD/amd64 and
1406 * x86-bsd-nat.c [!DBREG_DRX && __NetBSD__]: Define DBREG_DRX.
1410 * bsd-kvm.o: Make <sys/user.h> conditional on HAVE_SYS_USER_H.
1414 * bsd-kvm.o: Define _KMEMUSER.
1415 * configure.ac: Define _KMEMUSER when checking for "struct lwp".
1416 * configure: Regenerate.
1420 * amd64-fbsd-nat.c: Add include of "x86-xstate.h".
1421 * i386-fbsd-nat.c: Likewise.
1425 * unittests/array-view-selftests.c: Add include of <array>.
1429 * spu-tdep.c (flush_ea_cache): Add missing argument to
1430 call_function_by_hand.
1434 * NEWS (Safer support for debugging with no debug info): New.
1438 * c-exp.y (function_method, function_method_void): Add current
1439 instance flags to TYPE_INSTANCE.
1440 * dwarf2read.c (check_modifier): New.
1441 (compute_delayed_physnames): Assert that only C++ adds delayed
1442 physnames. Mark fn_fields as const/volatile depending on
1444 * eval.c (make_params): New type_instance_flags parameter. Use
1445 it as the new type's instance flags.
1446 (evaluate_subexp_standard) <TYPE_INSTANCE>: Extract the instance
1447 flags element and pass it to make_params.
1448 * expprint.c (print_subexp_standard) <TYPE_INSTANCE>: Handle
1449 instance flags element.
1450 (dump_subexp_body_standard) <TYPE_INSTANCE>: Likewise.
1451 * gdbtypes.h: Include "enum-flags.h".
1452 (type_instance_flags): New enum-flags type.
1453 (TYPE_CONST, TYPE_VOLATILE, TYPE_RESTRICT, TYPE_ATOMIC)
1454 (TYPE_CODE_SPACE, TYPE_DATA_SPACE): Return boolean.
1455 * parse.c (operator_length_standard) <TYPE_INSTANCE>: Adjust.
1456 (follow_type_instance_flags): New function.
1457 (operator_check_standard) <TYPE_INSTANCE>: Adjust.
1458 * parser-defs.h (follow_type_instance_flags): Declare.
1459 * valops.c (value_struct_elt_for_reference): const/volatile must
1464 * cp-namespace.c (cp_search_static_and_baseclasses): Handle
1465 function/method scopes; lookup the nested name as a function local
1470 (%type <voidval>): Add function_method.
1471 * c-exp.y (exp): New production for calls with no arguments.
1472 (function_method, function_method_void_or_typelist): New
1474 (exp): New production for "method()::static_var".
1475 * eval.c (evaluate_subexp_standard): Handle OP_FUNC_STATIC_VAR.
1476 * expprint.c (print_subexp_standard, dump_subexp_body_standard):
1477 Handle OP_FUNC_STATIC_VAR.
1478 * parse.c (operator_length_standard):
1479 Handle OP_FUNC_STATIC_VAR.
1483 * eval.c (evaluate_subexp_standard): Remove UNOP_MEMVAL_TLS
1485 * expprint.c (print_subexp_standard, dump_subexp_body_standard):
1487 * parse.c (operator_length_standard, operator_check_standard):
1489 * std-operator.def (UNOP_MEMVAL_TLS): Delete.
1493 * ax-gdb.c: Include "typeprint.h".
1494 (gen_expr_for_cast): New function.
1495 (gen_expr) <OP_CAST, OP_CAST_TYPE>: Use it.
1496 <OP_VAR_VALUE, OP_MSYM_VAR_VALUE>: Error out if the variable's
1498 * dwarf2read.c (new_symbol_full): Fallback to int instead of
1499 nodebug_data_symbol.
1500 * eval.c: Include "typeprint.h".
1501 (evaluate_subexp_standard) <OP_VAR_VALUE, OP_VAR_MSYM_VALUE>:
1502 Error out if symbol has unknown type.
1503 <UNOP_CAST, UNOP_CAST_TYPE>: Common bits factored out to
1504 evaluate_subexp_for_cast.
1505 (evaluate_subexp_for_address, evaluate_subexp_for_sizeof): Handle
1507 (evaluate_subexp_for_cast): New function.
1508 * gdbtypes.c (init_nodebug_var_type): New function.
1509 (objfile_type): Use it to initialize types of variables with no
1511 * typeprint.c (error_unknown_type): New.
1512 * typeprint.h (error_unknown_type): New declaration.
1513 * compile/compile-c-types.c (convert_type_basic): Handle
1514 TYPE_CODE_ERROR; warn and fallback to int for variables with
1519 * eval.c (evaluate_var_value): New function, factored out from ...
1520 (evaluate_subexp_standard): ... here.
1524 * eval.c (evaluate_subexp_standard) <UNOP_COMPLEMENT, UNOP_ADDR>:
1525 Remove useless assignments to 'op'.
1529 * eval.c (eval_skip_value): New function.
1530 (evaluate_subexp_standard): Use it.
1534 * eval.c (evaluate_subexp_standard): <OP_FUNCALL>: Extract
1535 function name from symbol/minsym and pass it to
1536 error_call_unknown_return_type.
1540 * ada-lang.c (resolve_subexp): Handle OP_VAR_MSYM_VALUE.
1541 * ax-gdb.c (gen_msym_var_ref): New function.
1542 (gen_expr): Handle OP_VAR_MSYM_VALUE.
1543 * eval.c (evaluate_var_msym_value): New function.
1544 * eval.c (evaluate_subexp_standard): Handle OP_VAR_MSYM_VALUE.
1545 <OP_FUNCALL>: Extract function name from symbol/minsym and pass it
1546 to call_function_by_hand.
1547 * expprint.c (print_subexp_standard, dump_subexp_body_standard):
1548 Handle OP_VAR_MSYM_VALUE.
1549 (union exp_element) <msymbol>: New field.
1550 * minsyms.h (struct type): Forward declare.
1551 (find_minsym_type_and_address): Declare.
1552 * parse.c (write_exp_elt_msym): New function.
1553 (write_exp_msymbol): Delete, refactored as ...
1554 (find_minsym_type_and_address): ... this new function.
1555 (write_exp_msymbol): Reimplement using OP_VAR_MSYM_VALUE.
1556 (operator_length_standard, operator_check_standard): Handle
1558 * std-operator.def (OP_VAR_MSYM_VALUE): New.
1562 * ada-lang.c (ada_evaluate_subexp) <TYPE_CODE_FUNC>: Don't handle
1563 TYPE_GNU_IFUNC specially here. Throw error if return type is
1565 * ada-typeprint.c (print_func_type): Handle functions with unknown
1567 * c-typeprint.c (c_type_print_base): Handle functions and methods
1568 with unknown return type.
1569 * compile/compile-c-symbols.c (convert_symbol_bmsym)
1570 <mst_text_gnu_ifunc>: Use nodebug_text_gnu_ifunc_symbol.
1571 * compile/compile-c-types.c: Include "objfiles.h".
1572 (convert_func): For functions with unknown return type, warn and
1574 * compile/compile-object-run.c (compile_object_run): Adjust call
1575 to call_function_by_hand_dummy.
1576 * elfread.c (elf_gnu_ifunc_resolve_addr): Adjust call to
1577 call_function_by_hand.
1578 * eval.c (evaluate_subexp_standard): Adjust calls to
1579 call_function_by_hand. Handle functions and methods with unknown
1580 return type. Pass expect_type to call_function_by_hand.
1581 * f-typeprint.c (f_type_print_base): Handle functions with unknown
1583 * gcore.c (call_target_sbrk): Adjust call to
1584 call_function_by_hand.
1585 * gdbtypes.c (objfile_type): Leave nodebug text symbol with NULL
1586 return type instead of int. Make nodebug_text_gnu_ifunc_symbol be
1587 an integer address type instead of nodebug.
1588 * guile/scm-value.c (gdbscm_value_call): Adjust call to
1589 call_function_by_hand.
1590 * infcall.c (error_call_unknown_return_type): New function.
1591 (call_function_by_hand): New "default_return_type" parameter.
1593 (call_function_by_hand_dummy): New "default_return_type"
1594 parameter. Use it instead of defaulting to int. If there's no
1595 default and the return type is unknown, throw an error. If
1596 there's a default return type, and the called function has no
1597 debug info, then assume the function is prototyped.
1598 * infcall.h (call_function_by_hand, call_function_by_hand_dummy):
1599 New "default_return_type" parameter.
1600 (error_call_unknown_return_type): New declaration.
1601 * linux-fork.c (call_lseek): Cast return type of lseek.
1602 (inferior_call_waitpid, checkpoint_command): Adjust calls to
1603 call_function_by_hand.
1604 * linux-tdep.c (linux_infcall_mmap, linux_infcall_munmap): Adjust
1605 calls to call_function_by_hand.
1606 * m2-typeprint.c (m2_procedure): Handle functions with unknown
1608 * objc-lang.c (lookup_objc_class, lookup_child_selector)
1609 (value_nsstring, print_object_command): Adjust calls to
1610 call_function_by_hand.
1611 * p-typeprint.c (pascal_type_print_varspec_prefix): Handle
1612 functions with unknown return type.
1613 (pascal_type_print_func_varspec_suffix): New function.
1614 (pascal_type_print_varspec_suffix) <TYPE_CODE_FUNC,
1615 TYPE_CODE_METHOD>: Use it.
1616 * python/py-value.c (valpy_call): Adjust call to
1617 call_function_by_hand.
1618 * rust-lang.c (rust_evaluate_funcall): Adjust call to
1619 call_function_by_hand.
1620 * valarith.c (value_x_binop, value_x_unop): Adjust calls to
1621 call_function_by_hand.
1622 * valops.c (value_allocate_space_in_inferior): Adjust call to
1623 call_function_by_hand.
1624 * typeprint.c (type_print_unknown_return_type): New function.
1625 * typeprint.h (type_print_unknown_return_type): New declaration.
1629 * gdbtypes.c (lookup_function_type_with_arguments): Mark function
1630 types with more than one parameter as prototyped.
1634 * cli/cli-cmds.c (print_disassembly, disassemble_current_function)
1635 (disassemble_command): Use gdb_disassembly_flags instead of bare
1637 * disasm.c (gdb_pretty_print_disassembler::pretty_print_insn)
1638 (dump_insns, do_mixed_source_and_assembly_deprecated)
1639 (do_mixed_source_and_assembly, do_assembly_only, gdb_disassembly):
1640 Use gdb_disassembly_flags instead of bare int.
1641 * disasm.h (DISASSEMBLY_SOURCE_DEPRECATED, DISASSEMBLY_RAW_INSN)
1642 (DISASSEMBLY_OMIT_FNAME, DISASSEMBLY_FILENAME)
1643 (DISASSEMBLY_OMIT_PC, DISASSEMBLY_SOURCE)
1644 (DISASSEMBLY_SPECULATIVE): No longer macros. Instead they're...
1645 (enum gdb_disassembly_flag): ... values of this new enumeration.
1646 (gdb_disassembly_flags): Define.
1648 (gdb_pretty_print_disassembler::pretty_print_insn): Use it.
1649 * mi/mi-cmd-disas.c (mi_cmd_disassemble): Use
1650 gdb_disassembly_flags instead of bare int.
1651 * record-btrace.c (btrace_insn_history)
1652 (record_btrace_insn_history, record_btrace_insn_history_range)
1653 (record_btrace_insn_history_from): Use gdb_disassembly_flags
1654 instead of bare int.
1655 * record.c (get_insn_history_modifiers, cmd_record_insn_history):
1656 Use gdb_disassembly_flags instead of bare int.
1657 * target-debug.h (target_debug_print_gdb_disassembly_flags):
1659 * target-delegates.c: Regenerate.
1660 * target.c (target_insn_history, target_insn_history_from)
1661 (target_insn_history_range): Use gdb_disassembly_flags instead of
1663 * target.h: Include "disasm.h".
1664 (struct target_ops) <to_insn_history, to_insn_history_from,
1665 to_insn_history_range>: Use gdb_disassembly_flags instead of bare
1667 (target_insn_history, target_insn_history_from)
1668 (target_insn_history_range): Use gdb_disassembly_flags instead of
1673 * cli/cli-script.c (build_command_line): For if/while commands,
1674 check whether args is empty.
1678 * cli/cli-script.h (enum misc_command_type): Move from defs.h.
1679 (enum command_control_type): Likewise.
1680 (struct command_line): Likewise.
1681 (free_command_lines): Likewise.
1682 (struct command_lines_deleter): Likewise.
1683 (command_line_up): Likewise.
1684 (read_command_lines): Likewise.
1685 (read_command_lines_1): Likewise.
1686 * defs.h (enum misc_command_type): Move to cli/cli-script.h.
1687 (enum command_control_type): Likewise.
1688 (struct command_line): Likewise.
1689 (free_command_lines): Likewise.
1690 (struct command_lines_deleter): Likewise.
1691 (command_line_up): Likewise.
1692 (read_command_lines): Likewise.
1693 (read_command_lines_1): Likewise.
1694 * breakpoint.h: Include cli/cli-script.h.
1695 * extension-priv.h: Likewise.
1696 * gdbcmd.h: Likewise.
1700 * ada-lang.c (is_known_support_routine): Move sal declaration to
1701 where it is initialized.
1702 * breakpoint.c (create_internal_breakpoint, init_catchpoint)
1703 (parse_breakpoint_sals, decode_static_tracepoint_spec)
1704 (clear_command, update_static_tracepoint): Remove init_sal
1705 references. Move declarations closer to initializations.
1706 * cli/cli-cmds.c (list_command): Move sal declarations closer to
1708 * elfread.c (elf_gnu_ifunc_resolver_stop): Remove init_sal
1709 references. Move sal declarations closer to initializations.
1710 * frame.c (find_frame_sal): Return a symtab_and_line via function
1711 return instead of output parameter. Remove init_sal references.
1712 * frame.h (find_frame_sal): Return a symtab_and_line via function
1713 return instead of output parameter.
1714 * guile/scm-frame.c (gdbscm_frame_sal): Adjust.
1715 * guile/scm-symtab.c (stscm_make_sal_smob): Use in-place new
1717 (gdbscm_find_pc_line): Remove init_sal reference.
1718 * infcall.c (call_function_by_hand_dummy): Remove init_sal
1719 references. Move declarations closer to initializations.
1720 * infcmd.c (set_step_frame): Update. Move declarations closer to
1722 (finish_backward): Remove init_sal references. Move declarations
1723 closer to initializations.
1724 * infrun.c (process_event_stop_test, handle_step_into_function)
1725 (insert_hp_step_resume_breakpoint_at_frame)
1726 (insert_step_resume_breakpoint_at_caller): Likewise.
1727 * linespec.c (create_sals_line_offset, decode_digits_ordinary)
1728 (symbol_to_sal): Likewise.
1729 * probe.c (parse_probes_in_pspace): Remove init_sal reference.
1730 * python/py-frame.c (frapy_find_sal): Move sal declaration closer
1731 to its initialization.
1732 * reverse.c (save_bookmark_command): Use new/delete. Remove
1733 init_sal references. Move declarations closer to initializations.
1734 * source.c (get_current_source_symtab_and_line): Remove brace
1736 (set_current_source_symtab_and_line): Now takes the sal by const
1737 reference. Remove brace initialization.
1738 (line_info): Remove init_sal reference.
1739 * source.h (set_current_source_symtab_and_line): Now takes a
1740 symtab_and_line via const reference.
1741 * stack.c (set_current_sal_from_frame): Adjust.
1742 (print_frame_info): Adjust.
1743 (get_last_displayed_sal): Return the sal via function return
1744 instead of via output parameter. Simplify.
1745 (frame_info): Adjust.
1746 * stack.h (get_last_displayed_sal): Return the sal via function
1747 return instead of via output parameter.
1748 * symtab.c (init_sal): Delete.
1749 (find_pc_sect_line): Remove init_sal references. Move
1750 declarations closer to initializations.
1751 (find_function_start_sal): Remove init_sal references. Move
1752 declarations closer to initializations.
1753 * symtab.h (struct symtab_and_line): In-class initialize all
1755 * tracepoint.c (set_traceframe_context)
1756 (print_one_static_tracepoint_marker): Remove init_sal references.
1757 Move declarations closer to initializations.
1758 * tui/tui-disasm.c (tui_show_disassem_and_update_source): Adjust.
1759 * tui/tui-stack.c (tui_show_frame_info): Adjust. Move
1760 declarations closer to initializations.
1761 * tui/tui-winsource.c (tui_update_source_window_as_is): Remove
1762 init_sal references. Adjust.
1766 * ax-gdb.c (agent_command_1): Use range-for.
1767 * break-catch-throw.c (re_set_exception_catchpoint): Update.
1768 * breakpoint.c: Include "common/array-view.h".
1769 (init_breakpoint_sal, create_breakpoint_sal): Change sals
1770 parameter from struct symtabs_and_lines to
1771 array_view<symtab_and_line>. Adjust. Use range-for. Update.
1772 (breakpoint_sals_to_pc): Change sals parameter from struct
1773 symtabs_and_lines to std::vector reference.
1774 (check_fast_tracepoint_sals): Change sals parameter from struct
1775 symtabs_and_lines to std::array_view. Use range-for.
1776 (decode_static_tracepoint_spec): Return a std::vector instead of
1777 symtabs_and_lines. Update.
1778 (create_breakpoint): Update.
1779 (break_range_command, until_break_command, clear_command): Update.
1780 (base_breakpoint_decode_location, bkpt_decode_location)
1781 (bkpt_probe_create_sals_from_location)
1782 (bkpt_probe_decode_location, tracepoint_decode_location)
1783 (tracepoint_probe_decode_location)
1784 (strace_marker_create_sals_from_location): Return a std::vector
1785 instead of symtabs_and_lines.
1786 (strace_marker_create_breakpoints_sal): Update.
1787 (strace_marker_decode_location): Return a std::vector instead of
1788 symtabs_and_lines. Update.
1789 (update_breakpoint_locations): Change struct symtabs_and_lines
1790 parameters to gdb::array_view. Adjust.
1791 (location_to_sals): Return a std::vector instead of
1792 symtabs_and_lines. Update.
1793 (breakpoint_re_set_default): Use std::vector instead of struct
1795 (decode_location_default): Return a std::vector instead of
1796 symtabs_and_lines. Update.
1797 * breakpoint.h: Include "common/array-view.h".
1798 (struct breakpoint_ops) <decode_location>: Now returns a
1799 std::vector instead of returning a symtabs_and_lines via output
1801 (update_breakpoint_locations): Change sals parameters to use
1803 * cli/cli-cmds.c (edit_command, list_command): Update to use
1804 std::vector and gdb::array_view.
1805 (ambiguous_line_spec): Adjust to use gdb::array_view and
1807 (compare_symtabs): Rename to ...
1808 (cmp_symtabs): ... this. Change parameters to symtab_and_line
1809 const reference and adjust.
1810 (filter_sals): Rewrite using std::vector and standard algorithms.
1811 * elfread.c (elf_gnu_ifunc_resolver_return_stop): Simplify.
1812 (jump_command): Update to use std::vector.
1813 * linespec.c (struct linespec_state) <canonical_names>: Update
1815 (add_sal_to_sals_basic): Delete.
1816 (add_sal_to_sals, filter_results, convert_results_to_lsals)
1817 (decode_line_2, create_sals_line_offset)
1818 (convert_address_location_to_sals, convert_linespec_to_sals)
1819 (convert_explicit_location_to_sals, parse_linespec)
1820 (event_location_to_sals, decode_line_full, decode_line_1)
1821 (decode_line_with_current_source)
1822 (decode_line_with_last_displayed, decode_objc)
1823 (decode_digits_list_mode, decode_digits_ordinary, minsym_found)
1824 (linespec_result::~linespec_result): Adjust to use std::vector
1825 instead of symtabs_and_lines.
1826 * linespec.h (linespec_sals::sals): Now a std::vector.
1827 (struct linespec_result): Use std::vector, bool, and in-class
1829 (decode_line_1, decode_line_with_current_source)
1830 (decode_line_with_last_displayed): Return std::vector.
1831 * macrocmd.c (info_macros_command): Use std::vector.
1832 * mi/mi-main.c (mi_cmd_trace_find): Use std::vector.
1833 * probe.c (parse_probes_in_pspace, parse_probes): Adjust to use
1835 * probe.h (parse_probes): Return a std::vector.
1836 * python/python.c (gdbpy_decode_line): Use std::vector and
1838 * source.c (select_source_symtab, line_info): Use std::vector.
1839 * stack.c (func_command): Use std::vector.
1840 * symtab.h (struct symtabs_and_lines): Delete.
1841 * tracepoint.c (tfind_line_command, scope_info): Use std::vector.
1845 * Makefile.in (SUBDIR_UNITTESTS_SRCS): Add
1846 unittests/array-view-selftests.c.
1847 (SUBDIR_UNITTESTS_OBS): Add array-view-selftests.o.
1848 * common/array-view.h: New file.
1849 * unittests/array-view-selftests.c: New file.
1853 * cli/cli-cmds.c (edit_command): Pass message to
1854 ambiguous_line_spec.
1855 (list_command): Pass message to ambiguous_line_spec. Say
1856 "first"/"last" instead of "start" and "end" to be consistent with
1858 (ambiguous_line_spec): Add 'format' and vararg parameters. Use
1859 them to print formatted message.
1863 * btrace.c (ftrace_add_pt): Pass btrace_insn to
1864 ftrace_update_insns by reference instead of pointer.
1868 * i386-go32-tdep.c: Include x86-xstate.h.
1869 (i386_go32_init_abi): Call i386_target_description.
1870 * i386-tdep.c (i386_target_description): Return tdesc_i386_mmx
1871 if xcr0 is X86_XSTATE_X87_MASK.
1872 * i386-tdep.h (tdesc_i386): Remove the declaration.
1873 (tdesc_i386_mmx): Likewise.
1877 * i386-fbsd-tdep.c (i386fbsd_core_read_xcr0): Return
1878 X86_XSTATE_SSE_MASK instead of 0.
1882 * amd64-fbsd-nat.c (amd64fbsd_read_description): Call
1883 i386_target_description.
1884 * i386-fbsd-nat.c (i386fbsd_read_description): Call
1885 i386_target_description.
1886 * i386-tdep.c (i386_gdbarch_init): Likewise.
1890 * amd64-darwin-tdep.c: Include "x86-xstate.h".
1891 (x86_darwin_init_abi_64): Call amd64_target_description.
1892 * amd64-dicos-tdep.c: Likewise.
1893 * amd64-fbsd-nat.c: Likewise.
1894 * amd64-fbsd-tdep.c: Likewise.
1895 * amd64-nbsd-tdep.c: Likewise.
1896 * amd64-obsd-tdep.c: Likewise.
1897 * amd64-sol2-tdep.c: Likewise.
1898 * amd64-windows-tdep.c: Likewise.
1899 * amd64-tdep.h (tdesc_amd64): Remove the declaration.
1903 * btrace.h (btrace_insn_s, DEF_VEC_O (btrace_insn_s)): Remove.
1904 (btrace_function) <insn>: Change type to use std::vector.
1905 * btrace.c (ftrace_debug, ftrace_call_num_insn,
1906 ftrace_find_call, ftrace_new_gap, ftrace_update_function,
1907 ftrace_update_insns, ftrace_compute_global_level_offset,
1908 btrace_stitch_bts, btrace_clear, btrace_insn_get,
1909 btrace_insn_end, btrace_insn_next, btrace_insn_prev): Adjust to
1910 change to std::vector.
1911 (ftrace_update_insns): Adjust to change to std::vector, change
1912 type of INSN parameter.
1913 (btrace_compute_ftrace_bts): Adjust call to ftrace_update_insns.
1914 * record-btrace.c (btrace_call_history_insn_range,
1915 btrace_compute_src_line_range,
1916 record_btrace_frame_prev_register): Adjust to change to
1918 * python/py-record-btrace.c (recpy_bt_func_instructions): Adjust
1919 to change to std::vector.
1923 * corefile.c (reopen_exec_file): Use std::string.
1927 * compile/compile.c (compile_register_name_mangled): Return
1929 * compile/compile-loc2c.c (pushf_register_address): Update.
1930 (pushf_register): Update.
1931 * compile/compile-c-types.c (convert_array): Update.
1932 * compile/compile-c-symbols.c (generate_vla_size): Update.
1933 (error_symbol_once): Use a gdb::unique_xmalloc_ptr.
1934 (symbol_substitution_name): Return a gdb::unique_xmalloc_ptr.
1935 (convert_one_symbol): Update.
1936 (generate_c_for_for_one_variable): Update.
1937 * compile/compile-c-support.c (c_get_range_decl_name): Return a
1939 (generate_register_struct): Update.
1940 * compile/compile-internal.h (c_get_range_decl_name): Return a
1942 (compile_register_name_mangled): Return std::string.
1946 * utils.c (perror_string): Return a std::string.
1947 (throw_perror_with_name, perror_warning_with_name): Update.
1951 * demangle.c (demangle_command): Use std::string,
1956 * cli/cli-setshow.c (do_set_command): Use std::string.
1960 * cli/cli-cmds.c (cd_command): Use gdb::unique_xmalloc_ptr.
1964 * mi/mi-interp.c (mi_cmd_interpreter_exec): Use std::string.
1968 * mi/mi-cmd-env.c (env_execute_cli_command): Use
1969 gdb::unique_xmalloc_ptr.
1973 * thread.c (print_thread_info_1): Use string_printf.
1974 (thread_apply_command, thread_apply_all_command): Use
1979 * valprint.c (val_print_string): Update.
1980 * gdbcore.h (memory_error_message): Return std::string.
1981 * corefile.c (memory_error_message): Return std::string.
1982 (memory_error): Update.
1983 * breakpoint.c (insert_bp_location): Update.
1987 * target/waitstatus.h (target_waitstatus_to_string): Change
1988 return type to std::string.
1989 * target/waitstatus.c (target_waitstatus_to_string): Return
1991 * target.h (target_waitstatus_to_string): Remove declaration.
1992 * infrun.c (resume, clear_proceed_status_thread,
1993 print_target_wait_results, do_target_wait, save_waitstatus,
1994 stop_all_threads): Adjust.
1995 * record-btrace.c (record_btrace_wait): Adjust.
1997 (target_debug_print_struct_target_waitstatus_p): Adjust.
2002 * nat/linux-procfs.c (parse_proc_status_state): Fix PROC_STATE_STOPPED
2007 * NEWS (Changes since GDB 8.0): Add entry mentioning new support
2008 for setting/unsetting environment variables on the remote target.
2009 (New remote packets): Add entries for QEnvironmentHexEncoded,
2010 QEnvironmentUnset and QEnvironmentReset.
2011 * common/environ.c (gdb_environ::operator=): Extend method to
2012 handle m_user_set_env_list and m_user_unset_env_list.
2013 (gdb_environ::clear): Likewise.
2014 (match_var_in_string): Change type of first parameter from 'char
2015 *' to 'const char *'.
2016 (gdb_environ::set): Extend method to handle
2017 m_user_set_env_list and m_user_unset_env_list.
2018 (gdb_environ::unset): Likewise.
2019 (gdb_environ::clear_user_set_env): New method.
2020 (gdb_environ::user_set_envp): Likewise.
2021 (gdb_environ::user_unset_envp): Likewise.
2022 * common/environ.h (gdb_environ): Handle m_user_set_env_list and
2023 m_user_unset_env_list on move constructor/assignment.
2024 (unset): Add new default parameter 'update_unset_list = true'.
2025 (clear_user_set_env): New method.
2026 (user_set_envp): Likewise.
2027 (user_unset_envp): Likewise.
2028 (m_user_set_env_list): New std::set.
2029 (m_user_unset_env_list): Likewise.
2030 * common/rsp-low.c (hex2str): New function.
2031 (bin2hex): New overload for bin2hex function.
2032 * common/rsp-low.c (hex2str): New prototype.
2033 (str2hex): New overload prototype.
2034 * remote.c: Include "environ.h". Add QEnvironmentHexEncoded,
2035 QEnvironmentUnset and QEnvironmentReset.
2036 (remote_protocol_features): Add QEnvironmentHexEncoded,
2037 QEnvironmentUnset and QEnvironmentReset packets.
2038 (send_environment_packet): New function.
2039 (extended_remote_environment_support): Likewise.
2040 (extended_remote_create_inferior): Call
2041 extended_remote_environment_support.
2042 (_initialize_remote): Add QEnvironmentHexEncoded,
2043 QEnvironmentUnset and QEnvironmentReset packet configs.
2044 * unittests/environ-selftests.c (gdb_selftest_env_var):
2046 (test_vector_initialization): New function.
2047 (test_init_from_host_environ): Likewise.
2048 (test_reinit_from_host_environ): Likewise.
2049 (test_set_A_unset_B_unset_A_cannot_find_A_can_find_B):
2051 (test_unset_set_empty_vector): Likewise.
2052 (test_vector_clear): Likewise.
2053 (test_std_move): Likewise.
2054 (test_move_constructor):
2055 (test_self_move): Likewise.
2056 (test_set_unset_reset): Likewise.
2057 (run_tests): Rewrite in terms of the functions above.
2061 * sparc64-tdep.c (adi_stat_t): Fix comment formatting.
2062 (adi_available): Use a temp variable of type CORE_ADDR as argument
2063 3 when calling target_auxv_search.
2064 (adi_normalize_address): Use masks and xor operators to calculate
2066 (adi_read_versions, adi_write_versions, adi_print_versions)
2067 (do_examine, do_assign): Use paddress.
2071 * mips-fbsd-nat.c (getfpregs_supplies): Return true for FIR.
2072 * mips-fbsd-tdep.c (mips_fbsd_supply_fpregs): Split supply of FSR
2073 out of loop and add supply of FIR.
2074 (mips_fbsd_collect_fpregs): Split collect of FSR out of loop and
2080 * cli/cli-script.c (define_command): Don't convert command name
2085 * ada-lang.c (ada_lookup_struct_elt_type): Remove parameter "dispp".
2086 Update all callers accordingly. Remove all code blocks handling
2087 the case where DISPP is not NULL.
2092 * dwarf2read.c (dwarf2_const_value_attr, dump_die_shallow)
2093 (dwarf2_get_attr_constant_value, dwarf2_fetch_constant_bytes)
2094 (skip_form_bytes, attr_form_is_constant): Handle DW_FORM_implicit_const.
2098 * dwarf2read.c (build_type_psymtabs_reader): New prototype.
2099 (process_psymtab_comp_unit): Accept IS_DEBUG_TYPES.
2100 (read_comp_units_from_section): New parameter abbrev_section, use
2101 read_and_check_comp_unit_head, allocate signatured_type if needed.
2102 (create_all_comp_units): Update read_comp_units_from_section caller.
2107 * remote.c (add_current_inferior_and_thread): Set inferior_ptid
2108 to null_ptid and switch to thread without reading the registers
2109 after adding the inferior.
2113 * NEWS (Changes since GDB 8.0): Add set compile-gcc and show
2115 * compile/compile.c (compile_gcc, show_compile_gcc): New.
2116 (compile_to_object): Implement compile_gcc.
2117 (_initialize_compile): Install "set compile-gcc". Initialize
2122 * compile/compile.c (compile_to_object): Conditionally call
2123 set_verbose. Conditionally call compile or compile_v0.
2127 * sparc64-tdep.h: (adi_normalize_address): New export.
2128 * sparc-nat.h: (open_adi_tag_fd): New export.
2129 * sparc64-linux-nat.c: (open_adi_tag_fd): New function.
2130 * sparc64-linux-tdep.c:
2131 (SEGV_ACCADI, SEGV_ADIDERR, SEGV_ADIPERR) New defines.
2132 (sparc64_linux_handle_segmentation_fault): New function.
2133 (sparc64_linux_init_abi): Register
2134 sparc64_linux_handle_segmentation_fault
2135 * sparc64-tdep.c: Include cli-utils.h,gdbcmd.h,auxv.h.
2136 (sparc64_addr_bits_remove): New function.
2137 (sparc64_init_abi): Register sparc64_addr_bits_remove.
2138 (MAX_PROC_NAME_SIZE): New macro.
2139 (AT_ADI_BLKSZ, AT_ADI_NBITS, AT_ADI_UEONADI) New defines.
2140 (sparc64adilist): New variable.
2141 (adi_proc_list): New variable.
2142 (find_adi_info): New function.
2143 (add_adi_info): New function.
2144 (get_adi_info_proc): New function.
2145 (get_adi_info): New function.
2146 (info_adi_command): New function.
2147 (read_maps_entry): New function.
2148 (adi_available): New function.
2149 (adi_normalize_address): New function.
2150 (adi_align_address): New function.
2151 (adi_convert_byte_count): New function.
2152 (adi_tag_fd): New function.
2153 (adi_is_addr_mapped): New function.
2154 (adi_read_versions): New function.
2155 (adi_write_versions): New function.
2156 (adi_print_versions): New function.
2157 (do_examine): New function.
2158 (do_assign): New function.
2159 (adi_examine_command): New function.
2160 (adi_assign_command): New function.
2161 (_initialize_sparc64_adi_tdep): New function.
2165 * breakpoint.c (breakpoints_info): Rename to ...
2166 (info_breakpoints_command): ... this.
2167 (watchpoints_info): Rename to ...
2168 (info_watchpoints_command): ... this.
2169 (tracepoints_info): Rename to ...
2170 (info_tracepoints_command): ... this.
2171 (_initialize_breakpoint): Adjust.
2172 * dcache.c (dcache_info): Rename to ...
2173 (info_display_command): ... this.
2174 (_initialize_dcache): Adjust.
2175 * frame.h (args_info): Rename to ...
2176 (info_args_command): ... this.
2177 (locals_info): Rename to ...
2178 (info_locals_command): ... this.
2179 * infcmd.c (nofp_registers_info): Rename to ...
2180 (info_registers_command): ... this.
2181 (float_info): Rename to ...
2182 (info_float_command): ... this.
2183 (program_info): Rename to ...
2184 (info_program_command): ... this.
2185 (all_registers_info): Rename to ...
2186 (info_all_registers_command): ... this.
2187 (vector_info): Rename to ...
2188 (info_vector_command): ... this.
2189 (float_info): Rename to ...
2190 (info_float_command): ... this.
2191 (_initialize_infcmd): Adjust.
2192 * inferior.h (term_info): Rename to ...
2193 (info_terminal_command): ... this.
2194 * inflow.c (term_info): Rename to ...
2195 (info_terminal_command): ... this.
2196 (_initialize_inflow): Adjust.
2197 * infrun.c (signals_info): Rename to ...
2198 (info_signals_command): ... this.
2199 (_initialize_infrun): Adjust.
2200 * objc-lang.c (classes_info): Rename to ...
2201 (info_classes_command): ... this.
2202 (selectors_info): Rename to ...
2203 (info_selectors_command): ... this.
2204 (_initialize_objc_language): Adjust.
2205 * printcmd.c (sym_info): Rename to ...
2206 (info_symbol_command): ... this.
2207 (address_info): Rename to ...
2208 (info_address_command): ... this.
2209 (display_info): Rename to ...
2210 (info_display_command): ... this.
2211 (_initialize_printcmd): Adjust.
2212 * reverse.c (bookmarks_info): Rename to ...
2213 (info_breakpoints_command): ... this.
2214 (_initialize_reverse): Adjust.
2215 * ser-go32.c (dos_info): Rename to ...
2216 (info_serial_command): ... this.
2217 (_initialize_ser_dos): Adjust.
2218 * skip.c (skip_info): Rename to ...
2219 (info_skip_command): ... this.
2220 (_initialize_step_skip): Adjust.
2221 * source.c (line_info): Rename to ...
2222 (info_line_command): ... this.
2223 (source_info): Rename to ...
2224 (info_source_command)
2225 * stack.c (frame_info): Rename to ...
2226 (info_frame_command): ... this.
2227 (locals_info): Rename to ...
2228 (info_locals_command): ... this.
2229 (args_info): Rename to ...
2230 (info_args_command): ... this.
2231 (_initialize_stack): Adjust.
2232 * symtab.c (sources_info): Rename to ...
2233 (info_sources_command): ... this.
2234 (variables_info): Rename to ...
2235 (info_variables_command): ... this.
2236 (functions_info): Rename to ...
2237 (info_functions_command): ... this.
2238 (types_info): Rename to ...
2239 (info_types_command): ... this.
2240 (_initialize_symtab): Adjust.
2241 * target.c (target_info): Rename to ...
2242 (info_target_command): ... this.
2243 (initialize_targets): Adjust.
2244 * tracepoint.c (tvariables_info): Rename to ...
2245 (info_tvariables_command): ... this.
2246 (scope_info): Rename to ...
2247 (info_scope_command): ... this.
2248 (trace_dump_actions): Adjust.
2249 (_initialize_tracepoint): Adjust.
2253 * breakpoint.h (install_breakpoint): Update.
2254 * breakpoint.c (add_solib_catchpoint): Update.
2255 (install_breakpoint): Change argument to a std::unique_ptr.
2256 (create_fork_vfork_event_catchpoint): Use std::unique_ptr.
2257 (create_breakpoint_sal, create_breakpoint): Update.
2258 (watch_command_1, catch_exec_command_1)
2259 (strace_marker_create_breakpoints_sal): Use std::unique_ptr.
2260 (add_to_breakpoint_chain): Change argument to a std::unique_ptr.
2261 Return the breakpoint.
2262 (set_raw_breakpoint_without_location, set_raw_breakpoint)
2263 (new_single_step_breakpoint): Update.
2264 * break-catch-throw.c (handle_gnu_v3_exceptions): Use
2266 * break-catch-syscall.c (create_syscall_event_catchpoint): Use
2268 * break-catch-sig.c (create_signal_catchpoint): Use
2270 * ada-lang.c (create_ada_exception_catchpoint): Use
2275 * breakpoint.c (add_solib_catchpoint): Use std::unique_ptr.
2279 * psymtab.c (psymtab_search_name): Return a unique_xmalloc_ptr.
2280 (lookup_partial_symbol): Update.
2284 * source.h (rewrite_source_path): Return a unique_xmalloc_ptr.
2285 * source.c (rewrite_source_path): Return a unique_xmalloc_ptr.
2286 (find_and_open_source, symtab_to_fullname): Update.
2287 * psymtab.c (psymtab_to_fullname): Update.
2291 * exec.c (exec_file_attach): Update.
2292 * linux-thread-db.c (try_thread_db_load): Update.
2293 * guile/scm-safe-call.c (gdbscm_safe_source_script): Update.
2294 * utils.c (gdb_realpath): Change return type.
2295 (gdb_realpath_keepfile): Update.
2296 (gdb_realpath_check_trailer, gdb_realpath_tests): New functions.
2297 (_initialize_utils): Register the new self test.
2298 * source.c (openp): Update.
2299 (find_and_open_source): Update.
2300 * nto-tdep.c (nto_find_and_open_solib): Update.
2301 * main.c (set_gdb_data_directory): Update.
2302 (captured_main_1): Update.
2303 * dwarf2read.c (dwarf2_get_dwz_file): Update
2304 (dw2_map_symbol_filenames): Update.
2305 * auto-load.c (auto_load_safe_path_vec_update): Update.
2306 (filename_is_in_auto_load_safe_path_vec): Change type of
2308 (auto_load_objfile_script): Update.
2309 (file_is_auto_load_safe): Update. Use std::string.
2310 * utils.h (gdb_realpath): Return a gdb::unique_xmalloc_ptr.
2314 * utils.c (gdb_realpath_keepfile): Return a
2315 gdb::unique_xmalloc_ptr.
2316 * exec.c (exec_file_attach): Update.
2317 * utils.h (gdb_realpath_keepfile): Return a
2318 gdb::unique_xmalloc_ptr.
2322 * compile/compile.c (compile_file_command): Use
2323 gdb::unique_xmalloc_ptr, std::string.
2324 * utils.c (gdb_abspath): Change return type.
2325 * source.c (openp): Update.
2326 * objfiles.c (allocate_objfile): Update.
2327 * main.c (set_gdb_data_directory): Update.
2328 * utils.h (gdb_abspath): Return a gdb::unique_xmalloc_ptr.
2332 * cli-cmds.c (list_commands): List actual code around more than
2337 * fbsd-nat.c (fbsd_add_threads): Use array type for `lwps'.
2342 * c-exp.y (variable production): Handle function aliases.
2343 * minsyms.c (msymbol_is_text): New function.
2344 * minsyms.h (msymbol_is_text): Declare.
2345 * symtab.c (find_function_alias_target): New function.
2346 * symtab.h (find_function_alias_target): Declare.
2350 * eval.c (evaluate_subexp_standard) <OP_TYPE>: Don't dig past
2352 * typeprint.c (whatis_exp): If handling "whatis", and expression
2353 is OP_TYPE, strip one typedef level. Otherwise don't strip
2355 * valops.c (value_cast): Save "to" type before resolving
2356 stubs/typedefs. Use that type as resulting value's type.
2361 * spu-multiarch.c (parse_spufs_run): Use scoped_restore.
2362 * sol-thread.c (sol_thread_resume, sol_thread_wait)
2363 (sol_thread_xfer_partial, rw_common): Use scoped_restore.
2364 * procfs.c (procfs_do_thread_registers): Use scoped_restore.
2365 * proc-service.c (ps_xfer_memory): Use scoped_restore.
2366 * linux-tdep.c (linux_corefile_thread): Remove a cleanup.
2367 (linux_get_siginfo_data): Add "thread" argument. Use
2369 * linux-nat.c (linux_child_follow_fork)
2370 (check_stopped_by_watchpoint): Use scoped_restore.
2371 * infrun.c (displaced_step_prepare_throw, write_memory_ptid)
2372 (THREAD_STOPPED_BY, handle_signal_stop): Use scoped_restore.
2373 (restore_inferior_ptid, save_inferior_ptid): Remove.
2374 * btrace.c (btrace_fetch): Use scoped_restore.
2375 * bsd-uthread.c (bsd_uthread_fetch_registers)
2376 (bsd_uthread_store_registers): Use scoped_restore.
2377 * breakpoint.c (reattach_breakpoints, detach_breakpoints): Use
2379 * aix-thread.c (aix_thread_resume, aix_thread_wait)
2380 (aix_thread_xfer_partial): Use scoped_restore.
2381 * inferior.h (save_inferior_ptid): Remove.
2386 * arm-tdep.c (gdb_print_insn_arm): Mark
2387 USER_SPECIFIED_MACHINE_TYPE if exec_bfd isn't NULL.
2391 * NEWS: Mention GDBserver's new option "--selftest".
2392 * Makefile.in (SFILES): Remove selftest.c, add common/selftest.c.
2393 * selftest.c: Move it to common/selftest.c.
2394 * selftest.h: Move it to common/selftest.h.
2395 * selftest-arch.c (reset): New function.
2396 (tests_with_arch): Call reset.
2400 * selftest.c (run_tests): Don't call QUIT. Call debug_printf
2401 instead of exception_fprintf and printf_filtered.
2405 * selftest.c (register_self_test): Rename it to
2406 selftests::register_test.
2407 (run_self_tests): selftest::run_tests.
2408 * selftest.h: Update declarations.
2409 * selftest-arch.c (register_self_test_foreach_arch): Rename it to
2410 selftests::register_test_foreach_arch.
2411 * selftest-arch.h: Update declaration.
2412 * aarch64-tdep.c: Update.
2413 * arm-tdep.c: Likewise.
2414 * disasm-selftests.c: Likewise.
2415 * dwarf2loc.c: Likewise.
2416 * dwarf2-frame.c: Likewise.
2417 * findvar.c: Likewise.
2418 * gdbarch-selftests.c: Likewise.
2419 * maint.c (maintenance_selftest): Likewise.
2420 * regcache.c: Likewise.
2421 * rust-exp.y: Likewise.
2422 * selftest-arch.c: Likewise.
2423 * unittests/environ-selftests.c: Likewise.
2424 * unittests/function-view-selftests.c: Likewise.
2425 * unittests/offset-type-selftests.c: Likewise.
2426 * unittests/optional-selftests.c: Likewise.
2427 * unittests/scoped_restore-selftests.c: Likewise.
2428 * utils-selftests.c: Likewise.
2432 * cli/cli-cmds.c (source_command): Delete 'old_source_verbose'
2437 * dwarf2read.c (struct dwarf2_cu) <line_header_die_owner>: New
2439 (reset_die_in_process): Delete, replaced by ...
2440 (process_die_scope): ... this new class. Make it responsible for
2441 freeing cu->line_header too.
2442 (process_die): Use process_die_scope.
2443 (handle_DW_AT_stmt_list): Record the line header's owner CU/DIE in
2444 cu->line_header_die_owner. Don't release the line header if it's
2446 (setup_type_unit_groups): Make the CU/DIE own the line header.
2447 Don't release the line header here.
2451 * elfread.c (elf_read_minimal_symbols): xfree synthsyms.
2455 * NEWS: Mention new shortcuts for nexti and stepi in TUI
2460 * tui/tui.c (tui_commands): Add "nexti" and "stepi" to the Single-Key
2465 * MAINTAINERS (Write After Approval): Add Stafford Horne.
2469 * xtensa-tdep.c (xtensa_init_reggroups): Use xstrdup for cpname.
2474 * infcmd.c (unset_environment_command): Use the 'clear' method on
2475 the environment instead of resetting it.
2479 * fbsd-nat.c (fbsd_convert_siginfo): Fix compile on big-endian
2484 * valprint.c (print_octal_chars): Use HOST_CHAR_BIT.
2485 (print_binary_chars): Likewise.
2486 (BITS_IN_BYTES): Remove.
2491 * valprint.c (LOW_ZERO): Change value to 034.
2492 (print_octal_chars): Add static_asserts for octal constants.
2493 * printcmd.c (print_scalar_formatted): Add 'd' case.
2497 * symfile.c (add_symbol_file_command): Use std::vector.
2501 * break-catch-throw.c (handle_gnu_v3_exceptions): Use std::move.
2502 * break-catch-syscall.c (create_syscall_event_catchpoint): Use
2504 * break-catch-sig.c (create_signal_catchpoint): Use std::move.
2508 * infrun.c (process_event_stop_test): Adjust
2509 function_name_is_marked_for_skip call.
2510 * skip.c: Include <list>.
2511 (skiplist_entry): Make it a class with private fields, and
2513 (skiplist_entry_chain): Delete.
2514 (skiplist_entries): New.
2515 (skiplist_entry_count): Delete.
2516 (highest_skiplist_entry_num): New.
2517 (ALL_SKIPLIST_ENTRIES, ALL_SKIPLIST_ENTRIES_SAFE): Delete.
2518 (add_skiplist_entry): Delete.
2519 (skiplist_entry::skiplist_entry): New.
2520 (skiplist_entry::add_entry): New.
2521 (skip_file_command, skip_function): Adjust.
2522 (compile_skip_regexp): Delete.
2523 (skip_command): Don't compile regexp here. Adjust to use
2524 skiplist_entry::add_entry.
2525 (skip_info): Adjust to use range-for and getters.
2526 (skip_enable_command, skip_disable_command): Adjust to use
2527 range-for and setters.
2528 (skip_delete_command): Adjust to use std::list.
2529 (add_skiplist_entry): Delete.
2530 (skip_file_p): Delete, refactored as ...
2531 (skiplist_entry::do_skip_file_p): ... this new method.
2532 (skip_gfile_p): Delete, refactored as ...
2533 (skiplist_entry::do_gskip_file_p): ... this new method.
2534 (skip_function_p, skip_rfunction_p): Delete, refactored as ...
2535 (skiplist_entry::skip_function_p): ... this new method.
2536 (function_name_is_marked_for_skip): Now returns bool, and takes
2537 the function sal by const reference. Adjust to use range-for and
2538 skiplist_entry methods.
2539 (_initialize_step_skip): Remove references to
2540 skiplist_entry_chain, skiplist_entry_count.
2541 * skip.h (function_name_is_marked_for_skip): Now returns bool, and
2542 takes the function sal by const reference.
2546 * dwarf2-frame.c (clear_pointer_cleanup): Remove.
2547 (dwarf2_frame_cache): Remove reset_cache_cleanup.
2548 (dwarf2_frame_cache):
2549 * frame-unwind.c (frame_unwind_try_unwinder): Catch
2550 RETURN_MASK_ALL and set *this_case to NULL.
2551 * frame-unwind.h: Update comments.
2555 * dwarf2-frame.c (dwarf2_frame_state_alloc_regs): Remove.
2556 (dwarf2_frame_state_copy_regs): Remove.
2557 (dwarf2_frame_state_free_regs): Remove.
2558 (dwarf2_frame_state::~dwarf2_frame_state): Remove.
2559 (dwarf2_restore_rule): Call method .alloc_regs instead of
2560 dwarf2_frame_state_alloc_regs.
2561 (execute_cfa_program): Likewise. Call dwarf2_frame_state_reg_info
2562 constructor. Call std::move.
2563 (dwarf2_fetch_cfa_info): Don't call dwarf2_frame_state_copy_regs.
2564 (dwarf2_frame_cache): Likewise.
2566 [GDB_SELF_TEST]: Include selftest.h and
2568 [GDB_SELF_TEST] (execute_cfa_program_test): New function.
2569 (_initialize_dwarf2_frame) [GDB_SELF_TEST]: Register
2570 execute_cfa_program_test.
2572 * dwarf2-frame.h (dwarf2_frame_state_reg_info): Add ctor, dtor,
2573 copy ctor, assignment operator, move assignment.
2574 <alloc_regs>: New method.
2576 (struct dwarf2_frame_state): Delete dtor.
2577 (dwarf2_frame_state_alloc_regs): Remove declaration.
2578 * sparc-tdep.c (sparc_execute_dwarf_cfa_vendor_op): Don't call
2579 dwarf2_frame_state_alloc_regs, use .alloc_regs instead.
2583 * dwarf2-frame.c (dwarf2_frame_state_free): Remove.
2584 (dwarf2_frame_state::dwarf2_frame_state): New.
2585 (dwarf2_frame_state::~dwarf2_frame_state): New.
2586 (dwarf2_fetch_cfa_info): Update.
2587 (dwarf2_frame_cache): Remove old_chain. Change 'fs' to an object
2588 rather than a pointer. Update code.
2589 * dwarf2-frame.h (struct dwarf2_frame_state): Declare ctor and
2591 <data_align, code_align, retaddr_column>: Change them to const.
2592 <armcc_cfa_offsets_sf, armcc_cfa_offsets_reversed>: Change them
2597 * dwarf2-frame.h (struct dwarf2_frame_state_reg) <exp_len>: Remove.
2598 <loc.exp>: New field.
2599 * dwarf2-frame.c (execute_cfa_program): Update.
2600 (dwarf2_frame_prev_register): Update.
2604 * common/gdb_unique_ptr.h (xfree_deleter<T[]>): Define.
2608 * fbsd-nat.c (struct fbsd_fork_info): Remove.
2609 (fbsd_pending_children): Use std::list.
2610 (fbsd_remember_child): Likewise.
2611 (fbsd_is_child_pending): Likewise.
2612 (fbsd_pending_vfork_done): Use std::forward_list.
2613 (fbsd_add_vfork_done): Likewise.
2614 (fbsd_is_vfork_done_pending): Likewise.
2615 (fbsd_next_vfork_done): Likewise.
2619 * fbsd-nat.c [HAVE_KINFO_GETVMMAP] (struct free_deleter): New.
2620 (fbsd_find_memory_regions): Use free_deleter with std::unique_ptr.
2621 [!HAVE_KINFO_GETVMMAP] (fbsd_find_memory_regions): Use std::string
2623 (fbsd_xfer_partial): Use gdb::byte_vector.
2624 (fbsd_add_threads): Use gdb::unique_xmalloc_ptr.
2628 * fbsd-nat.c: [!HAVE_KINFO_GETVMMAP]: Include <sys/user.h> and
2630 (fbsd_find_memory_regions): Fix `mapfile' initialization.
2634 * skip.c (skiplist_entry): New constructor.
2635 (skiplist_entry::enabled, skiplist_entry::function_is_regexp)
2636 (skiplist_entry::file_is_glob): Now bool.
2637 (skiplist_entry::file, skiplist_entry::function): Now
2639 (make_skip_entry): Return a unique_ptr. Use new.
2640 (free_skiplist_entry, free_skiplist_entry_cleanup)
2641 (make_free_skiplist_entry_cleanup): Remove.
2642 (skip_command, skip_disable_command, add_skiplist_entry)
2643 (skip_form_bytes, compile_skip_regexp, skip_command, skip_info)
2644 (skip_file_p, skip_gfile_p, skip_function_p, skip_rfunction_p)
2645 (function_name_is_marked_for_skip): Update.
2646 (skip_delete_command): Update. Use delete.
2650 * aarch64-linux-tdep.c: Include "auxv.h" and "elf/common.h".
2651 (aarch64_linux_core_read_description): New function.
2652 (aarch64_linux_init_abi): Register gdbarch_core_read_description.
2656 * cp-name-parser.y (cp_comp_to_string): Return a
2657 gdb::unique_xmalloc_ptr<char>.
2658 * cp-support.c (replace_typedefs_qualified_name)
2659 (replace_typedefs): Adjust to use gdb::unique_xmalloc_ptr<char>.
2660 (cp_canonicalize_string_full): Use op= instead of explicit
2662 (cp_class_name_from_physname, method_name_from_physname)
2663 (cp_func_name, cp_remove_params): Adjust to use
2664 gdb::unique_xmalloc_ptr<char>.
2665 * cp-support.h (cp_comp_to_string): Return a
2666 gdb::unique_xmalloc_ptr<char>.
2667 * python/py-type.c (typy_lookup_type): Adjust to use
2668 gdb::unique_xmalloc_ptr<char>.
2672 * dwarf2read.c (dwarf2_string_attr): Fix a typo.
2677 * cp-support.c (cp_canonicalize_string_full): Use
2678 gdb::unique_xmalloc_ptr<char>.
2679 (cp_canonicalize_string): Likewise.
2683 * features/Makefile (WHICH): Remove i386/ non-linux stuff.
2684 * regformats/i386/amd64-avx-avx512.dat: Remove.
2685 * regformats/i386/amd64-avx-mpx-avx512-pku.dat: Remove.
2686 * regformats/i386/amd64-avx-mpx.dat:Remove.
2687 * regformats/i386/amd64-avx.dat: Remove.
2688 * regformats/i386/amd64-mpx.dat: Remove.
2689 * regformats/i386/i386-avx-avx512.dat: Remove.
2690 * regformats/i386/i386-avx-mpx-avx512-pku.dat: Remove.
2691 * regformats/i386/i386-avx-mpx.dat: Remove.
2692 * regformats/i386/i386-mmx.dat: Remove.
2693 * regformats/i386/i386-mpx.dat: Remove.
2697 * amd64-tdep.h (tdesc_x32): Remove the declaration.
2698 * amd64-tdep.c: Don't include features/i386/x32*.c.
2699 (_initialize_amd64_tdep): Don't call initialize_tdesc_x32*
2701 * features/Makefile (WHICH): Remove i386/x32, i386/x32-avx,
2702 and i386/x32-avx-avx512.
2703 (XMLTOC): Remove i386/x32-avx.xml, i386/x32-avx-avx512.xml,
2705 * features/i386/x32-avx-avx512.c: Removed.
2706 * features/i386/x32-avx-avx512.xml: Removed.
2707 * features/i386/x32-avx.c: Removed.
2708 * features/i386/x32-avx.xml: Removed.
2709 * features/i386/x32.c: Removed.
2710 * features/i386/x32.xml: Removed.
2711 * regformats/i386/x32-avx-avx512.dat: Removed.
2712 * regformats/i386/x32-avx.dat: Removed.
2713 * regformats/i386/x32.dat: Removed.
2717 PR breakpoints/21886
2718 * mem-break.c (default_memory_insert_breakpoint): Use
2719 `->placed_address' rather than `->reqstd_address' for the
2720 breakpoint location.
2724 * arch-utils.c (default_print_insn): Remove arch/mach/endian
2729 * gdbarch.sh (gdbarch_info): Replace the `tdep_info' member with
2730 a union of `tdep_info', `tdesc_data' and `id'.
2731 * aarch64-tdep.c (aarch64_gdbarch_init): Use `info.tdesc_data'
2732 rather than `info.tdep_info'.
2733 * amd64-linux-tdep.c (amd64_linux_init_abi): Likewise.
2734 * i386-linux-tdep.c (i386_linux_init_abi): Likewise.
2735 * i386-tdep.c (i386_gdbarch_init): Likewise.
2736 * mips-linux-tdep.c (mips_linux_init_abi): Likewise.
2737 * mips-tdep.c (mips_gdbarch_init): Likewise.
2738 * nds32-tdep.c (nds32_gdbarch_init): Likewise.
2739 * rs6000-tdep.c (rs6000_gdbarch_init): Likewise.
2740 * ppc-linux-tdep.c (ppu2spu_sniffer): Use `info.id' rather than
2742 (ppc_linux_init_abi): Use `info.tdesc_data' rather than
2744 * sparc-tdep.c (sparc32_gdbarch_init): Likewise.
2745 * spu-multiarch.c (spu_gdbarch): Use `info.id' rather than
2747 * spu-tdep.c (spu_gdbarch_init): Likewise.
2748 * gdbarch.h: Regenerate.
2753 * dwarf2read.c (dwarf2_string_attr): Allow DW_FORM_GNU_strp_alt.
2757 * remote-sim.c (gdbsim_load): Remove char **argv local variable.
2758 (gdbsim_open): Rename gdb_argv args object to argv.
2762 * compile/compile-object-load.c (compile_object_load): Use
2763 gdb::unique_xmalloc_ptr.
2764 * cli/cli-dump.c (scan_filename): Rename from
2765 scan_filename_with_cleanup. Change return type.
2766 (scan_expression): Rename from scan_expression_with_cleanup.
2768 (dump_memory_to_file, dump_value_to_file, restore_command):
2769 Use gdb::unique_xmalloc_ptr. Update.
2770 * cli/cli-cmds.c (find_and_open_script): Use
2771 gdb::unique_xmalloc_ptr.
2772 * tracefile-tfile.c (tfile_open): Use gdb::unique_xmalloc_ptr.
2773 * symmisc.c (maintenance_print_symbols)
2774 (maintenance_print_msymbols): Use gdb::unique_xmalloc_ptr.
2775 * symfile.c (symfile_bfd_open, generic_load)
2776 (add_symbol_file_command, remove_symbol_file_command): Use
2777 gdb::unique_xmalloc_ptr.
2778 * source.c (openp): Use gdb::unique_xmalloc_ptr.
2779 * psymtab.c (maintenance_print_psymbols): Use
2780 gdb::unique_xmalloc_ptr.
2781 * corelow.c (core_open): Use gdb::unique_xmalloc_ptr.
2782 * breakpoint.c (save_breakpoints): Use gdb::unique_xmalloc_ptr.
2783 * solib.c (solib_map_sections): Use gdb::unique_xmalloc_ptr.
2784 (reload_shared_libraries_1): Likewise.
2788 * rust-exp.y (rust_op_ptr, set_field): Remove typedefs.
2789 (rust_op_vector, rust_set_vector): New typedefs.
2790 (current_parser): New global.
2791 (work_obstack): Change to pointer type. Update all users.
2792 (rust_ast, pstate): Remove globals.
2793 (struct rust_parser): New.
2794 (%union) <params, field_inits>: Change type.
2795 (start, tuple_expr, unit_expr, struct_expr_list, literal)
2796 (field_expr, expr_list, maybe_expr_list, type_list): Update.
2797 (ast_call_ish, ast_path, ast_function_type, ast_tuple_type)
2798 (convert_params_to_types, convert_params_to_expression): Change
2800 (ast_string): Change type of "fields".
2801 (rust_parse): Make a rust_parser. Remove cleanups.
2802 (rust_lex_tests): Make and install an auto_obstack.
2806 * configure.srv (ipa_x32_linux_regobj): New.
2807 * linux-amd64-ipa.c (get_ipa_tdesc): Use X86_TDESC_AVX_AVX512
2808 instead of X86_TDESC_AVX512.
2809 (initialize_low_tracepoint): Call
2810 init_registers_x32_avx_avx512_linux.
2814 * utils.h (gdb_argv): Add namespace std for nullptr_t.
2818 * MAINTAINERS (Write After Approval): Add Ruslan Kabatsayev.
2822 * utils.c (make_cleanup_freeargv, do_freeargv, gdb_buildargv):
2824 * utils.h (make_cleanup_freeargv, gdb_buildargv): Remove.
2828 * python/py-param.c (compute_enum_values): Use gdb_argv.
2832 * utils.h (struct gdb_argv_deleter): New.
2833 (gdb_argv): New class.
2834 * utils.c (gdb_argv::reset): New method.
2835 * tracepoint.c (delete_trace_variable_command): Use gdb_argv.
2836 * tracefile.c (tsave_command): Use gdb_argv.
2837 * top.c (new_ui_command): Use gdb_argv.
2838 * symmisc.c (maintenance_print_symbols)
2839 (maintenance_print_msymbols, maintenance_expand_symtabs): Use gdb_argv.
2840 * symfile.c (symbol_file_command, generic_load)
2841 (remove_symbol_file_command): Use gdb_argv.
2842 * stack.c (backtrace_command): Use gdb_argv.
2843 * source.c (add_path, show_substitute_path_command)
2844 (unset_substitute_path_command, set_substitute_path_command):
2846 * skip.c (skip_command): Use gdb_argv. Use gdb_buildargv.
2847 * ser-mingw.c (pipe_windows_open): Use gdb_argv.
2848 * remote.c (extended_remote_run, remote_put_command)
2849 (remote_get_command, remote_delete_command): Use gdb_argv.
2850 * remote-sim.c (gdbsim_load, gdbsim_create_inferior)
2851 (gdbsim_open): Use gdb_argv.
2852 * python/py-cmd.c (gdbpy_string_to_argv): Use gdb_argv.
2853 * psymtab.c (maintenance_print_psymbols): Use gdb_argv.
2854 * procfs.c (procfs_info_proc): Use gdb_argv.
2855 * interps.c (interpreter_exec_cmd): Use gdb_argv.
2856 * infrun.c (handle_command): Use gdb_argv.
2857 * inferior.c (add_inferior_command, clone_inferior_command):
2859 * guile/scm-string.c (gdbscm_string_to_argv): Use gdb_argv.
2860 * exec.c (exec_file_command): Use gdb_argv.
2861 * cli/cli-cmds.c (alias_command): Use gdb_argv.
2862 * compile/compile.c (build_argc_argv): Use gdb_argv.
2866 * python/python.c (gdbpy_decode_line): Use unique_xmalloc_ptr.
2870 * python/python.c (compute_python_string): Return std::string.
2871 (gdbpy_eval_from_control_command): Update.
2872 (do_start_initialization): Use std::string.
2873 * python/py-varobj.c (py_varobj_iter_next): Use string_printf, not
2875 * python/py-breakpoint.c (local_setattro): Use string_printf, not
2880 * top.h (do_restore_instream_cleanup): Remove.
2881 * top.c (do_restore_instream_cleanup): Remove.
2882 (read_command_file): Use scoped_restore.
2883 * cli/cli-script.c (execute_user_command): Use scoped_restore.
2887 * cli/cli-script.c (execute_user_command)
2888 (execute_control_command): Use scoped_restore.
2892 * cli/cli-script.c (do_restore_user_call_depth): Remove.
2893 (execute_user_command): Remove user_call_depth; use
2894 user_args_stack's size instead.
2898 * top.h (in_user_command): Remove.
2899 * top.c (in_user_command): Remove.
2900 * cli/cli-script.c (do_restore_user_call_depth)
2901 (execute_user_command): Update.
2905 * valops.c (search_struct_method): Use gdb::byte_vector.
2906 * valarith.c (value_concat): Use std::vector.
2907 * target.c (memory_xfer_partial): Use gdb::byte_vector.
2908 (simple_search_memory): Likewise.
2909 * printcmd.c (find_string_backward): Use gdb::byte_vector.
2910 * mi/mi-main.c (mi_cmd_data_write_memory): Use gdb::byte_vector.
2911 * gcore.c (gcore_copy_callback): Use gdb::byte_vector.
2912 * elfread.c (elf_rel_plt_read): Use std::string.
2913 * cp-valprint.c (cp_print_value): Use gdb::byte_vector.
2914 * cli/cli-dump.c (restore_section_callback): Use
2919 * jit.c (jit_reader_load_command): Use unique_xmalloc_ptr.
2923 * tui/tui-regs.c (tui_restore_gdbout): Remove.
2924 (tui_register_format): Use scoped_restore.
2928 * reverse.c (exec_direction_default): Remove.
2929 (exec_reverse_once): Use scoped_restore.
2930 * remote.c (restore_remote_timeout): Remove.
2931 (remote_flash_erase, remote_flash_write, remote_flash_done)
2932 (readchar, remote_serial_write): Use scoped_restore.
2933 * cli/cli-script.c (struct source_cleanup_lines_args)
2934 (source_cleanup_lines): Remove.
2935 (script_from_file): Use scoped_restore.
2936 * cli/cli-cmds.c (source_verbose_cleanup): Remove.
2937 (source_command): Use scoped_restore.
2941 * utils.h (make_cleanup_free_so): Remove.
2942 * utils.c (do_free_so, make_cleanup_free_so): Remove.
2943 * solist.h (struct so_deleter): New.
2944 (so_list_up): New typedef.
2945 * solib-svr4.c (svr4_read_so_list): Use so_list_up.
2949 * utils.h (make_cleanup_restore_current_language): Remove.
2950 * utils.c (do_restore_current_language)
2951 (make_cleanup_restore_current_language): Remove.
2952 * parse.c (parse_exp_in_context_1)
2953 (parse_expression_with_language): Use
2954 scoped_restore_current_language.
2955 * mi/mi-main.c (mi_cmd_execute): Use
2956 scoped_restore_current_language.
2957 * language.h (scoped_restore_current_language): New class.
2961 * compile/compile.c (cleanup_unlink_file): Remove.
2962 (compile_to_object): Use gdb::unlinker.
2963 (eval_compile_command): Likewise.
2967 * utils.h (make_cleanup_fclose): Remove.
2968 * utils.c (do_fclose_cleanup, make_cleanup_fclose): Remove.
2972 * top.c (open_terminal_stream): Return gdb_file_up.
2973 (new_ui_command): Update.
2977 * source.c (print_source_lines_base, forward_search_command)
2978 (reverse_search_command): Use gdb_file_up.
2982 * fbsd-nat.c (fbsd_find_memory_regions): Update.
2986 * cli/cli-cmds.c (find_and_open_script): Change return type.
2987 Remove "streamp" and "full_path" parameters.
2988 (source_script_with_search): Update.
2989 * auto-load.c (source_script_file): Update.
2990 * cli/cli-cmds.h (find_and_open_script): Change type.
2991 (open_script): New struct.
2995 * xml-support.c (xml_fetch_content_from_file): Update.
2996 * ui-file.c (stdio_file::open): Update.
2997 * tracefile-tfile.c (tfile_start): Update.
2998 * remote.c (remote_file_put, remote_file_get): Update.
2999 * nat/linux-procfs.c (linux_proc_get_int)
3000 (linux_proc_pid_get_state, linux_proc_tid_get_name): Update.
3001 * nat/linux-osdata.c (linux_common_core_of_thread): Update.
3002 (command_from_pid, commandline_from_pid, linux_xfer_osdata_cpus)
3003 (print_sockets, linux_xfer_osdata_shm, linux_xfer_osdata_sem)
3004 (linux_xfer_osdata_msg, linux_xfer_osdata_modules): Update.
3005 * nat/linux-btrace.c (linux_determine_kernel_start): Update.
3006 * linux-nat.c (linux_proc_pending_signals): Update.
3007 * dwarf2read.c (write_psymtabs_to_index): Use gdb_file_up.
3008 (file_closer): Remove.
3009 * compile/compile.c (compile_to_object): Update.
3010 * common/filestuff.h (struct gdb_file_deleter): New.
3011 (gdb_file_up): New typedef.
3012 (gdb_fopen_cloexec): Change return type.
3013 * common/filestuff.c (gdb_fopen_cloexec): Return gdb_file_up.
3014 * cli/cli-dump.c (fopen_with_cleanup): Remove.
3015 (dump_binary_file, restore_binary_file): Update.
3016 * auto-load.c (auto_load_objfile_script_1): Update.
3020 * tracepoint.c (tvariables_info_1): Use ui_out_emit_table.
3021 (info_static_tracepoint_markers_command): Likewise.
3022 * solib.c (info_sharedlibrary_command): Use ui_out_emit_table.
3023 * skip.c (skip_info): Use ui_out_emit_table.
3024 * progspace.c (print_program_space): Use ui_out_emit_table.
3025 * osdata.c (info_osdata): Use ui_out_emit_table.
3026 * mi/mi-cmd-info.c (mi_cmd_info_ada_exceptions): Use
3028 * linux-thread-db.c (info_auto_load_libthread_db): Use
3030 * inferior.c (print_inferior): Use ui_out_emit_table.
3031 * gdb_bfd.c (maintenance_info_bfds): Use ui_out_emit_table.
3032 * breakpoint.c (breakpoint_1): Use ui_out_emit_table.
3033 * auto-load.c (auto_load_info_scripts): Use ui_out_emit_table.
3034 * ada-tasks.c (print_ada_task_info): Use ui_out_emit_table.
3035 * ui-out.h (class ui_out_emit_table): New.
3039 * mips-tdep.c (mips_fpu_type_str): New function.
3040 (mips_dump_tdep): Call it.
3044 * mips-tdep.c (mips_gdbarch_init): Use MIPS_FPU_TYPE to access
3049 * solib-darwin.c (DYLD_VERSION_MAX): Increase value.
3053 * MAINTAINERS (Write After Approval): Add Xavier Roirand.
3057 * cli/cli-cmds.c (maintenancechecklist): New variable.
3058 * gdbcmd.h (maintenancechecklist): Declare it.
3059 * i386-linux-tdep.c (_initialize_i386_linux_tdep) [GDB_SELF_TEST]:
3060 Call i386_linux_read_description with different masks.
3061 * maint.c (maintenance_check_command): New function.
3062 (_initialize_maint_cmds): Call add_prefix_cmd.
3063 * target-descriptions.c (tdesc_reg): override operator != and ==.
3064 (tdesc_type): Likewise.
3065 (tdesc_feature): Likewise.
3066 (target_desc): Likewise.
3067 [GDB_SELF_TEST] (selftests::record_xml_tdesc): New function.
3068 (maintenance_check_xml_descriptions): New function.
3069 (_initialize_target_descriptions) Add command "xml-descriptions".
3070 * target-descriptions.h (selftests::record_xml_tdesc): Declare.
3074 * i386-linux-tdep.c: Don't include features/i386/i386-*linux.c.
3075 Include features/i386/32bit-*.c.
3076 (i386_linux_read_description): Generate target description if it
3078 (_initialize_i386_linux_tdep): Don't call _initialize_tdesc_i386
3080 * features/i386/32bit-linux.c: Re-generated.
3081 * features/i386/32bit-sse.c: Likewise.
3082 * target-descriptions.c (print_c_feature::visit): Print code to
3083 set register number if needed.
3084 (print_c_feature) <m_next_regnum>: New field.
3088 * features/Makefile (CFILES): Rename with TDESC_CFILES.
3089 (FEATURE_XMLFILES): New.
3090 (FEATURE_CFILES): New.
3092 (clean-cfiles): Remove generated c files.
3093 * features/i386/32bit-avx.c: Generated.
3094 * features/i386/32bit-avx512.c: Generated.
3095 * features/i386/32bit-core.c: Generated.
3096 * features/i386/32bit-linux.c: Generated.
3097 * features/i386/32bit-mpx.c: Generated.
3098 * features/i386/32bit-pkeys.c: Generated.
3099 * features/i386/32bit-sse.c: Generated.
3100 * target-descriptions.c: Include algorithm.
3101 (tdesc_element_visitor): Add method visit_end.
3102 (print_c_tdesc): Implement visit_end.
3103 (print_c_tdesc:: m_filename_after_features): Move it to
3105 (print_c_feature): New class.
3106 (maint_print_c_tdesc_cmd): Use print_c_feature if XML file
3107 name starts with "i386/32bit-".
3111 * target-descriptions.c (tdesc_element_visitor): New class.
3112 (tdesc_element): New class.
3113 (tdesc_reg): Inherit from tdesc_element.
3114 (tdesc_reg::accept): New function.
3115 (tdesc_type): Inherit from tdesc_element.
3116 (tdesc_type::accept): New function.
3117 (tdesc_feature): Inherit from tdesc_element.
3118 (tdesc_feature::accept): New function.
3119 (target_desc): Inherit from tdesc_element.
3120 (target_desc::target_desc): New.
3121 (target_desc::~target_desc): New.
3122 (target_desc::accept): New.
3123 (allocate_target_description): Use new.
3124 (free_target_description): Use delete.
3125 (print_c_tdesc): New class.
3126 (maint_print_c_tdesc_cmd): Adjust.
3128 * features/aarch64.c: Re-generated.
3129 * features/arc-arcompact.c: Re-generated.
3130 * features/arc-v2.c: Re-generated.
3131 * features/arm/arm-with-iwmmxt.c: Re-generated.
3132 * features/arm/arm-with-m.c: Re-generated.
3133 * features/arm/arm-with-m-fpa-layout.c: Re-generated.
3134 * features/arm/arm-with-m-vfp-d16.c: Re-generated.
3135 * features/arm/arm-with-neon.c: Re-generated.
3136 * features/arm/arm-with-vfpv2.c: Re-generated.
3137 * features/arm/arm-with-vfpv3.c: Re-generated.
3138 * features/i386/amd64-avx-avx512.c: Re-generated.
3139 * features/i386/amd64-avx-avx512-linux.c: Re-generated.
3140 * features/i386/amd64-avx.c: Re-generated.
3141 * features/i386/amd64-avx-linux.c: Re-generated.
3142 * features/i386/amd64-avx-mpx-avx512-pku.c: Re-generated.
3143 * features/i386/amd64-avx-mpx-avx512-pku-linux.c: Re-generated.
3144 * features/i386/amd64-avx-mpx.c: Re-generated.
3145 * features/i386/amd64-avx-mpx-linux.c: Re-generated.
3146 * features/i386/amd64.c: Re-generated.
3147 * features/i386/amd64-linux.c: Re-generated.
3148 * features/i386/amd64-mpx.c: Re-generated.
3149 * features/i386/amd64-mpx-linux.c: Re-generated.
3150 * features/i386/i386-avx-avx512.c: Re-generated.
3151 * features/i386/i386-avx-avx512-linux.c: Re-generated.
3152 * features/i386/i386-avx.c: Re-generated.
3153 * features/i386/i386-avx-linux.c: Re-generated.
3154 * features/i386/i386-avx-mpx-avx512-pku.c: Re-generated.
3155 * features/i386/i386-avx-mpx-avx512-pku-linux.c: Re-generated.
3156 * features/i386/i386-avx-mpx.c: Re-generated.
3157 * features/i386/i386-avx-mpx-linux.c: Re-generated.
3158 * features/i386/i386.c: Re-generated.
3159 * features/i386/i386-linux.c: Re-generated.
3160 * features/i386/i386-mmx.c: Re-generated.
3161 * features/i386/i386-mmx-linux.c: Re-generated.
3162 * features/i386/i386-mpx.c: Re-generated.
3163 * features/i386/i386-mpx-linux.c: Re-generated.
3164 * features/i386/x32-avx-avx512.c: Re-generated.
3165 * features/i386/x32-avx-avx512-linux.c: Re-generated.
3166 * features/i386/x32-avx.c: Re-generated.
3167 * features/i386/x32-avx-linux.c: Re-generated.
3168 * features/i386/x32.c: Re-generated.
3169 * features/i386/x32-linux.c: Re-generated.
3170 * features/microblaze.c: Re-generated.
3171 * features/microblaze-with-stack-protect.c: Re-generated.
3172 * features/mips64-dsp-linux.c: Re-generated.
3173 * features/mips64-linux.c: Re-generated.
3174 * features/mips-dsp-linux.c: Re-generated.
3175 * features/mips-linux.c: Re-generated.
3176 * features/nds32.c: Re-generated.
3177 * features/nios2.c: Re-generated.
3178 * features/nios2-linux.c: Re-generated.
3179 * features/rs6000/powerpc-32.c: Re-generated.
3180 * features/rs6000/powerpc-32l.c: Re-generated.
3181 * features/rs6000/powerpc-403.c: Re-generated.
3182 * features/rs6000/powerpc-403gc.c : Re-generated.
3183 * features/rs6000/powerpc-405.c: Re-generated.
3184 * features/rs6000/powerpc-505.c: Re-generated.
3185 * features/rs6000/powerpc-601.c: Re-generated.
3186 * features/rs6000/powerpc-602.c: Re-generated.
3187 * features/rs6000/powerpc-603.c: Re-generated.
3188 * features/rs6000/powerpc-604.c: Re-generated.
3189 * features/rs6000/powerpc-64.c: Re-generated.
3190 * features/rs6000/powerpc-64l.c: Re-generated.
3191 * features/rs6000/powerpc-7400.c: Re-generated.
3192 * features/rs6000/powerpc-750.c: Re-generated.
3193 * features/rs6000/powerpc-860.c: Re-generated.
3194 * features/rs6000/powerpc-altivec32.c: Re-generated.
3195 * features/rs6000/powerpc-altivec32l.c: Re-generated.
3196 * features/rs6000/powerpc-altivec64.c: Re-generated.
3197 * features/rs6000/powerpc-altivec64l.c: Re-generated.
3198 * features/rs6000/powerpc-cell32l.c: Re-generated.
3199 * features/rs6000/powerpc-cell64l.c: Re-generated.
3200 * features/rs6000/powerpc-e500.c: Re-generated.
3201 * features/rs6000/powerpc-e500l.c: Re-generated.
3202 * features/rs6000/powerpc-isa205-32l.c: Re-generated.
3203 * features/rs6000/powerpc-isa205-64l.c: Re-generated.
3204 * features/rs6000/powerpc-isa205-altivec32l.c: Re-generated.
3205 * features/rs6000/powerpc-isa205-altivec64l.c: Re-generated.
3206 * features/rs6000/powerpc-isa205-vsx32l.c: Re-generated.
3207 * features/rs6000/powerpc-isa205-vsx64l.c: Re-generated.
3208 * features/rs6000/powerpc-vsx32.c: Re-generated.
3209 * features/rs6000/powerpc-vsx32l.c: Re-generated.
3210 * features/rs6000/powerpc-vsx64.c: Re-generated.
3211 * features/rs6000/powerpc-vsx64l.c: Re-generated.
3212 * features/rs6000/rs6000.c: Re-generated.
3213 * features/s390-linux32.c: Re-generated.
3214 * features/s390-linux32v1.c: Re-generated.
3215 * features/s390-linux32v2.c: Re-generated.
3216 * features/s390-linux64.c: Re-generated.
3217 * features/s390-linux64v1.c: Re-generated.
3218 * features/s390-linux64v2.c: Re-generated.
3219 * features/s390-te-linux64.c: Re-generated.
3220 * features/s390-tevx-linux64.c: Re-generated.
3221 * features/s390-vx-linux64.c: Re-generated.
3222 * features/s390x-linux64.c: Re-generated.
3223 * features/s390x-linux64v1.c: Re-generated.
3224 * features/s390x-linux64v2.c: Re-generated.
3225 * features/s390x-te-linux64.c: Re-generated.
3226 * features/s390x-tevx-linux64.c: Re-generated.
3227 * features/s390x-vx-linux64.c: Re-generated.
3228 * features/sparc/sparc32-solaris.c: Re-generated.
3229 * features/sparc/sparc64-solaris.c: Re-generated.
3230 * features/tic6x-c62x.c: Re-generated.
3231 * features/tic6x-c62x-linux.c: Re-generated.
3232 * features/tic6x-c64x.c: Re-generated.
3233 * features/tic6x-c64x-linux.c: Re-generated.
3234 * features/tic6x-c64xp.c: Re-generated.
3235 * features/tic6x-c64xp-linux.c: Re-generated.
3239 * i386-linux-tdep.c (i386_linux_read_description): New function.
3240 (i386_linux_core_read_description): Call
3241 i386_linux_read_description.
3242 * i386-linux-tdep.h (i386_linux_read_description): Declare.
3243 (tdesc_i386_linux, tdesc_i386_mmx_linux): Remove declarations.
3244 (tdesc_i386_avx_linux, tdesc_i386_mpx_linux): Likewise
3245 (tdesc_i386_avx_mpx_linux, tdesc_i386_avx_avx512_linux): Likewise.
3246 (tdesc_i386_avx_mpx_avx512_pku_linux): Likewise.
3247 * x86-linux-nat.c (x86_linux_read_description): Call
3248 i386_linux_read_description.
3253 * features/Makefile (%.c: %.xml): Pass the xml file name to
3254 command "maint print c-tdesc".
3255 * target-descriptions.c (maint_print_c_tdesc_cmd): Get file
3260 * target-descriptions.c (target_desc): Add ctor and dtor. Do
3261 in-class initialization.
3262 (tdesc_create_feature): Call new instead of XCNEW.
3263 (free_target_description): Ue delete.
3267 * configure.nat: Add "-lkvm" for NetBSD/sparc64 and fix typo.
3271 * amd64-tdep.c (amd64_init_abi): Make argument default_tdesc
3273 (amd64_x32_init_abi): Likewise.
3274 * amd64-tdep.h (amd64_init_abi): Update declaration.
3275 (amd64_x32_init_abi): Likewise.
3280 * arm-linux-nat.c (arm_linux_fetch_inferior_registers): Update
3281 condition for FPSCR.
3282 (arm_linux_store_inferior_registers): Likewise.
3286 * break-catch-syscall.c (struct catch_syscall_inferior_data)
3287 <syscalls_counts>: Now a std::vector.
3288 (get_catch_syscall_inferior_data): Use "new".
3289 (catch_syscall_inferior_data_cleanup): Use "delete".
3290 (insert_catch_syscall, remove_catch_syscall)
3291 (clear_syscall_counts): Update.
3295 * break-catch-syscall.c (syscall_catchpoint)
3296 <syscalls_to_be_caught>: Now a std::vector<int>
3297 (~syscall_catchpoint): Remove.
3298 (insert_catch_syscall, remove_catch_syscall)
3299 (breakpoint_hit_catch_syscall, print_one_catch_syscall)
3300 (print_mention_catch_syscall, print_recreate_catch_syscall):
3302 (create_syscall_event_catchpoint): Change type of "filter"
3304 (catch_syscall_split_args): Return a std::vector.
3305 (catch_syscall_command_1, catching_syscall_number_1): Update.
3309 * break-catch-throw.c (struct exception_catchpoint)
3310 <exception_rx>: Now a std::string.
3311 (~exception_catchpoint): Remove.
3312 (print_one_detail_exception_catchpoint): Update.
3313 (handle_gnu_v3_exceptions): Change type of except_rx.
3314 (extract_exception_regexp): Return a std::string.
3315 (catch_exception_command_1): Update.
3319 * break-catch-sig.c (gdb_signal_type): Remove typedef.
3320 (struct signal_catchpoint) <signals_to_be_caught>: Now a
3322 <catch_all>: Now a bool.
3323 (~signal_catchpoint): Remove.
3324 (signal_catchpoint_insert_location)
3325 (signal_catchpoint_remove_location)
3326 (signal_catchpoint_breakpoint_hit, signal_catchpoint_print_one)
3327 (signal_catchpoint_print_mention)
3328 (signal_catchpoint_print_recreate)
3329 (signal_catchpoint_explains_signal): Update.
3330 (create_signal_catchpoint): Change type of "filter" and
3332 (catch_signal_split_args): Return a std::vector. Change type of
3334 (catch_signal_command): Update.
3338 * ada-lang.c (ada_language_defn): Make extern.
3339 (_initialize_ada_language): Remove add_language call.
3340 * c-lang.c (c_language_defn, cplus_language_defn)
3341 (asm_language_defn, minimal_language_defn): Make extern.
3342 (_initialize_c_language): Delete.
3343 * completer.c (compare_cstrings): Delete, moved to utils.h.
3344 * d-lang.c (d_language_defn): Make extern.
3345 (_initialize_d_language): Remove add_language calls.
3346 * defs.h (enum language): Add comment.
3347 * f-lang.c (f_language_defn): Make extern.
3348 (_initialize_f_language): Remove add_language call.
3349 * go-lang.c (go_language_defn): Make extern.
3350 (_initialize_go_language): Remove add_language call.
3351 * language.c: Include <algorithm>.
3352 (languages): Redefine as const array.
3353 (languages_size, languages_allocsize, DEFAULT_ALLOCSIZE): Delete.
3354 (set_language_command): Handle "local". Use for-range loop.
3355 (set_language): Remove loop.
3356 (language_enum): Rewrite.
3357 (language_def, language_str): Remove loops.
3358 (add_language): Delete.
3359 (add_set_language_command): New, based on add_languages.
3360 (skip_language_trampoline): Adjust.
3361 (local_language_defn): Delete.
3362 (language_gdbarch_post_init): Adjust.
3363 (_initialize_language): Remove add_language calls. Call
3364 add_set_language_command.
3365 * language.h (add_language): Delete.
3366 (auto_language_defn)
3367 (unknown_language_defn, minimal_language_defn, ada_language_defn)
3368 (asm_language_defn, c_language_defn, cplus_language_defn)
3369 (d_language_defn, f_language_defn, go_language_defn)
3370 (m2_language_defn, objc_language_defn, opencl_language_defn)
3371 (pascal_language_defn, rust_language_defn): Declare.
3372 * m2-lang.c (m2_language_defn): Make extern.
3373 (_initialize_m2_language): Remove add_language call.
3374 * objc-lang.c (objc_language_defn): Make extern.
3375 (_initialize_objc_language): Remove add_language call.
3376 * opencl-lang.c (opencl_language_defn): Make extern.
3377 (_initialize_opencl_language): Remove add_language call.
3378 * p-lang.c (pascal_language_defn): Make extern.
3379 (_initialize_pascal_language): Delete.
3380 * rust-lang.c (rust_language_defn): Make extern.
3381 (_initialize_rust_language): Delete.
3382 * utils.h (compare_cstrings): New static inline function.
3386 * ada-lang.c (ada_to_fixed_type_1): Adjust.
3387 (get_var_value): Constify parameters.
3388 (get_int_var_value): Change prototype.
3389 (to_fixed_range_type): Adjust.
3390 * ada-lang.h (get_int_var_value): Change prototype.
3394 * dwarf2read.c (dw2_lookup_symbol): Use
3395 SYMBOL_MATCHES_SEARCH_NAME.
3396 * psymtab.c (psym_lookup_symbol): Use SYMBOL_MATCHES_SEARCH_NAME.
3400 * block.c (block_iter_name_step, block_iter_name_first)
3401 (block_iter_name_next): Delete.
3402 (block_lookup_symbol_primary): Adjust to use
3403 dict_iter_match_first/dict_iter_match_next.
3404 * block.h (block_iter_name_first, block_iter_name_next): Delete
3406 (ALL_BLOCK_SYMBOLS_WITH_NAME): Adjust to use
3407 dict_iter_match_first/dict_iter_match_next.
3411 * cp-support.c (cp_find_first_component_aux): Add missing case for
3416 * dwarf2read.c (create_cus_hash_table): Re-add lost initialization
3417 of dwo_cu's dwo_file.
3421 * remote.c (store_registers_using_G): Remove one line comment.
3425 * regcache.c (regcache_cpy): Simplify it.
3426 (regcache::cpy_no_passthrough): Remove it.
3427 * regcache.h (cpy_no_passthrough): Remove it.
3428 (regcache_dup, regcache_cpy): Update comments.
3432 * remote-sim.c (sim_command_completer): Adjust to work with a
3433 completion_tracker instead of a VEC.
3437 * completer.c (complete_source_filenames): New function.
3438 (complete_address_and_linespec_locations): New function.
3439 (location_completer): Use complete_address_and_linespec_locations.
3440 (completion_tracker::build_completion_result): Honor the tracker's
3441 request to suppress append.
3442 * completer.h (completion_tracker::suppress_append_ws)
3443 (completion_tracker::set_suppress_append_ws): New methods.
3444 (completion_tracker::m_suppress_append_ws): New field.
3445 (complete_source_filenames): New declaration.
3446 * linespec.c (linespec_complete_what): New.
3447 (struct ls_parser) <complete_what, completion_word,
3448 completion_quote_char, completion_quote_end, completion_tracker>:
3450 (string_find_incomplete_keyword_at_end): New.
3451 (linespec_lexer_lex_string): Record quote char. If in completion
3453 (linespec_lexer_consume_token): Advance the completion word point.
3454 (linespec_lexer_peek_token): Save/restore completion info.
3455 (save_stream_and_consume_token): New.
3456 (set_completion_after_number): New.
3457 (linespec_parse_basic): Set what to complete next depending on
3458 token. Handle function and label completions specially.
3459 (parse_linespec): Disable objc shortcut in completion mode. Set
3460 what to complete next depending on token type. Skip keyword if in
3462 (complete_linespec_component, linespec_complete): New.
3463 * linespec.h (linespec_complete): Declare.
3467 * linespec.c (linespec_lexer_lex_string, find_toplevel_char):
3468 Handle 'operator<' / 'operator<<'.
3472 * completer.c (collect_explicit_location_matches): Handle
3474 (convert_explicit_location_to_linespec): New, factored out from
3476 (convert_explicit_location_to_sals): ... this.
3477 (complete_label): New.
3478 (linespec_complete_label, find_label_symbols_in_block): New.
3479 (find_label_symbols): Add completion_mode parameter and adjust to
3480 call find_label_symbols_in_block.
3481 * linespec.h (linespec_complete_label): Declare.
3485 * ada-lang.c (ada_collect_symbol_completion_matches): Add
3486 complete_symbol_mode parameter.
3487 * cli/cli-cmds.c (complete_command): Get the completion result out
3488 of the handle_brkchars tracker if used a custom word point.
3489 * completer.c: Include "linespec.h".
3490 (enum explicit_location_match_type) <MATCH_LINE>: New enumerator.
3491 (advance_to_expression_complete_word_point): New.
3492 (completion_tracker::completes_to_completion_word): New.
3493 (complete_files_symbols): Pass down
3494 complete_symbol_mode::EXPRESSION.
3495 (explicit_options, probe_options): New.
3496 (collect_explicit_location_matches): Complete on the
3497 explictit_loc->foo instead of word. Use
3498 linespec_complete_function. Handle MATCH_LINE. Handle offering
3499 keyword and options completions.
3500 (backup_text_ptr): Delete.
3501 (skip_keyword): New.
3502 (complete_explicit_location): Remove 'word' parameter. Add
3503 language, quoted_arg_start and quoted_arg_end parameters.
3504 Rewrite, parsing left to right.
3505 (location_completer): Rewrite.
3506 (location_completer_handle_brkchars): New function.
3507 (symbol_completer): Pass down complete_symbol_mode::EXPRESSION.
3508 (enum complete_line_internal_reason): Adjust comments.
3509 (completion_tracker::discard_completions): New.
3510 (completer_handle_brkchars_func_for_completer): Handle
3512 (gdb_custom_word_point_brkchars)
3513 (gdb_org_rl_basic_quote_characters): New.
3514 (gdb_completion_word_break_characters_throw)
3515 (completion_find_completion_word): Handle trackers that use a
3517 (completion_tracker::advance_custom_word_point_by): New.
3518 (completion_tracker::build_completion_result): Don't rely on
3519 readline appending the quote char.
3520 (gdb_rl_attempted_completion_function_throw): Handle trackers that
3521 use a custom word point.
3522 (gdb_rl_attempted_completion_function): Restore
3523 rl_basic_quote_characters.
3524 * completer.h (class completion_tracker): Extend intro comment.
3525 (completion_tracker::set_quote_char)
3526 (completion_tracker::quote_char)
3527 (completion_tracker::set_use_custom_word_point)
3528 (completion_tracker::use_custom_word_point)
3529 (completion_tracker::custom_word_point)
3530 (completion_tracker::set_custom_word_point)
3531 (completion_tracker::advance_custom_word_point_by)
3532 (completion_tracker::completes_to_completion_word)
3533 (completion_tracker::discard_completions): New methods.
3534 (completion_tracker::m_quote_char)
3535 (completion_tracker::m_use_custom_word_point)
3536 (completion_tracker::m_custom_word_point): New fields.
3537 (advance_to_expression_complete_word_point): Declare.
3538 * f-lang.c (f_collect_symbol_completion_matches): Add
3539 complete_symbol_mode parameter.
3540 * language.h (struct language_defn)
3541 <la_collect_symbol_completion_matches>: Add complete_symbol_mode
3543 * linespec.c (linespec_keywords): Add NULL terminator. Make extern.
3544 (linespec_complete_function): New function.
3545 (linespec_lexer_lex_keyword): Adjust.
3546 * linespec.h (linespec_keywords, linespec_complete_function): New
3548 * location.c (find_end_quote): New function.
3549 (explicit_location_lex_one): Add explicit_completion_info
3550 parameter. Save quoting info. Don't throw if being called for
3551 completion. Don't handle Ada operators here.
3552 (is_cp_operator, skip_op_false_positives, first_of)
3553 (explicit_location_lex_one_function): New function.
3554 (string_to_explicit_location): Replace 'dont_throw' parameter with
3555 an explicit_completion_info pointer parameter. Handle it. Don't
3556 use explicit_location_lex_one to lex function names. Use
3557 explicit_location_lex_one_function instead.
3558 * location.h (struct explicit_completion_info): New.
3559 (string_to_explicit_location): Replace 'dont_throw' parameter with
3560 an explicit_completion_info pointer parameter.
3561 * symtab.c (default_collect_symbol_completion_matches_break_on):
3562 Add complete_symbol_mode parameter. Handle LINESPEC mode.
3563 (default_collect_symbol_completion_matches)
3564 (collect_symbol_completion_matches): Add complete_symbol_mode
3566 (collect_symbol_completion_matches_type): Pass down
3567 complete_symbol_mode::EXPRESSION.
3568 (collect_file_symbol_completion_matches): Add complete_symbol_mode
3569 parameter. Handle LINESPEC mode.
3570 * symtab.h (complete_symbol_mode): New.
3571 (default_collect_symbol_completion_matches_break_on)
3572 (default_collect_symbol_completion_matches)
3573 (collect_symbol_completion_matches)
3574 (collect_file_symbol_completion_matches): Add complete_symbol_mode
3579 * utils.c (enum class strncmp_iw_mode): New.
3580 (strcmp_iw): Rename to ...
3581 (strncmp_iw_with_mode): ... this. Add string2_len and mode
3582 parameters. Handle them.
3584 (strcmp_iw): Reimplement as wrapper around strncmp_iw_with_mode.
3585 * utils.h (strncmp_iw): Declare.
3586 (strcmp_iw): Move describing comments here.
3590 * c-exp.y (operator_stoken): Use CP_OPERATOR_LEN and
3592 * c-typeprint.c (is_type_conversion_operator): Use
3594 * cp-support.c (LENGTH_OF_OPERATOR): Delete.
3595 (cp_find_first_component_aux): Use CP_OPERATOR_STR and
3597 * cp-support.h (CP_OPERATOR_STR, CP_OPERATOR_LEN): New.
3598 * gnu-v2-abi.c (gnuv2_is_operator_name): Use CP_OPERATOR_STR.
3599 * gnu-v3-abi.c (gnuv3_is_operator_name): Use CP_OPERATOR_STR.
3600 * linespec.c (linespec_lexer_lex_string): Use CP_OPERATOR_LEN and
3602 * location.c: Include "cp-support.h".
3603 (explicit_location_lex_one): Use CP_OPERATOR_LEN and
3605 * symtab.c (operator_chars): Use CP_OPERATOR_STR and
3610 * cli/cli-cmds.c (complete_command): Use a completion tracker
3611 along with completion_find_completion_word for handle_brkchars
3613 * completer.c (RL_QF_SINGLE_QUOTE, RL_QF_DOUBLE_QUOTE)
3614 (RL_QF_BACKSLASH, RL_QF_OTHER_QUOTE): New.
3615 (struct gdb_rl_completion_word_info): New.
3616 (gdb_rl_find_completion_word): New.
3617 (completion_find_completion_word): New.
3618 * completer.h (completion_find_completion_word): Declare.
3622 * ada-lang.c (symbol_completion_match): Adjust comments.
3623 (symbol_completion_add): Replace vector parameter with
3624 completion_tracker parameter. Use it.
3625 (ada_make_symbol_completion_list): Rename to...
3626 (ada_collect_symbol_completion_matches): ... this. Add
3627 completion_tracker parameter and use it.
3628 (ada_language_defn): Adjust.
3629 * break-catch-syscall.c (catch_syscall_completer): Adjust
3630 prototype and work with completion_tracker instead of VEC.
3631 * breakpoint.c (condition_completer): Adjust prototype and work
3632 with completion_tracker instead of VEC.
3633 * c-lang.c (c_language_defn, cplus_language_defn)
3634 (asm_language_defn, minimal_language_defn): Adjust to renames.
3635 * cli/cli-cmds.c (complete_command): Rework using
3636 completion_tracker. Catch exceptions when completing.
3637 * cli/cli-decode.c (integer_unlimited_completer)
3638 (complete_on_cmdlist, complete_on_enum): Adjust prototype and work
3639 with completion_tracker instead of VEC.
3640 * command.h (struct completion_tracker): Forward declare.
3641 (completer_ftype, completer_handle_brkchars_ftype): Change
3643 (complete_on_cmdlist, complete_on_enum): Adjust.
3644 * completer.c: Include <algorithm>.
3645 (struct gdb_completer_state): New.
3646 (current_completion): New global.
3647 (readline_line_completion_function): Delete.
3648 (noop_completer, filename_completer)
3649 (filename_completer_handle_brkchars, complete_files_symbols)
3650 (linespec_location_completer): Adjust to work with a
3651 completion_tracker instead of a VEC.
3652 (string_or_empty): New.
3653 (collect_explicit_location_matches): Adjust to work with a
3654 completion_tracker instead of a VEC.
3655 (explicit_location_completer): Rename to ...
3656 (complete_explicit_location): ... this and adjust to work with a
3657 completion_tracker instead of a VEC.
3658 (location_completer): Adjust to work with a completion_tracker
3660 (add_struct_fields): Adjust to work with a completion_list instead
3662 (expression_completer): Rename to ...
3663 (complete_expression): ... this and adjust to work with a
3664 completion_tracker instead of a VEC. Use complete_files_symbols.
3665 (expression_completer): Reimplement on top of complete_expression.
3666 (symbol_completer): Adjust to work with a completion_tracker
3668 (enum complete_line_internal_reason): Add describing comments.
3669 (complete_line_internal_normal_command): Adjust to work with a
3670 completion_tracker instead of a VEC.
3671 (complete_line_internal): Rename to ...
3672 (complete_line_internal_1): ... this and adjust to work with a
3673 completion_tracker instead of a VEC. Assert TEXT is NULL in the
3674 handle_brkchars phase.
3675 (new_completion_tracker): Delete.
3676 (complete_line_internal): Reimplement as TRY/CATCH wrapper around
3677 complete_line_internal_1.
3678 (free_completion_tracker): Delete.
3679 (INITIAL_COMPLETION_HTAB_SIZE): New.
3680 (completion_tracker::completion_tracker)
3681 (completion_tracker::~completion_tracker): New.
3682 (maybe_add_completion): Delete.
3683 (completion_tracker::maybe_add_completion)
3684 (completion_tracker::add_completion)
3685 (completion_tracker::add_completions): New.
3686 (throw_max_completions_reached_error): Delete.
3687 (complete_line): Adjust to work with a completion_tracker instead
3688 of a VEC. Don't create a completion_tracker_t or check for max
3690 (command_completer, command_completer_handle_brkchars)
3691 (signal_completer, reg_or_group_completer_1)
3692 (reg_or_group_completer, default_completer_handle_brkchars):
3693 Adjust to work with a completion_tracker.
3694 (gdb_completion_word_break_characters_throw): New.
3695 (gdb_completion_word_break_characters): Reimplement.
3696 (line_completion_function): Delete.
3697 (completion_tracker::recompute_lowest_common_denominator)
3698 (expand_preserving_ws)
3699 (completion_tracker::build_completion_result)
3700 (completion_result::completion_result)
3701 (completion_result::completion_result)
3702 (completion_result::~completion_result)
3703 (completion_result::completion_result)
3704 (completion_result::release_match_list, compare_cstrings)
3705 (completion_result::sort_match_list)
3706 (completion_result::reset_match_list)
3707 (gdb_rl_attempted_completion_function_throw)
3708 (gdb_rl_attempted_completion_function): New.
3709 * completer.h (completion_list, struct completion_result)
3710 (class completion_tracker): New.
3711 (complete_line): Add completion_tracker parameter.
3712 (readline_line_completion_function): Delete.
3713 (gdb_rl_attempted_completion_function): New.
3714 (noop_completer, filename_completer, expression_completer)
3715 (location_completer, symbol_completer, command_completer)
3716 (signal_completer, reg_or_group_completer): Update prototypes.
3717 (completion_tracker_t, new_completion_tracker)
3718 (make_cleanup_free_completion_tracker): Delete.
3719 (enum maybe_add_completion_enum): Delete.
3720 (maybe_add_completion): Delete.
3721 (throw_max_completions_reached_error): Delete.
3722 * corefile.c (complete_set_gnutarget): Adjust to work with a
3723 completion_tracker instead of a VEC.
3724 * cp-abi.c (cp_abi_completer): Adjust to work with a
3725 completion_tracker instead of a VEC.
3726 * d-lang.c (d_language_defn): Adjust.
3727 * disasm.c (disassembler_options_completer): Adjust to work with a
3728 completion_tracker instead of a VEC.
3729 * f-lang.c (f_make_symbol_completion_list): Rename to ...
3730 (f_collect_symbol_completion_matches): ... this. Adjust to work
3731 with a completion_tracker instead of a VEC.
3732 (f_language_defn): Adjust.
3733 * go-lang.c (go_language_defn): Adjust.
3734 * guile/scm-cmd.c (cmdscm_add_completion, cmdscm_completer):
3735 Adjust to work with a completion_tracker instead of a VEC.
3736 * infrun.c (handle_completer): Likewise.
3737 * interps.c (interpreter_completer): Likewise.
3738 * interps.h (interpreter_completer): Likewise.
3739 * language.c (unknown_language_defn, auto_language_defn)
3740 (local_language_defn): Adjust.
3741 * language.h (language_defn::la_make_symbol_completion_list):
3743 (language_defn::la_collect_symbol_completion_matches): ... this
3744 and adjust to work with a completion_tracker instead of a VEC.
3745 * m2-lang.c (m2_language_defn): Adjust.
3746 * objc-lang.c (objc_language_defn): Adjust.
3747 * opencl-lang.c (opencl_language_defn): Adjust.
3748 * p-lang.c (pascal_language_defn): Adjust.
3749 * python/py-cmd.c (cmdpy_completer_helper): Handle NULL word.
3750 (cmdpy_completer_handle_brkchars, cmdpy_completer): Adjust to work
3751 with a completion_tracker.
3752 * rust-lang.c (rust_language_defn): Adjust.
3753 * symtab.c (free_completion_list, do_free_completion_list)
3754 (return_val, completion_tracker): Delete.
3755 (completion_list_add_name, completion_list_add_symbol)
3756 (completion_list_add_msymbol, completion_list_objc_symbol)
3757 (completion_list_add_fields, add_symtab_completions): Add
3758 completion_tracker parameter and use it.
3759 (default_make_symbol_completion_list_break_on_1): Rename to...
3760 (default_collect_symbol_completion_matches_break_on): ... this.
3761 Add completion_tracker parameter and use it instead of allocating
3762 a completion tracker here.
3763 (default_make_symbol_completion_list_break_on): Delete old
3765 (default_make_symbol_completion_list): Delete.
3766 (default_collect_symbol_completion_matches): New.
3767 (make_symbol_completion_list): Delete.
3768 (collect_symbol_completion_matches): New.
3769 (make_symbol_completion_type): Rename to ...
3770 (collect_symbol_completion_matches_type): ... this. Add
3771 completion_tracker parameter and use it instead of VEC.
3772 (make_file_symbol_completion_list_1): Rename to...
3773 (collect_file_symbol_completion_matches): ... this. Add
3774 completion_tracker parameter and use it instead of VEC.
3775 (make_file_symbol_completion_list): Delete.
3776 (add_filename_to_list): Use completion_list instead of a VEC.
3777 (add_partial_filename_data::list): Now a completion_list.
3778 (make_source_files_completion_list): Work with a completion_list
3780 * symtab.h: Include "completer.h".
3781 (default_make_symbol_completion_list_break_on)
3782 (default_make_symbol_completion_list, make_symbol_completion_list)
3783 (make_symbol_completion_type, make_file_symbol_completion_list)
3784 (make_source_files_completion_list): Delete.
3785 (default_collect_symbol_completion_matches_break_on)
3786 (default_collect_symbol_completion_matches)
3787 (collect_symbol_completion_matches)
3788 (collect_symbol_completion_matches_type)
3789 (collect_file_symbol_completion_matches)
3790 (make_source_files_completion_list): New.
3791 * top.c (init_main): Don't install a rl_completion_entry_function
3792 hook. Install a rl_attempted_completion_function hook instead.
3793 * tui/tui-layout.c (layout_completer): Adjust to work with a
3795 * tui/tui-regs.c (tui_reggroup_completer):
3796 * tui/tui-win.c (window_name_completer, focus_completer)
3797 (winheight_completer): Adjust to work with a completion_tracker.
3798 * value.c: Include "completer.h".
3799 (complete_internalvar): Adjust to work with a completion_tracker.
3800 * value.h (complete_internalvar): Likewise.
3804 * cli/cli-decode.c (set_cmd_completer_handle_brkchars): Adjust to
3806 * cli/cli-decode.h (struct cmd_list_element) <completer>: Move
3807 comments to completer_ftype's declaration.
3808 <completer_handle_brkchars>: Change type to
3809 completer_handle_brkchars_ftype.
3810 * command.h (completer_ftype): Add describing comment and give
3811 names to parameters.
3812 (completer_ftype_void): Rename to ...
3813 (completer_handle_brkchars_ftype) ... this. Add describing comment.
3814 (set_cmd_completer_handle_brkchars): Adjust.
3815 * completer.c (filename_completer_handle_brkchars): New function.
3816 (complete_line_internal_normal_command): New function, factored
3818 (complete_line_internal): ... here.
3819 (command_completer_handle_brkchars)
3820 (default_completer_handle_brkchars)
3821 (completer_handle_brkchars_func_for_completer): New functions.
3822 * completer.h (set_gdb_completion_word_break_characters): Delete
3824 (completer_handle_brkchars_func_for_completer): New declaration.
3825 * python/py-cmd.c (cmdpy_completer_handle_brkchars): Adjust to use
3826 completer_handle_brkchars_func_for_completer.
3830 * completer.c (symbol_completer): New function, based on
3831 make_symbol_completion_list_fn.
3832 * completer.h (symbol_completer): New declaration.
3833 * guile/scm-cmd.c (cmdscm_completers): Adjust.
3834 * python/py-cmd.c (completers): Adjust.
3835 * symtab.c (make_symbol_completion_list_fn): Delete.
3836 * symtab.h (make_symbol_completion_list_fn): Delete.
3837 * cli/cli-decode.c (add_cmd): Adjust.
3841 * Makefile.in (COMMON_OBS): Add filename-seen-cache.o.
3842 * dwarf2read.c: Include "filename-seen-cache.h".
3843 * dwarf2read.c (dwarf2_per_objfile) <filenames_cache>: New field.
3844 (dw2_map_symbol_filenames): Build and use a filenames_seen_cache.
3845 * filename-seen-cache.c: New file.
3846 * filename-seen-cache.h: New file.
3847 * symtab.c: Include "filename-seen-cache.h".
3848 (struct filename_seen_cache, INITIAL_FILENAME_SEEN_CACHE_SIZE)
3849 (create_filename_seen_cache, clear_filename_seen_cache)
3850 (delete_filename_seen_cache, filename_seen): Delete, parts moved
3851 to filename-seen-cache.h/filename-seen-cache.c.
3852 (output_source_filename, sources_info)
3853 (maybe_add_partial_symtab_filename)
3854 (make_source_files_completion_list): Adjust to use
3855 filename_seen_cache.
3859 * dwarf2read.c (dwarf2_per_objfile): In-class initialize all
3861 (dwarf2_per_objfile::dwarf2_per_objfile(objfile*, const
3862 dwarf2_debug_sections*)): New.
3863 (dwarf2_per_objfile::dwarf2_per_objfile(const
3864 dwarf2_per_objfile&)): Declare as deleted.
3865 (dwarf2_per_objfile::operator=): Declare as deleted.
3866 (dwarf2_per_objfile::dwarf2_per_objfile)
3867 (dwarf2_per_objfile::~dwarf2_per_objfile)
3868 (dwarf2_per_objfile::free_cached_comp_units): New.
3869 (dwarf2_has_info): dwarf2_per_objfile initialization code moved to
3870 ctor. Call dwarf2_per_objfile's ctor manually.
3871 (dwarf2_locate_sections): Deleted/refactored as ...
3872 (dwarf2_per_objfile::locate_sections): ... this new method.
3873 (free_cached_comp_units): Defer to
3874 dwarf2_per_objfile::free_cached_comp_units.
3875 (dwarf2_free_objfile): Call dwarf2_per_objfile's dtor manually.
3880 * rust-exp.y (convert_ast_to_expression): Add "want_type"
3882 <UNOP_SIZEOF>: Split into separate case.
3883 <UNOP_VAR_VALUE>: Handle want_type. Add error case.
3888 * symtab.c (symbol_matches_domain): Add language_rust to special
3890 * rust-exp.y (convert_ast_to_expression) <OP_VAR_VALUE>: Don't
3891 treat LOC_TYPEDEF symbols as variables.
3895 * symtab.c (make_file_symbol_completion_list_1): Iterate over
3896 symtabs matching all symtabs with SRCFILE as file name instead of
3897 only considering the first hit, with lookup_symtab.
3901 * ax-gdb.c (gen_aggregate_elt_ref): Remove operand_name and
3902 operator_name parameters.
3903 (gen_expr): Update function call.
3907 * dwarf2loc.h (dwarf2_compile_expr_to_ax): Remove gdbarch
3909 * symtab.h (struct symbol_computed_ops::tracepoint_var_ref):
3911 * dwarf2loc.c (dwarf2_compile_expr_to_ax): Remove gdbarch
3912 parameter, use agent_expr::gdbarch instead, update function
3914 (locexpr_tracepoint_var_ref): Likewise.
3915 (loclist_tracepoint_var_ref): Likewise.
3916 * ax-gdb.c (gen_trace_static_fields): Likewise.
3917 (gen_traced_pop): Likewise.
3918 (gen_frame_args_address): Likewise.
3919 (gen_frame_locals_address): Likewise.
3920 (gen_var_ref): Likewise.
3921 (gen_struct_ref_recursive): Likewise.
3922 (gen_static_field): Likewise.
3923 (gen_maybe_namespace_elt): Likewise.
3924 (gen_expr): Likewise.
3925 (gen_trace_for_var): Likewise.
3926 (gen_trace_for_expr): Likewise.
3927 (gen_trace_for_return_address): Likewise.
3931 * ax-gdb.c (gen_deref, gen_address_of): Remove unused ax
3933 (gen_struct_ref, gen_expr, gen_expr_binop_rest): Update call.
3937 * ax-gdb.c (gen_usual_unary): Remove exp parameter, get gdbarch
3938 from ax, update calls.
3939 (gen_usual_arithmetic): Likewise.
3940 (gen_integral_promotions): Likewise.
3941 (gen_bitfield_ref): Likewise.
3942 (gen_primitive_field): Likewise.
3943 (gen_struct_ref_recursive): Likewise.
3944 (gen_struct_ref): Likewise.
3945 (gen_maybe_namespace_elt): Likewise.
3946 (gen_struct_elt_for_reference): Likewise.
3947 (gen_namespace_elt): Likewise.
3948 (gen_aggregate_elt_ref): Likewise.
3949 (gen_expr): Get gdbarch from ax, update calls.
3950 (gen_expr_binop_rest): Likewise.
3954 * amd64-darwin-tdep.c (x86_darwin_init_abi_64): Pass tdesc_amd64
3956 * amd64-dicos-tdep.c (amd64_dicos_init_abi):
3957 * amd64-fbsd-tdep.c (amd64fbsd_init_abi):
3958 * amd64-linux-tdep.c (amd64_linux_init_abi): Pass
3959 tdesc_amd64_linux as default tdesc. Get final tdesc from the
3961 (amd64_x32_linux_init_abi): Pass tdesc_x32_linux as default tdesc.
3962 Get final tdesc from the tdep.
3963 * amd64-nbsd-tdep.c (amd64nbsd_init_abi): Pass tdesc_amd64 as
3965 * amd64-obsd-tdep.c (amd64obsd_init_abi): Likewise.
3966 * amd64-sol2-tdep.c (amd64_sol2_init_abi): Likewise.
3967 * amd64-tdep.c (amd64_init_abi): Add 'default_tdesc' parameter.
3968 Use it as default tdesc.
3969 (amd64_x32_init_abi): Add 'default_tdesc' parameter, and pass it
3970 down to amd_init_abi. No longer handle fallback tdesc here.
3971 * amd64-tdep.h (tdesc_x32): Declare.
3972 (amd64_init_abi, amd64_x32_init_abi): Add 'default_tdesc'
3974 * amd64-windows-tdep.c (amd64_windows_init_abi): Pass tdesc_amd64
3979 * s390-linux-tdep.c (s390_process_record): Add support for
3980 instructions new in arch12.
3984 * amd64-bsd-nat.c (amd64bsd_fetch_inferior_registers): Use
3985 PT_GETFSBASE and PT_GETGSBASE.
3986 (amd64bsd_store_inferior_registers): Use PT_SETFSBASE and
3991 * features/Makefile (amd64.dat, amd64-avx.dat, amd64-mpx.dat)
3992 (amd64-avx-mpx.dat, amd64-avx-avx512.dat)
3993 (amd64-avx-mpx-avx512-pku.dat): Add i386/64bit-segments.xml in
3995 * features/i386/amd64-avx-avx512.xml: Add 64bit-segments.xml.
3996 * features/i386/amd64-avx-mpx-avx512-pku.xml: Add 64bit-segments.xml.
3997 * features/i386/amd64-avx-mpx.xml: Add 64bit-segments.xml.
3998 * features/i386/amd64-avx.xml: Add 64bit-segments.xml.
3999 * features/i386/amd64-mpx.xml: Add 64bit-segments.xml.
4000 * features/i386/amd64.xml: Add 64bit-segments.xml.
4001 * features/i386/amd64-avx-avx512.c: Regenerated.
4002 * features/i386/amd64-avx-mpx-avx512-pku.c: Regenerated.
4003 * features/i386/amd64-avx-mpx.c: Regenerated.
4004 * features/i386/amd64-avx.c: Regenerated.
4005 * features/i386/amd64-mpx.c: Regenerated.
4006 * features/i386/amd64.c: Regenerated.
4007 * regformats/i386/amd64-avx-avx512.dat: Regenerated.
4008 * regformats/i386/amd64-avx-mpx-avx512-pku.dat: Regenerated.
4009 * regformats/i386/amd64-avx-mpx.dat: Regenerated.
4010 * regformats/i386/amd64-avx.dat: Regenerated.
4011 * regformats/i386/amd64-mpx.dat: Regenerated.
4012 * regformats/i386/amd64.dat: Regenerated.
4016 * features/i386/amd64-avx-avx512-linux.c: Re-generated.
4017 * features/i386/amd64-avx-mpx-avx512-pku-linux.c: Re-generated.
4021 * gnulib/update-gnulib.sh (IMPORTED_GNULIB_MODULES): Add setenv and
4023 * gnulib/aclocal.m4: Regenerate.
4024 * gnulib/config.in: Regenerate.
4025 * gnulib/configure: Regenerate.
4026 * gnulib/import/Makefile.am: Regenerate.
4027 * gnulib/import/Makefile.in: Regenerate.
4028 * gnulib/import/m4/gnulib-cache.m4: Regenerate.
4029 * gnulib/import/m4/gnulib-comp.m4: Regenerate.
4030 * gnulib/import/m4/environ.m4: New file.
4031 * gnulib/import/m4/setenv.m4: New file.
4032 * gnulib/import/setenv.c: New file.
4033 * gnulib/import/unsetenv.c: New file.
4037 * compile/compile-loc2c.c (do_compile_dwarf_expr_to_c): Read
4038 address when op is DW_OP_addr.
4042 * dwarf2loc.c (dwarf2_evaluate_loc_desc_full): Reverse size
4043 check and apply to outer type.
4047 * fbsd-tdep.c (LWPINFO_OFFSET, LWPINFO_PL_FLAGS)
4048 (LWPINFO64_PL_SIGINFO, LWPINFO32_PL_SIGINFO, PL_FLAG_SI)
4049 (SIZE64_SIGINFO_T, SIZE32_SIGINFO_T, fbsd_core_xfer_siginfo): New.
4050 (fbsd_init_abi): Install gdbarch "core_xfer_siginfo" method.
4054 * fbsd-tdep.c (fbsd_core_thread_name): Use thread_section_name.
4058 * corelow.c (get_core_siginfo): Remove.
4059 (core_xfer_partial): Use the gdbarch "core_xfer_siginfo" method
4060 instead of get_core_siginfo.
4061 * gdbarch.sh (core_xfer_siginfo): New gdbarch callback.
4062 * gdbarch.h: Re-generate.
4063 * gdbarch.c: Re-generate.
4064 * linux-tdep.c (linux_core_xfer_siginfo): New.
4065 (linux_init_abi): Install gdbarch "core_xfer_siginfo" method.
4069 * corelow.c (thread_section_name): Move to ...
4070 * gdbcore.h (thread_section_name): ... here.
4074 * fbsd-nat.c [PT_LWPINFO && __LP64__] (union sigval32)
4075 (struct siginfo32): New.
4076 [PT_LWPINFO] (fbsd_siginfo_size, fbsd_convert_siginfo): New.
4077 (fbsd_xfer_partial) [PT_LWPINFO]: Handle TARGET_OBJECT_SIGNAL_INFO
4078 via ptrace(PT_LWPINFO).
4082 * fbsd-tdep.c (fbsd_gdbarch_data_handle, struct fbsd_gdbarch_data)
4083 (init_fbsd_gdbarch_data, get_fbsd_gdbarch_data)
4084 (fbsd_get_siginfo_type): New.
4085 (fbsd_init_abi): Install gdbarch "get_siginfo_type" method.
4086 (_initialize_fbsd_tdep): New.
4090 * dwarf2read.c (struct dwo_file): Use a htab of dwo_unit* (rather than
4091 a singular dwo_unit*) to support multiple CUs in the same way that
4092 multiple TUs are supported.
4093 (create_cus_hash_table): Replace create_dwo_cu with a function for
4094 parsing multiple CUs from a DWO file.
4095 (open_and_init_dwo_file): Use create_cus_hash_table rather than
4097 (lookup_dwo_cutu): Lookup CU in the hash table in the dwo_file with
4098 htab_find, rather than comparing the signature to a singleton CU in
4103 * python/py-unwind.c (pyuw_dealloc_cache): Fix for loop condition.
4107 * gdbtypes.c (recursive_dump_type): Don't reference TYPE_STATIC.
4108 * gdbtypes.h (TYPE_STATIC): Delete.
4109 (struct fn_field) <is_public, is_abstract, is_static, is_final,
4110 is_synchronized, is_native>: Delete.
4112 (TYPE_FN_FIELD_PUBLIC, TYPE_FN_FIELD_STATIC, TYPE_FN_FIELD_FINAL)
4113 (TYPE_FN_FIELD_SYNCHRONIZED, TYPE_FN_FIELD_NATIVE)
4114 (TYPE_FN_FIELD_ABSTRACT): Delete.
4118 * buffer.h (buffer_finish): Fix spelling mistakes.
4122 * .dir-locals.el: Automatically switch to C-style comments in
4123 versions of Emacs that support the feature.
4129 * cli/cli-script.c (command_name_equals_not_inline): Remove function.
4130 (process_next_line): New variable 'inline_cmd'.
4131 Adjust 'if' clauses for "python", "compile" and "guile" to use
4132 'command_name_equals' and check for '!inline_cmd'.
4137 * cli/cli-script.c (command_name_equals_not_inline): New function.
4138 (process_next_line): Adjust 'if' clauses for "python", "compile"
4139 and "guile" to use command_name_equals_not_inline.
4143 * completer.c (expression_completer): Call
4144 linespec_location_completer instead of location_completer.
4148 * completer.c (expression_completer): Remove code that recomputes
4153 * regformats/regdat.sh: Generate code with
4154 "ifndef IN_PROCESS_AGENT".
4158 * command.h: Include "common/scoped_restore.h".
4162 * mi/mi-cmd-break.c (mi_argv_to_format): Use obstack_grow_str
4163 instead of obstack_grow.
4168 * symfile.c (reread_symbols): Call objfiles_changed just before
4173 * symtab.c (COMPLETION_LIST_ADD_SYMBOL)
4174 (MCOMPLETION_LIST_ADD_SYMBOL): Delete macros, replace with ...
4175 (completion_list_add_symbol, completion_list_add_msymbol):
4176 ... these new functions.
4177 (add_symtab_completions)
4178 (default_make_symbol_completion_list_break_on_1): Adjust.
4182 * objfiles.c (get_objfile_bfd_data): Call bfd_alloc instead of
4183 bfd_zalloc. Call objfile_per_bfd_storage's ctor.
4184 (free_objfile_per_bfd_storage): Call objfile_per_bfd_storage's
4186 * objfiles.h (objfile_per_bfd_storage): Add ctor. Make
4187 'storage_obstack' field an auto_obstack. In-class initialize all
4188 non-bitfield fields. Make minsyms_read bool.
4189 * symfile.c (read_symbols): Adjust.
4193 * remote-sim.c (gdbsim_fetch_register): Use byte_vector.
4194 (gdbsim_store_register): Likewise.
4198 * c-exp.y (name_obstack): Now an auto_obstack.
4199 (yylex): Use auto_obstack::clear.
4200 (c_parse): Use auto_obstack::clear instead of reinitializing and
4201 freeing the obstack.
4202 * c-lang.c (evaluate_subexp_c): Use auto_obstack.
4203 * d-exp.y (name_obstack): Now an auto_obstack.
4204 (yylex): Use auto_obstack::clear.
4205 (d_parse): Use auto_obstack::clear instead of reinitializing and
4206 freeing the obstack.
4207 * dwarf2loc.c (fetch_const_value_from_synthetic_pointer): Use
4209 * dwarf2read.c (create_addrmap_from_index)
4210 (dwarf2_build_psymtabs_hard)
4211 (update_enumeration_type_from_children): Likewise.
4212 * gdb_obstack.h (auto_obstack): New type.
4213 * go-exp.y (name_obstack): Now an auto_obstack.
4214 (build_packaged_name): Use auto_obstack::clear.
4215 (go_parse): Use auto_obstack::clear instead of reinitializing and
4216 freeing the obstack.
4217 * linux-tdep.c (linux_make_mappings_corefile_notes): Use
4219 * printcmd.c (printf_wide_c_string, ui_printf): Use auto_obstack.
4220 * rust-exp.y (work_obstack): Now an auto_obstack.
4221 (rust_parse, rust_lex_tests): Use auto_obstack::clear instead of
4222 reinitializing and freeing the obstack.
4223 * utils.c (do_obstack_free, make_cleanup_obstack_free): Delete.
4224 (host_char_to_target): Use auto_obstack.
4225 * utils.h (make_cleanup_obstack_free): Delete declaration.
4226 * valprint.c (generic_emit_char, generic_printstr): Use
4231 * darwin-nat.c (darwin_check_new_threads): Don't handle dummy
4233 (darwin_init_thread_list): Don't update dummy thread.
4234 (darwin_create_inferior, darwin_attach): Don't add a dummy thread.
4238 * record-full.c (netorder16): Remove.
4242 * common/diagnostics.h: Define macros for GCC.
4243 (DIAGNOSTIC_IGNORE_UNUSED_FUNCTION): New macro.
4244 * common/vec.h: Include diagnostics.h.
4245 (DIAGNOSTIC_IGNORE_UNUSED_VEC_FUNCTION): New macro.
4246 (DEF_VEC_I, DEF_VEC_P, DEF_VEC_O): Ignore -Wunused-function
4251 * common/diagnostics.h (DIAGNOSTIC_IGNORE_DEPRECATED_REGISTER):
4253 * ada-lex.l: Ignore deprecated register warnings.
4257 * main.c (get_init_files): Replace "SYSTEM_GDBINIT +
4258 datadir_len" with "&SYSTEM_GDBINIT[datadir_len]".
4262 * dtrace-probe.c (dtrace_process_dof_probe): Put semi-colon on
4267 * nat/x86-dregs.c (x86_show_dr): Print registers one per line.
4271 * xtensa-tdep.c (XTENSA_MAX_REGISTER_SIZE): Add.
4272 (xtensa_register_write_masked): Use XTENSA_MAX_REGISTER_SIZE.
4273 (xtensa_register_read_masked): Likewise.
4277 * common/environ.c (gdb_environ::unset): Update comment.
4281 * python/py-unwind.c (pyuw_sniffer): Allocate space for
4286 * record-full.c (record_full_exec_insn): Use byte_vector.
4290 * regformats/i386/amd64-avx-mpx-avx512-pku-linux.dat: Regenerated.
4291 * regformats/i386/amd64-avx-mpx-avx512-pku.dat: Regenerated.
4295 * remote.c (cached_reg): Move from here...
4296 * regcache.h (cached_reg): ...to here.
4297 * python/py-unwind.c (struct reg_info): Remove.
4298 (cached_frame_info): Use cached_reg_t.
4299 (pyuw_prev_register): Likewise.
4300 (pyuw_sniffer): Use cached_reg_t and allocate registers.
4301 (pyuw_dealloc_cache): Free all registers.
4306 * unittests/environ-selftests.c (run_tests): Ignore -Wself-move
4308 * common/diagnostics.h: New file.
4312 * common/agent.h: Add include guards.
4316 * target.h (struct target_ops) <to_xfer_partial>: Update doc to
4317 talk about addressable units instead of bytes.
4321 * common/environ.c (gdb_environ::unset): Use '::iterator' instead
4322 of '::const_iterator'.
4326 * Makefile.in (SUBDIR_UNITTESTS_SRCS): Add
4327 'unittests/environ-selftests.c'.
4328 (SUBDIR_UNITTESTS_OBS): Add 'environ-selftests.o'.
4329 * charset.c (find_charset_names): Declare object 'iconv_env'.
4330 Update code to use 'iconv_env' object. Remove call to
4332 * common/environ.c: Include <utility>.
4333 (make_environ): Delete function.
4334 (free_environ): Delete function.
4335 (gdb_environ::clear): New function.
4336 (gdb_environ::operator=): New function.
4337 (gdb_environ::get): Likewise.
4338 (environ_vector): Delete function.
4339 (set_in_environ): Delete function.
4340 (gdb_environ::set): New function.
4341 (unset_in_environ): Delete function.
4342 (gdb_environ::unset): New function.
4343 (gdb_environ::envp): Likewise.
4344 * common/environ.h: Include <vector>.
4345 (struct gdb_environ): Delete; transform into...
4346 (class gdb_environ): ... this class.
4347 (free_environ): Delete prototype.
4348 (init_environ, get_in_environ, set_in_environ, unset_in_environ,
4349 environ_vector): Likewise.
4350 * infcmd.c (run_command_1): Update code to call
4351 'envp' from 'gdb_environ' class.
4352 (environment_info): Update code to call methods from 'gdb_environ'
4354 (unset_environment_command): Likewise.
4355 (path_info): Likewise.
4356 (path_command): Likewise.
4357 * inferior.c (inferior::~inferior): Delete call to 'free_environ'.
4358 (inferior::inferior): Initialize 'environment' using the host's
4360 * inferior.h: Remove forward declaration of 'struct gdb_environ'.
4361 Include "environ.h".
4362 (class inferior) <environment>: Change type from 'struct
4363 gdb_environ' to 'gdb_environ'.
4364 * mi/mi-cmd-env.c (mi_cmd_env_path): Update code to call
4365 methods from 'gdb_environ' class.
4366 * solib.c (solib_find_1): Likewise
4367 * unittests/environ-selftests.c: New file.
4371 * features/i386/i386-linux.xml: Exchange the order of including
4372 32bit-linux.xml and 32bit-sse.xml.
4373 * features/i386/i386-linux.c: Regenerated.
4377 * target-descriptions.c (tdesc_reg): Add ctor, dtor.
4378 Delete copy ctor and assignment operator.
4379 (tdesc_type): Likewise.
4380 (tdesc_feature): Likewise.
4381 (tdesc_free_reg): Remove.
4382 (tdesc_create_reg): Use new.
4383 (tdesc_free_type): Remove.
4384 (tdesc_create_vector): Use new.
4385 (tdesc_create_union): Likewise.
4386 (tdesc_create_flags): Likewise.
4387 (tdesc_create_enum): Likewise.
4388 (tdesc_free_feature): Delete.
4389 (free_target_description): Use delete.
4393 * mips-tdep.c (print_gp_register_row): Don't error for unavailable
4398 * dwarf2read.c (write_psymtabs_to_index): Construct file_closer
4399 after gdb::unlinker.
4403 * mi/mi-cm-env.c (_initialize_mi_cmd_env): Use getenv instead of
4404 gdb_environ to access an environment variable.
4408 * nat/linux-ptrace.c (linux_fork_to_function): Add cast to
4413 * nat/fork-inferior.h (trace_start_error): Add ATTRIBUTE_PRINTF.
4417 * configure: Re-generate.
4418 * warning.m4 (build_warnings): Add -Wno-mismatched-tags.
4422 * configure: Re-generate.
4423 * warning.m4: Pass -Werror to compiler when checking for
4424 supported warning flags.
4428 * Makefile.in (COMPILE.pre): Add "-x c++".
4434 * defs.h (RequireLongest): New.
4435 (extract_integer): Declare function template.
4436 (extract_signed_integer): Remove the declaration, but define it
4438 (extract_unsigned_integer): Likewise.
4439 (store_integer): Declare function template.
4440 (store_signed_integer): Remove the declaration, but define it
4442 (store_unsigned_integer): Likewise.
4443 * findvar.c (extract_integer): New function template.
4444 (extract_signed_integer): Remove.
4445 (extract_unsigned_integer): Remove.
4446 (extract_integer<LONGEST>, extract_integer<ULONGEST>): Explicit
4448 (store_integer): New function template.
4449 (store_signed_integer): Remove.
4450 (store_unsigned_integer): Remove.
4451 (store_integer): Explicit instantiations.
4452 * regcache.c (regcache_raw_read_signed): Update.
4453 (regcache::raw_read): New function.
4454 (regcache::raw_read_signed): Remove.
4455 (regcache::raw_read_unsigned): Remove.
4456 (regcache_raw_read_unsigned): Update.
4457 (regcache_raw_write_unsigned): Update.
4458 (regcache::raw_write_signed): Remove.
4459 (regcache::raw_write): New function.
4460 (regcache_cooked_read_signed): Update.
4461 (regcache::raw_write_unsigned): Remove.
4462 (regcache::cooked_read_signed): Remove.
4463 (regcache_cooked_read_unsigned): Update.
4464 (regcache::cooked_read_unsigned): Remove.
4465 (regcache_cooked_write_signed): Update.
4466 (regcache_cooked_write_unsigned): Update.
4467 * regcache.h (regcache) <raw_read_signed>: Remove.
4468 <raw_write_signed, raw_read_unsigned, raw_write_unsigned>: Remove.
4469 <raw_read, raw_write>: New.
4470 <cooked_read_signed, cooked_write_signed>: Remove.
4471 <cooked_write_unsigned, cooked_read_unsigned>: Remove.
4472 <cooked_read, cooked_write>: New.
4473 * sh64-tdep.c (sh64_pseudo_register_read): Update.
4474 (sh64_pseudo_register_write): Update.
4478 * arc-tdep.c (arc_disassembler_options): New variable.
4479 (arc_gdbarch_init): Set and use it. Use arc_delayed_print_insn instead
4480 of default_print_insn.
4481 (arc_delayed_print_insn): Set info->section when needed,
4482 use default_print_insn to retrieve a disassembler.
4487 * infcmd.c (_initialize_infcmd): Expand "help run" documentation
4488 to mention $SHELL and startup-with-shell.
4492 * MAINTAINERS: Move Maxim Grigoriev to the Past Maintainers.
4496 * aarch64-tdep.c (aarch64_gdb_print_insn): Call
4497 default_print_insn instead of print_insn_aarch64.
4498 * arm-tdep.c (gdb_print_insn_arm): Call
4499 default_print_insn instead of print_insn_big_arm
4500 and print_insn_little_arm.
4501 * i386-tdep.c (i386_print_insn): Call default_print_insn
4502 instead of print_insn_i386.
4503 * ia64-tdep.c (ia64_print_insn): Call
4504 default_print_insn instead of print_insn_ia64.
4505 * mips-tdep.c (gdb_print_insn_mips): Call
4506 default_print_insn instead of print_insn_big_mips
4507 and print_insn_little_mips.
4508 * spu-tdep.c (gdb_print_insn_spu): Call default_print_insn
4509 instead of print_insn_spu.
4513 * ada-lang.c: Include "common/byte-vector.h".
4514 (ada_value_primitive_packed_val): Use gdb::byte_vector.
4515 * charset.c (wchar_iterator::iterate): Resize the vector instead
4517 * common/byte-vector.h: Include "common/def-vector.h".
4518 (wchar_iterator::m_out): Now a gdb::def_vector<gdb_wchar_t>.
4519 * cli/cli-dump.c: Include "common/byte-vector.h".
4520 (dump_memory_to_file, restore_binary_file): Use gdb::byte_vector.
4521 * common/byte-vector.h: New file.
4522 * common/def-vector.h: New file.
4523 * common/default-init-alloc.h: New file.
4524 * dwarf2loc.c: Include "common/byte-vector.h".
4525 (rw_pieced_value): Use gdb::byte_vector, and resize the vector
4526 instead of reserving it.
4527 * dwarf2read.c: Include "common/byte-vector.h".
4528 (data_buf::m_vec): Now a gdb::byte_vector.
4529 * gdb_regex.c: Include "common/def-vector.h".
4530 (compiled_regex::compiled_regex): Use gdb::def_vector<char>.
4531 * mi/mi-main.c: Include "common/byte-vector.h".
4532 (mi_cmd_data_read_memory): Use gdb::byte_vector.
4533 * printcmd.c: Include "common/byte-vector.h".
4534 (print_scalar_formatted): Use gdb::byte_vector.
4535 * valprint.c: Include "common/byte-vector.h".
4536 (maybe_negate_by_bytes, print_decimal_chars): Use
4541 * darwin-nat.c: Include "nat/fork-inferior.h".
4545 * configure.nat: Factor out Darwin bits that are not
4546 architecture-specific. Add fork-inferior.o.
4550 * configure.nat: Factor out AIX bits that are not
4551 architecture-specific. Add fork-inferior.o.
4555 * dwarf2loc.c (rw_pieced_value): New. Merge logic from...
4556 (read_pieced_value, write_pieced_value): ...here. Reduce to
4557 wrappers that just call rw_pieced_value.
4561 * dwarf2loc.c (write_pieced_value): When writing the data for a
4562 memory piece, use write_memory_with_notification instead of
4567 * valops.c (read_value_memory): Change embedded_offset to
4568 represent a bit offset instead of a byte offset.
4569 * value.h (read_value_memory): Adjust comment.
4573 * dwarf2loc.c (read_pieced_value): Remove unnecessary variables
4574 dest_offset_bits and source_offset_bits.
4575 (write_pieced_value): Likewise.
4579 * dwarf2loc.c (read_pieced_value): Respect the piece offset, as
4580 given by DW_OP_bit_piece.
4581 (write_pieced_value): Likewise.
4585 * dwarf2loc.c (read_pieced_value): Move the buffer allocation and
4586 some other preparations to the places where sufficient information
4588 (write_pieced_value): Likewise.
4592 * dwarf2loc.c (bits_to_bytes): New function.
4593 (read_pieced_value): Fix offset calculations for register pieces
4594 on big-endian targets.
4595 (write_pieced_value): Likewise.
4599 * dwarf2loc.c (read_pieced_value): Remove buffer_size variable.
4600 (write_pieced_value): Likewise.
4604 * dwarf2loc.c (write_pieced_value): When writing to a bit-field,
4605 transfer the source value's least significant bits, instead of its
4606 lowest-addressed ones. Rename type_len to max_offset.
4607 (read_pieced_value): Mirror above changes to write_pieced_value as
4612 * dwarf2loc.c (write_pieced_value): In DWARF_VALUE_MEMORY,
4613 truncate full bytes from dest_offset_bits before using it as an
4614 offset into the buffer.
4618 * dwarf2loc.c (write_pieced_value): Include transfer size in
4623 * dwarf2loc.c (write_pieced_value): Fix copy/paste error in the
4624 calculation of this_size.
4628 * dwarf2loc.c (read_pieced_value): Respect parent value's offset
4629 when targeting a bit-field.
4630 (write_pieced_value): Likewise.
4634 * dwarf2loc.c (struct piece_closure) <addr_size>: Remove field.
4635 (allocate_piece_closure): Drop addr_size parameter.
4636 (dwarf2_evaluate_loc_desc_full): Adjust call to
4637 allocate_piece_closure.
4642 * dwarf2loc.c (read_pieced_value): Anchor stack value pieces at
4643 the LSB end, independent of endianness.
4647 * dwarf2loc.c (write_pieced_value): Fix order of calculations for
4652 * mips-linux-nat.c: Move include features/mips*-linux.c to
4654 (_initialize_mips_linux_nat): Move initialize_tdesc_mips* calls
4655 to mips-linux-tdep.c.
4656 * mips-linux-tdep.c: Include features/mips*-linux.c
4657 (_initialize_mips_linux_tdep): Call initialize_tdesc_mips*
4659 * mips-linux-tdep.h (tdesc_mips_linux): Declare.
4660 (tdesc_mips_dsp_linux, tdesc_mips64_linux): Declare.
4661 (tdesc_mips64_dsp_linux): Declare.
4665 * valprint.h (val_print_type_code_int): Remove.
4666 * valprint.c (generic_val_print_int): Always call
4667 val_print_scalar_formatted.
4668 (val_print_type_code_int): Remove.
4669 * printcmd.c (print_scalar_formatted): Handle options->format==0.
4670 * f-valprint.c (f_val_print): Use val_print_scalar_formatted.
4671 * c-valprint.c (c_val_print_int): Use val_print_scalar_formatted.
4672 * ada-valprint.c (ada_val_print_num): Use
4673 val_print_scalar_formatted.
4677 * printcmd.c (print_scalar_formatted): Unify the two switches.
4678 Don't convert scalars to LONGEST.
4683 * valprint.h (print_decimal_chars): Update.
4684 * valprint.c (maybe_negate_by_bytes): New function.
4685 (print_decimal_chars): Add "is_signed" argument.
4686 * printcmd.c (print_scalar_formatted): Update.
4691 * valprint.h (print_binary_chars, print_hex_chars): Update.
4692 * valprint.c (val_print_type_code_int): Update.
4693 (print_binary_chars): Add "zero_pad" argument.
4694 (emit_octal_digit): New function.
4695 (print_octal_chars): Don't zero-pad.
4696 (print_decimal_chars): Likewise.
4697 (print_hex_chars): Add "zero_pad" argument.
4698 * sh64-tdep.c (sh64_do_fp_register): Update.
4699 * regcache.c (regcache::dump): Update.
4700 * printcmd.c (print_scalar_formatted): Update.
4701 * infcmd.c (default_print_one_register_info): Update.
4706 * mips-tdep.c (MAX_MIPS_ABI_REGSIZE): New.
4707 (mips_eabi_push_dummy_call): Rename local 'regsize' to
4708 'abi_regsize'. Rename local array 'valbuf' to 'ref_valbuf', and
4709 use MAX_MIPS_ABI_REGSIZE instead of MAX_REGISTER_SIZE to size it.
4710 Assert that abi_regsize bytes fit in 'ref_valbuf'.
4714 * dwarf2read.c (mapped_symtab::data): Now a vector of
4715 symtab_index_entry instead of vector of
4716 std::unique_ptr<symtab_index_entry>. All users adjusted to check
4717 whether an element's name is NULL instead of checking whether the
4718 element itself is NULL.
4719 (find_slot): Change return type. Adjust.
4720 (hash_expand, , add_index_entry, uniquify_cu_indices)
4721 (write_hash_table): Adjust.
4725 * dwarf2read.c (recursively_count_psymbols): New function.
4726 (write_psymtabs_to_index): Call it to compute number of psyms and
4727 pass estimate size of psyms_seen to unordered_set's ctor.
4731 * dwarf2read.c (write_hash_table): Check if key already exists
4736 * dwarf2read.c (data_buf::append_space): Rename to...
4737 (data_buf::grow): ... this, and make private. Adjust all callers.
4738 (data_buf::append_uint): New method.
4739 (add_address_entry, write_one_signatured_type)
4740 (write_psymtabs_to_index): Use it.
4744 * dwarf2read.c (file_write(FILE *, const void *, size_t)): Delete.
4745 (file_write (FILE *, const std::vector<Elem>&)): Delete.
4746 (data_buf::file_write): Call ::fwrite directly.
4750 * dwarf2read.c (uniquify_cu_indices): Use std::unique and
4755 Code cleanup: C++ify .gdb_index producer.
4756 * dwarf2read.c: Include <unordered_set> and <unordered_map>.
4757 (MAYBE_SWAP) [WORDS_BIGENDIAN]: Cast to offset_type.
4758 (struct strtab_entry, hash_strtab_entry, eq_strtab_entry)
4759 (create_strtab, add_string): Remove.
4760 (file_write, data_buf): New.
4761 (struct symtab_index_entry): Use std::vector for cu_indices.
4762 (struct mapped_symtab): Use std::vector for data.
4763 (hash_symtab_entry, eq_symtab_entry, delete_symtab_entry)
4764 (create_symbol_hash_table, create_mapped_symtab, cleanup_mapped_symtab):
4766 (find_slot): Change return type. Update it to the new data structures.
4767 (hash_expand, add_index_entry): Update it to the new data structures.
4768 (offset_type_compare): Remove.
4769 (uniquify_cu_indices): Update it to the new data structures.
4770 (c_str_view, c_str_view_hasher, vector_hasher): New.
4771 (add_indices_to_cpool): Remove.
4772 (write_hash_table): Update it to the new data structures.
4773 (struct psymtab_cu_index_map, hash_psymtab_cu_index)
4774 (eq_psymtab_cu_index): Remove.
4775 (psym_index_map): New typedef.
4776 (struct addrmap_index_data): Change addr_obstack pointer to data_buf
4777 reference and std::unordered_map for cu_index_htab.
4778 (add_address_entry, add_address_entry_worker, write_address_map)
4779 (write_psymbols): Update it to the new data structures.
4780 (write_obstack): Remove.
4781 (struct signatured_type_index_data): Change types_list to a data_buf
4782 reference and psyms_seen to a std::unordered_set reference.
4783 (write_one_signatured_type, recursively_write_psymbols)
4784 (write_psymtabs_to_index): Update it to the new data structures.
4788 * NEWS (Changes since GDB 8.0): Announce {set,show} debug
4789 separate-debug-file commands.
4790 * symfile.h (separate_debug_file_debug): New global.
4791 * symfile.c (separate_debug_file_debug): New global.
4792 (separate_debug_file_exists, find_separate_debug_file): Add
4794 (_initialize_symfile): Add "set debug separate-debug-file"
4796 * build-id.c (build_id_to_debug_bfd,
4797 find_separate_debug_file_by_buildid): Add debug output.
4801 * gdbarch.sh (displaced_step_free_closure): Remove.
4802 * gdbarch.h, gdbarch.c: Re-generate.
4803 * aarch64-linux-tdep.c (aarch64_linux_init_abi): Don't set
4804 displaced_step_free_closure.
4805 * amd64-linux-tdep.c (amd64_linux_init_abi_common): Likewise.
4806 * arm-linux-tdep.c (arm_linux_init_abi): Likewise.
4807 * i386-linux-tdep.c (i386_linux_init_abi): Likewise.
4808 * rs6000-aix-tdep.c (rs6000_aix_init_osabi): Likewise.
4809 * rs6000-tdep.c (rs6000_gdbarch_init): Likewise.
4810 * s390-linux-tdep.c (s390_gdbarch_init): Likewise.
4811 * arch-utils.h (simple_displaced_step_free_closure): Remove.
4812 * arch-utils.c (simple_displaced_step_free_closure): Remove.
4813 * infrun.c (displaced_step_clear): Call xfree instead of
4814 gdbarch_displaced_step_free_closure.
4818 * common/common-utils.c (stringify_argv): Check for "arg[0] !=
4823 * mn10300-tdep.c (MN10300_MAX_REGISTER_SIZE): Add.
4824 (mn10300_extract_return_value): Use MN10300_MAX_REGISTER_SIZE.
4825 (mn10300_push_dummy_call): Likewise.
4829 * mi/mi-main.c (register_changed_p): Use value_contents_eq.
4833 * mi/mi-main.c (register_changed_p): Use cooked_read_value.
4837 * NEWS (Changes since GDB 8.0): Announce that GDBserver is now
4838 able to start inferiors using a shell.
4839 (New remote packets): Announce new packet "QStartupWithShell".
4840 * remote.c: Add PACKET_QStartupWithShell.
4841 (extended_remote_create_inferior): Handle new
4842 PACKET_QStartupWithShell.
4843 (remote_protocol_features) <QStartupWithShell>: New entry for
4844 PACKET_QStartupWithShell.
4845 (_initialize_remote): Call "add_packet_config_cmd" for
4851 * Makefile.in (HFILES_NO_SRCDIR): Add "common/common-inferior.h"
4852 and "nat/fork-inferior.h".
4853 * common/common-inferior.h: New file, with contents from
4855 * commom/common-utils.c: Include "common-utils.h".
4856 (stringify_argv): New function.
4857 * common/common-utils.h (stringify_argv): New prototype.
4858 * configure.nat: Add "fork-inferior.o" as a dependency for
4859 "*linux*", "fbsd*" and "nbsd*" hosts.
4860 * corefile.c (get_exec_file): Update comment.
4861 * darwin-nat.c (darwin_ptrace_him): Call "gdb_startup_inferior"
4862 instead of "startup_inferior".
4863 (darwin_create_inferior): Call "add_thread_silent" after
4865 * fork-child.c: Cleanup unnecessary includes.
4866 (SHELL_FILE): Move to "common/common-fork-child.c".
4867 (environ): Likewise.
4868 (exec_wrapper): Initialize.
4869 (get_exec_wrapper): New function.
4870 (breakup_args): Move to "common/common-fork-child.c"; rename to
4871 "breakup_args_for_exec".
4872 (escape_bang_in_quoted_argument): Move to
4873 "common/common-fork-child.c".
4874 (saved_ui): New variable.
4875 (prefork_hook): New function.
4876 (postfork_hook): Likewise.
4877 (postfork_child_hook): Likewise.
4878 (gdb_startup_inferior): Likewise.
4879 (fork_inferior): Move to "common/common-fork-child.c". Update
4880 function to support gdbserver.
4881 (startup_inferior): Likewise.
4882 * gdbcore.h (get_exec_file): Remove declaration.
4883 * gnu-nat.c (gnu_create_inferior): Call "gdb_startup_inferior"
4884 instead of "startup_inferior". Call "add_thread_silent" after
4886 * inf-ptrace.c: Include "nat/fork-inferior.h" and "utils.h".
4887 (inf_ptrace_create_inferior): Call "gdb_startup_inferior"
4888 instead of "startup_inferior". Call "add_thread_silent" after
4890 * inferior.h: Include "common-inferior.h".
4891 (trace_start_error): Move to "common/common-utils.h".
4892 (trace_start_error_with_name): Likewise.
4893 (fork_inferior): Move prototype to "nat/fork-inferior.h".
4894 (startup_inferior): Likewise.
4895 (gdb_startup_inferior): New prototype.
4896 * nat/fork-inferior.c: New file, with contents from "fork-child.c".
4897 * nat/fork-inferior.h: New file.
4898 * procfs.c (procfs_init_inferior): Call "gdb_startup_inferior"
4899 instead of "startup_inferior". Call "add_thread_silent" after
4901 * target.h (target_terminal_init): Move prototype to
4903 (target_terminal_inferior): Likewise.
4904 (target_terminal_ours): Likewise.
4905 * target/target.h (target_terminal_init): New prototype, moved
4907 (target_terminal_inferior): Likewise.
4908 (target_terminal_ours): Likewise.
4909 * utils.c (gdb_flush_out_err): New function.
4913 * Makefile.in (HFILES_NO_SRCDIR): Add "common/common-gdbthread.h".
4914 * common/common-gdbthread.h: New file, with parts from
4916 * gdbthread.h: Include "common-gdbthread.h".
4917 (switch_to_thread): Moved to "common/common-gdbthread.h".
4921 * Makefile.in (SFILES): Add "common/job-control.c".
4922 (HFILES_NO_SRCDIR): Add "common/job-control.h".
4923 (COMMON_OBS): Add "job-control.o".
4924 * common/job-control.c: New file, with contents from
4926 * common/job-control.h: New file, with contents from "terminal.h".
4927 * fork-child.c: Include "job-control.h".
4928 * inflow.c: Include "job-control.h".
4929 (gdb_setpgid): Move to "common/common-inflow.c".
4930 (_initialize_inflow): Move setting of "job_control" to
4931 "handle_job_control".
4932 * terminal.h (job_control): Moved to "common/common-terminal.h".
4933 (gdb_setpgid): Likewise.
4934 * top.c: Include "job_control.h".
4935 * utils.c: Likewise.
4936 (job_control): Moved to "job-control.c".
4940 * Makefile.in (SFILES): Add gdb_regex.c.
4941 (COMMON_OBS): Add gdb_regex.o.
4942 * ada-lang.c (ada_add_standard_exceptions)
4943 (ada_add_exceptions_from_frame, name_matches_regex)
4944 (ada_add_global_exceptions, ada_exceptions_list_1): Change regex
4945 parameter type to compiled_regex. Adjust.
4946 (ada_exceptions_list): Use compiled_regex.
4947 * break-catch-throw.c (exception_catchpoint::pattern): Now a
4948 std::unique_ptr<compiled_regex>.
4949 (exception_catchpoint::~exception_catchpoint): Remove regfree
4951 (check_status_exception_catchpoint): Adjust to use compiled_regex.
4952 (handle_gnu_v3_exceptions): Adjust to use compiled_regex.
4953 * breakpoint.c (solib_catchpoint::compiled): Now a
4954 std::unique_ptr<compiled_regex>.
4955 (solib_catchpoint::~solib_catchpoint): Remove regfree call.
4956 (check_status_catch_solib): Adjust to use compiled_regex.
4957 (add_solib_catchpoint): Adjust to use compiled_regex.
4958 * cli/cli-cmds.c (apropos_command): Use compiled_regex.
4959 * cli/cli-decode.c (apropos_cmd): Change regex parameter to
4960 compiled_regex reference. Adjust to use it.
4961 * cli/cli-decode.h: Remove struct re_pattern_buffer forward
4962 declaration. Include "gdb_regex.h".
4963 (apropos_cmd): Change regex parameter to compiled_regex reference.
4964 * gdb_regex.c: New file.
4965 * gdb_regex.h (make_regfree_cleanup, get_regcomp_error): Delete
4967 (class compiled_regex): New.
4968 * linux-tdep.c: Include "common/gdb_optional.h".
4969 (struct mapping_regexes): New, factored out from
4970 mapping_is_anonymous_p, and adjusted to use compiled_regex.
4971 (mapping_is_anonymous_p): Use mapping_regexes wrapped in a
4972 gdb::optional and remove cleanups. Adjust to compiled_regex.
4973 * probe.c: Include "common/gdb_optional.h".
4974 (collect_probes): Use compiled_regex and gdb::optional and remove
4976 * skip.c: Include "common/gdb_optional.h".
4977 (skiplist_entry::compiled_function_regexp): Now a
4978 gdb::optional<compiled_regex>.
4979 (skiplist_entry::compiled_function_regexp_is_valid): Delete field.
4980 (free_skiplist_entry): Remove regfree call.
4981 (compile_skip_regexp, skip_rfunction_p): Adjust to use
4982 compiled_regex and gdb::optional.
4983 * symtab.c: Include "common/gdb_optional.h".
4984 (search_symbols): Use compiled_regex and gdb::optional.
4985 * utils.c (do_regfree_cleanup, make_regfree_cleanup)
4986 (get_regcomp_error, compile_rx_or_error): Delete. Some bits moved
4991 * regcache.c (regcache::save): Avoid buffer use.
4992 (regcache::dump): Likewise.
4996 * sh-tdep.c (sh_pseudo_register_read): Remove
4998 (sh_pseudo_register_write): Likewise.
4999 * sh64-tdep.c (sh64_pseudo_register_read): Likewise.
5000 (sh64_pseudo_register_write): Likewise
5004 * aarch64-tdep.c (aarch64_store_return_value): Use
5006 (aarch64_pseudo_read_value): Likewise.
5007 (aarch64_pseudo_write): Likewise.
5011 * regformats/regdef.h (set_register_cache): Remove the
5016 * frame.c (frame_unwind_register_signed): Use
5017 frame_unwind_register_value.
5021 PR breakpoints/21553
5022 * breakpoint.c (create_breakpoints_sal_default)
5023 (init_breakpoint_sal, create_breakpoint_sal): Use
5024 gdb::unique_xmalloc_ptr for string parameters.
5025 (create_breakpoint): Constify 'extra_string' and 'cond_string'
5026 parameters. Replace cleanups with gdb::unique_xmalloc_ptr.
5027 (base_breakpoint_create_breakpoints_sal)
5028 (bkpt_create_breakpoints_sal, tracepoint_create_breakpoints_sal)
5029 (strace_marker_create_breakpoints_sal)
5030 (create_breakpoints_sal_default): Use gdb::unique_xmalloc_ptr for
5032 * breakpoint.h (breakpoint_ops::create_breakpoints_sal): Use
5033 gdb::unique_xmalloc_ptr for string parameters.
5034 (create_breakpoint): Constify 'extra_string' and 'cond_string'
5039 * alpha-tdep.c (alpha_register_to_value): Use
5040 get_frame_register_value.
5041 (alpha_value_to_register): Use ALPHA_REGISTER_SIZE.
5045 * ia64-tdep.c (IA64_MAX_FP_REGISTER_SIZE) Add.
5046 (ia64_register_to_value): Use IA64_MAX_FP_REGISTER_SIZE.
5047 (ia64_value_to_register): Likewise.
5048 (ia64_extract_return_value): Likewise.
5049 (ia64_store_return_value): Likewise.
5050 (ia64_push_dummy_call): Likewise.
5058 * x86-linux-nat.c (struct arch_lwp_info): Remove.
5062 * linux-nat.c (linux_nat_post_attach_wait): Remove FIRST
5064 (linux_nat_attach): Adjust call to linux_nat_post_attach_wait.
5068 * event-loop.c (poll_timers): Unallocate timer using delete
5073 * breakpoint.h (struct breakpoint_ops) <dtor>: Remove.
5074 (struct breakpoint) <~breakpoint>: New.
5075 (struct watchpoint): Inherit from breakpoint.
5078 (struct tracepoint): Inherit from breakpoint.
5080 * breakpoint.c (longjmp_breakpoint_ops): Remove.
5081 (struct longjmp_breakpoint): Inherit from breakpoint.
5082 <~longjmp_breakpoint>: New.
5084 (new_breakpoint_from_type): Remove casts.
5085 (watchpoint_in_thread_scope): Remove reference to base field.
5086 (watchpoint_del_at_next_stop): Likewise.
5087 (update_watchpoint): Likewise.
5088 (watchpoint_check): Likewise.
5089 (bpstat_check_watchpoint): Likewise.
5090 (set_longjmp_breakpoint): Likewise.
5091 (struct fork_catchpoint): Inherit from breakpoint.
5093 (struct solib_catchpoint): Inherit from breakpoint.
5094 <~solib_catchpoint>: New.
5096 (dtor_catch_solib): Change to ...
5097 (solib_catchpoint::~solib_catchpoint): ... this.
5098 (breakpoint_hit_catch_solib): Remove reference to base field.
5099 (add_solib_catchpoint): Likewise.
5100 (create_fork_vfork_event_catchpoint): Likewise.
5101 (struct exec_catchpoint): Inherit from breakpoint.
5102 <~exec_catchpoint>: New.
5104 (dtor_catch_exec): Change to ...
5105 (exec_catchpoint::~exec_catchpoint): ... this.
5106 (dtor_watchpoint): Change to ...
5107 (watchpoint::~watchpoint): ... this.
5108 (watch_command_1): Remove reference to base field.
5109 (catch_exec_command_1): Likewise.
5110 (base_breakpoint_dtor): Change to ...
5111 (breakpoint::~breakpoint): ... this.
5112 (base_breakpoint_ops): Remove dtor field value.
5113 (longjmp_bkpt_dtor): Change to ...
5114 (longjmp_breakpoint::~longjmp_breakpoint): ... this.
5115 (strace_marker_create_breakpoints_sal): Remove reference to base
5117 (delete_breakpoint): Don't manually call breakpoint destructor.
5118 (create_tracepoint_from_upload): Remove reference to base field.
5119 (trace_pass_set_count): Likewise.
5120 (initialize_breakpoint_ops): Don't initialize
5121 momentary_breakpoint_ops, don't set dtors.
5122 * ada-lang.c (struct ada_catchpoint): Inherit from breakpoint.
5123 <~ada_catchpoint>: New.
5125 (create_excep_cond_exprs): Remove reference to base field.
5126 (dtor_exception): Change to ...
5127 (ada_catchpoint::~ada_catchpoint): ... this.
5128 (dtor_catch_exception): Remove.
5129 (dtor_catch_exception_unhandled): Remove.
5130 (dtor_catch_assert): Remove.
5131 (create_ada_exception_catchpoint): Remove reference to base
5133 (initialize_ada_catchpoint_ops): Don't set dtors.
5134 * break-catch-sig.c (struct signal_catchpoint): Inherit from
5136 <~signal_catchpoint>: New.
5138 (signal_catchpoint_dtor): Change to ...
5139 (signal_catchpoint::~signal_catchpoint): ... this.
5140 (create_signal_catchpoint): Remove reference to base field.
5141 (initialize_signal_catchpoint_ops): Don't set dtor.
5142 * break-catch-syscall.c (struct syscall_catchpoint): Inherit
5144 <~syscall_catchpoint>: New.
5146 (dtor_catch_syscall): Change to ...
5147 (syscall_catchpoint::~syscall_catchpoint): ... this.
5148 (create_syscall_event_catchpoint): Remove reference to base
5150 (initialize_syscall_catchpoint_ops): Don't set dtor.
5151 * break-catch-throw.c (struct exception_catchpoint): Inherit
5153 <~exception_catchpoint>: New.
5155 (dtor_exception_catchpoint): Change to ...
5156 (exception_catchpoint::~exception_catchpoint): ... this.
5157 (handle_gnu_v3_exceptions): Remove reference to base field.
5158 (initialize_throw_catchpoint_ops): Don't set dtor.
5159 * ctf.c (ctf_get_traceframe_address): Remove reference to base
5161 * remote.c (remote_get_tracepoint_status): Likewise.
5162 * tracefile-tfile.c (tfile_get_traceframe_address): Likewise.
5163 * tracefile.c (tracefile_fetch_registers): Likewise.
5164 * tracepoint.c (actions_command): Likewise.
5165 (validate_actionline): Likewise.
5166 (tfind_1): Likewise.
5167 (get_traceframe_location): Likewise.
5168 (find_matching_tracepoint_location): Likewise.
5169 (parse_tracepoint_status): Likewise.
5170 * mi/mi-cmd-break.c (mi_cmd_break_passcount): Likewise.
5174 * breakpoint.c (struct longjmp_breakpoint): New struct.
5175 (is_tracepoint_type): Change return type to bool.
5176 (is_longjmp_type): New function.
5177 (new_breakpoint_from_type): Handle longjmp kinds of breakpoints.
5178 (set_raw_breakpoint_without_location): Use
5179 new_breakpoint_from_type.
5180 (set_raw_breakpoint): Likewise.
5184 * breakpoint.c (new_breakpoint_from_type): New function.
5185 (create_breakpoint_sal): Use new_breakpoint_from_type and
5187 (create_breakpoint): Likewise.
5191 * memattr.c (mem_info_command): Rename to ...
5192 (info_mem_command): ... this.
5193 (mem_enable_command): Rename to ...
5194 (enable_mem_command): ... this.
5195 (mem_disable_command): Rename to ...
5196 (disable_mem_command): ... this.
5197 (mem_delete_command): Rename to ...
5198 (delete_mem_command): ... this.
5199 (_initialize_mem): Adjust function names.
5203 * btrace.c (handle_pt_insn_events): New.
5204 (ftrace_add_pt): Call handle_pt_insn_events. Rename ERRCODE into
5205 STATUS. Split into this and ...
5206 (handle_pt_insn_event_flags): ... this.
5210 * configure.ac: Check for pt_insn_event, struct pt_insn.enabled,
5211 and struct pt_insn.resynced.
5212 * configure: Regenerated.
5213 * config.in: Regenerated.
5217 * btrace.c (ftrace_find_call_by_number): New function.
5218 (ftrace_new_function): Store objects, not pointers.
5219 (ftrace_find_call_by_number, ftrace_new_return, ftrace_new_switch,
5220 ftrace_new_gap, ftrace_update_function,
5221 ftrace_compute_global_level_offset, btrace_stich_bts, btrace_clear,
5222 btrace_insn_get, btrace_insn_get_error, btrace_insn_end,
5223 btrace_insn_next, btrace_insn_prev, ptrace_find_insn_by_number,
5224 btrace_ends_with_single_insn, btrace_call_get): Account for
5225 btrace_thread_info::functions now storing objects.
5226 * btrace.h (struct btrace_thread_info): Add constructor.
5227 (struct btrace_thread_info) <functions>: Make std::vector.
5228 (struct btrace_thread_info) <prev, next, up, insn, errcode, flags):
5229 Initialize with default values.
5230 * record-btrace.c (record_btrace_frame_sniffer): Account for
5231 btrace_thread_info::functions now storing objects.
5235 * btrace.c: Remove typedef bfun_s.
5236 (ftrace_new_gap): Directly add gaps to the list of gaps.
5237 (btrace_bridge_gaps, btrace_compute_ftrace_bts, pt_btrace_insn_flags,
5238 ftrace_add_pt, btrace_compute_ftrace_pt, btrace_compute_ftrace_1,
5239 btrace_finalize_ftrace, btrace_compute_ftrace): Use std::vector
5244 * btrace.c (ftrace_fixup_caller, ftrace_new_return, ftrace_connect_bfun,
5245 ftrace_bridge_gap): Replace references to btrace_thread_info::segment
5246 with btrace_thread_info::next_segment and
5247 btrace_thread_info::prev_segment.
5248 * btrace.h: Remove struct btrace_func_link.
5249 (struct btrace_function): Replace pair of function segment pointers
5250 with pair of indices.
5251 * python/py-record-btrace.c (btpy_call_prev_sibling,
5252 btpy_call_next_sibling): Replace references to
5253 btrace_thread_info::segment with btrace_thread_info::next_segment and
5254 btrace_thread_info::prev_segment.
5255 * record-btrace.c (record_btrace_frame_this_id): Use
5256 btrace_find_call_by_number.
5260 * btrace.c (ftrace_new_function, ftrace_fixup_level,
5261 ftrace_connect_bfun, ftrace_bridge_gap, btrace_bridge_gaps,
5262 btrace_insn_next, btrace_insn_prev): Remove references to
5263 btrace_thread_info::flow.
5264 * btrace.h (struct btrace_function): Remove FLOW.
5268 * btrace.c (ftrace_find_call_by_number): New function.
5269 (ftrace_update_caller, ftrace_new_call, ftrace_new_tailcall,
5270 ftrace_get_caller, ftrace_find_call, ftrace_new_return,
5271 ftrace_match_backtrace, ftrace_connect_bfun, ftrace_connect_backtrace,
5272 ftrace_bridge_gap, btrace_bridge_gaps): Use btrace_function::up as an
5274 * btrace.h (struct btrace_function): Turn UP into an index.
5275 * python/py-record-btrace.c (btpy_call_up): Use btrace_function::up
5277 * record-btrace.c (record_btrace_frame_unwind_stop_reason,
5278 record_btrace_frame_prev_register, record_btrace_frame_sniffer,
5279 record_btrace_tailcall_frame_sniffe): Use btrace_find_call_by_number.
5283 * btrace.c (ftrace_new_function, ftrace_new_call, ftrace_new_tailcall,
5284 ftrace_new_return, ftrace_new_switch, ftrace_new_gap,
5285 ftrace_update_function, ftrace_compute_global_level_offset,
5286 btrace_compute_ftrace_bts, ftrace_add_pt, btrace_compute_ftrace_pt,
5287 btrace_stitch_bts, btrace_fetch, btrace_clear, btrace_insn_number,
5288 btrace_insn_end, btrace_is_empty): Remove references to
5289 btrace_thread_info::begin and btrace_thread_info::end.
5290 * btrace.h (struct btrace_thread_info): Remove BEGIN and END.
5291 (struct btrace_thread_info) <functions>: Adjust comment.
5292 * record-btrace.c (record_btrace_start_replaying): Remove reference to
5293 btrace_thread_info::begin.
5297 * btrace.c (ftrace_new_function, ftrace_new_call, ftrace_new_tailcall,
5298 ftrace_new_return, ftrace_new_switch, ftrace_new_gap,
5299 ftrace_update_function): Remove arguments that implicitly were always
5301 (btrace_compute_ftrace_bts, ftrace_add_pt, btrace_compute_ftrace_pt):
5302 Don't pass BTINFO->END.
5306 * btrace.c: (btrace_insn_get, btrace_insn_get_error, btrace_insn_number,
5307 btrace_insn_begin, btrace_insn_end, btrace_insn_next, btrace_insn_prev,
5308 btrace_find_insn_by_number): Replace function segment pointer with
5310 (btrace_insn_cmp): Simplify.
5311 * btrace.h: (struct btrace_insn_iterator) Rename index to
5312 insn_index. Replace function segment pointer with index into function
5314 * record-btrace.c (record_btrace_call_history): Replace function
5315 segment pointer use with index.
5316 (record_btrace_frame_sniffer): Retrieve function call segment through
5318 (record_btrace_set_replay): Remove defunc't safety check.
5322 * btrace.c (btrace_ends_with_single_insn): New function.
5323 (btrace_call_get, btrace_call_number, btrace_call_begin,
5324 btrace_call_end, btrace_call_next, btrace_call_prev,
5325 btrace_find_call_by_number): Use index into call segment vector
5327 (btrace_call_cmp): Simplify.
5328 * btrace.h (struct btrace_call_iterator): Replace function call segment
5329 pointer with index into vector.
5330 * record-btrace.c (record_btrace_call_history): Use index instead of
5335 * btrace.c (btrace_insn_begin, btrace_insn_end,
5336 btrace_find_insn_by_number): Add btinfo to iterator.
5337 * btrace.h (struct btrace_insn_iterator): Add btinfo.
5341 * btrace.c (ftrace_new_function): Add btrace_thread_info to arguments
5342 and save pointers directly.
5343 (ftrace_new_call, ftrace_new_tailcall, ftrace_new_return,
5344 ftrace_new_switch, ftrace_new_gap, ftrace_update_function,
5345 ftrace_add_pt): Add btrace_thread_info to arguments. Adjust for
5346 changed signature of functions.
5347 (btrace_compute_ftrace_pt): Adjust for changed signature of functions.
5348 (btrace_fetch): Remove code that adds btrace_function pointers to
5349 vector of btrace_functions.
5350 (btrace_clear): Simplify freeing vector of btrace_functions.
5354 * btrace.c (btrace_fetch, btrace_clear, btrace_find_insn_by_number):
5355 Replace VEC_* with std::vector functions.
5356 * btrace.h: Add include: vector. Remove typedef for DEF_VEC_P.
5357 (struct btrace_thread_info)<functions>: Change type to std::vector.
5361 * NEWS (Changes in GDB 8.0): Remove extra empty line. Move
5362 "Removed targets and native configurations" up. Merge duplicate
5363 "New commands" sub-sections. Add "New options" sub-sections.
5367 * defs.h (copy_integer_to_size): New declaration.
5368 * findvar.c (copy_integer_to_size): New function.
5369 (do_cint_test): New selftest function.
5370 (copy_integer_to_size_test): Likewise.
5371 (_initialize_findvar): Likewise.
5372 * mips-fbsd-tdep.c (mips_fbsd_supply_reg): Use raw_supply_integer.
5373 (mips_fbsd_collect_reg): Use raw_collect_integer.
5374 * mips-linux-tdep.c (supply_32bit_reg): Use raw_supply_integer.
5375 (mips64_fill_gregset): Use raw_collect_integer
5376 (mips64_fill_fpregset): Use raw_supply_integer.
5377 * regcache.c (regcache::raw_supply_integer): New function.
5378 (regcache::raw_collect_integer): Likewise.
5379 * regcache.h: (regcache::raw_supply_integer): New declaration.
5380 (regcache::raw_collect_integer): Likewise.
5384 * Makefile.in (SFILES): Add gdbarch-selftests.c.
5385 (COMMON_OBS): Add gdbarch-selftests.o.
5386 * frame.c [GDB_SELF_TESTS] (create_new_frame): New function.
5387 * frame.h [GDB_SELF_TESTS] (create_new_frame): Declare.
5388 * gdbarch-selftests.c: New file.
5389 * regcache.h (regcache) <~regcache>: Mark it virtual if
5391 <raw_write>: Likewise.
5395 * regcache.c (current_regcache): Change it to
5396 regcache::current_regcache.
5397 (regcache_observer_target_changed): Update.
5398 (regcache_thread_ptid_changed): Make it a regcache static
5400 (regcache_thread_ptid_changed): Update.
5401 (class regcache_access): New.
5402 (current_regcache_test): Update.
5403 (_initialize_regcache): Update.
5404 * regcache.h: Include forward_list.
5405 (regcache): Declare regcache_thread_ptid_changed and declare
5406 registers_changed_ptid as friend.
5410 * i387-tdep.c (i387_register_to_value): Use register_size
5411 instead of TYPE_LENGTH.
5412 * m68k-tdep.c (m68k_register_to_value): Likewise.
5416 * i387-tdep.c (i387_convert_register_p): Return false if type
5417 code isn't TYPE_CODE_FLT.
5421 * alpha-tdep.c (alpha_convert_register_p): Return true if type
5423 (alpha_register_to_value): Remove type length check.
5424 (alpha_value_to_register): Likewise.
5428 * ia64-tdep.c (ia64_convert_register_p): Check type's code is
5433 * m68k-tdep.c (m68k_convert_register_p): Check type's code is
5434 TYPE_CODE_FLT or not.
5438 * alpha-tdep.c (alpha_gdbarch_init): Use XCNEW instead of XNEW.
5439 * avr-tdep.c (avr_gdbarch_init): Likewise.
5440 * bfin-tdep.c (bfin_gdbarch_init): Likewise.
5441 * cris-tdep.c (cris_gdbarch_init): Likewise.
5442 * ft32-tdep.c (ft32_gdbarch_init): Likewise.
5443 * lm32-tdep.c (lm32_gdbarch_init): Likewise.
5444 * m32r-tdep.c (m32r_gdbarch_init): Likewise.
5445 * m68hc11-tdep.c (m68hc11_gdbarch_init): Likewise.
5446 * mep-tdep.c (mep_gdbarch_init): Likewise.
5447 * microblaze-tdep.c (microblaze_gdbarch_init): Likewise.
5448 * mips-tdep.c (mips_gdbarch_init): Likewise.
5449 * mn10300-tdep.c (mn10300_gdbarch_init): Likewise.
5450 * moxie-tdep.c (moxie_gdbarch_init): Likewise.
5451 * msp430-tdep.c (msp430_gdbarch_init): Likewise.
5452 * sh64-tdep.c (sh64_gdbarch_init): Likewise.
5453 * v850-tdep.c (v850_gdbarch_init): Likewise.
5457 * selftest-arch.c (tests_with_arch): Call registers_changed
5458 and reinit_frame_cache.
5459 * selftest.c (run_self_tests): Likewise.
5463 * rs6000-tdep.c (gdb_print_insn_powerpc): Remove.
5464 (rs6000_gdbarch_init): Don't call set_gdbarch_print_insn.
5468 * rl78-tdep.c (rl78_gdbarch_init): Don't call
5469 set_gdbarch_print_insn.
5473 * h8300-tdep.c (h8300_gdbarch_init): Don't call
5474 set_gdbarch_print_insn.
5478 * alpha-tdep.c (alpha_gdbarch_init): Don't call
5479 set_gdbarch_print_insn.
5480 * arc-tdep.c (arc_gdbarch_init): Likewise.
5481 * arch-utils.c: include dis-asm.h.
5482 (default_print_insn): New function.
5483 * arch-utils.h (default_print_insn): Declare.
5484 * avr-tdep.c (avr_gdbarch_init): Don't call set_gdbarch_print_insn.
5485 * bfin-tdep.c (bfin_gdbarch_init): Likewise.
5486 * cris-tdep.c (cris_delayed_get_disassembler): Remove.
5487 (cris_gdbarch_init): Don't call set_gdbarch_print_insn.
5488 * frv-tdep.c (frv_gdbarch_init): Likewise.
5489 * ft32-tdep.c (ft32_gdbarch_init): Likewise.
5490 * gdbarch.sh (print_insn): Use default_print_insn.
5491 * gdbarch.c: Regenerated.
5492 * hppa-tdep.c (hppa_gdbarch_init): Likewise.
5493 * iq2000-tdep.c (iq2000_gdbarch_init): Likewise.
5494 * lm32-tdep.c (lm32_gdbarch_init): Likewise.
5495 * m32c-tdep.c (m32c_gdbarch_init): Likewise.
5496 * m32r-tdep.c (m32r_gdbarch_init): Likewise.
5497 * m68hc11-tdep.c (gdb_print_insn_m68hc11): Remove.
5498 (m68hc11_gdbarch_init): Don't call set_gdbarch_print_insn.
5499 * m68k-tdep.c (m68k_gdbarch_init): Likewise.
5500 * m88k-tdep.c (m88k_gdbarch_init): Likewise.
5501 * microblaze-tdep.c (microblaze_gdbarch_init): Likewise.
5502 * mn10300-tdep.c (mn10300_gdbarch_init): Likewise.
5503 * moxie-tdep.c (moxie_gdbarch_init): Likewise.
5504 * msp430-tdep.c (msp430_gdbarch_init): Likewise.
5505 * mt-tdep.c (mt_gdbarch_init): Likewise.
5506 * nds32-tdep.c (nds32_gdbarch_init): Likewise.
5507 * nios2-tdep.c (nios2_print_insn): Remove.
5508 (nios2_gdbarch_init): Don't call set_gdbarch_print_insn.
5509 * rx-tdep.c (rx_gdbarch_init): Likewise.
5510 * s390-linux-tdep.c (s390_gdbarch_init): Likewise.
5511 * score-tdep.c (score_print_insn): Remove.
5512 (score_gdbarch_init): Don't call set_gdbarch_print_insn.
5513 * sh-tdep.c (sh_gdbarch_init): Likewise.
5514 * sh64-tdep.c (sh64_gdbarch_init): Likewise.
5515 * sparc-tdep.c (sparc32_gdbarch_init): Likewise.
5516 * tic6x-tdep.c (tic6x_print_insn): Remove.
5517 (tic6x_gdbarch_init): Don't call set_gdbarch_print_insn.
5518 * tilegx-tdep.c (tilegx_gdbarch_init): Likewise.
5519 * v850-tdep.c (v850_gdbarch_init): Likewise.
5520 * vax-tdep.c (vax_gdbarch_init): Likewise.
5521 * xstormy16-tdep.c (xstormy16_gdbarch_init): Likewise.
5522 * xtensa-tdep.c (xtensa_gdbarch_init): Likewise.
5526 * mips-fbsd-tdep.c (MIPS_PC_REGNUM): Remove.
5527 (MIPS_FP0_REGNUM): Remove.
5528 (MIPS_FSR_REGNUM): Remove.
5529 (mips_fbsd_supply_fpregs): Use mips_regnum.
5530 (mips_fbsd_supply_gregs): Likewise.
5531 (mips_fbsd_collect_fpregs): Likewise.
5532 (mips_fbsd_collect_gregs): Likewise.
5536 * mips-fbsd-nat.c (getregs_supplies): Fix upper bound comparison.
5537 (getpfpregs_supplies): New function.
5538 (mips_fbsd_fetch_inferior_registers): Remove early exit and use
5540 (mips_fbsd_store_inferior_registers): Likewise.
5544 * MAINTAINERS (Host/Native): Add John Baldwin as FreeBSD
5549 * ppc-linux-nat.c (fetch_register): Use PPC_MAX_REGISTER_SIZE.
5550 (store_register): Likewise.
5551 * ppc-sysv-tdep.c (ppc_sysv_abi_push_dummy_call): Likewise.
5552 (get_decimal_float_return_value): Likewise.
5553 (do_ppc_sysv_return_value): Likewise.
5554 (ppc64_sysv_abi_push_integer): Likewise.
5555 (ppc64_sysv_abi_push_freg): Likewise.
5556 (ppc64_sysv_abi_return_value_base): Likewise.
5557 (ppc64_sysv_abi_return_value): Likewise.
5558 * rs6000-aix-tdep.c (rs6000_push_dummy_call): Likewise.
5559 * rs6000-lynx178-tdep.c (rs6000_lynx178_push_dummy_call): Likewise.
5560 * rs6000-nat.c: Likewise.
5561 * rs6000-tdep.c (rs6000_register_to_value): Likewise.
5562 (rs6000_value_to_register): Likewise.
5563 * ppc-tdep.h (PPC_MAX_REGISTER_SIZE): Add.
5568 * rust-lang.c (rust_print_type) <TYPE_CODE_ARRAY>: Print unsized
5569 arrays as "[T]", not "[T; ]".
5574 * rust-lang.c (exp_descriptor_rust): New function.
5575 (rust_language_defn): Use it.
5576 * p-lang.c (pascal_language_defn): Update.
5577 * opencl-lang.c (opencl_language_defn): Update.
5578 * objc-lang.c (objc_language_defn): Update.
5579 * m2-lang.c (m2_language_defn): Update.
5580 * language.h (struct language_defn)
5581 <la_watch_location_expression>: New member.
5582 * language.c (unknown_language_defn, auto_language_defn)
5583 (local_language_defn): Update.
5584 * go-lang.c (go_language_defn): Update.
5585 * f-lang.c (f_language_defn): Update.
5586 * d-lang.c (d_language_defn): Update.
5587 * c-lang.h (c_watch_location_expression): Declare.
5588 * c-lang.c (c_watch_location_expression): New function.
5589 (c_language_defn, cplus_language_defn, asm_language_defn)
5590 (minimal_language_defn): Use it.
5591 * breakpoint.c (watch_command_1): Call
5592 la_watch_location_expression.
5593 * ada-lang.c (ada_language_defn): Update.
5598 * gdb_curses.h (NOMACROS): Define.
5599 (NCURSES_NOMACROS): Define.
5604 * tui/tui-windata.c (tui_erase_data_content): Cast last mvwaddstr
5606 * tui/tui-wingeneral.c (box_win): Likewise.
5607 * tui/tui-winsource.c (tui_erase_source_content): Likewise.
5608 (tui_show_source_line): Likewise.
5609 (tui_show_exec_info_content): Likewise.
5613 * sparc-tdep.c (sparc_structure_return_p)
5614 (sparc_arg_on_registers_p): New functions.
5615 (sparc32_store_arguments): Use them.
5616 * sparc64-tdep.c (sparc64_16_byte_align_p)
5617 (sparc64_store_floating_fields, sparc64_extract_floating_fields):
5618 Handle TYPE_CODE_ARRAY.
5622 * cli/cli-decode.c (add_alias_cmd): New function.
5623 * command.h (add_alias_cmd): Declare.
5624 * infcmd.c (_initialize_infcmd): Don't call add_com_alias,
5625 instead call add_alias_cmd.
5629 * Makefile.in (nat_extra_makefile_frag): Rename to ...
5630 (nat_makefile_frag): ... this. All references updated.
5631 * configure.ac: Likewise.
5632 * configure.nat: Likewise. Enhance comments.
5633 * configure: Regenerate.
5637 * procfs.c (procfs_create_inferior): Change prototype to match
5642 * tui/tui.c (tui_enable): Cast "unknown" to 'char *' to avoid a
5643 C++ compiler warning.
5648 * rust-lang.c (rust_evaluate_subexp) <STRUCTOP_STRUCT>: Don't
5649 recurse, just call value_struct_elt directly.
5653 * rust-lang.c (rust_dump_subexp_body) <STRUCTOP_ANONYMOUS,
5654 OP_RUST_ARRAY>: Fix.
5658 * rust-lang.c (rust_print_subexp): Replace "return" with "break".
5662 * regcache.c: Include <forward_list>.
5663 (struct regcache_list): Remove.
5664 (current_regcache): Update.
5665 (get_thread_arch_aspace_regcache): Update for std::forward_list.
5666 (regcache_thread_ptid_changed): Likewise.
5667 (registers_changed_ptid): Likewise.
5668 (current_regcache_size): Likewise.
5672 * regcache.c [GDB_SELF_TEST]: Include selftest.h.
5673 (current_regcache_size): New function.
5674 (current_regcache_test): New function.
5675 (_initialize_regcache) [GDB_SELF_TEST]: Register the unit test.
5679 * mips-tdep.c (mips_o32_return_value): Remove unused buffer.
5680 (print_gp_register_row): Use get_frame_register_value.
5684 * mips-linux-tdep.c (mips_supply_gregset): Use raw_supply_zeroed.
5685 (mips_supply_fpregset): Likewise.
5686 (mips64_supply_gregset): Likewise.
5690 * mn10300-linux-tdep.c (am33_supply_gregset_method): Use
5691 regcache->raw_supply_zeroed.
5695 * configure.nat: Rearrange 'case' statements to match
5700 * Makefile.in: Remove "@host_makefile_frag@". Add variables
5701 NAT_FILE, NATDEPFILES, NAT_CDEPS, LOADLIBES, MH_CFLAGS, XM_CLIBS,
5702 NAT_GENERATED_FILES, HAVE_NATIVE_GCORE_HOST. Add
5703 "@nat_extra_makefile_frag@".
5704 (Makefile): Remove dependency on "@frags@".
5705 ($(GNULIB_BUILDDIR)/Makefile): Likewise.
5706 (data-directory/Makefile): Likewise.
5707 * config/aarch64/linux.mh: Deleted; moved contents to
5708 "gdb/configure.nat".
5709 * config/alpha/alpha-linux.mh: Likewise.
5710 * config/alpha/nbsd.mh: Likewise.
5711 * config/arm/linux.mh: Likewise.
5712 * config/arm/nbsdelf.mh: Likewise.
5713 * config/i386/cygwin.mh: Likewise.
5714 * config/i386/cygwin64.mh: Likewise.
5715 * config/i386/darwin.mh: Likewise.
5716 * config/i386/fbsd.mh: Likewise.
5717 * config/i386/fbsd64.mh: Likewise.
5718 * config/i386/go32.mh: Likewise.
5719 * config/i386/i386gnu.mh: Likewise.
5720 * config/i386/i386sol2.mh: Likewise.
5721 * config/i386/linux.mh: Likewise.
5722 * config/i386/linux64.mh: Likewise.
5723 * config/i386/mingw.mh: Likewise.
5724 * config/i386/mingw64.mh: Likewise.
5725 * config/i386/nbsd64.mh: Likewise.
5726 * config/i386/nbsdelf.mh: Likewise.
5727 * config/i386/nto.mh: Likewise.
5728 * config/i386/obsd.mh: Likewise.
5729 * config/i386/obsd64.mh: Likewise.
5730 * config/i386/sol2-64.mh: Likewise.
5731 * config/ia64/linux.mh: Likewise.
5732 * config/m32r/linux.mh: Likewise.
5733 * config/m68k/linux.mh: Likewise.
5734 * config/m68k/nbsdelf.mh: Likewise.
5735 * config/m68k/obsd.mh: Likewise.
5736 * config/m88k/obsd.mh: Likewise.
5737 * config/mips/fbsd.mh: Likewise.
5738 * config/mips/linux.mh: Likewise.
5739 * config/mips/nbsd.mh: Likewise.
5740 * config/mips/obsd64.mh: Likewise.
5741 * config/pa/linux.mh: Likewise.
5742 * config/pa/nbsd.mh: Likewise.
5743 * config/pa/obsd.mh: Likewise.
5744 * config/powerpc/aix.mh: Likewise.
5745 * config/powerpc/fbsd.mh: Likewise.
5746 * config/powerpc/linux.mh: Likewise.
5747 * config/powerpc/nbsd.mh: Likewise.
5748 * config/powerpc/obsd.mh: Likewise.
5749 * config/powerpc/ppc64-linux.mh: Likewise.
5750 * config/powerpc/spu-linux.mh: Likewise.
5751 * config/s390/linux.mh: Likewise.
5752 * config/sh/nbsd.mh: Likewise.
5753 * config/sparc/fbsd.mh: Likewise.
5754 * config/sparc/linux.mh: Likewise.
5755 * config/sparc/linux64.mh: Likewise.
5756 * config/sparc/nbsd64.mh: Likewise.
5757 * config/sparc/nbsdelf.mh: Likewise.
5758 * config/sparc/obsd64.mh: Likewise.
5759 * config/sparc/sol2.mh: Likewise.
5760 * config/tilegx/linux.mh: Likewise.
5761 * config/vax/nbsdelf.mh: Likewise.
5762 * config/vax/obsd.mh: Likewise.
5763 * config/xtensa/linux.mh: Likewise.
5764 * config/i386/i386gnu.mn: New file, with excerpts from
5765 "config/i386/i386gnu.mh".
5766 * configure: Regenerate.
5767 * configure.ac: Rewrite code to use "gdb/configure.nat" instead of
5768 *.mh files under "gdb/config".
5769 * configure.nat: New file, with contents from the
5770 "gdb/config/*/*.mh" files.
5774 * btrace.c (btrace_clear): Free insn vector.
5778 * warning.m4 (build_warnings): Add -Wno-error=maybe-uninitialized.
5779 * configure: Regenerate.
5783 * Makefile.in (SFILES): Add progspace-and-thread.c.
5784 (HFILES_NO_SRCDIR): Add progspace-and-thread.h.
5785 (COMMON_OBS): Add progspace-and-thread.o.
5786 * breakpoint.c: Include "progspace-and-thread.h".
5787 (update_inserted_breakpoint_locations)
5788 (insert_breakpoint_locations, create_longjmp_master_breakpoint):
5789 Use scoped_restore_current_pspace_and_thread.
5790 (create_std_terminate_master_breakpoint): Use
5791 scoped_restore_current_program_space.
5792 (remove_breakpoint): Use scoped_restore_current_pspace_and_thread.
5793 (print_breakpoint_location): Use
5794 scoped_restore_current_program_space.
5795 (bp_loc_is_permanent): Use
5796 scoped_restore_current_pspace_and_thread.
5797 (resolve_sal_pc): Use scoped_restore_current_pspace_and_thread.
5798 (download_tracepoint_locations): Use
5799 scoped_restore_current_pspace_and_thread.
5800 (breakpoint_re_set): Use scoped_restore_current_pspace_and_thread.
5801 * exec.c (exec_close_1): Use scoped_restore_current_program_space.
5802 (enum step_over_calls_kind): Moved from inferior.h.
5803 (class scoped_restore_current_thread): New class.
5804 * gdbthread.h (make_cleanup_restore_current_thread): Delete
5806 (scoped_restore_current_thread): New class.
5807 * infcmd.c: Include "common/gdb_optional.h".
5808 (continue_1, proceed_after_attach): Use
5809 scoped_restore_current_thread.
5810 (notice_new_inferior): Use scoped_restore_current_thread.
5811 * inferior.c: Include "progspace-and-thread.h".
5812 (restore_inferior, save_current_inferior): Delete.
5813 (add_inferior_command, clone_inferior_command): Use
5814 scoped_restore_current_pspace_and_thread.
5815 * inferior.h (scoped_restore_current_inferior): New class.
5816 * infrun.c: Include "progspace-and-thread.h" and
5817 "common/gdb_optional.h".
5818 (follow_fork_inferior): Use
5819 scoped_restore_current_pspace_and_thread.
5820 (scoped_restore_exited_inferior): New class.
5821 (handle_vfork_child_exec_or_exit): Use
5822 scoped_restore_exited_inferior,
5823 scoped_restore_current_pspace_and_thread,
5824 scoped_restore_current_thread and scoped_restore.
5825 (fetch_inferior_event): Use scoped_restore_current_thread.
5826 * linespec.c (decode_line_full, decode_line_1): Use
5827 scoped_restore_current_program_space.
5828 * mi/mi-main.c: Include "progspace-and-thread.h".
5829 (exec_continue): Use scoped_restore_current_thread.
5830 (mi_cmd_exec_run): Use scoped_restore_current_pspace_and_thread.
5831 (mi_cmd_trace_frame_collected): Use scoped_restore_current_thread.
5832 * proc-service.c (ps_pglobal_lookup): Use
5833 scoped_restore_current_program_space.
5834 * progspace-and-thread.c: New file.
5835 * progspace-and-thread.h: New file.
5836 * progspace.c (release_program_space, clone_program_space): Use
5837 scoped_restore_current_program_space.
5838 (restore_program_space, save_current_program_space)
5839 (save_current_space_and_thread): Delete.
5840 (switch_to_program_space_and_thread): Moved to
5841 progspace-and-thread.c.
5842 * progspace.h (save_current_program_space)
5843 (save_current_space_and_thread): Delete declarations.
5844 (scoped_restore_current_program_space): New class.
5845 * remote.c (remote_btrace_maybe_reopen): Use
5846 scoped_restore_current_thread.
5847 * symtab.c: Include "progspace-and-thread.h".
5848 (skip_prologue_sal): Use scoped_restore_current_pspace_and_thread.
5849 * thread.c (print_thread_info_1): Use
5850 scoped_restore_current_thread.
5851 (struct current_thread_cleanup): Delete.
5852 (do_restore_current_thread_cleanup)
5853 (restore_current_thread_cleanup_dtor): Rename/convert both to ...
5854 (scoped_restore_current_thread::~scoped_restore_current_thread):
5856 (make_cleanup_restore_current_thread): Rename/convert to ...
5857 (scoped_restore_current_thread::scoped_restore_current_thread):
5859 (thread_apply_all_command): Use scoped_restore_current_thread.
5860 (thread_apply_command): Use scoped_restore_current_thread.
5861 * tracepoint.c (tdump_command): Use scoped_restore_current_thread.
5862 * varobj.c (value_of_root_1): Use scoped_restore_current_thread.
5866 * thread.c (make_cleanup_restore_current_thread): Move
5867 find_thread_ptid call before the is_stopped call. Assert that the
5868 thread is found. Replace is_stopped call by checking the thread's
5869 state directly. Remove unnecessary NULL-thread check.
5873 * corelow.c (thread_section_name): New class.
5874 (get_core_register_section, get_core_siginfo): Use it.
5878 * corelow.c (sniff_core_bfd): Remove extra semicolon.
5879 (get_core_register_section): Remove xfree of NULL pointer.
5883 * frv-linux-tdep.c (frv_linux_supply_gregset): Use raw_supply_zeroed.
5884 * regcache.c (regcache::raw_supply_zeroed): New function.
5885 * regcache.h (regcache::raw_supply_zeroed): New declaration.
5889 * gdbarch.sh: Remove commented out definition of
5891 * gdbarch.h: Re-generate.
5895 * configure: Regenerate.
5899 * solib-target.c (solib_target_relocate_section_addresses):
5900 Remove num_section_bases, num_bases, segment_bases variables.
5904 * common/gdb_vecs.h (DEF_VEC_I (CORE_ADDR)): Remove.
5908 * solib-target.c: Include <vector>
5909 (struct lm_info_target) <~lm_info_target>: Remove.
5910 <segment_bases, section_bases>: Change type to
5911 std::vector<CORE_ADDR>.
5912 (library_list_start_segment, library_list_start_section,
5913 library_list_end_library,
5914 solib_target_relocate_section_addresses): Adjust.
5918 * gdbarch.sh (software_single_step): Change return type to
5919 std::vector<CORE_ADDR>.
5920 * gdbarch.c, gdbarch.h: Re-generate.
5921 * arch/arm-get-next-pcs.c (thumb_deal_with_atomic_sequence_raw):
5923 (arm_deal_with_atomic_sequence_raw): Adjust.
5924 (thumb_get_next_pcs_raw): Adjust.
5925 (arm_get_next_pcs_raw): Adjust.
5926 (arm_get_next_pcs): Adjust.
5927 * arch/arm-get-next-pcs.h (arm_get_next_pcs): Adjust.
5928 * aarch64-tdep.c (aarch64_software_single_step): Adjust.
5929 * alpha-tdep.c (alpha_deal_with_atomic_sequence): Adjust.
5930 (alpha_software_single_step): Adjust.
5931 * alpha-tdep.h (alpha_software_single_step): Adjust.
5932 * arm-linux-tdep.c (arm_linux_software_single_step): Adjust.
5933 * arm-tdep.c (arm_software_single_step): Adjust.
5934 (arm_breakpoint_kind_from_current_state): Adjust.
5935 * arm-tdep.h (arm_software_single_step): Adjust.
5936 * breakpoint.c (insert_single_step_breakpoint): Adjust.
5937 * cris-tdep.c (cris_software_single_step): Adjust.
5938 * mips-tdep.c (mips_deal_with_atomic_sequence): Adjust.
5939 (micromips_deal_with_atomic_sequence): Adjust.
5940 (deal_with_atomic_sequence): Adjust.
5941 (mips_software_single_step): Adjust.
5942 * mips-tdep.h (mips_software_single_step): Adjust.
5943 * moxie-tdep.c (moxie_software_single_step): Adjust.
5944 * nios2-tdep.c (nios2_software_single_step): Adjust.
5945 * ppc-tdep.h (ppc_deal_with_atomic_sequence): Adjust.
5946 * rs6000-aix-tdep.c (rs6000_software_single_step): Adjust.
5947 * rs6000-tdep.c (ppc_deal_with_atomic_sequence): Adjust.
5948 * s390-linux-tdep.c (s390_software_single_step): Adjust.
5949 * sparc-tdep.c (sparc_software_single_step): Adjust.
5950 * spu-tdep.c (spu_software_single_step): Adjust.
5951 * tic6x-tdep.c (tic6x_software_single_step): Adjust.
5955 * gdbarch.sh: Use semi-colon as field separator instead of colon.
5956 * gdbarch.h: Re-generate.
5960 * Makefile.in (SUBDIR_PYTHON_OBS): Add py-instruction.o.
5961 (SUBDIR_PYTHON_SRCS): Add py-instruction.c.
5962 * python/py-instruction.c, python/py-instruction.h: New file.
5963 * python/py-record.c: Add py-instruction.h include.
5964 (gdbpy_initialize_record): Make gdb.Instruction a super class of
5965 gdb.RecordInstruction.
5966 * python/python-internal.h: Add gdbpy_initialize_instruction
5968 * python/python.c (do_start_initialization): Add
5969 gdbpy_initialize_instruction.
5973 * python/py-record-btrace.c (BTPY_REQUIRE_VALID_CALL, btpy_call_type):
5975 (btrace_func_from_recpy_func): New function.
5976 (btpy_call_new, btpy_number, btpy_hash, btpy_richcompare): Remove.
5977 (btpy_call_level, btpy_call_symbol, btpy_call_instructions,
5978 btpy_call_up, btpy_call_prev_sibling, btpy_call_next_sibling): Rename to ...
5979 (recpy_bt_func_level, recpy_bt_func_symbol, recpy_bt_func_instructions,
5980 recpy_bt_func_up, recpy_bt_func_prev, recpy_bt_func_next): This.
5981 Also, use new helper functions.
5982 (btpy_list_item): Use new helper functions.
5983 (recpy_bt_function_call_history): Use new type name.
5984 (btpy_call_getset): Remove.
5985 (gdbpy_initialize_btrace): Remove code to initialize
5986 gdb.BtraceFunctionCall.
5987 * python/py-record-btrace.h (recpy_bt_func_number, recpy_btb_func_level,
5988 recpy_btb_func_symbol, recpy_bt_func_instructions, recpy_bt_func_up,
5989 recpy_bt_func_prev, recpy_bt_func_next): New export.
5990 * python/py-record.c (recpy_func_type): New static object.
5991 (recpy_func_new, recpy_func_level, recpy_func_symbol,
5992 recpy_func_instructions, recpy_func_up, recpy_func_prev,
5993 recpy_func_next): New function.
5994 (recpy_element_hash, recpy_element_richcompare): Updated comment.
5995 (recpy_func_getset): New static object.
5996 (gdbpy_initialize_record): Add code to initialize gdb.RecordInstruction.
5997 * python/py-record.h (recpy_func_type, recpy_func_new): New export.
6001 * python/py-record-btrace.c (BTPY_REQUIRE_VALID_INSN): Remove.
6002 (btpy_object, btpy_insn_type, btpy_new): Remove.
6003 (btpy_list_object): Use gdb.RecordInstruction type instead of
6004 gdb.BtraceInstruction type.
6005 (btrace_insn_from_recpy_insn): New function.
6006 (btpy_insn_or_gap_new): Adjust comment. Use recpy_insn_new instead of
6008 (btpy_call_new, btpy_list_item): Do not use btpy_new anymore.
6009 (btpy_number, btpy_hash, btpy_call_level, btpy_call_symbol,
6010 btpy_call_instructions, btpy_call_up, btpy_call_prev_sibling,
6011 btpy_call_next_sibling, btpy_richcompare): Use recpy_element_object
6012 instead of btpy_object.
6013 (btpy_insn_sal, btpy_insn_pc, btpy_insn_size, btpy_insn_is_speculative,
6014 btpy_insn_data, btpy_insn_decode): Rename to ...
6015 (recpy_bt_insn_sal, recpy_bt_insn_pc, recpy_bt_insn_size,
6016 recpy_bt_insn_is_speculative, recpy_bt_insn_data,
6017 recpy_bt_insn_decode): This. Also, use new helper functions.
6018 (btpy_list_position, recpy_bt_goto): Use recpy_element_object and
6020 (btpy_insn_getset): Remove.
6021 (gdbpy_initialize_btrace): Remove code to initialize
6022 gdb.BtraceInstruction. Use recpy_element_object.
6023 * python/py-record-btrace.h (recpy_bt_insn_number, recpy_bt_insn_sal,
6024 recpy_bt_insn_pc, recpy_bt_insn_data, recpy_bt_insn_decoded,
6025 recpy_bt_insn_size, recpy_bt_insn_is_speculative): New export.
6026 * python/py-record.c (recpy_insn_type): New static object.
6027 (recpy_insn_new, recpy_insn_sal, recpy_insn_pc, recpy_insn_data,
6028 recpy_insn_decoded, recpy_insn_size, recpy_insn_is_speculative,
6029 recpy_element_number, recpy_element_hash, recpy_element_richcompare):
6031 (recpy_insn_getset): New static object.
6032 (gdbpy_initialize_record): Initialize gdb.RecordInstruction.
6033 * python/py-record.h (recpy_element_object): New typedef.
6034 (recpy_insn_type, recpy_insn_new): New export.
6038 * py-record-btrace.c (btpy_insn_new): Removed.
6039 (btpy_insn_or_gap_new): New function.
6040 (btpy_insn_error): Removed.
6041 (btpy_insn_sal, btpy_insn_pc, btpy_insn_size, btpy_insn_is_speculative,
6042 btpy_insn_data, btpy_insn_decode): Remove code path for gaps.
6043 (recpy_bt_replay_position, recpy_bt_begin, recpy_bt_end): Call
6044 btpy_insn_or_gap_new instead of btpy_insn_new.
6045 (btpy_insn_getset): Remove btpy_insn_error.
6046 * py-record.c (recpy_gap_type): New static object.
6047 (recpy_gap_object): New typedef.
6048 (recpy_gap_new, recpy_gap_number, recpy_gap_reason_code,
6049 recpy_gap_reason_string): New function.
6050 (recpy_gap_getset): New static object.
6051 (gdbpy_initialize_record): Initialize gdb.RecordGap type.
6052 * py-record.h (recpy_gap_new): New export.
6056 * python/py-record.c (recpy_ptid): Remove.
6057 (recpy_record_getset): Remove recpy_ptid.
6061 * btrace.c (btrace_fetch): Set inferior_ptid.
6062 * python/py-record-btrace.c: Add "py-record.h" include.
6063 (recpy_bt_format, recpy_bt_replay_position, recpy_bt_begin,
6064 recpy_bt_end, recpy_bt_instruction_history,
6065 recpy_bt_function_call_history, recpy_bt_goto): Use ptid stored
6066 in gdb.Record object instead of current ptid.
6067 * python/py-record.c: Include new "py-record.h" file.
6068 (recpy_record_object): Moved to py-record.h.
6069 * python/py-record.h: New file.
6073 * python/py-record-btrace.c (BTPY_REQUIRE_VALID_INSN,
6074 BTPY_REQUIRE_VALID_CALL, recpy_bt_function_call_history): Fix
6079 * MAINTAINERS: Move Daniel Jacobowitz and Mark Kettenis to
6080 the past maintainers section.
6084 * infcmd.c (get_return_value): Use regcache ctor, and remove
6090 * regcache.c (regcache::regcache): New tag dispatch ctor.
6091 (do_cooked_read): Moved above.
6092 (regcache_dup): Use the tag dispatch ctor..
6093 * regcache.h (regcache): Declare ctor, delete copy ctor and
6094 assignment operator, remove friend regcache_dup.
6098 * regcache.c (regcache_dup): Assert !src->m_readonly_p and
6099 call method save instead of regcache_cpy.
6100 * regcache.h (struct regcache): Make regcache_dup a friend.
6104 * regcache.c (struct regcache): Move to regcache.h
6105 (regcache::arch): New method.
6106 (regcache_get_ptid): Update.
6107 (get_regcache_arch): Call arch method.
6108 (get_regcache_aspace): Call method aspace.
6109 (register_buffer): Change it to method.
6110 (regcache_save): Change it to regcache::save.
6111 (regcache_restore): Likewise.
6112 (regcache_cpy_no_passthrough): Remove the declaration.
6113 (regcache_cpy): Call methods restore and cpy_no_passthrough.
6114 (regcache_cpy_no_passthrough): Change it to method
6116 (regcache_register_status): Change it to method
6117 get_register_status.
6118 (regcache_invalidate): Change it to method invalidate.
6119 (regcache_thread_ptid_changed): Use methods ptid and set_ptid.
6120 (regcache_raw_update): Change it to method raw_update.
6121 (regcache_raw_read): Likewise.
6122 (regcache_raw_read_signed): Likewise.
6123 (regcache_raw_read_unsigned): Likewise.
6124 (regcache_raw_write_signed): Likewise.
6125 (regcache_raw_write_unsigned): Likewise.
6126 (regcache_cooked_read): Likewise.
6127 (regcache_cooked_read_value): Likewise.
6128 (regcache_cooked_read_signed): Likewise.
6129 (regcache_cooked_read_unsigned): Likewise.
6130 (regcache_cooked_write_signed): Likewise.
6131 (regcache_cooked_write_unsigned): Likewise.
6132 (regcache_raw_set_cached_value): Likewise.
6133 (regcache_raw_write): Likewise.
6134 (regcache_cooked_write): Likewise.
6135 (regcache_xfer_part): Likewise.
6136 (regcache_raw_read_part): Likewise.
6137 (regcache_raw_write_part): Likewise.
6138 (regcache_cooked_read_part): Likewise.
6139 (regcache_cooked_write_part): Likewise.
6140 (regcache_raw_supply): Likewise.
6141 (regcache_raw_collect): Likewise.
6142 (regcache_transfer_regset): Likewise.
6143 (regcache_supply_regset): Likewise.
6144 (regcache_collect_regset): Likewise.
6145 (regcache_debug_print_register): Likewise.
6146 (enum regcache_dump_what): Move it to regcache.h.
6147 (regcache_dump): Change it to method dump.
6148 * regcache.h (enum regcache_dump_what): New.
6149 (class regcache): New.
6150 * target.c (target_fetch_registers): Call method
6151 debug_print_register.
6152 (target_store_registers): Likewise.
6156 * windows-nat.c (struct lm_info_windows): Initialize field.
6157 (windows_make_so): Allocate lm_info_windows with new.
6158 (windows_free_so): Free lm_info_windows with delete.
6162 * solib-darwin.c (struct lm_info_darwin): Initialize field.
6163 (darwin_current_sos): Allocate lm_info_darwin with new, remove
6165 (darwin_free_so): Free lm_info_darwin with delete.
6169 * solib-svr4.h (struct lm_info_svr4): Initialize fields.
6170 <l_addr_p>: Change type to bool.
6171 * solib-svr4.c (lm_info_read): Allocate lm_info_svr4 with new.
6172 (svr4_free_so): Free lm_info_svr4 with delete.
6173 (svr4_copy_library_list): Replace memcpy with call to copy
6175 (library_list_start_library, svr4_default_sos): Allocate
6176 lm_info_svr4 with new.
6180 * solib-target.c (struct lm_info_target): Add destructor,
6182 <name>: Change type to std::string.
6183 (library_list_start_library): Allocate lm_info_target with new.
6184 (solib_target_free_library_list): Free lm_info_target with
6186 (solib_target_current_sos): Adapt to std::string.
6187 (solib_target_free_so): Free lm_info_target with delete.
6191 * solib-frv.c (struct lm_info_frv): Add destructor, initialize
6193 (frv_current_sos): Allocate lm_info_frv with new.
6194 (frv_relocate_main_executable): Free lm_info_frv with delete,
6196 (frv_clear_solib, frv_free_so): Free lm_info_frv with delete.
6200 * solib-frv.c (struct lm_info_frv): Fix indentation.
6204 * solib-dsbt.c (struct lm_info_dsbt): Add destructor, initialize
6206 (dsbt_current_sos): Allocate lm_info_dsbt with new.
6207 (dsbt_relocate_main_executable): Free lm_info_dsbt with delete
6208 and allocate with new.
6209 (dsbt_clear_solib, dsbt_free_so): Free lm_info_dsbt with delete.
6213 * solib-aix.c (struct lm_info_aix): Initialize fields in-class.
6214 <filename, member_name>: Change type to std::string.
6215 (solib_aix_new_lm_info, solib_aix_xfree_lm_info): Remove.
6216 (library_list_start_library): Allocate lm_info_aix with new.
6217 (solib_aix_free_library_list, solib_aix_free_so): Free with delete.
6218 (solib_aix_current_sos): Adapt to std::string, copy lm_info_aix
6219 with copy constructor.
6223 * solist.h (struct lm_info): Remove.
6224 (struct lm_info_base): New class.
6225 (struct so_list) <lm_info>: Change type to lm_info_base *.
6226 * nto-tdep.c (struct lm_info): Remove.
6228 * solib-aix.c (struct lm_info): Rename to ...
6229 (struct lm_info_aix): ... this. Extend lm_info_base.
6230 (lm_info_p): Rename to ...
6231 (lm_info_aix_p): ... this, and adjust.
6232 (solib_aix_new_lm_info, solib_aix_xfree_lm_info,
6233 solib_aix_parse_libraries, library_list_start_library,
6234 solib_aix_free_library_list, solib_aix_parse_libraries,
6235 solib_aix_get_library_list,
6236 solib_aix_relocate_section_addresses, solib_aix_free_so,
6237 solib_aix_get_section_offsets,
6238 solib_aix_solib_create_inferior_hook, solib_aix_current_sos):
6240 (struct solib_aix_inferior_data) <library_list>: Adjust.
6241 * solib-darwin.c (struct lm_info): Rename to ...
6242 (struct lm_info_darwin): ... this. Extend lm_info_base.
6243 (darwin_current_sos, darwin_relocate_section_addresses): Adjust.
6244 * solib-dsbt.c (struct lm_info): Rename to ...
6245 (struct lm_info_dsbt): ... this. Extend lm_info_base.
6246 (struct dsbt_info) <main_executable_lm_info): Adjust.
6247 (dsbt_current_sos, dsbt_relocate_main_executable, dsbt_free_so,
6248 dsbt_relocate_section_addresses): Adjust.
6249 * solib-frv.c (struct lm_info): Rename to ...
6250 (struct lm_info_frv): ... this. Extend lm_info_base.
6251 (main_executable_lm_info): Adjust.
6252 (frv_current_sos, frv_relocate_main_executable, frv_free_so,
6253 frv_relocate_section_addresses, frv_fdpic_find_global_pointer,
6254 find_canonical_descriptor_in_load_object,
6255 frv_fdpic_find_canonical_descriptor): Adjust.
6256 * solib-svr4.c (struct lm_info): Move to solib-svr4.h, renamed
6258 (lm_info_read, lm_addr_check, svr4_keep_data_in_core,
6259 svr4_clear_so, svr4_copy_library_list,
6260 library_list_start_library, svr4_default_sos, svr4_read_so_list,
6261 svr4_current_sos, svr4_fetch_objfile_link_map,
6262 solist_update_incremental): Adjust.
6263 * solib-svr4.h (struct lm_info_svr4): Move here from
6265 * solib-target.c (struct lm_info): Rename to ...
6266 (struct lm_info_target): ... this. Extend lm_info_base.
6267 (lm_info_p): Rename to ...
6268 (lm_info_target_p): ... this.
6269 (solib_target_parse_libraries, library_list_start_segment,
6270 library_list_start_section, library_list_start_library,
6271 library_list_end_library, solib_target_free_library_list,
6272 solib_target_current_sos, solib_target_free_so,
6273 solib_target_relocate_section_addresses): Adjust.
6274 * windows-nat.c (struct lm_info): Rename to ...
6275 (struct lm_info_windows): ... this. Extend lm_info_base.
6276 (windows_make_so, handle_load_dll, handle_unload_dll,
6277 windows_xfer_shared_libraries): Adjust.
6281 * solib-darwin.c (struct darwin_so_list): Remove.
6282 (darwin_current_sos): Allocate an so_list object instead of a
6283 darwin_so_list, separately allocate an lm_info object.
6284 (darwin_free_so): Free lm_info.
6288 * mips-tdep.c (print_gp_register_row): Replace printf_filtered
6289 with fprintf_filtered.
6293 * regcache.c (regcache::regcache): New function.
6294 (regcache::~regcache): New function.
6295 (regcache_xmalloc_1): Remove.
6296 (regcache_xmalloc): Call new regcache.
6297 (regcache_xfree): Call delete regcache.
6298 (get_thread_arch_aspace_regcache): Call new regcache.
6302 * mips-linux-nat.c (mips_linux_new_thread): Use ptid method
6303 lwp instead of ptid_get_lwp.
6307 * mips-linux-nat.c (mips_linux_new_thread): Get lwpid from
6308 lwp_info instead of getting from inferior_ptid.
6312 * gdbtypes.c (LVALUE_REFERENCE_TO_RVALUE_BINDING_BADNESS)
6313 DIFFERENT_REFERENCE_TYPE_BADNESS): Remove.
6314 (CV_CONVERSION_BADNESS): Define.
6315 (rank_one_type): Remove overly restrictive rvalue reference
6317 Add cv-qualifier checks and subranks for type equality.
6318 * gdbtypes.h (REFERENCE_CONVERSION_RVALUE,
6319 REFERENCE_CONVERSION_CONST_LVALUE, CV_CONVERSION_BADNESS,
6320 CV_CONVERSION_CONST, CV_CONVERSION_VOLATILE): Declare.
6324 * python/py-inferior.c (inferior_to_inferior_object): Increment reference
6325 count when creating the object.
6330 * xcoffread.c (read_xcoff_symtab): Read correct function auxiliary
6331 entry if xlc -qfuncsect or gcc -ffunction-sections compiler option
6333 (read_xcoff_symtab): Handle C_WEAKEXT storage class.
6334 (process_xcoff_symbol): Likewise.
6335 (scan_xcoff_symtab): Likewise.
6339 * ia64-tdep.c (examine_prologue): Use get_frame_register_unsigned.
6340 (ia64_sigtramp_frame_prev_register): Use read_memory_unsigned_integer.
6341 (ia64_access_reg): Use get_frame_register_unsigned.
6342 (ia64_access_rse_reg): Likewise.
6343 (ia64_libunwind_frame_prev_register): Likewise.
6347 * gdbarch.sh: New gdbarch method execute_dwarf_cfa_vendor_op.
6348 * gdbarch.c: Regenerated.
6349 * gdbarch.h: Regenerated.
6350 * dwarf2-frame.c (dwarf2_frame_state_alloc_regs): Made the
6351 visibility external.
6352 (execute_cfa_program): Call execute_dwarf_cfa_vendor_op for CFI
6353 between DW_CFA_lo_user and DW_CFA_high_user inclusive.
6354 (enum cfa_how_kind): Move to ...
6355 (struct dwarf2_frame_state_reg_info): Likewise.
6356 (struct dwarf2_frame_state): Likewise.
6357 * dwarf2-frame.h: ... here.
6358 (dwarf2_frame_state_alloc_regs): New declaration.
6359 * sparc-tdep.c (sparc_execute_dwarf_cfa_vendor_op): New function.
6360 (sparc32_gdbarch_init): Register execute_dwarf_cfa_vendor_op hook.
6364 * xtensa-tdep.c (xtensa_pseudo_register_read): Use
6365 regcache_raw_read_unsigned.
6366 (xtensa_pseudo_register_write): Likewise.
6370 * nds32-tdep.c (nds32_pseudo_register_read): Abort on errors.
6371 (nds32_pseudo_register_write): Likewise.
6375 * regcache.c (struct regcache) <readonly_p>: Change its type
6377 (regcache_xmalloc_1): Update parameter type and callers update.
6381 * aarch64-tdep.c (aarch64_gdbarch_init): Don't call
6382 set_gdbarch_wchar_bit.
6383 * arm-tdep.c (arm_gdbarch_init): Likewise.
6387 * common/poison.h [!HAVE_IS_TRIVIALLY_COPYABLE] (IsRelocatable)
6388 (BothAreRelocatable, memcopy, memmove): Don't define.
6389 * common/traits.h (__has_feature, HAVE_IS_TRIVIALLY_COPYABLE): New
6394 * common/common-defs.h: Include "common/poison.h".
6395 * common/function-view.h: (Not, Or, Requires): Move to traits.h
6397 * common/poison.h: New file.
6398 * common/traits.h: Include <type_traits>.
6399 (Not, Or, Requires): New, moved from common/function-view.h.
6403 * breakpoint.h (struct breakpoint): In-class initialize all
6404 fields. Make boolean fields "bool".
6405 * breakpoint.c (init_raw_breakpoint_without_location): Remove
6406 memset call and initializations no longer necessary.
6410 * btrace.c (pt_btrace_insn_flags): Change parameter type to
6412 (pt_btrace_insn): New function.
6413 (ftrace_add_pt): Remove memset call and use pt_btrace_insn.
6417 * ada-lang.c (ada_catchpoint_location): Now a "class". Remove
6418 "base" field and inherit from "bp_location" instead. Add
6420 (allocate_location_exception): Use new non-default ctor.
6421 * breakpoint.c (get_first_locp_gte_addr): Remove memset call.
6422 (init_bp_location): Convert to ...
6423 (bp_location::bp_location): ... this new ctor, and remove memset
6425 (base_breakpoint_allocate_location): Use the new non-default ctor.
6426 * breakpoint.h (bp_location): Now a class. Declare default and
6427 non-default ctors. In-class initialize all members.
6428 (init_bp_location): Remove declaration.
6432 * common/enum-flags.h (enum_flags): Don't implement copy ctor and
6433 assignment operator.
6437 * doublest.c (convert_doublest_to_floatformat): Call
6438 floatformat_totalsize_bytes.
6442 * mi/mi-cmd-file.c (mi_cmd_file_list_shared_libraries): Use
6444 * stack.c (print_frame): Use ui_out_emit_list.
6445 * mi/mi-symbol-cmds.c (mi_cmd_symbol_list_lines): Use
6447 * mi/mi-main.c (print_one_inferior)
6448 (mi_cmd_data_list_register_names)
6449 (mi_cmd_data_list_register_values, mi_cmd_list_features)
6450 (mi_cmd_list_target_features, mi_cmd_trace_frame_collected): Use
6452 * mi/mi-interp.c (mi_on_normal_stop_1): Use ui_out_emit_list.
6453 (mi_output_solib_attribs): Use ui_out_emit_list,
6455 * mi/mi-cmd-var.c (varobj_update_one): Use ui_out_emit_list.
6456 * mi/mi-cmd-stack.c (mi_cmd_stack_list_frames)
6457 (mi_cmd_stack_list_args, list_args_or_locals): Use
6459 * disasm.c (do_assembly_only): Use ui_out_emit_list.
6460 * breakpoint.c (print_solib_event, output_thread_groups): Use
6465 * mi/mi-main.c (print_variable_or_computed): Use ui_out_emit_tuple.
6466 * mi/mi-cmd-var.c (varobj_update_one): Use ui_out_emit_tuple.
6467 * mi/mi-cmd-stack.c (list_arg_or_local): Use ui_out_emit_tuple.
6471 * tracepoint.c (tvariables_info_1)
6472 (print_one_static_tracepoint_marker): Use ui_out_emit_tuple.
6476 * stack.c (print_frame_arg): Use ui_out_emit_tuple,
6477 annotate_arg_emitter.
6478 * breakpoint.c (print_mention_watchpoint)
6479 (print_mention_masked_watchpoint): Use ui_out_emit_tuple.
6480 * annotate.h (struct annotate_arg_emitter): New.
6484 * record-btrace.c (record_btrace_insn_history)
6485 (record_btrace_insn_history_range, record_btrace_call_history)
6486 (record_btrace_call_history_range): Use ui_out_emit_tuple.
6487 * thread.c (do_captured_list_thread_ids, print_thread_info_1): Use
6489 * stack.c (print_frame_info): Use ui_out_emit_tuple.
6490 * solib.c (info_sharedlibrary_command): Use ui_out_emit_tuple.
6491 * skip.c (skip_info): Use ui_out_emit_tuple.
6492 * remote.c (show_remote_cmd): Use ui_out_emit_tuple.
6493 * progspace.c (print_program_space): Use ui_out_emit_tuple.
6494 * probe.c (info_probes_for_ops): Use ui_out_emit_tuple.
6495 * osdata.c (info_osdata): Use ui_out_emit_tuple.
6496 * mi/mi-symbol-cmds.c (mi_cmd_symbol_list_lines): Use
6498 * mi/mi-main.c (print_one_inferior, list_available_thread_groups)
6499 (output_register, mi_cmd_data_read_memory)
6500 (mi_cmd_data_read_memory_bytes, mi_load_progress)
6501 (mi_cmd_trace_frame_collected): Use ui_out_emit_tuple.
6502 * mi/mi-cmd-var.c (mi_cmd_var_list_children, varobj_update_one):
6503 Use ui_out_emit_tuple.
6504 * mi/mi-cmd-stack.c (mi_cmd_stack_list_args): Use
6506 * mi/mi-cmd-info.c (mi_cmd_info_ada_exceptions)
6507 (mi_cmd_info_gdb_mi_command): Use ui_out_emit_tuple.
6508 * linux-thread-db.c (info_auto_load_libthread_db): Use
6510 * inferior.c (print_inferior): Use ui_out_emit_tuple.
6511 * gdb_bfd.c (print_one_bfd): Use ui_out_emit_tuple.
6512 * disasm.c (do_mixed_source_and_assembly_deprecated)
6513 (do_mixed_source_and_assembly): Use ui_out_emit_tuple.
6514 * cp-abi.c (list_cp_abis): Use ui_out_emit_tuple.
6515 * cli/cli-setshow.c (cmd_show_list): Use ui_out_emit_tuple.
6516 * breakpoint.c (print_one_breakpoint_location)
6517 (print_one_breakpoint): Use ui_out_emit_tuple.
6518 * auto-load.c (print_script, info_auto_load_cmd): Use
6520 * ada-tasks.c (print_ada_task_info): Use ui_out_emit_tuple.
6524 * thread.c (print_thread_info_1): Remove dead code.
6528 * aarch64-tdep.c (selftests::aarch64_process_record_test): Make it #if
6530 * arm-tdep.c (selftests::arm_record_test): Likewise.
6534 * regcache.c (regcache_restore): Remove argument 2. Replace
6535 argument 3 with regcache. Get register status from
6536 src->register_status and get register contents from
6537 register_buffer (src, regnum).
6538 (regcache_cpy): Update.
6542 * gdbthread.h (thread): Add missing closing parenthesis in
6547 * common/refcounted-object.h: New file.
6548 * gdbthread.h: Include "common/refcounted-object.h".
6549 (thread_info): Inherit from refcounted_object and add comments.
6550 (thread_info::incref, thread_info::decref)
6551 (thread_info::m_refcount): Delete.
6552 (thread_info::deletable): Use the refcounted_object::refcount()
6554 * inferior.c (current_inferior_): Add comment.
6555 (set_current_inferior): Increment/decrement refcounts.
6556 (prune_inferiors, remove_inferior_command): Skip inferiors marked
6557 not-deletable instead of comparing with the current inferior.
6558 (initialize_inferiors): Increment the initial inferior's refcount.
6559 * inferior.h (struct inferior): Forward declare.
6560 Include "common/refcounted-object.h".
6561 (current_inferior, set_current_inferior): Move declaration to
6562 before struct inferior's definition, and fix comment.
6563 (inferior): Inherit from refcounted_object. Add comments.
6564 * thread.c (switch_to_thread_no_regs): Reference the thread's
6565 inferior pointer directly instead of doing a ptid lookup.
6566 (switch_to_no_thread): New function.
6567 (switch_to_thread(thread_info *)): New function, factored out
6569 (switch_to_thread(ptid_t)): ... this.
6570 (restore_current_thread): Delete.
6571 (current_thread_cleanup): Remove 'inf_id' and 'was_removable'
6572 fields, and add 'inf' field.
6573 (do_restore_current_thread_cleanup): Check whether old->inf is
6574 alive instead of looking up an inferior by ptid. Use
6575 switch_to_thread and switch_to_no_thread.
6576 (restore_current_thread_cleanup_dtor): Use old->inf directly
6577 instead of lookup up an inferior by id. Decref the inferior.
6578 Don't restore 'removable'.
6579 (make_cleanup_restore_current_thread): Same the inferior pointer
6580 in old, instead of the inferior number. Incref the inferior.
6581 Don't save/clear 'removable'.
6585 * Makefile.in (SUBDIR_UNITTESTS_SRCS): Add
6586 unittests/scoped_restore-selftests.c.
6587 (SUBDIR_UNITTESTS_OBS): Add scoped_restore-selftests.o.
6588 * common/scoped_restore.h (scoped_restore_base): Make "class".
6589 (scoped_restore_base::release): New public method.
6590 (scoped_restore_base::scoped_restore_base): New protected ctor.
6591 (scoped_restore_base::m_saved_var): New protected field.
6592 (scoped_restore_tmpl::scoped_restore_tmpl(T*)): Initialize the
6593 scoped_restore_base base class instead of m_saved_var directly.
6594 (scoped_restore_tmpl::scoped_restore_tmpl(T*, T2)): Likewise.
6595 (scoped_restore_tmpl::scoped_restore_tmpl(const
6596 scoped_restore_tmpl<T>&)): Likewise.
6597 (scoped_restore_tmpl::~scoped_restore_tmpl): Use the saved_var
6599 (scoped_restore_tmpl::saved_var): New method.
6600 (scoped_restore_tmpl::m_saved_var): Delete.
6601 * inferior.h (inferior::detaching): Now a bool.
6602 * infrun.c (prepare_for_detach): Use a scoped_restore instead of a
6604 * unittests/scoped_restore-selftests.c: New file.
6608 * Makefile.in (SUBDIR_UNITTESTS_SRCS, SUBDIR_UNITTESTS_OBS):
6609 Re-sort in alphabetic order.
6613 * xml-support.c (obstack_xml_printf): Delete.
6614 * xml-support.h (obstack_xml_printf): Delete.
6618 * xml-support.c (gdb_xml_parser) <use_dtd, dtd_name, parse,
6619 vdebug, verror, body_text, start_element, end_element, name,
6620 user_data, set_is_xinclude, set_error, expat_parser>: New methods.
6621 <name, user_data, expat_parser, scopes, error, last_line, dtd_name,
6622 is_xinclude>: Make private and add m_ prefix.
6623 (gdb_xml_parser::body_text): New method, based on ...
6624 (gdb_xml_body_text): ... this. Adjust.
6625 (gdb_xml_parser::vdebug): New method, based on ...
6626 (gdb_xml_debug): ... this. Adjust.
6627 (gdb_xml_parser::verror): New method, based on ...
6628 (gdb_xml_error): ... this. Adjust.
6629 (gdb_xml_parser::start_element): New method, based on ...
6630 (gdb_xml_start_element): ... this. Adjust.
6631 (gdb_xml_start_element_wrapper): Defer to
6632 gdb_xml_parser::start_element and gdb_xml_parser::set_error.
6633 (gdb_xml_parser::end_element): New method, based on ...
6634 (gdb_xml_end_element_wrapper): ... this. Adjust.
6635 (gdb_xml_parser::~gdb_xml_parser): Adjust.
6636 (gdb_xml_parser::gdb_xml_parser): Adjust to field renames.
6637 (gdb_xml_parser::use_dtd): New method, based on ...
6638 (gdb_xml_use_dtd): ... this. Adjust.
6639 (gdb_xml_parser::parse): New method, based on ...
6640 (gdb_xml_parse): ... this. Adjust.
6641 (gdb_xml_parse_quick): Adjust to call the parser's parse method.
6642 (xinclude_start_include): Adjust to call the parser's name method.
6643 (xml_xinclude_default, xml_xinclude_start_doctype)
6644 (xml_xinclude_end_doctype): Adjust to call the parser's user_data
6646 (xml_process_xincludes): Adjust to call parser methods.
6647 * xml-support.h (gdb_xml_use_dtd, gdb_xml_parse): Delete
6652 * tracefile-tfile.c (tfile_write_tdesc): Adjust to use
6653 gdb::optional<std::string>.
6654 * xml-support.c: Include <string>.
6655 (scope_level::scope_level(scope_level &&))
6656 (scope_level::~scope_level): Delete.
6657 (scope_level::body): Now a std::string.
6658 (gdb_xml_body_text, gdb_xml_end_element): Adjust.
6659 (xinclude_parsing_data::xinclude_parsing_data): Add 'output'
6661 (xinclude_parsing_data::~xinclude_parsing_data): Delete.
6662 (xinclude_parsing_data::output): Now a std::string reference.
6663 (xinclude_start_include): Adjust.
6664 (xml_xinclude_default): Adjust.
6665 (xml_process_xincludes): Add 'output' parameter, and return bool.
6666 * xml-support.h (xml_process_xincludes): Add 'output' parameter,
6668 * xml-tdesc.c: Include <unordered_map> and <string>.
6669 (tdesc_xml_cache): Delete.
6670 (tdesc_xml_cache_s): Delete.
6671 (xml_cache): Now an std::unordered_map.
6672 (tdesc_parse_xml): Adjust to use std::string and unordered_map.
6673 (target_fetch_description_xml): Change return type to
6674 gdb::optional<std::string>, and adjust.
6675 * xml-tdesc.h: Include "common/gdb_optional.h" and <string>.
6676 (target_fetch_description_xml): Change return type to
6677 gdb::optional<std::string>.
6681 * Makefile.in (SUBDIR_UNITTESTS_SRCS): Add
6682 unittests/optional-selftests.c.
6683 (SUBDIR_UNITTESTS_OBS): Add optional-selftests.o.
6684 * unittests/optional-selftests.c: New file.
6685 * unittests/optional/assignment/1.cc: New file.
6686 * unittests/optional/assignment/2.cc: New file.
6687 * unittests/optional/assignment/3.cc: New file.
6688 * unittests/optional/assignment/4.cc: New file.
6689 * unittests/optional/assignment/5.cc: New file.
6690 * unittests/optional/assignment/6.cc: New file.
6691 * unittests/optional/assignment/7.cc: New file.
6692 * unittests/optional/cons/copy.cc: New file.
6693 * unittests/optional/cons/default.cc: New file.
6694 * unittests/optional/cons/move.cc: New file.
6695 * unittests/optional/cons/value.cc: New file.
6696 * unittests/optional/in_place.cc: New file.
6697 * unittests/optional/observers/1.cc: New file.
6698 * unittests/optional/observers/2.cc: New file.
6702 * common/gdb_optional.h: Include common/traits.h.
6703 (in_place_t): New type.
6704 (in_place): New constexpr variable.
6705 (optional::optional): Remove member initialization of
6707 (optional::optional(in_place_t...)): New constructor.
6708 (optional::~optional): Use reset.
6709 (optional::optional(const optional&)): New.
6710 (optional::optional(const optional&&)): New.
6711 (optional::optional(T &)): New.
6712 (optional::optional(T &&)): New.
6713 (operator::operator=(const optional &)): New.
6714 (operator::operator=(optional &&)): New.
6715 (operator::operator= (const T &))
6716 (operator::operator= (T &&))
6717 (operator::emplace (Args &&... args)): Return a T&. Use reset.
6718 (operator::reset): New.
6719 (operator::m_instantiated):: Add in-class initializer.
6720 * common/traits.h: Include <type_traits>.
6721 (struct And): New types.
6725 * xml-support.c: Include <vector>.
6726 (scope_level::scope_level(const gdb_xml_element *))
6727 (scope_level::scope_level(scope_level&&)): New.
6728 (scope_level::~scope_level): New.
6729 (scope_level_s): Delete.
6730 (gdb_xml_parser::scopes): Now a std::vector.
6731 (gdb_xml_body_text, gdb_xml_start_element, gdb_xml_end_element):
6733 (gdb_xml_parser::~gdb_xml_parser): Remove now unnecessary
6735 (gdb_xml_parser::gdb_xml_parser): Remove explicit initialization
6736 of the scopes member. Use std::vector::emplace_back.
6740 * xml-support.c (gdb_xml_parser): Add ctor/dtor. Make is_xinclude
6742 (gdb_xml_end_element): Change type of first parameter.
6743 (gdb_xml_cleanup): Rename to ...
6744 (gdb_xml_parser::~gdb_xml_parser): ... this.
6745 (gdb_xml_create_parser_and_cleanup): Delete with ...
6746 (gdb_xml_parser::gdb_xml_parser): ... creation parts factored out
6748 (gdb_xml_parse_quick): Create a local gdb_xml_parser instead of
6749 using gdb_xml_create_parser_and_cleanup.
6750 (xinclude_parsing_data): Add ctor/dtor.
6751 (xml_xinclude_cleanup): Delete.
6752 (xml_process_xincludes): Create a local xinclude_parsing_data
6753 instead of heap-allocating one. Create a local gdb_xml_parser
6754 instead of heap-allocating one with
6755 gdb_xml_create_parser_and_cleanup.
6760 * fbsd-nat.c (resume_one_thread_cb): Remove.
6761 (resume_all_threads_cb): Remove.
6762 (fbsd_resume): Use ALL_NON_EXITED_THREADS instead of
6763 iterate_over_threads.
6767 * NEWS: Create a new section for the next release branch.
6768 Rename the section of the current branch, now that it has
6773 GDB 8.0 branch created (725bf5cf125783c2a7ca4ab63d3768e220bab2db):
6774 * version.in: Bump version to 8.0.50.DATE-git.
6779 * windows-nat.c (windows_create_inferior): Declare 'allargs'
6780 independently of the host, and fix build breakage on Cygwin.
6784 * inferior.c (free_inferior): Convert to ...
6785 (inferior::~inferior): ... this dtor.
6786 (inferior::inferior): New ctor, factored out from ...
6787 (add_inferior_silent): ... here. Allocate the inferior with a new
6789 (delete_inferior): Call delete instead of free_inferior.
6790 * inferior.h (gdb_environ, continuation): Forward declare.
6791 (inferior): Now a class. Add in-class initialization to all
6792 members. Make boolean fields bool, except 'detaching'.
6793 (inferior::inferior): New explicit ctor.
6794 (inferior::~inferior): New.
6798 * inferior.c (init_inferior_list): Delete.
6799 * inferior.h (init_inferior_list): Delete.
6804 * gdb.threads/threadapply.exp (thr_apply_detach): New procedure.
6805 (top level): Call it twice, with different thread sets.
6809 * thread.c: Include <algorithm>.
6810 (thread_array_cleanup): Delete.
6811 (scoped_inc_dec_ref): New class.
6812 (live_threads_count): New function.
6813 (set_thread_refcount): Delete.
6814 (tp_array_compar_ascending): Now a bool.
6815 (tp_array_compar): Convert to a std::sort comparison function.
6816 (thread_apply_all_command): Use std::vector and scoped_inc_dec_ref
6817 and live_threads_count.
6821 * infrun.c (follow_fork_inferior): Also switch the current
6826 * breakpoint.c (watch_command_1): Save watchpoint-frame info
6827 before calling create_internal_breakpoint.
6831 * fork-child.c (execv_argv): New class.
6832 (breakup_args): Refactored as ...
6833 (execv_argv::init_for_no_shell): .. this method of execv_argv.
6834 Copy arguments to storage and replace separators with NULL
6835 terminators in place.
6836 (escape_bang_in_quoted_argument): Adjust to return bool.
6837 (execv_argv::execv_argv): New ctor.
6838 (execv_argv::init_for_shell): New method, factored out from
6839 fork_inferior. Don't strdup strings into the vector.
6840 (fork_inferior): Eliminate "shell" local and use execv_argv. Use
6841 Remove free_vector_argv call.
6845 * rx-tdep.c (rx_fpsw_type): Check tdep->rx_fpsw_type instead of
6850 * rl78-tdep.c (rl78_gdbarch_init): Use XCNEW instead of XNEW.
6851 * rx-tdep.c (rx_gdbarch_init): Likewise.
6855 * breakpoint.h (struct breakpoint): Reindent.
6859 * breakpoint.c (bp_location): Rename to ...
6860 (bp_locations): ... this. All references updated.
6861 (bp_location_count): Rename to ...
6862 (bp_locations_count): ... this. All references updated.
6863 (bp_location_placed_address_before_address_max): Rename to ...
6864 (bp_locations_placed_address_before_address_max): ... this. All
6866 (bp_location_shadow_len_after_address_max): Rename to ...
6867 (bp_locations_shadow_len_after_address_max): ... this. All
6869 (bp_location_compare_addrs): Rename to ...
6870 (bp_locations_compare_addrs): ... this. All references updated.
6871 (bp_location_compare):Rename to ...
6872 (bp_locations_compare): ... this. All references updated.
6873 (bp_location_target_extensions_update): Rename to ...
6874 (bp_locations_target_extensions_update): ... this. All references
6879 * Makefile.in (HFILES_NO_SRCDIR): Add "common/gdb_termios.h".
6880 * common/common.m4: Check headers 'termios.h', 'termio.h' and
6882 * common/gdb_termios.h: New file, with parts of "terminal.h".
6883 * inflow.c: Include "gdb_termios.h".
6884 * ser-unix.c: Include "gdb_termios.h".
6885 * terminal.h: Move terminal-related defines to
6886 "common/gdb_termios.h".
6890 * probe.c (parse_probes): Update.
6891 * location.h (delete_event_location): Don't declare.
6892 (event_location_deleter::operator()): Update.
6893 * location.c (event_location_deleter::operator()): Rename from
6894 delete_event_location.
6895 * linespec.h (linespec_result) <location>: Change type to
6897 * linespec.c (canonicalize_linespec, event_location_to_sals)
6898 (decode_objc): Update.
6899 (linespec_result): Don't call delete_event_location.
6900 * breakpoint.c (create_breakpoints_sal)
6901 (bkpt_probe_create_sals_from_location)
6902 (strace_marker_create_sals_from_location): Update.
6906 * linespec.h (struct linespec_result): Add constructor and
6908 (init_linespec_result, destroy_linespec_result)
6909 (make_cleanup_destroy_linespec_result): Don't declare.
6910 * linespec.c (init_linespec_result): Remove.
6911 (linespec_result::~linespec_result): Rename from
6912 destroy_linespec_result. Update.
6913 (cleanup_linespec_result, make_cleanup_destroy_linespec_result):
6915 * breakpoint.c (create_breakpoint, break_range_command)
6916 (decode_location_default): Update.
6917 * ax-gdb.c (agent_command_1): Update.
6921 * remote.c (remote_download_tracepoint): Update.
6922 * python/py-breakpoint.c (bppy_get_location): Update.
6923 * guile/scm-breakpoint.c (bpscm_print_breakpoint_smob)
6924 (gdbscm_breakpoint_location): Update.
6925 * elfread.c (elf_gnu_ifunc_resolver_return_stop): Update.
6926 * breakpoint.h (struct breakpoint) <location, location_range_end>:
6927 Change type to event_location_up.
6928 * breakpoint.c (create_overlay_event_breakpoint)
6929 (create_longjmp_master_breakpoint)
6930 (create_std_terminate_master_breakpoint)
6931 (create_exception_master_breakpoint)
6932 (breakpoint_event_location_empty_p, print_breakpoint_location)
6933 (print_one_breakpoint_location, create_thread_event_breakpoint)
6934 (init_breakpoint_sal, create_breakpoint)
6935 (print_recreate_ranged_breakpoint, break_range_command)
6936 (init_ada_exception_breakpoint, say_where): Update.
6937 (base_breakpoint_dtor): Don't call delete_event_location.
6938 (bkpt_print_recreate, tracepoint_print_recreate)
6939 (dprintf_print_recreate, update_static_tracepoint)
6940 (breakpoint_re_set_default): Update.
6944 * compile/compile-loc2c.c (compute_stack_depth_worker): Change
6945 type of "to_do". Update.
6946 (compute_stack_depth): Use std::vector.
6950 * printcmd.c (find_instruction_backward): Use std::vector.
6954 * symfile.c (objfilep): Remove typedef.
6955 (reread_symbols): Use a std::vector.
6959 * mi/mi-main.c (exec_direction_forward): Remove.
6960 (exec_reverse_continue, mi_execute_command): Use scoped_restore.
6961 * guile/scm-ports.c (ioscm_with_output_to_port_worker): Use
6963 * guile/guile.c (guile_repl_command, guile_command)
6964 (gdbscm_execute_gdb_command): Use scoped_restore.
6965 * go-exp.y (go_parse): Use scoped_restore.
6966 * d-exp.y (d_parse): Use scoped_restore.
6967 * cli/cli-decode.c (cmd_func): Use scoped_restore.
6968 * c-exp.y (c_parse): Use scoped_restore.
6972 * mi/mi-parse.h (struct mi_parse): Add constructor, destructor.
6973 (mi_parse): Update return type.
6974 (mi_parse_free): Remove.
6975 * mi/mi-parse.c (mi_parse::mi_parse): New constructor.
6976 (mi_parse::~mi_parse): Rename from mi_parse_free.
6977 (mi_parse_cleanup): Remove.
6978 (mi_parse): Return a unique_ptr. Use new.
6979 * mi/mi-main.c (mi_execute_command): Update.
6983 * location.c (explicit_location_lex_one): Return a
6985 (string_to_explicit_location): Update. Remove cleanups.
6989 * gnu-v3-abi.c (value_and_voffset_p): Remove typedef.
6990 (compare_value_and_voffset): Change type. Update.
6991 (compute_vtable_size): Change type of "offset_vec".
6992 (gnuv3_print_vtable): Use std::vector. Remove cleanups.
6993 (gnuv3_get_typeid): Remove extraneous declaration.
6997 * charset.h (wchar_iterator): Fix comment.
7001 * charset.c (iconv_wrapper): New class.
7002 (cleanup_iconv): Remove.
7003 (convert_between_encodings): Use it.
7007 * symfile.h (increment_reading_symtab): Update type.
7008 * symfile.c (decrement_reading_symtab): Remove.
7009 (increment_reading_symtab): Return a scoped_restore_tmpl<int>.
7010 * psymtab.c (psymtab_to_symtab): Update.
7011 * dwarf2read.c (dw2_instantiate_symtab): Update.
7015 * jit.c (struct jit_reader): Declare separately. Add constructor
7016 and destructor. Change type of "handle".
7017 (loaded_jit_reader): Define separately.
7018 (jit_reader_load): Update. New "new".
7019 (jit_reader_unload_command): Use "delete".
7020 * gdb-dlfcn.h (struct dlclose_deleter): New.
7021 (gdb_dlhandle_up): New typedef.
7022 (gdb_dlopen, gdb_dlsym): Update types.
7023 (gdb_dlclose): Remove.
7024 * gdb-dlfcn.c (gdb_dlopen): Return a gdb_dlhandle_up.
7025 (gdb_dlsym): Change type of "handle".
7026 (make_cleanup_dlclose): Remove.
7027 (dlclose_deleter::operator()): Rename from gdb_dlclose.
7028 * compile/compile-c-support.c (load_libcc): Update.
7032 * symtab.h (find_pcs_for_symtab_line): Change return type.
7033 * symtab.c (find_pcs_for_symtab_line): Change return type.
7034 * python/py-linetable.c (build_line_table_tuple_from_pcs): Change
7035 type of "vec". Update.
7036 (ltpy_get_pcs_for_line): Update.
7037 * linespec.c (decode_digits_ordinary): Update.
7041 * tracepoint.c (actions_command): Update.
7042 * python/python.c (python_command, python_interactive_command):
7044 * mi/mi-cmd-break.c (mi_cmd_break_commands): Update.
7045 * guile/guile.c (guile_command): Update.
7046 * defs.h (read_command_lines, read_command_lines_1): Return
7048 (command_lines_deleter): New struct.
7049 (command_line_up): New typedef.
7050 * compile/compile.c (compile_code_command)
7051 (compile_print_command): Update.
7052 * cli/cli-script.h (get_command_line, copy_command_lines): Return
7054 (make_cleanup_free_command_lines): Remove.
7055 * cli/cli-script.c (get_command_line, read_command_lines_1)
7056 (copy_command_lines): Return command_line_up.
7057 (while_command, if_command, read_command_lines, define_command)
7058 (document_command): Update.
7059 (do_free_command_lines_cleanup, make_cleanup_free_command_lines):
7061 * breakpoint.h (breakpoint_set_commands): Change type of
7063 * breakpoint.c (breakpoint_set_commands): Change type of
7065 (do_map_commands_command, update_dprintf_command_list)
7066 (create_tracepoint_from_upload): Update.
7070 * tracepoint.c (scope_info): Update.
7071 * spu-tdep.c (spu_catch_start): Update.
7072 * python/python.c (gdbpy_decode_line): Update.
7073 * python/py-finishbreakpoint.c (bpfinishpy_init): Update.
7074 * python/py-breakpoint.c (bppy_init): Update.
7075 * probe.c (parse_probes): Update.
7076 * mi/mi-cmd-break.c (mi_cmd_break_insert_1): Update.
7077 * location.h (event_location_deleter): New struct.
7078 (event_location_up): New typedef.
7079 (new_linespec_location, new_address_location, new_probe_location)
7080 (new_explicit_location, copy_event_location)
7081 (string_to_event_location, string_to_event_location_basic)
7082 (string_to_explicit_location): Update return type.
7083 (make_cleanup_delete_event_location): Remove.
7084 * location.c (new_linespec_location, new_address_location)
7085 (new_probe_location, new_explicit_location, copy_event_location):
7086 Return event_location_up.
7087 (delete_event_location_cleanup)
7088 (make_cleanup_delete_event_location): Remove.
7089 (string_to_explicit_location, string_to_event_location_basic)
7090 (string_to_event_location): Return event_location_up.
7091 * linespec.c (canonicalize_linespec, event_location_to_sals)
7092 (decode_line_with_current_source)
7093 (decode_line_with_last_displayed, decode_objc): Update.
7094 * guile/scm-breakpoint.c (gdbscm_register_breakpoint_x): Update.
7095 * completer.c (location_completer): Update.
7096 * cli/cli-cmds.c (edit_command, list_command): Update.
7097 * breakpoint.c (create_overlay_event_breakpoint)
7098 (create_longjmp_master_breakpoint)
7099 (create_std_terminate_master_breakpoint)
7100 (create_exception_master_breakpoint)
7101 (create_thread_event_breakpoint): Update.
7102 (init_breakpoint_sal): Update. Remove some dead code.
7103 (create_breakpoint_sal): Change type of "location". Update.
7104 (create_breakpoints_sal, create_breakpoint, break_command_1)
7105 (dprintf_command, break_range_command, until_break_command)
7106 (init_ada_exception_breakpoint)
7107 (strace_marker_create_sals_from_location)
7108 (update_static_tracepoint, trace_command, ftrace_command)
7109 (strace_command, create_tracepoint_from_upload): Update.
7110 * break-catch-throw.c (re_set_exception_catchpoint): Update.
7111 * ax-gdb.c (agent_command_1): Update.
7115 * Makefile.in (ALL_TARGET_OBS): Add i386-go32-tdep.o.
7116 * configure.tgt: Handle i[34567]86-*-go32* and
7117 i[34567]86-*-msdosdjgpp*.
7118 * i386-tdep.c (i386_svr4_reg_to_regnum):
7120 (i386_go32_init_abi, i386_coff_osabi_sniffer): Moved to
7122 (_initialize_i386_tdep): DJGPP bits moved to i386-go32-tdep.c.
7123 * i386-go32-tdep.c: New file.
7124 * i386-tdep.h (tdesc_i386_mmx, i386_svr4_reg_to_regnum): New
7129 * aix-thread.c (pd_status2str): Change return type to const char *.
7133 * i386-tdep.c (i386_elf_init_abi, i386_go32_init_abi): Remove
7134 calls to set_gdbarch_gnu_triplet_regexp.
7139 * c-lang.c (cplus_primitive_types) <cplus_primitive_type_wchar_t>:
7141 (cplus_language_arch_info): Register cplus_primitive_type_wchar_t.
7142 * gdbtypes.h (struct builtin_type) <builtin_wchar>: New field.
7143 * gdbtypes.c (gdbtypes_post_init): Create the "wchar_t" type.
7144 * gdbarch.sh (wchar_bit, wchar_signed): New per-arch values.
7145 * gdbarch.h, gdbarch.c: Regenerate.
7146 * aarch64-tdep.c (aarch64_gdbarch_init): Override
7147 gdbarch_wchar_bit and gdbarch_wchar_signed.
7148 * alpha-tdep.c (alpha_gdbarch_init): Likewise.
7149 * arm-tdep.c (arm_gdbarch_init): Likewise.
7150 * avr-tdep.c (avr_gdbarch_init): Likewise.
7151 * h8300-tdep.c (h8300_gdbarch_init): Likewise.
7152 * i386-nto-tdep.c (i386nto_init_abi): Likewise.
7153 * i386-tdep.c (i386_go32_init_abi): Likewise.
7154 * m32r-tdep.c (m32r_gdbarch_init): Likewise.
7155 * moxie-tdep.c (moxie_gdbarch_init): Likewise.
7156 * nds32-tdep.c (nds32_gdbarch_init): Likewise.
7157 * rs6000-aix-tdep.c (rs6000_aix_init_osabi): Likewise.
7158 * sh-tdep.c (sh_gdbarch_init): Likewise.
7159 * sparc-tdep.c (sparc32_gdbarch_init): Likewise.
7160 * sparc64-tdep.c (sparc64_init_abi): Likewise.
7161 * windows-tdep.c (windows_init_abi): Likewise.
7162 * xstormy16-tdep.c (xstormy16_gdbarch_init): Likewise.
7167 * c-lang.c (cplus_primitive_types) <cplus_primitive_type_char16_t,
7168 cplus_primitive_type_char32_t>: New enum values.
7169 (cplus_language_arch_info): Register cplus_primitive_type_char16_t
7170 and cplus_primitive_type_char32_t.
7171 * dwarf2read.c (read_base_type) <DW_ATE_UTF>: If bit size is 16 or
7172 32, use the archtecture's built-in type for char16_t and char32_t,
7173 respectively. Otherwise, fallback to init_integer_type as before,
7174 but make the type unsigned, and issue a complaint.
7175 * gdbtypes.c (gdbtypes_post_init): Make char16_t and char32_t unsigned.
7179 * m32r-tdep.c (M32R_ARG_REGISTER_SIZE): Added.
7180 (m32r_push_dummy_call): Use M32R_ARG_REGISTER_SIZE.
7184 * windows-nat.c (windows_create_inferior): Declare 'toexec' as
7189 * common/common-utils.c (free_vector_argv): New function.
7190 * common/common-utils.h: Include <vector>.
7191 (free_vector_argv): New prototype.
7192 * darwin-nat.c (darwin_create_inferior): Rewrite function
7193 prototype in order to constify "exec_file" and accept a
7194 "std::string" for "allargs".
7195 * fork-child.c: Include <vector>.
7196 (breakup_args): Rewrite function, using C++.
7197 (fork_inferior): Rewrite function header, constify "exec_file_arg"
7198 and accept "std::string" for "allargs". Update the code to
7199 calculate "argv" based on "allargs". Update calls to "exec_fun"
7201 * gnu-nat.c (gnu_create_inferior): Rewrite function prototype in
7202 order to constify "exec_file" and accept a "std::string" for
7204 * go32-nat.c (go32_create_inferior): Likewise.
7205 * inf-ptrace.c (inf_ptrace_create_inferior): Likewise.
7206 * infcmd.c (run_command_1): Constify "exec_file". Use
7207 "std::string" for inferior arguments.
7208 * inferior.h (fork_inferior): Update prototype.
7209 * linux-nat.c (linux_nat_create_inferior): Rewrite function
7210 prototype in order to constify "exec_file" and accept a
7211 "std::string" for "allargs".
7212 * nto-procfs.c (procfs_create_inferior): Likewise.
7213 * procfs.c (procfs_create_inferior): Likewise.
7214 * remote-sim.c (gdbsim_create_inferior): Likewise.
7215 * remote.c (extended_remote_run): Update code to accept
7216 "std::string" as argument.
7217 (extended_remote_create_inferior): Rewrite function prototype in
7218 order to constify "exec_file" and accept a "std::string" for
7220 * rs6000-nat.c (super_create_inferior): Likewise.
7221 (rs6000_create_inferior): Likewise.
7222 * target.h (struct target_ops) <to_create_inferior>: Likewise.
7223 * windows-nat.c (windows_create_inferior): Likewise.
7227 * thread.c: Fix whitespace throughout.
7231 * linux-nat.c (linux_nat_detach): Remove delete_lwp call.
7235 * arm-tdep.c (arm_store_return_value): Use FP_REGISTER_SIZE
7240 * osdata.c (info_osdata): Check if 'type' is an empty string
7245 * thread.c (add_thread_silent, delete_thread_1, find_thread_ptid)
7246 (ptid_to_global_thread_id, in_thread_list)
7247 (do_captured_list_thread_ids, set_resumed, set_running)
7248 (set_executing, set_stop_requested, finish_thread_state)
7249 (validate_registers_access, can_access_registers_ptid)
7250 (print_thread_info_1, switch_to_thread)
7251 (do_restore_current_thread_cleanup)
7252 (make_cleanup_restore_current_thread, thread_command)
7253 (thread_name_command): Use operator== instead of ptid_equal.
7257 * thread.c (struct current_thread_cleanup) <next>: Delete field.
7258 (current_thread_cleanup_chain): Delete.
7259 (restore_current_thread_cleanup_dtor)
7260 (make_cleanup_restore_current_thread): Remove references to
7261 current_thread_cleanup_chain.
7265 * msp430-tdep.c (msp430_pseudo_register_read): Never return
7271 * gdbthread.h (thread_info::deletable): New method.
7272 (thread_info::incref): New method.
7273 (thread_info::decref): New method.
7274 (thread_info::refcount): Move it to private.
7275 * infrun.c (save_stop_context): Call inc_refcount.
7276 (release_stop_context_cleanup): Likewise.
7277 * thread.c (set_thread_exited): New function.
7278 (init_thread_list): Delete "tp" only it is deletable, otherwise
7279 call set_thread_exited.
7280 (delete_thread_1): Call set_thread_exited.
7281 (current_thread_cleanup) <inferior_pid>: Remove.
7282 <thread>: New field.
7283 (restore_current_thread_ptid_changed): Removed.
7284 (do_restore_current_thread_cleanup): Adjust.
7285 (restore_current_thread_cleanup_dtor): Don't call
7287 (set_thread_refcount): Use dec_refcount.
7288 (make_cleanup_restore_current_thread): Adjust.
7289 (thread_apply_all_command): Call inc_refcount.
7290 (_initialize_thread): Don't call
7291 observer_attach_thread_ptid_changed.
7295 * thread.c (delete_thread_1): Hoist code on marking thread as
7300 * windows-nat.c (windows_detach): Initialize ptid with
7305 * unittests/ptid-selftests.c: Fix erroneous assert messages.
7309 * bfin-tdep.c (BFIN_MAX_REGISTER_SIZE): Add.
7310 (bfin_pseudo_register_read): Use BFIN_MAX_REGISTER_SIZE.
7311 (bfin_pseudo_register_write): Likewise
7315 * common/ptid.h (struct ptid): Change to...
7316 (class ptid_t): ... this.
7317 <ptid_t>: New constructors.
7318 <pid, lwp_p, lwp, tid_p, tid, is_pid, operator==, operator!=,
7319 matches>: New methods.
7320 <make_null, make_minus_one>: New static methods.
7327 (ptid_build, ptid_get_pid, ptid_get_lwp, ptid_get_tid, ptid_equal,
7328 ptid_is_pid, ptid_lwp_p, ptid_tid_p, ptid_match): Take ptid arguments
7329 as references, move comment to class ptid_t.
7330 * common/ptid.c (null_ptid, minus_one_ptid): Initialize with
7331 ptid_t static methods.
7332 (ptid_build, pid_to_ptid, ptid_get_pid, ptid_get_tid,
7333 ptid_equal, ptid_is_pid, ptid_lwp_p, ptid_tid_p, ptid_match):
7334 Take ptid arguments as references, implement using ptid_t methods.
7335 * unittests/ptid-selftests.c: New file.
7336 * Makefile.in (SUBDIR_UNITTESTS_SRCS): Add
7337 unittests/ptid-selftests.c.
7338 (SUBDIR_UNITTESTS_OBS): Add unittests/ptid-selftests.o.
7342 * python/python.c (python_run_simple_file): Cast mode literal to
7343 non-const char pointer as expected by PyFile_FromString.
7347 * common/ptid.c (ptid_lwp_p, ptid_tid_p): Remove comparison with
7348 minus_one_ptid and null_ptid.
7352 * warning.m4 (build_warnings): Remove -Wno-write-strings.
7353 * configure: Regenerate.
7357 * ada-exp.y (yyerror): Constify.
7358 * ada-lang.c (bound_name, get_selections)
7359 (ada_variant_discrim_type)
7360 (ada_variant_discrim_name, ada_value_struct_elt)
7361 (ada_lookup_struct_elt_type, is_unchecked_variant)
7362 (ada_which_variant_applies, standard_exc, ada_get_next_arg)
7363 (catch_ada_exception_command_split)
7364 (catch_ada_assert_command_split, catch_assert_command)
7365 (ada_op_name): Constify.
7366 * ada-lang.h (ada_yyerror, get_selections)
7367 (ada_variant_discrim_name, ada_value_struct_elt): Constify.
7368 * arc-tdep.c (arc_print_frame_cache): Constify.
7369 * arm-tdep.c (arm_skip_stub): Constify.
7370 * ax-gdb.c (gen_binop, gen_struct_ref_recursive, gen_struct_ref)
7371 (gen_aggregate_elt_ref): Constify.
7372 * bcache.c (print_bcache_statistics): Constify.
7373 * bcache.h (print_bcache_statistics): Constify.
7374 * break-catch-throw.c (catch_exception_command_1):
7375 * breakpoint.c (struct ep_type_description::description):
7377 (add_solib_catchpoint): Constify.
7378 (catch_fork_command_1): Add cast.
7379 (add_catch_command): Constify.
7380 * breakpoint.h (add_catch_command, add_solib_catchpoint):
7382 * bsd-uthread.c (bsd_uthread_state): Constify.
7383 * buildsym.c (patch_subfile_names): Constify.
7384 * buildsym.h (next_symbol_text_func, patch_subfile_names):
7386 * c-exp.y (yyerror): Constify.
7387 (token::oper): Constify.
7388 * c-lang.h (c_yyerror, cp_print_class_member): Constify.
7389 * c-varobj.c (cplus_describe_child): Constify.
7390 * charset.c (find_charset_names): Add cast.
7391 (find_charset_names): Constify array and add const_cast.
7392 * cli/cli-cmds.c (complete_command, cd_command): Constify.
7393 (edit_command): Constify.
7394 * cli/cli-decode.c (lookup_cmd): Constify.
7395 * cli/cli-dump.c (dump_memory_command, dump_value_command):
7397 (struct dump_context): Constify.
7398 (add_dump_command, restore_command): Constify.
7399 * cli/cli-script.c (get_command_line): Constify.
7400 * cli/cli-script.h (get_command_line): Constify.
7401 * cli/cli-utils.c (check_for_argument): Constify.
7402 * cli/cli-utils.h (check_for_argument): Constify.
7403 * coff-pe-read.c (struct read_pe_section_data): Constify.
7404 * command.h (lookup_cmd): Constify.
7405 * common/print-utils.c (decimal2str): Constify.
7406 * completer.c (gdb_print_filename): Constify.
7407 * corefile.c (set_gnutarget): Constify.
7408 * cp-name-parser.y (yyerror): Constify.
7409 * cp-valprint.c (cp_print_class_member): Constify.
7410 * cris-tdep.c (cris_register_name, crisv32_register_name):
7412 * d-exp.y (yyerror): Constify.
7413 (struct token::oper): Constify.
7414 * d-lang.h (d_yyerror): Constify.
7415 * dbxread.c (struct header_file_location::name): Constify.
7416 (add_old_header_file, add_new_header_file, last_function_name)
7417 (dbx_next_symbol_text, add_bincl_to_list)
7418 (find_corresponding_bincl_psymtab, set_namestring)
7419 (find_stab_function_addr, read_dbx_symtab, start_psymtab)
7420 (dbx_end_psymtab, read_ofile_symtab, process_one_symbol):
7421 * defs.h (command_line_input, print_address_symbolic)
7422 (deprecated_readline_begin_hook): Constify.
7423 * dwarf2read.c (anonymous_struct_prefix, dwarf_bool_name):
7425 * event-top.c (handle_line_of_input): Constify and add cast.
7426 * exceptions.c (catch_errors): Constify.
7427 * exceptions.h (catch_errors): Constify.
7428 * expprint.c (print_subexp_standard, op_string, op_name)
7429 (op_name_standard, dump_raw_expression, dump_raw_expression):
7430 * expression.h (op_name, op_string, dump_raw_expression):
7432 * f-exp.y (yyerror): Constify.
7433 (struct token::oper): Constify.
7434 (struct f77_boolean_val::name): Constify.
7435 * f-lang.c (f_word_break_characters): Constify.
7436 * f-lang.h (f_yyerror): Constify.
7437 * fork-child.c (fork_inferior): Add cast.
7438 * frv-tdep.c (struct gdbarch_tdep::register_names): Constify.
7439 (new_variant): Constify.
7440 * gdbarch.sh (pstring_ptr, pstring_list): Constify.
7441 * gdbarch.c: Regenerate.
7442 * gdbcore.h (set_gnutarget): Constify.
7443 * go-exp.y (yyerror): Constify.
7444 (token::oper): Constify.
7445 * go-lang.h (go_yyerror): Constify.
7446 * go32-nat.c (go32_sysinfo): Constify.
7447 * guile/scm-breakpoint.c (gdbscm_breakpoint_expression): Constify.
7448 * guile/scm-cmd.c (cmdscm_function): Constify.
7449 * guile/scm-param.c (pascm_param_value): Constify.
7450 * h8300-tdep.c (h8300_register_name, h8300s_register_name)
7451 (h8300sx_register_name): Constify.
7452 * hppa-tdep.c (hppa32_register_name, hppa64_register_name):
7454 * ia64-tdep.c (ia64_register_names): Constify.
7455 * infcmd.c (construct_inferior_arguments): Constify.
7456 (path_command, attach_post_wait): Constify.
7457 * language.c (show_range_command, show_case_command)
7458 (unk_lang_error): Constify.
7459 * language.h (language_defn::la_error)
7460 (language_defn::la_name_of_this): Constify.
7461 * linespec.c (decode_line_2): Constify.
7462 * linux-thread-db.c (thread_db_err_str): Constify.
7463 * lm32-tdep.c (lm32_register_name): Constify.
7464 * m2-exp.y (yyerror): Constify.
7465 * m2-lang.h (m2_yyerror): Constify.
7466 * m32r-tdep.c (m32r_register_names): Constify and make static.
7467 * m68hc11-tdep.c (m68hc11_register_names): Constify.
7468 * m88k-tdep.c (m88k_register_name): Constify.
7469 * macroexp.c (appendmem): Constify.
7470 * mdebugread.c (fdr_name, add_data_symbol, parse_type)
7471 (upgrade_type, parse_external, parse_partial_symbols)
7472 (mdebug_next_symbol_text, cross_ref, mylookup_symbol, new_psymtab)
7473 (new_symbol): Constify.
7474 * memattr.c (mem_info_command): Constify.
7475 * mep-tdep.c (register_name_from_keyword): Constify.
7476 * mi/mi-cmd-env.c (mi_cmd_env_path, _initialize_mi_cmd_env):
7478 * mi/mi-cmd-stack.c (list_args_or_locals): Constify.
7479 * mi/mi-cmd-var.c (mi_cmd_var_show_attributes): Constify.
7480 * mi/mi-main.c (captured_mi_execute_command): Constify and add
7482 (mi_execute_async_cli_command): Constify.
7483 * mips-tdep.c (mips_register_name): Constify.
7484 * mn10300-tdep.c (register_name, mn10300_generic_register_name)
7485 (am33_register_name, am33_2_register_name)
7486 * moxie-tdep.c (moxie_register_names): Constify.
7487 * nat/linux-osdata.c (osdata_type): Constify fields.
7488 * nto-tdep.c (nto_parse_redirection): Constify.
7489 * objc-lang.c (lookup_struct_typedef, lookup_objc_class)
7490 (lookup_child_selector): Constify.
7491 (objc_methcall::name): Constify.
7492 * objc-lang.h (lookup_objc_class, lookup_child_selector)
7493 (lookup_struct_typedef): Constify.
7494 * objfiles.c (pc_in_section): Constify.
7495 * objfiles.h (pc_in_section): Constify.
7496 * p-exp.y (struct token::oper): Constify.
7497 (yyerror): Constify.
7498 * p-lang.h (pascal_yyerror): Constify.
7499 * parser-defs.h (op_name_standard): Constify.
7500 (op_print::string): Constify.
7501 (exp_descriptor::op_name): Constify.
7502 * printcmd.c (print_address_symbolic): Constify.
7503 * psymtab.c (print_partial_symbols): Constify.
7504 * python/py-breakpoint.c (stop_func): Constify.
7505 (bppy_get_expression): Constify.
7506 * python/py-cmd.c (cmdpy_completer::name): Constify.
7507 (cmdpy_function): Constify.
7508 * python/py-event.c (evpy_add_attribute)
7509 (gdbpy_initialize_event_generic): Constify.
7510 * python/py-event.h (evpy_add_attribute)
7511 (gdbpy_initialize_event_generic): Constify.
7512 * python/py-evts.c (add_new_registry): Constify.
7513 * python/py-finishbreakpoint.c (outofscope_func): Constify.
7514 * python/py-framefilter.c (get_py_iter_from_func): Constify.
7515 * python/py-inferior.c (get_buffer): Add cast.
7516 * python/py-param.c (parm_constant::name): Constify.
7517 * python/py-unwind.c (fprint_frame_id): Constify.
7518 * python/python.c (gdbpy_parameter_value): Constify.
7519 * remote-fileio.c (remote_fio_func_map): Make 'name' const.
7520 * remote.c (memory_packet_config::name): Constify.
7521 (show_packet_config_cmd, remote_write_bytes)
7522 (remote_buffer_add_string):
7523 * reverse.c (exec_reverse_once): Constify.
7524 * rs6000-tdep.c (variant::name, variant::description): Constify.
7525 * rust-exp.y (rustyyerror): Constify.
7526 * rust-lang.c (rust_op_name): Constify.
7527 * rust-lang.h (rustyyerror): Constify.
7528 * serial.h (serial_ops::name): Constify.
7529 * sh-tdep.c (sh_sh_register_name, sh_sh3_register_name)
7530 (sh_sh3e_register_name, sh_sh2e_register_name)
7531 (sh_sh2a_register_name, sh_sh2a_nofpu_register_name)
7532 (sh_sh_dsp_register_name, sh_sh3_dsp_register_name)
7533 (sh_sh4_register_name, sh_sh4_nofpu_register_name)
7534 (sh_sh4al_dsp_register_name): Constify.
7535 * sh64-tdep.c (sh64_register_name): Constify.
7536 * solib-darwin.c (lookup_symbol_from_bfd): Constify.
7537 * spu-tdep.c (spu_register_name, info_spu_dma_cmdlist): Constify.
7538 * stabsread.c (patch_block_stabs, read_type_number)
7539 (ref_map::stabs, ref_add, process_reference)
7540 (symbol_reference_defined, define_symbol, define_symbol)
7541 (error_type, read_type, read_member_functions, read_cpp_abbrev)
7542 (read_one_struct_field, read_struct_fields, read_baseclasses)
7543 (read_tilde_fields, read_struct_type, read_array_type)
7544 (read_enum_type, read_sun_builtin_type, read_sun_floating_type)
7545 (read_huge_number, read_range_type, read_args, common_block_start)
7546 (find_name_end): Constify.
7547 * stabsread.h (common_block_start, define_symbol)
7548 (process_one_symbol, symbol_reference_defined, ref_add):
7549 * symfile.c (get_section_index, add_symbol_file_command):
7550 * symfile.h (get_section_index): Constify.
7551 * target-descriptions.c (tdesc_type::name): Constify.
7552 (tdesc_free_type): Add cast.
7553 * target.c (find_default_run_target):
7554 (add_deprecated_target_alias, find_default_run_target)
7555 (target_announce_detach): Constify.
7556 (do_option): Constify.
7557 * target.h (add_deprecated_target_alias): Constify.
7558 * thread.c (print_thread_info_1): Constify.
7559 * top.c (deprecated_readline_begin_hook, command_line_input):
7561 (init_main): Add casts.
7562 * top.h (handle_line_of_input): Constify.
7563 * tracefile-tfile.c (tfile_write_uploaded_tsv): Constify.
7564 * tracepoint.c (tvariables_info_1, trace_status_mi): Constify.
7565 (tfind_command): Rename to ...
7566 (tfind_command_1): ... this and constify.
7567 (tfind_command): New function.
7568 (tfind_end_command, tfind_start_command): Adjust.
7569 (encode_source_string): Constify.
7570 * tracepoint.h (encode_source_string): Constify.
7571 * tui/tui-data.c (tui_partial_win_by_name): Constify.
7572 * tui/tui-data.h (tui_partial_win_by_name): Constify.
7573 * tui/tui-source.c (tui_set_source_content_nil): Constify.
7574 * tui/tui-source.h (tui_set_source_content_nil): Constify.
7575 * tui/tui-win.c (parse_scrolling_args): Constify.
7576 * tui/tui-windata.c (tui_erase_data_content): Constify.
7577 * tui/tui-windata.h (tui_erase_data_content): Constify.
7578 * tui/tui-winsource.c (tui_erase_source_content): Constify.
7579 * tui/tui.c (tui_enable): Add cast.
7580 * utils.c (defaulted_query): Constify.
7581 (init_page_info): Add cast.
7582 (puts_debug, subset_compare): Constify.
7583 * utils.h (subset_compare): Constify.
7584 * varobj.c (varobj_format_string): Constify.
7585 * varobj.h (varobj_format_string): Constify.
7586 * vax-tdep.c (vax_register_name): Constify.
7587 * windows-nat.c (windows_detach): Constify.
7588 * xcoffread.c (process_linenos, xcoff_next_symbol_text): Constify.
7589 * xml-support.c (gdb_xml_end_element): Constify.
7590 * xml-tdesc.c (tdesc_start_reg): Constify.
7591 * xstormy16-tdep.c (xstormy16_register_name): Constify.
7592 * xtensa-tdep.c (xtensa_find_register_by_name): Constify.
7593 * xtensa-tdep.h (xtensa_register_t::name): Constify.
7597 * proc-api.c (struct trans): Constify.
7598 (procfs_note): Constify.
7599 * proc-events.c (struct trans, syscall_table):
7600 * proc-flags.c (struct trans): Constify.
7601 * proc-utils.h (procfs_note): Constify.
7602 * proc-why.c (struct trans): Constify.
7603 * procfs.c (dead_procinfo, find_syscall, proc_warn, proc_error)
7604 (procfs_detach): Constify.
7605 * sol-thread.c (struct string_map): Constify.
7606 (td_err_string, td_state_string): Constify.
7610 * proc-api.c (procfs_filename): Don't initialize
7612 (prepare_to_trace): Assume procfs_filename is non-NULL.
7613 (_initialize_proc_api): Give procfs_filename a default value here.
7617 * break-catch-throw.c (handle_gnu_v3_exceptions): Constify
7618 'cond_string' parameter.
7619 (extract_exception_regexp): Constify 'string' parameter.
7620 (catch_exception_command_1): Constify.
7621 * breakpoint.c (init_catchpoint)
7622 (create_fork_vfork_event_catchpoint): Constify 'cond_string'
7624 (ep_parse_optional_if_clause, catch_fork_command_1)
7625 (catch_exec_command_1): Constify.
7626 * breakpoint.h (init_catchpoint): Constify 'cond_string'
7628 (ep_parse_optional_if_clause): Constify.
7629 * cli/cli-utils.c (remove_trailing_whitespace)
7630 (check_for_argument): Constify.
7631 * cli/cli-utils.h (remove_trailing_whitespace): Constify and add
7633 (check_for_argument): Likewise.
7637 * event-top.c (command_line_handler): Add cast to execute_command
7639 * record-btrace.c (cmd_record_btrace_bts_start)
7640 (cmd_record_btrace_pt_start, cmd_record_btrace_start)
7641 (cmd_record_btrace_start): Add cast to execute_command call.
7642 * record-full.c (record_full_goto_insn):
7643 * record.c (record_start, record_stop): Add cast to
7644 execute_command_to_string calls.
7645 (cmd_record_start): Add cast to execute_command calls.
7649 * python/python-internal.h (gdb_PyArg_ParseTupleAndKeywords): New
7650 static inline function.
7651 * python/py-arch.c (archpy_disassemble): Constify 'keywords'
7652 array and use gdb_PyArg_ParseTupleAndKeywords.
7653 * python/py-cmd.c (cmdpy_init): Likewise.
7654 * python/py-finishbreakpoint.c (bpfinishpy_init): Likewise.
7655 * python/py-inferior.c (infpy_read_memory, infpy_write_memory)
7656 (infpy_search_memory): Likewise.
7657 * python/py-objfile.c (objfpy_add_separate_debug_file)
7658 (gdbpy_lookup_objfile): Likewise.
7659 * python/py-symbol.c (gdbpy_lookup_symbol)
7660 (gdbpy_lookup_global_symbol): Likewise.
7661 * python/py-type.c (gdbpy_lookup_type): Likewise.
7662 * python/py-value.c (valpy_lazy_string, valpy_string): Likewise.
7663 * python/python.c (execute_gdb_command, gdbpy_write, gdbpy_flush):
7668 * python/python-internal.h (gdb_PyGetSetDef): New type.
7669 * python/py-block.c (block_object_getset)
7670 (breakpoint_object_getset): Now a gdb_PyGetSetDef array.
7671 * python/py-event.c (event_object_getset)
7672 (finish_breakpoint_object_getset): Likewise.
7673 * python/py-inferior.c (inferior_object_getset): Likewise.
7674 * python/py-infthread.c (thread_object_getset): Likewise.
7675 * python/py-lazy-string.c (lazy_string_object_getset): Likewise.
7676 * python/py-linetable.c (linetable_entry_object_getset): Likewise.
7677 * python/py-objfile.c (objfile_getset): Likewise.
7678 * python/py-progspace.c (pspace_getset): Likewise.
7679 * python/py-record-btrace.c (btpy_insn_getset, btpy_call_getset):
7681 * python/py-record.c (recpy_record_getset): Likewise.
7682 * python/py-symbol.c (symbol_object_getset): Likewise.
7683 * python/py-symtab.c (symtab_object_getset, sal_object_getset):
7685 * python/py-type.c (type_object_getset, field_object_getset):
7687 * python/py-value.c (value_object_getset): Likewise.
7691 * python/python-internal.h (gdb_PyObject_CallMethod)
7692 (gdb_PyErr_NewException, gdb_PySys_GetObject, gdb_PySys_SetPath):
7694 (GDB_PYSYS_SETPATH_CHAR, PyObject_CallMethod, PyErr_NewException)
7695 (PySys_GetObject, PySys_SetPath): New macros.
7699 * mi/mi-cmd-info.c (mi_cmd_info_os): Call info_osdata instead of
7700 info_osdata_command.
7701 * osdata.c (info_osdata_command): Rename to ...
7702 (info_osdata): ... this. Constify 'type' parameter, and remove
7703 the 'from_tty' parameter. Accept NULL TYPE.
7704 (info_osdata_command): New function.
7705 * osdata.h (info_osdata_command): Remove declaration.
7706 (info_osdata): New declaration.
7710 * mi/mi-cmd-break.c (mi_cmd_break_insert_1, mi_cmd_break_insert)
7711 (mi_cmd_dprintf_insert, mi_cmd_break_passcount)
7712 (mi_cmd_break_watch, mi_cmd_break_commands): Constify 'command'
7714 * mi/mi-cmd-catch.c (mi_cmd_catch_assert, mi_cmd_catch_exception)
7715 (mi_cmd_catch_load, mi_cmd_catch_unload): Constify cmd' parameter.
7716 * mi/mi-cmd-disas.c (mi_cmd_disassemble): Constify 'command'
7718 * mi/mi-cmd-env.c (mi_cmd_env_pwd, mi_cmd_env_cd, mi_cmd_env_path)
7719 (mi_cmd_env_dir, mi_cmd_inferior_tty_set, _cmd_inferior_tty_show)
7720 * mi/mi-cmd-file.c (mi_cmd_file_list_exec_source_file)
7721 (mi_cmd_file_list_exec_source_files)
7722 (mi_cmd_file_list_shared_libraries): Constify 'command' parameter.
7723 * mi/mi-cmd-info.c (mi_cmd_info_ada_exceptions)
7724 (mi_cmd_info_gdb_mi_command, mi_cmd_info_os): Constify 'command'
7726 * mi/mi-cmd-stack.c (mi_cmd_enable_frame_filters)
7727 (mi_cmd_stack_list_frames, mi_cmd_stack_info_depth)
7728 (mi_cmd_stack_list_locals, mi_cmd_stack_list_args)
7729 (mi_cmd_stack_list_variables, mi_cmd_stack_select_frame)
7730 (mi_cmd_stack_info_frame): Constify 'command' parameter.
7731 * mi/mi-cmd-target.c (mi_cmd_target_file_get)
7732 (mi_cmd_target_file_put, mi_cmd_target_file_delete): Constify
7733 'command' parameter.
7734 * mi/mi-cmd-var.c (mi_cmd_var_create, mi_cmd_var_delete)
7735 (mi_cmd_var_set_format, mi_cmd_var_set_visualizer)
7736 (mi_cmd_var_set_frozen, mi_cmd_var_show_format)
7737 (mi_cmd_var_info_num_children, mi_cmd_var_list_children)
7738 (mi_cmd_var_info_type, mi_cmd_var_info_path_expression)
7739 (mi_cmd_var_info_expression, mi_cmd_var_show_attributes)
7740 (mi_cmd_var_evaluate_expression, mi_cmd_var_assign)
7741 (mi_cmd_var_update, mi_cmd_enable_pretty_printing)
7742 (mi_cmd_var_set_update_range): Constify 'command' parameter.
7743 * mi/mi-cmds.h (mi_cmd_argv_ftype): Constify 'command' parameter.
7744 * mi/mi-interp.c (mi_cmd_interpreter_exec): Constify 'command'
7746 * mi/mi-main.c (mi_cmd_gdb_exit, mi_cmd_exec_next)
7747 (mi_cmd_exec_next_instruction, mi_cmd_exec_step)
7748 (mi_cmd_exec_step_instruction, mi_cmd_exec_finish)
7749 (mi_cmd_exec_return ,mi_cmd_exec_jump, mi_cmd_exec_continue)
7750 (mi_cmd_exec_interrupt, mi_cmd_exec_run, mi_cmd_target_detach)
7751 (mi_cmd_target_flash_erase, mi_cmd_thread_select)
7752 (mi_cmd_thread_list_ids, mi_cmd_thread_info)
7753 (mi_cmd_list_thread_groups, mi_cmd_data_list_register_names)
7754 (mi_cmd_data_list_changed_registers)
7755 (mi_cmd_data_write_register_values)
7756 (mi_cmd_data_evaluate_expression, mi_cmd_data_read_memory)
7757 (mi_cmd_data_read_memory_bytes, mi_cmd_data_write_memory)
7758 (mi_cmd_data_write_memory_bytes, mi_cmd_enable_timings)
7759 (mi_cmd_list_features, mi_cmd_list_target_features)
7760 (mi_cmd_add_inferior, mi_cmd_remove_inferior)
7761 (mi_cmd_trace_define_variable, mi_cmd_trace_list_variables)
7762 (mi_cmd_trace_find, mi_cmd_trace_save, mi_cmd_trace_start)
7763 (mi_cmd_trace_status, mi_cmd_trace_stop, mi_cmd_ada_task_info)
7764 (mi_cmd_trace_frame_collected): Constify 'command'
7766 * mi/mi-symbol-cmds.c (mi_cmd_symbol_list_lines): Constify
7767 'command' parameter.
7771 * ada-lang.c (ada_completer_word_break_characters): Now a const
7773 (ada_get_gdb_completer_word_break_characters): Constify.
7774 * completer.c (gdb_completer_command_word_break_characters)
7775 (gdb_completer_file_name_break_characters)
7776 (gdb_completer_quote_characters): Now const arrays.
7777 (get_gdb_completer_quote_characters): Constify.
7778 (set_rl_completer_word_break_characters): New function.
7779 (set_gdb_completion_word_break_characters)
7780 (complete_line_internal): Use it.
7781 * completer.h (get_gdb_completer_quote_characters): Constify.
7782 (set_rl_completer_word_break_characters): Declare.
7783 * f-lang.c (f_word_break_characters): Constify.
7784 * language.c (default_word_break_characters): Constify.
7785 * language.h (language_defn::la_word_break_characters): Constify.
7786 (default_word_break_characters): Constify.
7787 * top.c (init_main): Use set_rl_completer_word_break_characters.
7791 * aix-thread.c (aix_thread_pid_to_str)
7792 (aix_thread_extra_thread_info): Constify.
7793 * bsd-kvm.c (bsd_kvm_pid_to_str): Constify.
7794 * bsd-uthread.c (bsd_uthread_extra_thread_info)
7795 (bsd_uthread_pid_to_str): Constify.
7796 * corelow.c (core_pid_to_str): Constify.
7797 * darwin-nat.c (darwin_pid_to_str): Constify.
7798 * fbsd-nat.c (fbsd_pid_to_str): Constify.
7799 * fbsd-tdep.c (fbsd_core_pid_to_str, gdbarch_core_pid_to_str):
7801 * gnu-nat.c (gnu_pid_to_str): Constify.
7802 * go32-nat.c (go32_pid_to_str): Constify.
7803 * i386-cygwin-tdep.c (i386_windows_core_pid_to_str): Constify.
7804 * inf-ptrace.c (inf_ptrace_pid_to_str): Constify.
7805 * inferior.c (inferior_pid_to_str): Constify.
7806 * linux-nat.c (linux_nat_pid_to_str): Constify.
7807 * linux-tdep.c (linux_core_pid_to_str): Constify.
7808 * linux-thread-db.c (thread_db_pid_to_str)
7809 (thread_db_extra_thread_info): Constify.
7810 * nto-tdep.c (nto_extra_thread_info): Constify.
7811 * nto-tdep.h (nto_extra_thread_info): Constify.
7812 * obsd-nat.c (obsd_pid_to_str): Constify.
7813 * procfs.c (procfs_pid_to_str): Constify.
7814 * ravenscar-thread.c (ravenscar_extra_thread_info)
7815 (ravenscar_pid_to_str): Constify.
7816 * remote-sim.c (gdbsim_pid_to_str): Constify.
7817 * remote.c (remote_threads_extra_info, remote_pid_to_str):
7819 * sol-thread.c (solaris_pid_to_str): Constify.
7820 * sol2-tdep.c (sol2_core_pid_to_str): Constify.
7821 * sol2-tdep.h (sol2_core_pid_to_str): Constify.
7822 * target.c (default_pid_to_str, target_pid_to_str)
7823 (normal_pid_to_str, default_pid_to_str): Constify.
7824 * target.h (target_ops::to_pid_to_str)
7825 (target_ops::to_extra_thread_info): Constify.
7826 (target_pid_to_str, normal_pid_to_str): Constify.
7827 * windows-nat.c (windows_pid_to_str): Constify.
7828 * gdbarch.sh (core_pid_to_str): Constify.
7829 * target-delegates.c: Regenerate.
7830 * gdbarch.h, gdbarch.c: Regenerate.
7834 * main.c (captured_main_1): Use gdb::unique_xmalloc_ptr to manage
7835 the memory of the temporary warning_pre_print override.
7836 * utils.c (warning_pre_print): Constify.
7837 * utils.h (warning_pre_print): Constify.
7841 * cli/cli-cmds.c (shell_escape): Constify 'arg' parameter.
7842 (shell_command): New function.
7843 (make_command): Use std::string.
7844 (init_cli_cmds): Register shell_command instead of shell_escape.
7848 * breakpoint.c (dprintf_function, dprintf_channel): Don't initialize.
7849 * tracepoint.c (default_collect): Don't initialize.
7853 * macroexp.c (macro_buffer::shared): Now a bool.
7854 (init_buffer): Update.
7855 (init_shared_buffer): Constify 'addr' parameter.
7856 (substitute_args, expand, macro_expand, macro_expand_next): Remove
7861 * arm-tdep.c (show_disassembly_style_sfunc): Constify local.
7862 * disasm.c (set_disassembler_options): Constify local.
7863 * i386-tdep.c (i386_print_insn): Remove cast and FIXME comment.
7868 * tracefile.c (tsave_command): Fix argument parsing for '-r'
7873 * frame.c (frame_unwind_register_unsigned): Call
7874 frame_unwind_register_value.
7878 * gdb.threads/thread-specific-bp.exp (check_thread_specific_breakpoint):
7879 Use gdb_test_multiple, and don't match anchor.
7883 * MAINTAINERS (Global Maintainers): Add Simon Marchi.
7884 (Write After Approval): Remove Simon Marchi.
7888 * common/gdb_optional.h (optional::optional): Make constexpr and
7893 * amd64-fbsd-tdep.c: Remove "bsd-uthread.h" include.
7894 (amd64fbsd_jmp_buf_reg_offset): Remove.
7895 (amd64fbsd_supply_uthread): Remove function.
7896 (amd64fbsd_collect_uthread): Remove function.
7897 (amd64fbsd_init_abi): Don't set bsd-uthread callbacks.
7898 * configure.tgt (i[34567]86-*-freebsd*): Remove bsd-uthread.o.
7899 (x86_64-*-freebsd*): Remove bsd-uthread.o.
7900 (fbsd-nat.c): Update comment.
7901 * i386-fbsd-tdep.c: Remove "bsd-uthread.h" include.
7902 (i386fbsd_jmp_buf_reg_offset): Remove.
7903 (i386fbsd_supply_uthread): Remove function.
7904 (i386fbsd_collect_uthread): Remove function.
7905 (i386fbsd_init_abi): Don't set bsd-uthread callbacks.
7909 * Makefile.in (ALL_64_TARGET_OBS): Remove alpha-fbsd-tdep.o.
7910 (ALLDEPFILES): Remove alpha-fbsd-tdep.c
7911 * NEWS: Mention that support for FreeBSD/alpha was removed.
7912 * alpha-fbsd-tdep.c: Delete file.
7913 * config/alpha/fbsd.mh: Delete file.
7914 * configure.host: Delete alpha*-*-freebsd* and
7915 alpha*-*-kfreebsd*-gnu.
7916 * configure.tgt: Delete alpha*-*-freebsd* and
7917 alpha*-*-kfreebsd*-gnu.
7921 * amd64-bsd-nat.c (amd64bsd_fetch_inferior_registers,
7922 amd64bsd_store_inferior_registers): Use ptid from regcache.
7926 * dwarf2read.c (lnp_state_machine): Now a class. Initialize all
7927 data fields, make them private and add "m_" prefixes.
7928 (lnp_state_machine::lnp_state_machine): New ctor.
7929 (record_line, check_line_address, handle_set_discriminator)
7930 (handle_set_address, handle_advance_pc, handle_special_opcode)
7931 (handle_advance_line, handle_set_file, handle_negate_stmt)
7932 (handle_const_add_pc, handle_fixed_advance_pc, handle_copy)
7933 (end_sequence, advance_line): New methods.
7934 (m_gdbarch, m_record_lines_p): New fields.
7935 (lnp_reader_state): Delete.
7936 (dwarf_record_line): Rename to ...
7937 (lnp_state_machine::record_line): ... adjust.
7938 (init_lnp_state_machine): Delete.
7939 (lnp_state_machine::lnp_state_machine): New.
7940 (check_line_address): Rename to ...
7941 (lnp_state_machine::check_line_address): This.
7942 (dwarf_decode_lines_1): Remove reference to "reader_state".
7943 Adjust lnp_state_machine having a non-default ctor. Use bool.
7944 State machine internal state manipulation moved to
7945 lnp_state_machine methods.
7949 * Makefile.in (SUBDIR_UNITTESTS_SRCS): Add
7950 unittests/offset-type-selftests.c.
7951 (SUBDIR_UNITTESTS_OBS): Add offset-type-selftests.o.
7952 * common/offset-type.h: New file.
7953 * common/preprocessor.h: New file.
7954 * common/traits.h: New file.
7955 * common/valid-expr.h: New file.
7956 * dwarf2expr.c: Include "common/underlying.h". Adjust to use
7957 sect_offset and cu_offset strong typedefs throughout.
7958 * dwarf2expr.h: Adjust to use sect_offset and cu_offset strong
7959 typedefs throughout.
7960 * dwarf2loc.c: Include "common/underlying.h". Adjust to use
7961 sect_offset and cu_offset strong typedefs throughout.
7962 * dwarf2read.c: Adjust to use sect_offset and cu_offset strong
7963 typedefs throughout.
7964 * gdbtypes.h: Include "common/offset-type.h".
7965 (cu_offset): Now an offset type (strong typedef) instead of a
7967 (sect_offset): Likewise.
7968 (union call_site_parameter_u): Rename "param_offset" field to
7970 * unittests/offset-type-selftests.c: New file.
7974 * common/underlying.h: New file.
7975 * dwarf2read.c: Include "common/gdb_optional.h" and
7976 "common/underlying.h".
7977 (dir_index, file_name_index): New types.
7978 (file_entry): Use them.
7979 (file_entry::include): Use to_underlying.
7980 (line_header::add_file_name): Use dir_index.
7981 (read_formatted_entries): Use gdb::optional. Read form before
7982 writting to file_entry.
7983 (dwarf_decode_line_header): Use dir_index.
7984 (lnp_state_machine::current_file): Use to_underlying.
7985 (lnp_state_machine::file): Change type to file_name_index.
7986 (dwarf_record_line): Use to_underlying.
7987 (init_lnp_state_machine): Use file_name_index.
7988 (dwarf_decode_lines_1): Use dir_index and file_name_index.
7992 * common/gdb_optional.h (gdb::optiona): Add operator->, operator*,
7993 operator bool, has_value and get methods.
7997 * dwarf2read.c (struct file_entry): Add ctors, and initialize all
7999 (line_header): Initialize all data fields. Change type of
8000 standard_opcode_lengths to std::unique_ptr<unsigned char[]>.
8001 Change type of include_dirs to std::vector<const char *>. Remove
8002 num_include_dirs, include_dirs_size. Change type of file_names to
8003 std::vector<file_entry>. Remove num_file_names, file_names_size.
8004 (line_header::line_header): New.
8005 (line_header::add_include_dir, line_header::add_file_name): New
8007 (line_header::include_dir_at): Remove NULL check.
8008 (line_header::file_name_at): Add const overload.
8009 (line_header_up): New unique_ptr typedef.
8010 (dw2_get_file_names_reader): Use line_header_up. Adjust to use
8011 std::vector. Remove free_line_header call.
8012 (dwarf2_build_include_psymtabs): Use line_header_up. Remove
8013 free_line_header call.
8014 (free_cu_line_header): Delete.
8015 (handle_DW_AT_stmt_list, handle_DW_AT_stmt_list)
8016 (setup_type_unit_groups): Use line_header_up instead of cleanups.
8017 Adjust to use std::vector.
8018 (free_line_header): Delete.
8019 (free_line_header_voidp): Use delete.
8020 (add_include_dir): Replace with ...
8021 (line_header::add_include_dir): ... this method. Use std::vector.
8022 (add_file_name): Replace with ...
8023 (line_header::add_file_name): ... this method. Use std::vector.
8024 (add_include_dir_stub): Delete.
8025 (read_formatted_entries): Remove memset.
8026 (dwarf_decode_line_header): Return a line_header_up instead of a
8027 raw pointer. Remove cleanup handling. Pass lambdas to
8028 read_formatted_entries. Adjust to use line_header methods.
8029 (dwarf_decode_lines_1): Adjust to use line_header methods.
8030 (dwarf_decode_lines, file_file_name, file_full_name): Adjust to
8035 * remote.c (set_general_thread, set_continue_thread): Use ptid_t
8036 instead of struct ptid.
8040 * frame.c (get_frame_register_bytes): Unwind using value.
8041 (put_frame_register_bytes): Likewise.
8045 * d-exp.y (type_aggregate_p): Treat TYPE_CODE_MODULE as being
8050 * auto-load.c (auto_load_section_scripts): Check SEC_HAS_CONTENTS.
8054 * gdbthread.h (struct thread_info): Declare constructor and
8055 destructor. Add some in-class member initializers.
8056 * thread.c (free_thread): Remove.
8057 (init_thread_list): Call delete instead of free_thread.
8058 (new_thread): Call thread_info constructor.
8059 (thread_info::thread_info): New function.
8060 (thread_info::~thread_info): New function.
8061 (delete_thread_1): Call delete instead of free_thread.
8062 (make_cleanup_restore_current_thread): Move tp and frame to
8067 * arc-tdep.c (arc_frame_cache): Add support for prologue analysis.
8068 (arc_skip_prologue): Likewise.
8069 (arc_make_frame_cache): Likewise.
8070 (arc_pv_get_operand): New function.
8071 (arc_is_in_prologue): Likewise.
8072 (arc_analyze_prologue): Likewise.
8073 (arc_print_frame_cache): Likewise.
8074 (MAX_PROLOGUE_LENGTH): New constant.
8078 * configure.tgt: Add arc-insn.o.
8079 * arc-tdep.c (arc_delayed_print_insn): Make non-static.
8080 (dump_arc_instruction_command): New function.
8081 (arc_fprintf_disasm): Likewise.
8082 (arc_disassemble_info): Likewise.
8083 (arc_insn_get_operand_value): Likewise.
8084 (arc_insn_get_operand_value_signed): Likewise.
8085 (arc_insn_get_memory_base_reg): Likewise.
8086 (arc_insn_get_memory_offset): Likewise.
8087 (arc_insn_get_branch_target): Likewise.
8088 (arc_insn_dump): Likewise.
8089 (arc_insn_get_linear_next_pc): Likewise.
8090 * arc-tdep.h (arc_delayed_print_insn): Add function declaration.
8091 (arc_disassemble_info): Likewise.
8092 (arc_insn_get_branch_target): Likewise.
8093 (arc_insn_get_linear_next_pc): Likewise.
8094 * NEWS: Mention new "maint print arc arc-instruction".
8098 * arc-tdep (maintenance_print_arc_list): New variable.
8099 (maintenance_print_arc_command): New function.
8103 * arc-tdep.c (core_v2_register_names, core_arcompact_register_names)
8104 Add "limm" and "reserved".
8105 (arc_cannot_fetch_register, arc_cannot_store_register): Add
8106 ARC_RESERVED_REGNUM and ARC_LIMM_REGNUM.
8107 * arc-tdep.h (arc_regnum): Likewise.
8111 * xtensa-linux-nat.c (fill_gregset): Call regcache_raw_collect
8112 for THREADPTR register.
8113 (supply_gregset_reg): Call regcache_raw_supply for THREADPTR
8115 * xtensa-tdep.c (XTENSA_DBREGN_UREG): New definition.
8116 (xtensa_derive_tdep): Initialize tdep->threadptr_regnum.
8117 * xtensa-tdep.h (gdbarch_tdep::threadptr_regnum): New field.
8121 * xtensa-tdep.c (xtensa_pseudo_register_read): Treat all
8122 registers above gdbarch_num_regs (gdbarch) as privileged in
8127 * xtensa-linux-nat.c (fill_gregset): Call regcache_raw_collect
8128 for a single specified register or for all registers in
8129 a0_base..a0_base + C0_NREGS range.
8130 (supply_gregset_reg): Call regcache_raw_supply for a single
8131 specified register or for all registers in a0_base..a0_base +
8136 * arch/xtensa.h (C0_NREGS): Add definition.
8137 * xtensa-tdep.c (C0_NREGS): Remove definition.
8141 * xtensa-tdep.c (xtensa_scan_prologue, call0_analyze_prologue):
8142 Drop xtensa_default_isa initialization.
8143 (xtensa_gdbarch_init): Initialize xtensa_default_isa.
8147 * dwarf2read.c (file_entry) <dir_index>: Add comment.
8148 (file_entry::include_dir): New method.
8149 (line_header::include_dir_at, line_header::file_name_at): New
8151 (setup_type_unit_groups, setup_type_unit_groups)
8152 (psymtab_include_file_name): Simplify using the new methods.
8153 (lnp_state_machine) <the_line_header>: New field.
8154 <file>: Add comment.
8155 (lnp_state_machine::current_file): New method.
8156 (dwarf_record_line): Simplify using the new methods.
8157 (init_lnp_state_machine): Initialize the "the_line_header" field.
8158 (dwarf_decode_lines_1, dwarf_decode_lines, file_file_name):
8159 Simplify using the new methods.
8163 * cp-name-parser.y (make_empty): Delete.
8164 (demangler_special, nested_name, ptr_operator, array_indicator)
8165 (direct_declarator, declarator_1): Use fill_comp instead of
8170 * xml-support.h (gdb_xml_debug): Pass a "first-to-check" argument
8171 to ATTRIBUTE_PRINTF.
8172 * solib-target.c (library_list_start_list): Print "string" not
8174 * xml-tdesc.c (tdesc_start_field): Pass "field_name" to
8179 * dwarf2read.c (struct file_and_directory): New.
8180 (dwarf2_get_dwz_file): Adjust to use std::string.
8181 (dw2_get_file_names_reader): Adjust to use file_and_directory.
8182 (find_file_and_directory): Adjust to return a file_and_directory
8184 (read_file_scope): Adjust to use file_and_directory. Remove
8185 make_cleanup/do_cleanups calls.
8186 (open_and_init_dwp_file): Adjust to use std::string. Remove
8187 make_cleanup/do_cleanups calls.
8188 * python/python.c (do_start_initialization): Adjust to ldirname
8189 returning a std::string.
8190 * utils.c (ldirname): Now returns a std::string.
8191 * utils.h (ldirname): Change return type to std::string.
8192 * xml-syscall.c (xml_init_syscalls_info): Adjust to ldirname
8193 returning a std::string.
8194 * xml-tdesc.c (file_read_description_xml): Likewise.
8198 * regcache.c (regcache_debug_print_register): New function.
8199 * regcache.h (regcache_debug_print_register): New declaration.
8200 * target.c (debug_print_register): Remove.
8201 (target_fetch_registers): Call regcache_debug_print_register.
8202 (target_store_registers): Likewise.
8206 * dwarf2read.c (setup_type_unit_groups): Ensure dir_index doesn't
8207 reference beyond the 'lh->include_dirs' array before accessing to
8209 (psymtab_include_file_name): Likewise.
8210 (dwarf_decode_lines_1): Likewise.
8211 (dwarf_decode_lines): Likewise.
8212 (file_file_name): Likewise.
8216 * fbsd-tdep.c (fbsd_corefile_thread): Don't set/restore
8218 * proc-service.c (ps_lgetregs, ps_lsetregs, ps_lgetfpregs,
8219 ps_lsetfpregs): Likewise.
8220 * regcache.c (regcache_raw_update, regcache_raw_write): Likewise.
8221 * sol-thread.c (ps_lgetregs, ps_lsetregs, ps_lgetfpregs,
8222 ps_lsetfpregs): Likewise.
8223 * target.c (target_fetch_registers, target_store_registers):
8228 * sol-thread.c (sol_thread_store_registers): Remove regcache calls.
8232 * aarch64-tdep.c (aarch64_process_record_test): Declare.
8233 (_initialize_aarch64_tdep): Register it.
8234 (aarch64_record_load_store): Handle PRFM instruction.
8235 (aarch64_process_record_test): New function.
8239 * aarch64-tdep.c (aarch64_record_load_store): Fix code
8244 * aarch64-tdep.c: Remove AARCH64_RECORD_FAILURE.
8248 python/python.c (do_start_initialization): Fix memory leak.
8252 * inf-ptrace.c (inf_ptrace_xfer_partial): Get pid from ptid
8253 using get_ptrace_pid.
8254 * linux-nat.c (linux_nat_xfer_partial): Don't set/restore
8256 (linux_proc_xfer_partial, linux_proc_xfer_spu): Use lwp of
8257 inferior_ptid instead of pid.
8261 * aarch64-tdep.c: Wrap locally used classes in anonymous
8263 * arm-tdep.c: Likewise.
8264 * linespec.c: Likewise.
8265 * ui-out.c: Likewise.
8270 * python/lib/gdb/printer/bound_registers.py: Import sys.
8274 * windows-nat.c (do_windows_fetch_inferior_registers): Add
8275 windows_thread_info parameter and use it instead of
8277 (windows_fetch_inferior_registers): Don't set current_thread,
8278 pass the thread to do_windows_fetch_inferior_registers. Use
8279 ptid from regcache instead of inferior_ptid.
8280 (do_windows_store_inferior_registers): Add windows_thread_info
8281 parameter and use it instead of current_thread.
8282 (windows_store_inferior_registers): Don't set current_thread,
8283 pass the thread to do_windows_store_inferior_registers. Use
8284 ptid from regcache instead of inferior_ptid.
8288 * ser-mingw.c (ser_windows_raw): Remove reference to
8289 struct serial::current_timeout.
8294 * gdb/sparc-tdep.h (gdbarch_tdep) <sparc64_ccr_type>: New field.
8295 * gdb/sparc64-tdep.c (sparc64_ccr_type): New function.
8296 (sparc64_fsr_type): Fix %fsr decoding.
8300 * python/py-record-btrace.c (btpy_insn_data): Change return type
8305 * spu-linux-nat.c (spu_fetch_inferior_registers,
8306 spu_store_inferior_registers): Use ptid from regcache, set and
8307 restore inferior_ptid.
8308 * spu-multiarch.c (spu_fetch_registers, spu_store_registers):
8313 * i386-linux-nat.c (fetch_register, store_register,
8314 i386_linux_fetch_inferior_registers,
8315 i386_linux_store_inferior_registers): Use ptid from regcache.
8316 * ia64-linux-nat.c (ia64_linux_fetch_register,
8317 ia64_linux_store_register): Likewise.
8318 * inf-ptrace.c (inf_ptrace_fetch_register,
8319 inf_ptrace_store_register): Likewise.
8320 * m32r-linux-nat.c (m32r_linux_fetch_inferior_registers,
8321 m32r_linux_store_inferior_registers): Likewise.
8322 * m68k-bsd-nat.c (m68kbsd_fetch_inferior_registers,
8323 m68kbsd_store_inferior_registers): Likewise.
8324 * m68k-linux-nat.c (fetch_register, store_register,
8325 m68k_linux_fetch_inferior_registers,
8326 m68k_linux_store_inferior_registers): Likewise.
8327 * m88k-bsd-nat.c (m88kbsd_fetch_inferior_registers,
8328 m88kbsd_store_inferior_registers): Likewise.
8329 * mips-fbsd-nat.c (mips_fbsd_fetch_inferior_registers,
8330 mips_fbsd_store_inferior_registers): Likewise.
8331 * mips-linux-nat.c (mips64_linux_regsets_fetch_registers,
8332 mips64_linux_regsets_store_registers): Likewise.
8333 * mips-nbsd-nat.c (mipsnbsd_fetch_inferior_registers,
8334 mipsnbsd_store_inferior_registers): Likewise.
8335 * mips-obsd-nat.c (mips64obsd_fetch_inferior_registers,
8336 mips64obsd_store_inferior_registers): Likewise.
8337 * nto-procfs.c (procfs_fetch_registers, procfs_store_registers):
8339 * ppc-fbsd-nat.c (ppcfbsd_fetch_inferior_registers,
8340 ppcfbsd_store_inferior_registers): Likewise.
8341 * ppc-linux-nat.c (ppc_linux_fetch_inferior_registers,
8342 ppc_linux_store_inferior_registers): Likewise.
8343 * ppc-nbsd-nat.c (ppcnbsd_fetch_inferior_registers,
8344 ppcnbsd_store_inferior_registers): Likewise.
8345 * ppc-obsd-nat.c (ppcobsd_fetch_registers,
8346 ppcobsd_store_registers): Likewise.
8347 * procfs.c (procfs_fetch_registers, procfs_store_registers):
8349 * ravenscar-thread.c (ravenscar_fetch_registers,
8350 ravenscar_store_registers, ravenscar_prepare_to_store):
8352 * record-btrace.c (record_btrace_fetch_registers,
8353 record_btrace_store_registers, record_btrace_prepare_to_store):
8355 * remote-sim.c (gdbsim_fetch_register, gdbsim_store_register):
8356 Lookup inferior using ptid from regcache, instead of
8358 * remote.c (remote_fetch_registers, remote_store_registers): Use
8360 * rs6000-nat.c (fetch_register, store_register): Likewise.
8361 * s390-linux-nat.c (s390_linux_fetch_inferior_registers,
8362 s390_linux_store_inferior_registers): Likewise.
8363 * sh-nbsd-nat.c (shnbsd_fetch_inferior_registers,
8364 shnbsd_store_inferior_registers): Likewise.
8365 * sol-thread.c (sol_thread_fetch_registers,
8366 sol_thread_store_registers): Likewise.
8367 * sparc-nat.c (sparc_fetch_inferior_registers,
8368 sparc_store_inferior_registers): Likewise.
8369 * tilegx-linux-nat.c (fetch_inferior_registers,
8370 store_inferior_registers): Likewise.
8371 * vax-bsd-nat.c (vaxbsd_fetch_inferior_registers,
8372 vaxbsd_store_inferior_registers): Likewise.
8373 * xtensa-linux-nat.c (fetch_gregs, store_gregs, fetch_xtregs,
8374 store_xtregs): Likewise.
8379 * NEWS: Mention support for rvalue references in GDB and python.
8380 * doc/gdb.texinfo (C Plus Plus Expressions): Mention that GDB
8381 supports both lvalue and rvalue references.
8386 * gdbtypes.c (rank_one_type): Implement overloading
8387 resolution rules regarding rvalue references.
8392 * aarch64-tdep.c (aarch64_type_align)
8393 (aarch64_extract_return_value, aarch64_store_return_value): Change
8394 lvalue reference type checks to general reference type checks.
8395 * amd64-tdep.c (amd64_classify): Likewise.
8396 * amd64-windows-tdep.c (amd64_windows_passed_by_integer_register):
8398 * arm-tdep.c (arm_type_align, arm_extract_return_value)
8399 (arm_store_return_value): Likewise.
8400 * ax-gdb.c (gen_fetch, gen_cast): Likewise.
8401 * c-typeprint.c (c_print_type): Likewise.
8402 * c-varobj.c (adjust_value_for_child_access, c_value_of_variable)
8403 (cplus_number_of_children, cplus_describe_child): Likewise.
8404 * compile/compile-c-symbols.c (generate_vla_size): Likewise.
8405 * completer.c (expression_completer): Likewise.
8406 * cp-support.c (make_symbol_overload_list_adl_namespace):
8408 * darwin-nat-info.c (info_mach_region_command): Likewise.
8409 * dwarf2loc.c (entry_data_value_coerce_ref)
8410 (value_of_dwarf_reg_entry): Likewise.
8411 * eval.c (ptrmath_type_p, evaluate_subexp_standard)
8412 (evaluate_subexp_for_address, evaluate_subexp_for_sizeof):
8414 * findvar.c (extract_typed_address, store_typed_address):
8416 * gdbtypes.c (rank_one_type): Likewise.
8417 * hppa-tdep.c (hppa64_integral_or_pointer_p): Likewise.
8418 * infcall.c (value_arg_coerce): Likewise.
8419 * language.c (pointer_type): Likewise.
8420 * m32c-tdep.c (m32c_reg_arg_type, m32c_m16c_address_to_pointer):
8422 * m88k-tdep.c (m88k_integral_or_pointer_p): Likewise.
8423 * mn10300-tdep.c (mn10300_type_align): Likewise.
8424 * msp430-tdep.c (msp430_push_dummy_call): Likewise.
8425 * ppc-sysv-tdep.c (do_ppc_sysv_return_value)
8426 (ppc64_sysv_abi_push_param, ppc64_sysv_abi_return_value):
8428 * printcmd.c (print_formatted, x_command): Likewise.
8429 * python/py-type.c (typy_get_composite, typy_template_argument):
8431 * python/py-value.c (valpy_referenced_value)
8432 (valpy_get_dynamic_type, value_has_field): Likewise.
8433 * s390-linux-tdep.c (s390_function_arg_integer): Likewise.
8434 * sparc-tdep.c (sparc_integral_or_pointer_p): Likewise.
8435 * sparc64-tdep.c (sparc64_integral_or_pointer_p): Likewise.
8436 * spu-tdep.c (spu_scalar_value_p): Likewise.
8437 * symtab.c (lookup_symbol_aux): Likewise.
8438 * typeprint.c (whatis_exp, print_type_scalar): Likewise.
8439 * valarith.c (binop_types_user_defined_p, unop_user_defined_p):
8441 * valops.c (value_cast_pointers, value_cast)
8442 (value_reinterpret_cast, value_dynamic_cast, value_addr, typecmp)
8443 (value_struct_elt, value_struct_elt_bitpos)
8444 (value_find_oload_method_list, find_overload_match)
8445 (value_rtti_indirect_type): Likewise.
8446 * valprint.c (val_print_scalar_type_p, generic_val_print):
8448 * value.c (value_actual_type, value_as_address, unpack_long)
8449 (pack_long, pack_unsigned_long, coerce_ref_if_computed)
8450 (coerce_ref): Likewise.
8451 * varobj.c (varobj_get_value_type): Likewise.
8456 * doc/python.texi (Types in Python): Add TYPE_CODE_RVALUE_REF to
8458 * python/lib/gdb/command/explore.py: Support exploring values
8459 of rvalue reference types.
8460 * python/lib/gdb/types.py: Implement get_basic_type() for
8461 rvalue reference types.
8462 * python/py-type.c (pyty_codes) <TYPE_CODE_RVALUE_REF>: New
8464 * python/py-value.c (valpy_getitem): Add an rvalue reference
8466 (valpy_reference_value): Add new parameter "refcode".
8467 (valpy_lvalue_reference_value, valpy_rvalue_reference_value):
8468 New wrappers for valpy_reference_value().
8469 * python/py-xmethods.c (gdbpy_get_xmethod_result_type)
8470 (gdbpy_invoke_xmethod): Likewise.
8475 * dwarf2read.c (process_die, read_type_die_1): Handle the
8476 DW_TAG_rvalue_reference_type DIE.
8477 (read_tag_reference_type): Add new parameter "refcode".
8482 * c-typeprint.c (c_print_type, c_type_print_varspec_prefix)
8483 (c_type_print_modifier, c_type_print_varspec_suffix)
8484 (c_type_print_base): Support printing rvalue reference types.
8485 * c-valprint.c (c_val_print, c_value_print): Support printing
8486 rvalue reference values.
8491 * cp-name-parser.y (ptr_operator): Handle the '&&' token in
8493 * cp-support.c (replace_typedefs): Handle
8494 DEMANGLE_COMPONENT_RVALUE_REFERENCE.
8495 * python/py-type.c (typy_lookup_type): Likewise.
8500 * c-exp.y (ptr_operator): Handle the '&&' token in the typename.
8501 * parse.c (insert_type): Change assert statement.
8502 (follow_types): Handle rvalue reference types.
8503 * parser-defs.h (enum type_pieces) <tp_rvalue_reference>: New
8509 * ada-lang.c (ada_evaluate_subexp): Adhere to the new
8510 value_ref() interface.
8511 * c-valprint.c (c_value_print): Likewise.
8512 * infcall.c (value_arg_coerce): Likewise.
8513 * python/py-value.c (valpy_reference_value): Likewise.
8514 * valops.c (value_cast, value_reinterpret_cast)
8515 (value_dynamic_cast, typecmp): Likewise.
8516 (value_ref): Parameterize by kind of return value reference type.
8517 * value.h (value_ref): Add new parameter "refcode".
8522 * dwarf2read.c (read_tag_reference_type): Use
8523 lookup_lvalue_reference_type() instead of lookup_reference_type().
8524 * eval.c (evaluate_subexp_standard): Likewise.
8525 * f-exp.y: Likewise.
8526 * gdbtypes.c (make_reference_type, lookup_reference_type):
8527 Generalize with rvalue reference types.
8528 (lookup_lvalue_reference_type, lookup_rvalue_reference_type): New
8529 convenience wrappers for lookup_reference_type().
8530 * gdbtypes.h (make_reference_type, lookup_reference_type): Add a
8531 reference kind parameter.
8532 (lookup_lvalue_reference_type, lookup_rvalue_reference_type): Add
8533 wrappers for lookup_reference_type().
8534 * guile/scm-type.c (gdbscm_type_reference): Use
8535 lookup_lvalue_reference_type() instead of lookup_reference_type().
8536 * guile/scm-value.c (gdbscm_value_dynamic_type): Likewise.
8537 * parse.c (follow_types): Likewise.
8538 * python/py-type.c (typy_reference, typy_lookup_type): Likewise.
8539 * python/py-value.c (valpy_get_dynamic_type, valpy_getitem):
8541 * python/py-xmethods.c (gdbpy_get_xmethod_result_type)
8542 (gdbpy_invoke_xmethod): Likewise.
8543 * stabsread.c: Provide extra argument to make_reference_type()
8545 * valops.c (value_ref, value_rtti_indirect_type): Use
8546 lookup_lvalue_reference_type() instead of lookup_reference_type().
8551 * gdbtypes.h (enum type_code) <TYPE_CODE_RVALUE_REF>: New constant.
8552 (TYPE_IS_REFERENCE): New macro.
8553 (struct type): Add rvalue_reference_type field.
8554 (TYPE_RVALUE_REFERENCE_TYPE): New macro.
8558 * NEWS: Add an entry about new '-file-list-shared-libraries' command.
8559 * mi/mi-cmd-file.c (mi_cmd_file_list_shared_libraries):
8560 New function definition.
8561 * mi/mi-cmds.c (mi_cmds): Add -file-list-shared-libraries command.
8562 * mi/mi-cmds.h (mi_cmd_file_list_shared_libraries):
8563 New function declaration.
8564 * mi/mi-interp.c (mi_output_solib_attribs): New Function.
8565 * mi/mi-interp.h: New file.
8566 * solib.c (info_sharedlibrary_command): Replace for loop with
8568 * solib.h (update_solib_list): New function declaration.
8569 (so_list_head): Move macro.
8570 * solist.h (ALL_SO_LIBS): New macro.
8574 * infcmd.c (post_create_inferior): Remove unused argument in
8576 * remote.c (remote_start_remote): Likewise.
8577 * solib-frv.c (frv_fetch_objfile_link_map): Likewise.
8578 * solib-svr4.c: (svr4_fetch_objfile_link_map): Likewise.
8579 (enable_break): Likewise.
8580 * solib.c (update_solib_list): Remove unused target argument
8581 and its documentation.
8582 (solib_add): Remove unused target argument. Remove unused
8583 argument in call to update_solib_list.
8584 (info_sharedlibrary_command): Remove unused argument in call
8585 to update_solib_list.
8586 (sharedlibrary_command): Remove unused argument in call to
8588 (handle_solib_event): Likewise.
8589 (reload_shared_libraries): Likewise.
8590 * solib.h (solib_add): Remove unused target argument.
8594 * s390-linux-tdep.c (is_rsi, is_rie): Remove functions.
8595 (s390_displaced_step_fixup): Cover relative branches with the
8596 default fixup handling. This fixes lack of support for some
8597 relative branch instructions.
8601 * i386-gnu-nat.c (gnu_fetch_registers, gnu_store_registers): Use
8606 * i386-darwin-nat.c (i386_darwin_fetch_inferior_registers,
8607 i386_darwin_store_inferior_registers): Use ptid from regcache.
8611 * i386-bsd-nat.c (i386bsd_fetch_inferior_registers,
8612 i386bsd_store_inferior_registers): Use ptid from regcache.
8616 * hppa-obsd-nat.c (hppaobsd_fetch_registers,
8617 hppaobsd_store_registers): Use ptid from regcache.
8621 * hppa-nbsd-nat.c (hppanbsd_fetch_registers,
8622 hppanbsd_store_registers): Use ptid from regcache.
8626 * hppa-linux-nat.c (fetch_register, store_register): Use ptid
8627 from regcache. Use get_ptrace_pid.
8631 * corelow.c (get_core_register_section): Use ptid from regcache,
8636 * bsd-uthread.c (bsd_uthread_fetch_registers,
8637 bsd_uthread_store_registers): Use ptid from regcache, set and
8638 restore inferior_ptid.
8642 * arm-nbsd-nat.c (fetch_register, fetch_regs, fetch_fp_register,
8643 fetch_fp_regs, store_register, store_regs, store_fp_register,
8644 store_fp_regs): Use ptid from regcache.
8648 * arm-linux-nat.c (fetch_fpregs, store_fpregs, fetch_regs,
8649 store_regs, fetch_wmmx_regs, store_wmmx_regs, fetch_vfp_regs,
8650 store_vfp_regs): Use ptid from regcache.
8655 * ser-base.c (ser_base_wait_for): Add comment.
8656 (do_ser_base_readchar): Improve comment based on the ser-unix.c's
8658 * ser-unix.c (hardwire_raw): Remove reference to
8659 scb->current_timeout.
8660 (wait_for, do_hardwire_readchar, hardwire_readchar): Delete.
8661 (hardwire_ops): Install ser_base_readchar instead of
8663 * serial.h (struct serial) <current_timeout, timeout_remaining>:
8669 * python/lib/gdb/printer/bound_registers.py: Add support for
8674 * dwarf2loc.c (indirect_synthetic_pointer): Get data type of
8675 pointed-to DIE and pass it to dwarf2_evaluate_loc_desc_full.
8676 (dwarf2_evaluate_loc_desc_full): New parameter subobj_type; rename
8677 byte_offset to subobj_byte_offset. Fix the handling of
8678 DWARF_VALUE_STACK on big-endian targets when coming via an
8680 (dwarf2_evaluate_loc_desc): Adjust call to
8681 dwarf2_evaluate_loc_desc_full.
8682 * dwarf2loc.h (dwarf2_fetch_die_type_sect_off): New declaration.
8683 * dwarf2read.c (dwarf2_fetch_die_type_sect_off): New function.
8687 * arm-tdep.c (thumb_record_misc): Decode CBNZ, CBZ, REV16,
8688 and REVSH instructions.
8692 * arm-tdep.c [GDB_SELF_TEST]: include "selftests.h".
8693 (arm_record_test): Declare.
8694 (_initialize_arm_tdep) [GDB_SELF_TEST]: call register_self_test.
8695 (thumb_record_ld_st_reg_offset): Rewrite the opcode matching to
8696 align with the manual.
8697 (thumb_record_misc): Adjust the code order to align with the
8699 (thumb2_record_decode_insn_handler): Fix instruction matching.
8700 (instruction_reader_thumb): New class.
8701 (arm_record_test): New function.
8705 * arm-tdep.c (abstract_memory_reader): New class.
8706 (instruction_reader): New class.
8707 (extract_arm_insn): Add argument 'reader'. Callers updated.
8708 (decode_insn): Likewise.
8712 * guile/scm-lazy-string.c (lazy_string_smob): Clarify use of LENGTH
8713 member. Change type of TYPE member to SCM. All uses updated.
8714 (lsscm_make_lazy_string_smob): Add assert.
8715 (lsscm_make_lazy_string): Flag bad length values.
8716 (lsscm_elt_type): New function.
8717 (gdbscm_lazy_string_to_value): Rewrite to use
8718 lsscm_safe_lazy_string_to_value.
8719 (lsscm_safe_lazy_string_to_value): Fix handling of TYPE_CODE_PTR.
8720 * guile/scm-value.c (gdbscm_value_to_lazy_string): Flag bad length
8721 values. Fix TYPE_CODE_PTR. Handle TYPE_CODE_ARRAY. Handle typedefs
8723 * guile/guile-internal.h (tyscm_scm_to_type): Declare.
8724 * guile/scm-type.c (tyscm_scm_to_type): New function.
8728 PR python/17728, python/18439, python/18779
8729 * python/py-lazy-string.c (lazy_string_object): Clarify use of LENGTH
8730 member. Change type of TYPE member to PyObject *. All uses updated.
8731 (stpy_convert_to_value): Fix handling of TYPE_CODE_PTR.
8732 (gdbpy_create_lazy_string_object): Flag bad length values.
8733 Handle TYPE_CODE_ARRAY with possibly different user-provided length.
8734 Handle typedefs in incoming type.
8735 (stpy_lazy_string_elt_type): New function.
8736 (gdbpy_extract_lazy_string): Call it.
8737 * python/py-value.c (valpy_lazy_string): Flag bad length values.
8738 Fix handling of TYPE_CODE_PTR. Handle TYPE_CODE_ARRAY. Handle
8739 typedefs in incoming type.
8743 * guile/guile-internal.h (tyscm_scm_to_type): Declare.
8744 * guile/scm-type.c (tyscm_scm_to_type): New function.
8748 * inf-ptrace.c (inf_ptrace_peek_poke): Change the type to
8749 "ULONGEST" for "skip".
8754 * inf-ptrace.c (inf_ptrace_xfer_partial): In "case
8755 TARGET_OBJECT_MEMORY", extract the logic for ptrace peek/poke...
8756 (inf_ptrace_peek_poke): ...here. New function. Now also loop
8757 over ptrace peek/poke until end of buffer or error.
8761 * parse.c (length_of_subexp): Make static.
8762 * parser-defs.h (length_of_subexp): Remove.
8766 * linux-nat.c (linux_proc_xfer_partial): Handle write operations
8771 * cp-name-parser.y (cp_demangled_name_to_comp): Update comment.
8772 (main): Use std::unique_ptr. Remove calls to
8773 cp_demangled_name_parse_free.
8777 * alpha-bsd-nat.c (alphabsd_fetch_inferior_registers,
8778 alphabsd_store_inferior_registers): Use regcache->ptid instead
8783 * aix-thread.c (aix_thread_fetch_registers,
8784 aix_thread_store_registers): Use regcache->ptid instead of
8789 * aarch64-linux-nat.c (fetch_gregs_from_thread,
8790 store_gregs_to_thread, fetch_fpregs_from_thread,
8791 store_fpregs_to_thread): Use regcache->ptid instead of
8796 * amd64-linux-nat.c (amd64_linux_fetch_inferior_registers,
8797 amd64_linux_fetch_inferior_registers): Use regcache->ptid
8798 instead of inferior_ptid.
8802 * target.c (target_fetch_registers, target_store_registers): Add
8807 * regcache.h (regcache_get_ptid): New function.
8808 * regcache.c (regcache_get_ptid): New function.
8812 * cp-name-parser.y (make_empty): Initialize d_printing to zero.
8817 * c-typeprint.c (cp_type_print_method_args): Skip artificial arguments.
8822 * infrun.c (start_step_over, do_target_resume, resume)
8823 (restart_threads): Assert we're not resuming a thread that is
8824 meant to be stopped.
8825 (infrun_thread_stop_requested_callback): Delete.
8826 (infrun_thread_stop_requested): If the thread is internally
8827 stopped, queue a pending stop event and clear the thread's
8829 (handle_stop_requested): New function.
8830 (handle_syscall_event, handle_inferior_event_1): Use
8831 handle_stop_requested.
8832 (handle_stop_requested): New function.
8833 (handle_signal_stop): Set the thread's stop_signal here instead of
8835 (finish_step_over): Clear step over info unconditionally.
8836 (handle_signal_stop): If the user had interrupted the event
8837 thread, consider the stop a random signal.
8838 (handle_signal_stop) <signal arrived while stepping over
8839 breakpoint>: Don't restart threads here.
8840 (stop_waiting): Don't clear step-over info here.
8845 * common/gdb_unlinker.h (unlinker::unlinker): Attribute nonnull
8846 goes to argument 2, not 1.
8851 * top.c (gdb_readline_wrapper): Avoid passing NULL to
8853 (command_line_input): Add comment.
8858 * tui/tui-file.c (tui_file::write): New.
8859 * tui/tui-file.h (tui_file): Override "write".
8860 * tui/tui-io.c (do_tui_putc, update_start_line): New functions,
8861 factored out from ...
8862 (tui_puts): ... here.
8863 (tui_putc): Use them.
8864 (tui_write): New function.
8865 * tui/tui-io.h (tui_write): Declare.
8869 * Makefile.in (SFILES): Replace "environ.c" with
8871 (HFILES_NO_SRCDIR): Likewise, for "environ.h".
8872 * environ.c: Include "common-defs.h" instead of "defs.h. Moved
8874 * common/environ.c: ... here.
8875 * environ.h: Moved to...
8876 * common/environ.h: ... here.
8880 * gdbarch.sh (pstring_ptr): New static function.
8881 (gdbarch_disassembler_options): Use it.
8882 (gdbarch_verify_disassembler_options): Print valid_disassembler_options,
8883 not valid_disassembler_option->name.
8884 * gdbarch.c: Regenerate.
8888 * config/powerpc/ppc64-linux.mh (MH_CFLAGS): Delete.
8892 * tui/tui-regs.c (tui_restore_gdbout): Don't delete gdb_stdout.
8896 * i387-tdep.h (i387_reset_bnd_regs): Add function definition.
8897 * i387-tdep.c (i387_reset_bnd_regs): Add function implementation.
8898 * i386-tdep.c (i386_push_dummy_call): Call i387_reset_bnd_regs.
8899 * amd64-tdep.c (amd64_push_dummy_call): Call i387_reset_bnd_regs.
8903 * xtensa-linux-nat.c (fetch_gregs): Remove const.
8907 * remote.c (remote_add_target_side_commands): Use range-based
8913 * ada-valprint.c (ada_val_print_ref): Call value_fetch_lazy if
8915 * valprint.c (common_val_print): Likewise.
8919 * NEWS: Mention new set/show disassembler-options commands.
8920 * doc/gdb.texinfo: Document new set/show disassembler-options commands.
8921 * disasm.c: Include "arch-utils.h", "gdbcmd.h" and "safe-ctype.h".
8922 (prospective_options): New static variable.
8923 (gdb_disassembler::gdb_disassembler): Initialize
8924 m_di.disassembler_options.
8925 (gdb_buffered_insn_length_init_dis): Initilize di->disassembler_options.
8926 (get_disassembler_options): New function.
8927 (set_disassembler_options): Likewise.
8928 (set_disassembler_options_sfunc): Likewise.
8929 (show_disassembler_options_sfunc): Likewise.
8930 (disassembler_options_completer): Likewise.
8931 (_initialize_disasm): Likewise.
8932 * disasm.h (get_disassembler_options): New prototype.
8933 (set_disassembler_options): Likewise.
8934 * gdbarch.sh (gdbarch_disassembler_options): New variable.
8935 (gdbarch_verify_disassembler_options): Likewise.
8936 * gdbarch.c: Regenerate.
8937 * gdbarch.h: Likewise.
8938 * arm-tdep.c (num_disassembly_options): Delete.
8939 (set_disassembly_style): Likewise.
8940 (arm_disassembler_options): New static variable.
8941 (set_disassembly_style_sfunc): Convert short style name into long
8942 option name. Call set_disassembler_options.
8943 (show_disassembly_style_sfunc): New function.
8944 (arm_gdbarch_init): Call set_gdbarch_disassembler_options and
8945 set_gdbarch_verify_disassembler_options.
8946 (_initialize_arm_tdep): Delete regnames variable and update callers.
8947 (arm_disassembler_options): Initialize.
8948 (disasm_options): New variable.
8949 (num_disassembly_options): Rename from this...
8950 (num_disassembly_styles): ...to this. Compute by scanning through
8952 (valid_disassembly_styles): Initialize using disasm_options.
8953 Remove calls to parse_arm_disassembler_option, get_arm_regnames and
8954 set_arm_regname_option.
8955 Pass show_disassembly_style_sfunc to the "disassembler" setshow command.
8956 * rs6000-tdep.c (powerpc_disassembler_options): New static variable.
8957 (rs6000_gdbarch_init): Call set_gdbarch_disassembler_options and
8958 set_gdbarch_verify_disassembler_options.
8959 * s390-tdep.c (s390_disassembler_options): New static variable.
8960 (s390_gdbarch_init):all set_gdbarch_disassembler_options and
8961 set_gdbarch_verify_disassembler_options.
8965 * remote.c (remote_add_target_side_condition): Remove "struct"
8966 keyword from range-based for loop.
8970 * remote.c (remote_add_target_side_condition): Use range-based
8971 for loop. Update comment.
8975 * f-typeprint.c (f_print_type): Check "varstring" is empty first.
8979 * regcache.c (regcache_raw_update): New function.
8980 (regcache_raw_read): Move code to regcache_raw_update.
8981 * regcache.h (regcache_raw_update): New declaration.
8982 * remote.c (remote_prepare_to_store): Call regcache_raw_update.
8986 * dwarf2read.c (create_debug_type_hash_table): Initialize
8987 header.signature and header.type_offset_in_tu.
8991 * symtab.c (make_file_symbol_completion_list_1): Use
8992 add_symtab_completions.
8996 * stack.c (frame_info): Use frame_unwind_register_value to avoid buf.
9000 * i386-tdep.c (i386_pseudo_register_read_into_value): Use
9001 I386_MAX_REGISTER_SIZE.
9002 (i386_pseudo_register_write): Likewise.
9003 (i386_process_record): Likewise.
9004 * i387-tdep.c (i387_supply_xsave): Likewise.
9005 * m68k-linux-nat.c (fetch_register): Use M68K_MAX_REGISTER_SIZE.
9006 (store_register): Likewise.
9010 * ada-lang.c: Include "common/function-view.h".
9011 (ada_iterate_over_symbols): Adjust to use function_view as
9013 (struct add_partial_datum, ada_complete_symbol_matcher): Delete.
9014 (ada_make_symbol_completion_list): Use a lambda.
9015 (ada_exc_search_name_matches): Delete.
9016 (name_matches_regex): New.
9017 (ada_add_global_exceptions): Use a lambda and name_matches_regex.
9018 * compile/compile-c-support.c: Include "common/function-view.h".
9019 (print_one_macro): Change prototype to accept a ui_file pointer.
9020 (write_macro_definitions): Use a lambda.
9021 * dwarf2read.c: Include "common/function-view.h".
9022 (dw2_map_expand_apply, dw2_map_symtabs_matching_filename)
9023 (dw2_expand_symtabs_matching): Adjust to use function_view as
9025 * language.h: Include "common/function-view.h".
9026 (struct language_defn) <la_iterate_over_symbols>: Adjust to use
9027 function_view as callback type.
9028 (LA_ITERATE_OVER_SYMBOLS): Remove DATA parameter.
9029 * linespec.c: Include "common/function-view.h".
9030 (collect_info::add_symbol): New method.
9031 (struct symbol_and_data_callback, iterate_inline_only, struct
9032 symbol_matcher_data, iterate_name_matcher): Delete.
9033 (iterate_over_all_matching_symtabs): Adjust to use function_view
9034 as callback type and lambdas.
9035 (iterate_over_file_blocks): Adjust to use function_view as
9037 (decode_compound_collector): Now a class with private fields.
9038 (decode_compound_collector::release_symbols): New method.
9039 (collect_one_symbol): Rename to...
9040 (decode_compound_collector::operator()): ... this and adjust.
9041 (lookup_prefix_sym): decode_compound_collector construction bits
9042 move to decode_compound_collector ctor. Pass the
9043 decode_compound_collector object directly as callback. Remove
9044 cleanups and use decode_compound_collector::release_symbols
9046 (symtab_collector): Now a class with private fields.
9047 (symtab_collector::release_symtabs): New method.
9048 (add_symtabs_to_list): Rename to...
9049 (symtab_collector::operator()): ... this and adjust.
9050 (collect_symtabs_from_filename): symtab_collector construction
9051 bits move to symtab_collector ctor. Pass the symtab_collector
9052 object directly as callback. Remove cleanups and use
9053 symtab_collector::release_symtabs instead.
9054 (collect_symbols): Delete.
9055 (add_matching_symbols_to_info): Use lambdas.
9056 * macrocmd.c (print_macro_callback): Delete.
9057 (info_macro_command): Use a lambda.
9058 (info_macros_command): Pass print_macro_definition as callable
9060 (print_one_macro): Remove 'ignore' parameter.
9061 (macro_list_command): Adjust.
9062 * macrotab.c (macro_for_each_data::fn): Now a function_view.
9063 (macro_for_each_data::user_data): Delete field.
9064 (foreach_macro): Adjust to call the function_view.
9065 (macro_for_each): Adjust to use function_view as callback type.
9066 (foreach_macro_in_scope): Adjust to call the function_view.
9067 (macro_for_each_in_scope): Adjust to use function_view as callback
9069 * macrotab.h: Include "common/function-view.h".
9070 (macro_callback_fn): Declare a prototype instead of a pointer.
9071 Remove "user_data" parameter.
9072 (macro_for_each, macro_for_each_in_scope): Adjust to use
9073 function_view as callback type.
9074 * psymtab.c (partial_map_expand_apply)
9075 (psym_map_symtabs_matching_filename, recursively_search_psymtabs):
9076 Adjust to use function_view as callback type and to return bool.
9077 (psym_expand_symtabs_matching): Adjust to use function_view as
9079 * symfile-debug.c (debug_qf_map_symtabs_matching_filename): Adjust
9080 to use function_view as callback type and to return bool.
9081 (debug_qf_expand_symtabs_matching): Adjust to use function_view as
9083 * symfile.c (expand_symtabs_matching): Adjust to use function_view
9085 * symfile.h: Include "common/function-view.h".
9086 (expand_symtabs_file_matcher_ftype)
9087 (expand_symtabs_symbol_matcher_ftype)
9088 (expand_symtabs_exp_notify_ftype): Remove "data" parameter and
9090 (quick_symbol_functions::map_symtabs_matching_filename)
9091 (quick_symbol_functions::expand_symtabs_matching): Adjust to use
9092 function_view as callback type and return bool.
9093 (expand_symtabs_matching): Adjust to use function_view as callback
9095 (maintenance_expand_name_matcher)
9096 (maintenance_expand_file_matcher): Delete.
9097 (maintenance_expand_symtabs): Use lambdas.
9098 * symtab.c (iterate_over_some_symtabs): Adjust to use
9099 function_view as callback types and return bool.
9100 (iterate_over_symtabs): Likewise. Use unique_xmalloc_ptr instead
9102 (lookup_symtab_callback): Delete.
9103 (lookup_symtab): Use a lambda.
9104 (iterate_over_symbols): Adjust to use function_view as callback
9106 (struct search_symbols_data, search_symbols_file_matches)
9107 (search_symbols_name_matches): Delete.
9108 (search_symbols): Use a pair of lambdas.
9109 (struct add_name_data, add_macro_name, symbol_completion_matcher)
9110 (symtab_expansion_callback): Delete.
9111 (default_make_symbol_completion_list_break_on_1): Use lambdas.
9112 * symtab.h: Include "common/function-view.h".
9113 (iterate_over_some_symtabs): Adjust to use function_view as
9114 callback type and return bool.
9115 (iterate_over_symtabs): Adjust to use function_view as callback
9117 (symbol_found_callback_ftype): Remove 'data' parameter and return
9119 (iterate_over_symbols): Adjust to use function_view as callback
9124 * Makefile.in (SUBDIR_UNITTESTS_SRCS, SUBDIR_UNITTESTS_OBS): New.
9125 (%.o) <unittests/%.c>: New pattern.
9126 * configure.ac ($development): Add $(SUBDIR_UNITTESTS_OBS) to
9127 CONFIG_OBS, and $(SUBDIR_UNITTESTS_SRCS) to CONFIG_SRCS.
9128 * common/function-view.h: New file.
9129 * unittests/function-view-selftests.c: New file.
9130 * configure: Regenerate.
9134 * bsd-uthread.c (bsd_uthread_thread_alive): Use ptid instead of
9136 * go32-nat.c (go32_thread_alive): Likewise.
9140 * varobj-iter.h (varobj_iter_delete): Call xfree instead of
9145 * varobj.c (varobj_clear_saved_item): Use delete instead of
9147 (update_dynamic_varobj_children): Likewise.
9151 * dwarf2read.c (dwarf2_record_block_ranges): Add forgotten BASEADDR.
9155 * common/enum-flags.h (enum_flags::enum_flags): Initialize
9156 m_enum_value to 0 in default constructor.
9160 * rs6000-tdep.c (LOAD_AND_RESERVE_MASK): Rename from LWARX_MASK.
9161 (STORE_CONDITIONAL_MASK): Rename from STWCX_MASK.
9162 (LBARX_INSTRUCTION, LHARX_INSTRUCTION, LQARX_INSTRUCTION,
9163 STBCX_INSTRUCTION, STHCX_INSTRUCTION, STQCX_INSTRUCTION): New defines.
9164 (IS_LOAD_AND_RESERVE_INSN, IS_STORE_CONDITIONAL_INSN): New macros.
9165 (ppc_displaced_step_copy_insn): Use IS_LOAD_AND_RESERVE_INSN.
9166 (ppc_deal_with_atomic_sequence): Use IS_LOAD_AND_RESERVE_INSN and
9167 IS_STORE_CONDITIONAL_INSN.
9171 * dwarf2_rnglists_process: Initialize range_beginning and range_end.
9175 * NEWS (Changes since GDB 7.12): Add DWARF-5.
9179 * dwarf2read.c (skip_one_die, read_attribute_value)
9180 (dwarf2_const_value_attr, dump_die_shallow)
9181 (dwarf2_get_attr_constant_value, dwarf2_fetch_constant_bytes)
9182 (skip_form_bytes, attr_form_is_constant): Handle DW_FORM_data16.
9186 * dwarf2read.c (read_file_scope): Rename DW_MACRO_GNU_*.
9187 (dwarf_parse_macro_header): Accept DWARF version 5.
9188 (dwarf_decode_macro_bytes, dwarf_decode_macros): Rename DW_MACRO_GNU_*.
9192 * block.c (call_site_for_pc): Rename DW_OP_GNU_*, DW_TAG_GNU_* and
9194 * common/common-exceptions.h (enum errors): Likewise.
9195 * dwarf2-frame.c (class dwarf_expr_executor): Likewise.
9196 * dwarf2expr.c (dwarf_block_to_dwarf_reg)
9197 (dwarf_expr_context::execute_stack_op): Likewise.
9198 * dwarf2expr.h (struct dwarf_expr_context, struct dwarf_expr_piece):
9200 * dwarf2loc.c (dwarf_evaluate_loc_desc::get_base_type)
9201 (dwarf_evaluate_loc_desc::push_dwarf_reg_entry_value)
9202 (show_entry_values_debug, call_site_to_target_addr)
9203 (func_addr_to_tail_call_list, func_verify_no_selftailcall)
9204 (dwarf_expr_reg_to_entry_parameter, dwarf_entry_parameter_to_value)
9205 (entry_data_value_free_closure, value_of_dwarf_reg_entry)
9206 (value_of_dwarf_block_entry, indirect_pieced_value)
9207 (symbol_needs_eval_context::push_dwarf_reg_entry_value):
9208 (disassemble_dwarf_expression): Likewise.
9209 * dwarf2read.c (process_die, inherit_abstract_dies)
9210 (read_call_site_scope): Likewise.
9211 * gdbtypes.h (struct func_type, struct call_site_parameter)
9212 (struct call_site): Likewise.
9213 * stack.c (read_frame_arg): Likewise.
9214 * std-operator.def (OP_VAR_ENTRY_VALUE): Likewise.
9218 * defs.h (read_unsigned_leb128): New declaration.
9219 * dwarf2loc.c (decode_debug_loclists_addresses): New function.
9220 (decode_debug_loc_dwo_addresses): Update DEBUG_LOC_* to DW_LLE_*.
9221 (dwarf2_find_location_expression): Call also
9222 decode_debug_loclists_addresses. Handle DWARF-5 ULEB128 length.
9223 * dwarf2loc.h (dwarf2_version): New declaration.
9224 * dwarf2read.c (struct dwarf2_per_objfile): Add loclists, line_str,
9226 (dwarf2_elf_names): Add .debug_loclists, .debug_line_str,
9228 (struct dwop_section_names): Add loclists_dwo.
9229 (dwop_section_names): Add .debug_loclists.dwo.
9230 (struct comp_unit_head): Add unit_type, signature, type_offset_in_tu.
9231 (struct dwarf2_per_cu_data): Add dwarf_version.
9232 (struct dwo_sections): Add loclists.
9233 (struct attr_abbrev): Add implicit_const.
9234 (read_indirect_line_string): New declaration.
9235 (read_unsigned_leb128): Delete declaration.
9236 (rcuh_kind): New definition.
9237 (read_and_check_comp_unit_head): Change parameter
9238 is_debug_types_section to section_kind.
9239 (dwarf2_locate_sections): Handle loclists, line_str and rnglists.
9240 (read_comp_unit_head): Change parameter abfd to section, add parameter
9241 section_kind. Handle DWARF-5.
9242 (error_check_comp_unit_head): Accept also DWARF version 5.
9243 (read_and_check_comp_unit_head): Change parameter
9244 is_debug_types_section to section_kind.
9245 (read_and_check_type_unit_head): Delete function.
9246 (read_abbrev_offset): Handle DWARF-5.
9247 (create_debug_type_hash_table): Add parameter section_kind. Process
9248 only DW_UT_type. Use signature and type_offset_in_tu from struct
9250 (create_debug_types_hash_table): Update create_debug_type_hash_table
9252 (create_all_type_units): Call create_debug_type_hash_table.
9253 (read_cutu_die_from_dwo, init_cutu_and_read_dies): Change
9254 read_and_check_type_unit_head caller to read_and_check_comp_unit_head
9256 (skip_one_die): Handle DW_FORM_implicit_const.
9257 (dwarf2_rnglists_process): New function.
9258 (dwarf2_ranges_process): Call dwarf2_rnglists_process for DWARF-5.
9259 (abbrev_table_read_table): Handle DW_FORM_implicit_const.
9260 (read_attribute_value): Handle DW_FORM_implicit_const,
9262 (read_attribute): Handle DW_FORM_implicit_const.
9263 (read_indirect_string_at_offset_from): New function from
9264 read_indirect_string_at_offset.
9265 (read_indirect_string_at_offset): Call
9266 read_indirect_string_at_offset_from.
9267 (read_indirect_line_string_at_offset): New function.
9268 (read_indirect_string): New function comment.
9269 (read_indirect_line_string): New function.
9270 (read_unsigned_leb128): Make it global.
9271 (dwarf2_string_attr): Handle DWARF-5.
9272 (add_include_dir_stub, read_formatted_entries): New functions.
9273 (dwarf_decode_line_header, dump_die_shallow, cu_debug_loc_section):
9275 (per_cu_header_read_in): Update read_comp_unit_head caller.
9276 (dwarf2_version): New function.
9277 * symfile.h (struct dwarf2_debug_sections): Add loclists, line_str and
9279 * xcoffread.c (dwarf2_xcoff_names): Update struct dwarf2_debug_sections
9284 * dwarf2read.c (abbrev_table_read_table): Read the data only once.
9288 * dwarf2read.c (dwarf2_ranges_process): New function from
9290 (dwarf2_ranges_read, dwarf2_record_block_ranges): Use
9291 dwarf2_ranges_process.
9295 * dwarf2read.c (create_debug_type_hash_table): New function from
9296 create_debug_types_hash_table.
9297 (create_debug_types_hash_table): Call create_debug_type_hash_table.
9298 (create_all_type_units, open_and_init_dwo_file): Update
9299 create_debug_types_hash_table callers.
9304 * fork-child.c (trace_start_error): Fix thinko. va_end should
9305 refer to 'ap', not 'args'.
9311 * darwin-nat.c (darwin_ptrace_me): Check if calls to system
9313 * fork-child.c (trace_start_error): New function.
9314 (trace_start_error_with_name): Likewise.
9315 * gnu-nat.c (gnu_ptrace_me): Check if call to PTRACE succeeded.
9316 * inf-ptrace.c (inf_ptrace_me): Likewise.
9317 * inferior.h (trace_start_error): New prototype.
9318 (trace_start_error_with_name): Likewise.
9323 * psymtab.c (maintenance_print_psymbols): Verify if 'argv' is not
9324 NULL before using it.
9325 * symmisc.c (maintenance_print_symbols): Likewise.
9326 (maintenance_print_msymbols): Likewise.
9330 * NEWS: Add record Python bindings entry.
9334 * Makefile.in (SUBDIR_PYTHON_OBS): Add py-record-btrace.o,
9336 (SUBDIR_PYTHON_SRCS): Add py-record-btrace.c, py-record-full.c.
9337 * python/py-record-btrace.c, python/py-record-btrace.h,
9338 python/py-record-full.c, python/py-record-full.h: New file.
9339 * python/py-record.c: Add include for py-record-btrace.h and
9341 (recpy_method, recpy_format, recpy_goto, recpy_replay_position,
9342 recpy_instruction_history, recpy_function_call_history, recpy_begin,
9343 recpy_end): Use functions from py-record-btrace.c and py-record-full.c.
9344 * python/python-internal.h (PyInt_FromSsize_t, PyInt_AsSsize_t):
9346 (gdbpy_initialize_btrace): New export.
9347 * python/python.c (_initialize_python): Add gdbpy_initialize_btrace.
9351 * Makefile.in (SUBDIR_PYTHON_OBS): Add python/py-record.o.
9352 (SUBDIR_PYTHON_SRCS): Add python/py-record.c.
9353 * python/py-record.c: New file.
9354 * python/python-internal.h (gdbpy_start_recording,
9355 gdbpy_current_recording, gdpy_stop_recording,
9356 gdbpy_initialize_record): New export.
9357 * python/python.c (_initialize_python): Add gdbpy_initialize_record.
9358 (python_GdbMethods): Add gdbpy_start_recording,
9359 gdbpy_current_recording and gdbpy_stop_recording.
9363 * record-btrace.c (record_btrace_record_method): New function.
9364 (init_record_btrace_ops): Initialize to_record_method.
9365 * record-full.c (record_full_record_method): New function.
9366 (init_record_full_ops, init_record_full_core_ops): Add
9367 record_full_record_method.
9368 * record.h (enum record_method): New enum.
9369 * target-debug.h (target_debug_print_enum_record_method: New define.
9370 * target-delegates.c: Regenerate.
9371 * target.c (target_record_method): New function.
9372 * target.h: Include record.h.
9373 (struct target_ops) <to_record_method>: New field.
9374 (target_record_method): New export.
9378 * record.h (record_start, record_stop): New export.
9379 * record.c (record_start, record_stop): New function.
9383 * btrace.c (btrace_fetch): Copy function call segments pointer
9385 (btrace_clear): Clear the vector.
9386 (btrace_find_insn_by_number): Use binary search to find the correct
9387 function call segment.
9388 * btrace.h (brace_fun_p): New typedef.
9389 (struct btrace_thread_info) <functions>: New field.
9393 * record-btrace.c (btrace_ui_out_decode_error): Move most of it ...
9394 * btrace.c (btrace_decode_error): ... here. New function.
9395 * btrace.h (btrace_decode_error): New export.
9399 * btrace.c (ftrace_call_num_insn, btrace_insn_get_error): New function.
9400 (ftrace_new_function, btrace_insn_number, btrace_insn_cmp,
9401 btrace_find_insn_by_number): Remove special case for gaps.
9402 * btrace.h (btrace_insn_get_error): New export.
9403 (btrace_insn_number, btrace_find_insn_by_number): Adjust comment.
9404 * record-btrace.c (btrace_insn_history): Print number for gaps.
9405 (record_btrace_info, record_btrace_goto): Handle gaps.
9410 * python/python.c (gdbpy_before_prompt_hook): Emit before_prompt
9412 * python/py-evts.c (gdbpy_initialize_py_events): Add
9413 before_prompt registry.
9414 * python/py-events.h (events_object) <before_prompt>: New field.
9418 * btrace.c (ftrace_new_switch): Preserve up link and flags.
9422 * symfile (_initialize_symfile): Add usage text to the load command's
9427 * utils.c (defaulted_query): Don't query on secondary UIs.
9431 * rust-lang.c (rust_get_disr_info): Remove unused variable.
9435 * python/py-value.c (valpy_richcompare_throw): Remove unnecessary
9437 * python/py-type.c (typy_legacy_template_argument): Remove
9438 unnecessary "cleanup" local.
9442 * python/python.c (do_start_initialization): New function, from
9444 (_initialize_python): Call do_start_initialization.
9445 * python/py-linetable.c (ltpy_iternext): Use explicit returns, not
9450 * python/py-prettyprint.c (pretty_print_one_value): Use
9455 * python/py-cmd.c (cmdpy_destroyer): Use gdbpy_ref.
9456 * python/py-breakpoint.c (gdbpy_breakpoint_deleted): Use
9458 * python/py-type.c (field_new): Use gdbpy_ref.
9459 * python/py-symtab.c (symtab_and_line_to_sal_object): Use
9461 * python/py-progspace.c (pspy_new): Use gdbpy_ref.
9462 (py_free_pspace): Likewise.
9463 (pspace_to_pspace_object): Likewise.
9464 * python/py-objfile.c (objfpy_new): Use gdbpy_ref.
9465 (py_free_objfile): Likewise.
9466 (objfile_to_objfile_object): Likewise.
9467 * python/py-inferior.c (delete_thread_object): Use
9469 (infpy_read_memory): Likewise.
9470 (py_free_inferior): Likewise.
9471 * python/py-evtregistry.c (create_eventregistry_object): Use
9473 * python/py-event.c (create_event_object): Use gdbpy_ref.
9477 * python/py-ref.h (gdbpy_ref_policy): Now a template.
9478 (gdbpy_ref): Now a template; allow subclasses of PyObject to be
9480 * python/py-arch.c, python/py-bpevent.c, python/py-breakpoint.c,
9481 python/py-cmd.c, python/py-continueevent.c, python/py-event.c,
9482 python/py-exitedevent.c, python/py-finishbreakpoint.c,
9483 python/py-framefilter.c, python/py-function.c,
9484 python/py-inferior.c, python/py-infevents.c,
9485 python/py-linetable.c, python/py-newobjfileevent.c,
9486 python/py-param.c, python/py-prettyprint.c, python/py-ref.h,
9487 python/py-signalevent.c, python/py-stopevent.c,
9488 python/py-symbol.c, python/py-threadevent.c, python/py-type.c,
9489 python/py-unwind.c, python/py-utils.c, python/py-value.c,
9490 python/py-varobj.c, python/py-xmethods.c, python/python.c,
9491 varobj.c: Change gdbpy_ref to gdbpy_ref<>.
9495 * ui-out.h (ui_out_emit_type): New class.
9496 (ui_out_emit_tuple, ui_out_emit_list): New typedefs.
9497 * python/py-framefilter.c (py_print_single_arg): Use gdb::optional
9498 and ui_out_emit_tuple.
9499 (enumerate_locals): Likewise.
9500 (py_mi_print_variables, py_print_locals, py_print_args): Use
9502 (py_print_frame): Use gdb::optional, ui_out_emit_tuple,
9504 * common/gdb_optional.h: New file.
9508 * MAINTAINERS (Write After Approval): Update my e-mail address.
9513 * breakpoint.c (_initialize_breakpoint): Update the help description
9514 of the 'commands' command to indicate that it takes a list argument.
9518 * interps.c (current_interp_set_logging): Remove "return".
9522 * symtab.c (add_symtab_completions): Prevent NULL pointer
9527 * interps.c (interp::interp): Remove reference to quiet_p.
9528 (interp_set): Make static. Remove dead "Switching to" output
9530 (interp_quiet_p, interp_set_quiet): Delete.
9531 (interpreter_exec_cmd): Don't set the interpreter quiet.
9532 * interps.h (interp_quiet_p): Make static.
9533 (class interp) <quiet_p>: Remove field
9537 * cli/cli-decode.c (find_command_name_length): Make it extern.
9538 * cli/cli-decode.h (find_command_name_length): Declare.
9539 * cli/cli-script.c (command_name_equals, line_first_arg):
9541 (process_next_line): Use cli-decode to parse command names.
9542 (build_command_line): Make args a constant pointer.
9546 * cli-decode.c (lookup_cmd_1, lookup_cmd_composition):
9547 Remove case-insensitive search.
9551 * sparc-tdep.c (sparc32_gdbarch_init): Do not place a + operator
9552 at the end of the line. Avoids an ARI warning.
9556 * NEWS: Mention support for record/replay of Intel 64 rdrand and
9557 rdseed instructions.
9558 i386-tdep.c (i386_process_record): Handle Intel 64 rdrand and rseed.
9563 Provide and use sparc32 and sparc64 target description XML files.
9564 * features/sparc/sparc32-cp0.xml, features/sparc/sparc32-cpu.xml,
9565 features/sparc/sparc32-fpu.xml: New files for sparc 32-bit.
9566 * features/sparc/sparc64-cp0.xml, features/sparc/sparc64-cpu.xml,
9567 features/sparc/sparc64-fpu.xml: New files for sparc 64-bit.
9568 * features/sparc/sparc32-solaris.xml: New file.
9569 * features/sparc/sparc64-solaris.xml: New file.
9570 * features/sparc/sparc32-solaris.c: Generated.
9571 * features/sparc/sparc64-solaris.c: Generated.
9572 * sparc-tdep.h: Account for differences in target descriptions.
9573 * sparc-tdep.c (sparc32_register_name): Use target provided registers.
9574 (sparc32_register_type): Use target provided registers.
9575 (validate_tdesc_registers): New function.
9576 (sparc32_gdbarch_init): Use tdesc_has_registers.
9577 Set pseudoregister functions.
9578 * sparc64-tdep.c (sparc64_register_name): Use target provided registers.
9579 (sparc64_register_type): Use target provided registers.
9580 (sparc64_init_abi): Set pseudoregister functions.
9585 * rust-lang.c (rust_print_type) <TYPE_CODE_UNION>: Handle enums
9586 with a single member.
9590 * cli/cli-interp.c (cli_interp_base::cli_interp_base)
9591 (cli_interp_base::~cli_interp_base): New.
9592 (cli_interp): New struct.
9593 (as_cli_interp): Cast the interp itself to cli_interp.
9594 (cli_interpreter_pre_command_loop): Rename to ...
9595 (cli_interp_base::pre_command_loop): ... this. Remove 'self'
9597 (cli_interpreter_init): Rename to ...
9598 (cli_interp::init): ... this. Remove 'self' parameter. Use
9599 boolean. Make extern.
9600 (cli_interpreter_resume): Rename to ...
9601 (cli_interp::resume): ... this. Remove 'data' parameter. Make
9603 (cli_interpreter_suspend): Rename to ...
9604 (cli_interp::suspend): ... this. Remove 'data' parameter. Make
9606 (cli_interpreter_exec): Rename to ...
9607 (cli_interp::exec): ... this. Remove 'data' parameter. Make
9609 (cli_interpreter_supports_command_editing): Rename to ...
9610 (cli_interp_base::supports_command_editing): ... this. Remove
9611 'interp' parameter. Make extern.
9612 (cli_ui_out): Rename to ...
9613 (cli_interp::interp_ui_out): ... this. Remove 'interp' parameter.
9615 (cli_set_logging): Rename to ...
9616 (cli_interp_base::set_logging): ... this. Remove 'interp'
9617 parameter. Make extern.
9618 (cli_interp_procs): Delete.
9619 (cli_interp_factory): Adjust to use "new".
9620 * cli/cli-interp.h: Include "interps.h".
9621 (struct cli_interp_base): New struct.
9622 * interps.c (struct interp): Delete. Fields moved to interps.h.
9623 (interp_new): Delete.
9624 (interp::interp, interp::~interp): New.
9625 (interp_set): Use bool, and return void. Assume the interpreter
9626 has suspend, init and resume methods, and that the all return
9628 (set_top_level_interpreter): interp_set returns void.
9629 (interp_ui_out): Adapt.
9630 (current_interp_set_logging): Adapt.
9631 (interp_data): Delete.
9632 (interp_pre_command_loop, interp_supports_command_editing): Adapt.
9633 (interp_exec): Adapt.
9634 (top_level_interpreter_data): Delete.
9635 * interps.h (interp_init_ftype, interp_resume_ftype)
9636 (interp_suspend_ftype, interp_exec_ftype)
9637 (interp_pre_command_loop_ftype, interp_ui_out_ftype): Delete.
9638 (class interp): New.
9639 (interp_new): Delete.
9640 (interp_set): Now returns void. Use bool.
9641 (interp_data, top_level_interpreter_data): Delete.
9642 * mi/mi-common.h: Include interps.h.
9643 (class mi_interp): Inherit from interp. Define a ctor. Declare
9644 init, resume, suspect, exec, interp_ui_out, set_logging and
9645 pre_command_loop methods.
9646 * mi/mi-interp.c (as_mi_interp): Cast the interp itself.
9647 (mi_interpreter_init): Rename to ...
9648 (mi_interp::init): ... this. Remove the 'interp' parameter, use
9649 bool, return void and make extern. Adjust.
9650 (mi_interpreter_resume): ... Rename to ...
9651 (mi_interp::resume): ... this. Remove the 'data' parameter,
9652 return void and make extern. Adjust.
9653 (mi_interpreter_suspend): ... Rename to ...
9654 (mi_interp::suspend): ... this. Remove the 'data' parameter,
9655 return void and make extern. Adjust.
9656 (mi_interpreter_exec): ... Rename to ...
9657 (mi_interp::exec): ... this. Remove the 'data' parameter and make
9659 (mi_interpreter_pre_command_loop): ... Rename to ...
9660 (mi_interp::pre_command_loop): ... this. Remove the 'self'
9661 parameter and make extern.
9662 (mi_on_normal_stop_1): Adjust.
9663 (mi_ui_out): Rename to ...
9664 (mi_interp::interp_ui_out): ... this. Remove the 'interp'
9665 parameter and make extern. Adjust.
9666 (mi_set_logging): Rename to ...
9667 (mi_interp::set_logging): ... this. Remove the 'interp'
9668 parameter and make extern. Adjust.
9669 (mi_interp_procs): Delete.
9670 (mi_interp_factory): Adjust to use 'new'.
9671 * mi/mi-main.c (mi_cmd_gdb_exit, captured_mi_execute_command)
9672 (mi_print_exception, mi_execute_command, mi_load_progress):
9674 * tui/tui-interp.c (tui_interp): New class.
9675 (as_tui_interp): Return a tui_interp pointer.
9676 (tui_on_normal_stop, tui_on_signal_received)
9677 (tui_on_end_stepping_range, tui_on_signal_exited, tui_on_exited)
9678 (tui_on_no_history, tui_on_user_selected_context_changed): Adjust
9679 to use interp::interp_ui_out.
9680 (tui_init): Rename to ...
9681 (tui_interp::init): ... this. Remove the 'self' parameter, use
9682 bool, return void and make extern. Adjust.
9683 (tui_resume): Rename to ...
9684 (tui_interp::resume): ... this. Remove the 'data' parameter,
9685 return void and make extern. Adjust.
9686 (tui_suspend): Rename to ...
9687 (tui_interp::suspend): ... this. Remove the 'data' parameter,
9688 return void and make extern. Adjust.
9689 (tui_ui_out): Rename to ...
9690 (tui_interp::interp_ui_out): ... this. Remove the 'self'
9691 parameter, and make extern. Adjust.
9692 (tui_exec): Rename to ...
9693 (tui_interp::exec): ... this. Remove the 'data' parameter and
9695 (tui_interp_procs): Delete.
9696 (tui_interp_factory): Use "new".
9700 * rust-exp.y (ends_raw_string, space_then_number)
9701 (rust_identifier_start_p): Return bool.
9702 * rust-lang.c (rust_tuple_type_p, rust_underscore_fields)
9703 (rust_tuple_struct_type_p, rust_tuple_variant_type_p)
9704 (rust_slice_type_p, rust_range_type_p, rust_u8_type_p)
9705 (rust_chartype_p): Return bool.
9706 (val_print_struct, rust_print_struct_def, rust_print_type):
9708 * rust-lang.h (rust_tuple_type_p, rust_tuple_struct_type_p):
9713 * rust-lang.c: Reindent.
9717 * rust-lang.h (rust_crate_for_block): Update.
9718 * rust-lang.c (rust_crate_for_block): Return std::string.
9719 (rust_get_disr_info): Use std:;string, not
9720 gdb::unique_xmalloc_ptr.
9721 * rust-exp.y (crate_name): Update.
9725 * disasm-selftests.c (print_one_insn_test): Move the "verbose"
9726 field out of gdb_disassembler_test and make it static.
9730 * mi/mi-common.h (struct mi_interp): Delete the mi2_interp,
9731 mi1_interp and mi_interp fields.
9735 * cli/cli-interp.c (struct saved_output_files, saved_output):
9736 Moved from cli/cli-logging.c.
9737 (cli_set_logging): New function.
9738 (cli_interp_procs): Install cli_set_logging.
9739 * cli/cli-interp.h (make_logging_output, cli_set_logging):
9741 * cli/cli-logging.c (struct saved_output_files, saved_output):
9742 Moved to cli/cli-interp.c.
9743 (pop_output_files): Don't save outputs here.
9744 (make_logging_output): New function.
9745 (handle_redirections): Don't build tee nor save previous outputs
9747 * interps.c (current_interp_set_logging): Change prototype.
9748 Assume there's always a set_logging_proc method installed.
9749 * interps.h (interp_set_logging_ftype): Change prototype.
9750 (current_interp_set_logging): Change prototype and adjust comment.
9751 * mi/mi-interp.c (mi_set_logging): Change protototype. Adjust to
9752 use make_logging_output.
9753 * tui/tui-interp.c (tui_interp_procs): Install cli_set_logging.
9756 * cli/cli-logging.c (maybe_warn_already_logging): New factored out
9758 (set_logging_overwrite): ... here.
9759 (logging_no_redirect_file): Delete.
9760 (set_logging_redirect): Don't handle redirection on the fly.
9761 Instead warn that "logging off" / "logging on" is necessary.
9762 (pop_output_files): Delete references to logging_no_redirect_file.
9763 (show_logging_command): Always speak in terms of what will happen
9764 once logging is reenabled.
9768 * disasm.h (gdb_pretty_print_disassembler): Tweak intro comment.
9772 * disasm.c (gdb_pretty_print_insn): Rename to ...
9773 (gdb_pretty_print_disassembler::pretty_print_insn): ... this.
9774 Remove gdbarch parameter. Adapt to clear the object's buffers
9775 instead of allocating new buffers, and to print using the object's
9776 gdb_disassembler instead of calling gdb_print_insn.
9777 (dump_insns): Use gdb_pretty_print_disassembler.
9778 * disasm.h (gdb_pretty_print_insn): Delete declaration.
9779 (gdb_pretty_print_disassembler): New class.
9780 * record-btrace.c (btrace_insn_history): Use
9781 gdb_pretty_print_disassembler.
9785 * ada-lang.c (type_as_string): Use string_file.
9786 * ada-valprint.c (ada_print_floating): Use string_file.
9787 * ada-varobj.c (ada_varobj_scalar_image)
9788 (ada_varobj_get_value_image): Use string_file.
9789 * aix-thread.c (aix_thread_extra_thread_info): Use string_file.
9790 * arm-tdep.c (_initialize_arm_tdep): Use string_printf.
9791 * breakpoint.c (update_inserted_breakpoint_locations)
9792 (insert_breakpoint_locations, reattach_breakpoints)
9793 (print_breakpoint_location, print_one_detail_ranged_breakpoint)
9794 (print_it_watchpoint): Use string_file.
9795 (save_breakpoints): Use stdio_file.
9796 * c-exp.y (oper): Use string_file.
9797 * cli/cli-logging.c (set_logging_redirect): Use ui_file_up and
9799 (pop_output_files): Use delete.
9800 (handle_redirections): Use stdio_file and tee_file.
9801 * cli/cli-setshow.c (do_show_command): Use string_file.
9802 * compile/compile-c-support.c (c_compute_program): Use
9804 * compile/compile-c-symbols.c (generate_vla_size): Take a
9805 'string_file &' instead of a 'ui_file *'.
9806 (generate_c_for_for_one_variable): Take a 'string_file &' instead
9807 of a 'ui_file *'. Use string_file.
9808 (generate_c_for_variable_locations): Take a 'string_file &'
9809 instead of a 'ui_file *'.
9810 * compile/compile-internal.h (generate_c_for_for_one_variable):
9811 Take a 'string_file &' instead of a 'ui_file *'.
9812 * compile/compile-loc2c.c (push, pushf, unary, binary)
9813 (print_label, pushf_register_address, pushf_register)
9814 (do_compile_dwarf_expr_to_c): Take a 'string_file &' instead of a
9815 'ui_file *'. Adjust.
9816 * compile/compile.c (compile_to_object): Use string_file.
9817 * compile/compile.h (compile_dwarf_expr_to_c)
9818 (compile_dwarf_bounds_to_c): Take a 'string_file &' instead of a
9820 * cp-support.c (inspect_type): Use string_file and obstack_copy0.
9821 (replace_typedefs_qualified_name): Use string_file and
9823 * disasm.c (gdb_pretty_print_insn): Use string_file.
9824 (gdb_disassembly): Adjust reference the null_stream global.
9825 (do_ui_file_delete): Delete.
9826 (gdb_insn_length): Use null_stream.
9827 * dummy-frame.c (maintenance_print_dummy_frames): Use stdio_file.
9828 * dwarf2loc.c (dwarf2_compile_property_to_c)
9829 (locexpr_generate_c_location, loclist_generate_c_location): Take a
9830 'string_file &' instead of a 'ui_file *'.
9831 * dwarf2loc.h (dwarf2_compile_property_to_c): Likewise.
9832 * dwarf2read.c (do_ui_file_peek_last): Delete.
9833 (dwarf2_compute_name): Use string_file.
9834 * event-top.c (gdb_setup_readline): Use stdio_file.
9835 * gdbarch.sh (verify_gdbarch): Use string_file.
9836 * gdbtypes.c (safe_parse_type): Use null_stream.
9837 * guile/scm-breakpoint.c (gdbscm_breakpoint_commands): Use
9839 * guile/scm-disasm.c (gdbscm_print_insn_from_port): Take a
9840 'string_file *' instead of a 'ui_file *'.
9841 (gdbscm_arch_disassemble): Use string_file.
9842 * guile/scm-frame.c (frscm_print_frame_smob): Use string_file.
9843 * guile/scm-ports.c (class ioscm_file_port): Now a class that
9844 inherits from ui_file.
9845 (ioscm_file_port_delete, ioscm_file_port_rewind)
9846 (ioscm_file_port_put): Delete.
9847 (ioscm_file_port_write): Rename to ...
9848 (ioscm_file_port::write): ... this. Remove file_port_magic
9850 (ioscm_file_port_new): Delete.
9851 (ioscm_with_output_to_port_worker): Use ioscm_file_port and
9853 * guile/scm-type.c (tyscm_type_name): Use string_file.
9854 * guile/scm-value.c (vlscm_print_value_smob, gdbscm_value_print):
9856 * infcmd.c (print_return_value_1): Use string_file.
9857 * infrun.c (print_target_wait_results): Use string_file.
9858 * language.c (add_language): Use string_file.
9859 * location.c (explicit_to_string_internal): Use string_file.
9860 * main.c (captured_main_1): Use null_file.
9861 * maint.c (maintenance_print_architecture): Use stdio_file.
9862 * mi/mi-cmd-stack.c (list_arg_or_local): Use string_file.
9863 * mi/mi-common.h (struct mi_interp) <out, err, log, targ,
9864 event_channel>: Change type to mi_console_file pointer.
9865 * mi/mi-console.c (mi_console_file_fputs, mi_console_file_flush)
9866 (mi_console_file_delete): Delete.
9867 (struct mi_console_file): Delete.
9868 (mi_console_file_magic): Delete.
9869 (mi_console_file_new): Delete.
9870 (mi_console_file::mi_console_file): New.
9871 (mi_console_file_delete): Delete.
9872 (mi_console_file_fputs): Delete.
9873 (mi_console_file::write): New.
9874 (mi_console_raw_packet): Delete.
9875 (mi_console_file::flush): New.
9876 (mi_console_file_flush): Delete.
9877 (mi_console_set_raw): Rename to ...
9878 (mi_console_file::set_raw): ... this.
9879 * mi/mi-console.h (class mi_console_file): New class.
9880 (mi_console_file_new, mi_console_set_raw): Delete.
9881 * mi/mi-interp.c (mi_interpreter_init): Use mi_console_file.
9882 (mi_set_logging): Use delete and tee_file. Adjust.
9883 * mi/mi-main.c (output_register): Use string_file.
9884 (mi_cmd_data_evaluate_expression): Use string_file.
9885 (mi_cmd_data_read_memory): Use string_file.
9886 (mi_cmd_execute, print_variable_or_computed): Use string_file.
9887 * mi/mi-out.c (mi_ui_out::main_stream): New.
9888 (mi_ui_out::rewind): Use main_stream and
9890 (mi_ui_out::put): Use main_stream and string_file.
9891 (mi_ui_out::mi_ui_out): Remove 'stream' parameter.
9892 Allocate a 'string_file' instead.
9893 (mi_out_new): Don't allocate a mem_fileopen stream here.
9894 * mi/mi-out.h (mi_ui_out::mi_ui_out): Remove 'stream' parameter.
9895 (mi_ui_out::main_stream): Declare method.
9896 * printcmd.c (eval_command): Use string_file.
9897 * psymtab.c (maintenance_print_psymbols): Use stdio_file.
9898 * python/py-arch.c (archpy_disassemble): Use string_file.
9899 * python/py-breakpoint.c (bppy_get_commands): Use string_file.
9900 * python/py-frame.c (frapy_str): Use string_file.
9901 * python/py-framefilter.c (py_print_type, py_print_single_arg):
9903 * python/py-type.c (typy_str): Use string_file.
9904 * python/py-unwind.c (unwind_infopy_str): Use string_file.
9905 * python/py-value.c (valpy_str): Use string_file.
9906 * record-btrace.c (btrace_insn_history): Use string_file.
9907 * regcache.c (regcache_print): Use stdio_file.
9908 * reggroups.c (maintenance_print_reggroups): Use stdio_file.
9909 * remote.c (escape_buffer): Use string_file.
9910 * rust-lang.c (rust_get_disr_info): Use string_file.
9911 * serial.c (serial_open_ops_1): Use stdio_file.
9912 (do_serial_close): Use delete.
9913 * stack.c (print_frame_arg): Use string_file.
9914 (print_frame_args): Remove local mem_fileopen stream, not used.
9915 (print_frame): Use string_file.
9916 * symmisc.c (maintenance_print_symbols): Use stdio_file.
9917 * symtab.h (struct symbol_computed_ops) <generate_c_location>:
9918 Take a 'string_file *' instead of a 'ui_file *'.
9919 * top.c (new_ui): Use stdio_file and stderr_file.
9920 (free_ui): Use delete.
9921 (execute_command_to_string): Use string_file.
9922 (quit_confirm): Use string_file.
9923 * tracepoint.c (collection_list::append_exp): Use string_file.
9924 * tui/tui-disasm.c (tui_disassemble): Use string_file.
9925 * tui/tui-file.c: Don't include "ui-file.h".
9926 (enum streamtype, struct tui_stream): Delete.
9927 (tui_file_new, tui_file_delete, tui_fileopen, tui_sfileopen)
9928 (tui_file_isatty, tui_file_rewind, tui_file_put): Delete.
9929 (tui_file::tui_file): New method.
9930 (tui_file_fputs): Delete.
9931 (tui_file_get_strbuf): Delete.
9932 (tui_file::puts): New method.
9933 (tui_file_adjust_strbuf): Delete.
9934 (tui_file_flush): Delete.
9935 (tui_file::flush): New method.
9936 * tui/tui-file.h: Tweak intro comment.
9938 (tui_fileopen, tui_sfileopen, tui_file_get_strbuf)
9939 (tui_file_adjust_strbuf): Delete declarations.
9940 (class tui_file): New class.
9941 * tui/tui-io.c (tui_initialize_io): Use tui_file.
9942 * tui/tui-regs.c (tui_restore_gdbout): Use delete.
9943 (tui_register_format): Use string_stream.
9944 * tui/tui-stack.c (tui_make_status_line): Use string_file.
9945 (tui_get_function_from_frame): Use string_file.
9946 * typeprint.c (type_to_string): Use string_file.
9947 * ui-file.c (struct ui_file, ui_file_magic, ui_file_new): Delete.
9948 (null_stream): New global.
9949 (ui_file_delete): Delete.
9950 (ui_file::ui_file): New.
9951 (null_file_isatty): Delete.
9952 (ui_file::~ui_file): New.
9953 (null_file_rewind): Delete.
9954 (ui_file::printf): New.
9955 (null_file_put): Delete.
9956 (null_file_flush): Delete.
9957 (ui_file::putstr): New.
9958 (null_file_write): Delete.
9959 (ui_file::putstrn): New.
9960 (null_file_read): Delete.
9961 (ui_file::putc): New.
9962 (null_file_fputs): Delete.
9963 (null_file_write_async_safe): Delete.
9964 (ui_file::vprintf): New.
9965 (null_file_delete): Delete.
9966 (null_file::write): New.
9967 (null_file_fseek): Delete.
9968 (null_file::puts): New.
9969 (ui_file_data): Delete.
9970 (null_file::write_async_safe): New.
9971 (gdb_flush, ui_file_isatty): Adjust.
9972 (ui_file_put, ui_file_rewind): Delete.
9973 (ui_file_write): Adjust.
9974 (ui_file_write_for_put): Delete.
9975 (ui_file_write_async_safe, ui_file_read): Adjust.
9976 (ui_file_fseek): Delete.
9977 (fputs_unfiltered): Adjust.
9978 (set_ui_file_flush, set_ui_file_isatty, set_ui_file_rewind)
9979 (set_ui_file_put, set_ui_file_write, set_ui_file_write_async_safe)
9980 (set_ui_file_read, set_ui_file_fputs, set_ui_file_fseek)
9981 (set_ui_file_data): Delete.
9982 (string_file::~string_file, string_file::write)
9983 (struct accumulated_ui_file, do_ui_file_xstrdup, ui_file_xstrdup)
9984 (do_ui_file_as_string, ui_file_as_string): Delete.
9985 (do_ui_file_obsavestring, ui_file_obsavestring): Delete.
9986 (struct mem_file): Delete.
9987 (mem_file_new): Delete.
9988 (stdio_file::stdio_file): New.
9989 (mem_file_delete): Delete.
9990 (stdio_file::stdio_file): New.
9991 (mem_fileopen): Delete.
9992 (stdio_file::~stdio_file): New.
9993 (mem_file_rewind): Delete.
9994 (stdio_file::set_stream): New.
9995 (mem_file_put): Delete.
9996 (stdio_file::open): New.
9997 (mem_file_write): Delete.
9998 (stdio_file_magic, struct stdio_file): Delete.
9999 (stdio_file_new, stdio_file_delete, stdio_file_flush): Delete.
10000 (stdio_file::flush): New.
10001 (stdio_file_read): Rename to ...
10002 (stdio_file::read): ... this. Adjust.
10003 (stdio_file_write): Rename to ...
10004 (stdio_file::write): ... this. Adjust.
10005 (stdio_file_write_async_safe): Rename to ...
10006 (stdio_file::write_async_safe) ... this. Adjust.
10007 (stdio_file_fputs): Rename to ...
10008 (stdio_file::puts) ... this. Adjust.
10009 (stdio_file_isatty): Delete.
10010 (stdio_file_fseek): Delete.
10011 (stdio_file::isatty): New.
10012 (stderr_file_write): Rename to ...
10013 (stderr_file::write) ... this. Adjust.
10014 (stderr_file_fputs): Rename to ...
10015 (stderr_file::puts) ... this. Adjust.
10016 (stderr_fileopen, stdio_fileopen, gdb_fopen): Delete.
10017 (stderr_file::stderr_file): New.
10018 (tee_file_magic): Delete.
10019 (struct tee_file): Delete.
10020 (tee_file::tee_file): New.
10021 (tee_file_new): Delete.
10022 (tee_file::~tee_file): New.
10023 (tee_file_delete): Delete.
10024 (tee_file_flush): Rename to ...
10025 (tee_file::flush): ... this. Adjust.
10026 (tee_file_write): Rename to ...
10027 (tee_file::write): ... this. Adjust.
10028 (tee_file::write_async_safe): New.
10029 (tee_file_fputs): Rename to ...
10030 (tee_file::puts): ... this. Adjust.
10031 (tee_file_isatty): Rename to ...
10032 (tee_file::isatty): ... this. Adjust.
10033 * ui-file.h (struct obstack, struct ui_file): Don't
10035 (ui_file_new, ui_file_flush_ftype, set_ui_file_flush)
10036 (ui_file_write_ftype)
10037 (set_ui_file_write, ui_file_fputs_ftype, set_ui_file_fputs)
10038 (ui_file_write_async_safe_ftype, set_ui_file_write_async_safe)
10039 (ui_file_read_ftype, set_ui_file_read, ui_file_isatty_ftype)
10040 (set_ui_file_isatty, ui_file_rewind_ftype, set_ui_file_rewind)
10041 (ui_file_put_method_ftype, ui_file_put_ftype, set_ui_file_put)
10042 (ui_file_delete_ftype, set_ui_file_data, ui_file_fseek_ftype)
10043 (set_ui_file_fseek): Delete.
10044 (ui_file_data, ui_file_delete, ui_file_rewind)
10045 (struct ui_file): New.
10047 (class null_file): New.
10048 (null_stream): Declare.
10049 (ui_file_write_for_put, ui_file_put): Delete.
10050 (ui_file_xstrdup, ui_file_as_string, ui_file_obsavestring):
10052 (ui_file_fseek, mem_fileopen, stdio_fileopen, stderr_fileopen)
10053 (gdb_fopen, tee_file_new): Delete.
10054 (struct string_file): New.
10055 (struct stdio_file): New.
10056 (stdio_file_up): New.
10057 (struct stderr_file): New.
10058 (class tee_file): New.
10059 * ui-out.c (ui_out::field_stream): Take a 'string_file &' instead
10060 of a 'ui_file *'. Adjust.
10061 * ui-out.h (class ui_out) <field_stream>: Likewise.
10062 * utils.c (do_ui_file_delete, make_cleanup_ui_file_delete)
10063 (null_stream): Delete.
10064 (error_stream): Take a 'string_file &' instead of a 'ui_file *'.
10066 * utils.h (struct ui_file): Delete forward declaration..
10067 (make_cleanup_ui_file_delete, null_stream): Delete declarations.
10068 (error_stream): Take a 'string_file &' instead of a
10070 * varobj.c (varobj_value_get_print_value): Use string_file.
10071 * xtensa-tdep.c (xtensa_verify_config): Use string_file.
10072 * gdbarch.c: Regenerate.
10076 * disasm.c (gdb_disassembler::pretty_print_insn): Rename to...
10077 (gdb_pretty_print_insn): ... this. Now a free function. Add back
10078 a 'gdbarch' parameter. Allocate a mem_fileopen stream here.
10079 Adjust to call gdb_print_insn instead of
10080 gdb_disassembler::print_insn.
10081 (dump_insns, do_mixed_source_and_assembly_deprecated)
10082 (do_mixed_source_and_assembly, do_assembly_only): Add back a
10083 'gdbarch' parameter. Remove gdb_disassembler parameter.
10084 (gdb_disassembly): Don't allocate a gdb_disassembler here.
10085 * disasm.h (gdb_disassembler::pretty_print_insn): Delete
10087 (gdb_pretty_print_insn): Re-add declaration.
10088 * record-btrace.c (btrace_insn_history): Don't allocate a
10089 gdb_disassembler here. Adjust to call gdb_pretty_print_insn.
10093 * disasm.h (gdb_disassembly): Remove file_string parameter.
10094 * disasm.c (gdb_disassembly): Likewise.
10095 * cli/cli-cmds.c (print_disassembly): Adapt.
10096 * mi/mi-cmd-disas.c (mi_cmd_disassemble): Likewise.
10097 * stack.c (do_gdb_disassembly): Likewise.
10101 * dwarf2loc.c (dwarf2_evaluate_loc_desc_full): For
10102 DWARF_VALUE_LITERAL, no longer ignore the offset on big-endian
10103 targets. And if the implicit value is longer than needed, extract
10104 the first bytes instead of the "least significant" ones.
10108 * btrace.c (btrace_enable): Do not call btrace_add_pc for
10109 BTRACE_FORMAT_PT or if can_access_registers_ptid returns false.
10110 (btrace_fetch): Assert can_access_registers_ptid.
10111 * record-btrace.c (require_btrace_thread, record_btrace_info): Call
10112 validate_registers_access.
10116 * gdbthread.h (can_access_registers_ptid): New.
10117 * thread.c (can_access_registers_ptid): New.
10121 * i386-tdep.c (i386_fast_tracepoint_valid_at): Use gdb_insn_length.
10125 * mi/mi-interp.c (mi_breakpoint_created, mi_breakpoint_modified):
10130 * stack.c (print_frame_args): Remove local mem_fileopen stream,
10135 * varobj.c (varobj_value_get_print_value): Remove xstrdup call.
10139 * common/scoped_restore.h
10140 (scoped_restore_tmpl::scoped_restore_tmpl): Template on T2, and
10141 change the value's parameter type to T2.
10142 (make_scoped_restore): Likewise.
10147 * amd64-linux-nat.c (PTRACE_ARCH_PRCTL): New define.
10148 (amd64_linux_fetch_inferior_registers): Add case to fetch FS_BASE
10149 GS_BASE for older kernels.
10150 (amd64_linux_store_inferior_registers): Add case to store FS_BASE
10151 GS_BASE for older kernels.
10152 * amd64-linux-tdep.c (amd64_linux_gregset_reg_offset): Add FS_BASE
10153 and GS_BASE to the offset table.
10154 (amd64_linux_register_reggroup_p): Add FS_BASE and GS_BASE to the
10155 system register group.
10156 * amd64-nat.c (amd64_native_gregset_reg_offset): Implements case
10158 * amd64-tdep.c (amd64_init_abi): Add segment registers for the
10160 * amd64-tdep.h (amd64_regnum): Add AMD64_FSBASE_REGNUM and
10161 AMD64_GSBASE_REGNUM.
10162 (AMD64_NUM_REGS): Set to AMD64_GSBASE_REGNUM + 1.
10163 * features/Makefile (amd64-linux.dat, amd64-avx-linux.dat)
10164 (amd64-mpx-linux.dat, amd64-avx512-linux.dat, x32-linux.dat)
10165 (x32-avx-linux.dat, x32-avx512-linux.dat): Add
10166 i386/64bit-segments.xml in those rules.
10167 * features/i386/64bit-segments.xml: New file.
10168 * features/i386/amd64-avx-mpx-linux.xml: Add 64bit-segments.xml.
10169 * features/i386/amd64-avx-linux.xml: Add 64bit-segments.xml.
10170 * features/i386/amd64-avx512-linux.xml: Add 64bit-segments.xml.
10171 * features/i386/amd64-mpx-linux.xml: Add 64bit-segments.xml.
10172 * features/i386/x32-avx512-linux.xml: Add 64bit-segments.xml.
10173 * features/i386/x32-avx-linux.xml: Add 64bit-segments.xml.
10174 * features/i386/amd64-linux.xml: Add 64bit-segments.xml.
10175 * features/i386/amd64-avx-linux.c: Regenerated.
10176 * features/i386/amd64-avx-mpx-linux.c: Regenerated.
10177 * features/i386/amd64-avx-mpx.c: Regenerated.
10178 * features/i386/amd64-avx512-linux.c: Regenerated.
10179 * features/i386/amd64-linux.c: Regenerated.
10180 * features/i386/amd64-mpx-linux.c: Regenerated.
10181 * features/i386/i386-avx-mpx-linux.c: Regenerated.
10182 * features/i386/i386-avx-mpx.c: Regenerated.
10183 * features/i386/x32-avx-linux.c: Regenerated.
10184 * features/i386/x32-avx512-linux.c: Regenerated.
10185 * regformats/i386/amd64-avx-linux.dat: Regenerated.
10186 * regformats/i386/amd64-avx-mpx-linux.dat: Regenerated.
10187 * regformats/i386/amd64-avx512-linux.dat: Regenerated.
10188 * regformats/i386/amd64-linux.dat: Regenerated.
10189 * regformats/i386/amd64-mpx-linux.dat: Regenerated.
10190 * regformats/i386/x32-avx-linux.dat: Regenerated.
10191 * regformats/i386/x32-avx512-linux.dat: Regenerated.
10192 * regformats/i386/x32-linux.dat: Regenerated.
10196 * amd64-linux-tdep.h (AMD64_LINUX_ORIG_RAX_REGNUM):
10197 Set to AMD64_NUM_REGS.
10201 * amd64-nat.c (amd64_native_gregset_reg_offset): Simplify logic
10202 that checks validity of a register number.
10206 * gdb/arm-linux-nat.c (arm_linux_fetch_inferior_registers): Call
10207 fetch_fpregs if target has fpa registers.
10208 (arm_linux_store_inferior_registers): Call store_fpregs if target
10213 * cris-tdep.c (cris_gdbarch_init): Remove check for
10214 info.byte_order and force it to BFD_ENDIAN_LITTLE.
10218 * corelow.c (get_core_register_section): Check for regset
10219 existence before checking for REGSET_VARIABLE_SIZE.
10225 * disasm.c (gdb_disassembler::dis_asm_memory_error): Don't
10226 call memory_error, save memaddr instead.
10227 (gdb_disassembler::print_insn): If gdbarch_print_insn returns
10228 negative, cal memory_error.
10229 * disasm.h (gdb_disassembler) <m_err_memaddr>: New field.
10233 * disasm-selftests.c (memory_error_test): New function.
10234 (_initialize_disasm_selftests): Register memory_error_test.
10238 * Makefile.in (SFILES): Add disasm-selftests.c and
10240 (COMMON_OBS): Add disasm-selftests.o and selftest-arch.o.
10241 * disasm-selftests.c: New file.
10242 * selftest-arch.c: New file.
10243 * selftest-arch.h: New file.
10247 * mep-tdep.c (mep_gdb_print_insn): Set info->arch
10248 to bfd_arch_mep. Don't return 0 if section is not
10249 found. Call print_insn_mep.
10254 * arm-tdep.c: Include "disasm.h".
10255 (gdb_print_insn_arm): Update code to get gdbarch.
10256 * disasm.c (dis_asm_read_memory): Change it to
10257 gdb_disassembler::dis_asm_read_memory.
10258 (dis_asm_memory_error): Likewise.
10259 (dis_asm_print_address): Likewise.
10260 (gdb_pretty_print_insn): Change it to
10261 gdb_disassembler::pretty_print_insn.
10262 (dump_insns): Add one argument gdb_disassemlber. All
10264 (do_mixed_source_and_assembly_deprecated): Likewise.
10265 (do_mixed_source_and_assembly): Likewise.
10266 (do_assembly_only): Likewise.
10267 (gdb_disassembler::gdb_disassembler): New.
10268 (gdb_disassembler::print_insn): New.
10269 * disasm.h (class gdb_disassembler): New.
10270 (gdb_pretty_print_insn): Remove declaration.
10271 (gdb_disassemble_info): Likewise.
10272 * guile/scm-disasm.c (class gdbscm_disassembler): New.
10273 (gdbscm_disasm_read_memory_worker): Update.
10274 (gdbscm_disasm_read_memory): Update.
10275 (gdbscm_disasm_memory_error): Remove.
10276 (gdbscm_disasm_print_address): Remove.
10277 (gdbscm_disassembler::gdbscm_disassembler): New.
10278 (gdbscm_print_insn_from_port): Update.
10279 * mips-tdep.c: Include disasm.h.
10280 (gdb_print_insn_mips): Update code to get gdbarch.
10281 * record-btrace.c (btrace_insn_history): Update.
10282 * spu-tdep.c: Include disasm.h.
10283 (struct spu_dis_asm_data): Remove.
10284 (struct spu_dis_asm_info): New.
10285 (spu_dis_asm_print_address): Use spu_dis_asm_info to get
10287 (gdb_print_insn_spu): Cast disassemble_info to
10292 * disasm.c (do_ui_file_delete): Delete.
10293 (gdb_insn_length): Move code creating stream to ...
10294 * utils.c (null_stream): ... here. New function.
10295 * utils.h (null_stream): Declare.
10299 * python/py-inferior.c (find_thread_object): Return directly
10300 from the loop. Remove "found" variable.
10304 GDB 7.12.1 released.
10308 * python/py-function.c (fnpy_call): Reorder declarations to have
10309 the gdbpy_enter object declared first.
10310 * python/py-xmethods.c (gdbpy_get_xmethod_arg_types): Likewise.
10315 * python/python-internal.h (PyMem_RawMalloc): Define for
10317 * python/py-gdb-readline.c (gdbpy_readline_wrapper): Use
10318 PyMem_RawMalloc instead of PyMem_Malloc.
10323 * NEWS (New commands): Mention flash-erase.
10324 (New MI commands): Mention target-flash-erase.
10325 * mi/mi-cmds.c (mi_cmd_target_flash_erase): Add target-flash-erase MI
10327 * mi/mi-cmds.h (mi_cmd_target_flash_erase): New declaration.
10328 * mi/mi-main.c (mi_cmd_target_flash_erase): New function.
10329 * target.c (flash_erase_command): New function.
10330 (initialize_targets): Add new flash-erase command.
10331 * target.h (flash_erase_command): New declaration.
10335 * nat/linux-ptrace.c: Only include <sys/procfs.h> if
10336 HAVE_SYS_PROCFS_H is defined.
10340 * remote.c (struct cached_reg): Change data into a pointer.
10341 * (stop_reply_dtr): Free data pointers before deleting vector.
10342 (process_stop_reply): Likewise.
10343 (remote_parse_stop_reply): Allocate space for data
10347 * amd64-tdep.c (amd64_pseudo_register_read_value): remove
10349 (amd64_pseudo_register_read_value): Likewise.
10350 * remote.c (fetch_register_using_p): Remove MAX_REGISTER_SIZE.
10351 (store_register_using_P): Likewise.
10352 * regcache.c (regcache_xfer_part): Likewise.
10356 Split real and pseudo registers.
10357 * sparc-tdep.h (SPARC_CORE_REGISTERS): New macro.
10358 (sparc32_pseudo_regnum): New enum.
10359 * sparc64-tdep.h (sparc64_pseudo_regnum): New enum.
10360 * sparc-tdep.c (SPARC32_FPU_REGISTERS): New macro.
10361 (SPARC32_CP0_REGISTERS): New macro.
10362 (sparc32_pseudo_register_name): New function.
10363 (sparc32_register_name): Use sparc32_pseudo_register_name.
10364 (sparc32_pseudo_register_type): New function.
10365 (sparc32_register_type): Use sparc32_pseudo_register_type.
10366 (sparc32_pseudo_register_read, sparc32_pseudo_register_write): Handle
10367 pseudo register numbers.
10368 * sparc64-tdep.c SPARC64_FPU_REGISTERS): New macro.
10369 (SPARC64_CP0_REGISTERS): New macro.
10370 (sparc64_pseudo_register_name): New function.
10371 (sparc64_register_name): Use sparc64_pseudo_register_name.
10372 (sparc64_pseudo_register_type): New function.
10373 (sparc64_register_type): Use sparc64_pseudo_register_type.
10374 (sparc64_pseudo_register_read, sparc64_pseudo_register_write): Handle
10375 pseudo register numbers.
10376 (sparc64_store_floating_fields, sparc64_extract_floating_fields,
10377 sparc64_store_arguments): Handle pseudo register numbers.
10381 * remote.c (REMOTE_DEBUG_MAX_CHAR): New macro.
10382 (putpkt_binary): Print only REMOTE_DEBUG_MAX_CHAR chars in debug
10384 (getpkt_or_notif_sane_1): Likewise.
10388 * Makefile.in (checker-headers): Use CXX and CXX_DIALET instead
10389 of CC. Pass "-x c++-header" instead of "-x c".
10393 * remote.c (remote_can_async_p): Update comment.
10397 * linux-nat.c (linux_nat_can_async_p): Update comment.
10401 * serial.c (serial_open): Forget about "pc" and "lpt" serial interface.
10405 * cli/cli-decode.c (lookup_cmd_1): Fix typo in comment.
10409 * python/py-type.c (typy_legacy_template_argument): Update.
10410 * cp-support.h (struct demangle_parse_info) (demangle_parse_info,
10411 ~demangle_parse_info): Declare new members.
10412 (cp_demangled_name_to_comp): Return unique_ptr.
10413 (cp_demangled_name_parse_free)
10414 (make_cleanup_cp_demangled_name_parse_free)
10415 (cp_new_demangle_parse_info): Remove.
10416 * cp-support.c (do_demangled_name_parse_free_cleanup)
10417 (make_cleanup_cp_demangled_name_parse_free): Remove.
10418 (inspect_type, cp_canonicalize_string_full)
10419 (cp_canonicalize_string): Update.
10420 (mangled_name_to_comp): Change return type.
10421 (cp_class_name_from_physname, method_name_from_physname)
10422 (cp_func_name, cp_remove_params): Update.
10423 * cp-name-parser.y (demangle_parse_info): New constructor, from
10424 cp_new_demangle_parse_info.
10425 (~demangle_parse_info): New destructor, from
10426 cp_demangled_name_parse_free.
10427 (cp_merge_demangle_parse_infos): Update.
10428 (cp_demangled_name_to_comp): Change return type.
10432 * top.c (prevent_dont_repeat): Change return type.
10433 * python/python.c (execute_gdb_command): Use std::string.
10435 * guile/guile.c (gdbscm_execute_gdb_command): Update.
10436 * command.h (prevent_dont_repeat): Change return type.
10437 * breakpoint.c (bpstat_do_actions_1): Update.
10441 * value.h (scoped_value_mark::~scoped_value_mark): Call
10443 (scoped_value_mark::free_to_mark): New method.
10444 * dwarf2loc.c (dwarf2_evaluate_loc_desc_full): Use
10449 * python/py-value.c (valpy_dereference, valpy_referenced_value)
10450 (valpy_reference_value, valpy_const_value, valpy_get_address)
10451 (valpy_get_dynamic_type, valpy_lazy_string, valpy_do_cast)
10452 (valpy_getitem, valpy_call, valpy_binop_throw, valpy_negative)
10453 (valpy_absolute, valpy_richcompare_throw): Use scoped_value_mark.
10454 * dwarf2loc.c (dwarf2_loc_desc_get_symbol_read_needs): Use
10456 * dwarf2-frame.c (execute_stack_op): Use scoped_value_mark.
10457 * value.h (scoped_value_mark): New class.
10461 * dwarf2read.c (dwarf2_build_psymtabs): Use psymtab_discarder.
10462 * psympriv.h (make_cleanup_discard_psymtabs): Don't declare.
10463 * psymtab.c (discard_psymtabs_upto): Remove.
10464 (make_cleanup_discard_psymtabs): Remove.
10465 (struct psymtab_state): Remove.
10469 * record-full.c (record_full_save_cleanups): Remove.
10470 (record_full_save): Use gdb::unlinker.
10471 * gcore.c (do_bfd_delete_cleanup): Remove.
10472 (gcore_command): Use gdb::unlinker, unique_xmalloc_ptr. Remove
10474 * dwarf2read.c (unlink_if_set): Remove.
10475 (write_psymtabs_to_index): Use gdb::unlinker.
10476 * common/gdb_unlinker.h: New file.
10480 * windows-tdep.c (windows_xfer_shared_library): Update.
10481 * windows-nat.c (windows_make_so): Update.
10482 * utils.h (make_cleanup_bfd_unref): Remove.
10483 * utils.c (do_bfd_close_cleanup, make_cleanup_bfd_unref): Remove.
10484 * symfile.h (symfile_bfd_open)
10485 (find_separate_debug_file_in_section): Return gdb_bfd_ref_ptr.
10486 * symfile.c (read_symbols, symbol_file_add)
10487 (separate_debug_file_exists): Update.
10488 (symfile_bfd_open): Return gdb_bfd_ref_ptr.
10489 (generic_load, reread_symbols): Update.
10490 * symfile-mem.c (symbol_file_add_from_memory): Update.
10491 * spu-linux-nat.c (spu_bfd_open): Return gdb_bfd_ref_ptr.
10492 (spu_symbol_file_add_from_memory): Update.
10493 * solist.h (struct target_so_ops) <bfd_open>: Return
10495 (solib_bfd_fopen, solib_bfd_open): Return gdb_bfd_ref_ptr.
10496 * solib.c (solib_bfd_fopen, solib_bfd_open): Return
10498 (solib_map_sections, reload_shared_libraries_1): Update.
10499 * solib-svr4.c (enable_break): Update.
10500 * solib-spu.c (spu_bfd_fopen): Return gdb_bfd_ref_ptr.
10501 * solib-frv.c (enable_break2): Update.
10502 * solib-dsbt.c (enable_break): Update.
10503 * solib-darwin.c (gdb_bfd_mach_o_fat_extract): Return
10505 (darwin_solib_get_all_image_info_addr_at_init): Update.
10506 (darwin_bfd_open): Return gdb_bfd_ref_ptr.
10507 * solib-aix.c (solib_aix_bfd_open): Return gdb_bfd_ref_ptr.
10508 * record-full.c (record_full_save): Update.
10509 * python/py-objfile.c (objfpy_add_separate_debug_file): Update.
10510 * procfs.c (insert_dbx_link_bpt_in_file): Update.
10511 * minidebug.c (find_separate_debug_file_in_section): Return
10513 * machoread.c (macho_add_oso_symfile): Change abfd to
10515 (macho_symfile_read_all_oso): Update.
10516 (macho_check_dsym): Return gdb_bfd_ref_ptr.
10517 (macho_symfile_read): Update.
10518 * jit.c (bfd_open_from_target_memory): Return gdb_bfd_ref_ptr.
10519 (jit_bfd_try_read_symtab): Update.
10520 * gdb_bfd.h (gdb_bfd_open, gdb_bfd_fopen, gdb_bfd_openr)
10521 (gdb_bfd_openw, gdb_bfd_openr_iovec)
10522 (gdb_bfd_openr_next_archived_file, gdb_bfd_fdopenr): Return
10524 (gdb_bfd_ref_policy): New struct.
10525 (gdb_bfd_ref_ptr): New typedef.
10526 * gdb_bfd.c (gdb_bfd_open, gdb_bfd_fopen, gdb_bfd_openr)
10527 (gdb_bfd_openw, gdb_bfd_openr_iovec)
10528 (gdb_bfd_openr_next_archived_file, gdb_bfd_fdopenr): Return
10530 * gcore.h (create_gcore_bfd): Return gdb_bfd_ref_ptr.
10531 * gcore.c (create_gcore_bfd): Return gdb_bfd_ref_ptr.
10532 (gcore_command): Update.
10533 * exec.c (exec_file_attach): Update.
10534 * elfread.c (elf_symfile_read): Update.
10535 * dwarf2read.c (dwarf2_get_dwz_file): Update.
10536 (try_open_dwop_file, open_dwo_file): Return gdb_bfd_ref_ptr.
10537 (open_and_init_dwo_file): Update.
10538 (open_dwp_file): Return gdb_bfd_ref_ptr.
10539 (open_and_init_dwp_file): Update.
10540 * corelow.c (core_open): Update.
10541 * compile/compile-object-load.c (compile_object_load): Update.
10542 * common/gdb_ref_ptr.h (ref_ptr::operator->): New operator.
10543 * coffread.c (coff_symfile_read): Update.
10544 * cli/cli-dump.c (bfd_openr_or_error, bfd_openw_or_error): Return
10545 gdb_bfd_ref_ptr. Rename.
10546 (dump_bfd_file, restore_command): Update.
10547 * build-id.h (build_id_to_debug_bfd): Return gdb_bfd_ref_ptr.
10548 * build-id.c (build_id_to_debug_bfd): Return gdb_bfd_ref_ptr.
10549 (find_separate_debug_file_by_buildid): Update.
10553 * common/gdb_ref_ptr.h: New file.
10554 * python/py-ref.h (struct gdbpy_ref_policy): New.
10555 (gdbpy_ref): Now a typedef.
10559 * utils.h (make_cleanup_htab_delete): Don't declare.
10560 * utils.c (do_htab_delete_cleanup, make_cleanup_htab_delete):
10562 * linespec.c (decode_compound_collector): Add constructor,
10564 (lookup_prefix_sym): Remove cleanup.
10565 (symtab_collector): Add constructor, destructor.
10566 (collect_symtabs_from_filename): Remove cleanup.
10567 * disasm.c (do_mixed_source_and_assembly): Use htab_up.
10568 * compile/compile-c-symbols.c (generate_c_for_variable_locations):
10570 * gnu-v3-abi.c (gnuv3_print_vtable): Use htab_up.
10571 * dwarf2read.c (dw2_expand_symtabs_matching)
10572 (dw2_map_symbol_filenames, dwarf_decode_macros)
10573 (write_psymtabs_to_index): Use htab_up.
10574 * dwarf2loc.c (func_verify_no_selftailcall)
10575 (call_site_find_chain_1, func_verify_no_selftailcall)
10576 (chain_candidate, call_site_find_chain_1): Use std::unordered_set,
10577 std::vector, gdb::unique_xmalloc_ptr.
10578 (call_sitep): Remove typedef.
10579 (dwarf2_locexpr_baton_eval): Remove unused variable.
10583 * python/python-internal.h (make_cleanup_py_decref)
10584 (make_cleanup_py_xdecref): Don't declare.
10585 * python/py-utils.c (py_decref, make_cleanup_py_decref)
10586 (py_xdecref, make_cleanup_py_xdecref): Remove.
10590 * python/py-framefilter.c (py_mi_print_variables): Use gdbpy_ref.
10591 (py_print_locals, enumerate_locals, py_print_args): Use gdbpy_ref.
10595 * python/py-framefilter.c (enumerate_args): Use gdbpy_ref.
10599 * python/py-utils.c (unicode_to_encoded_string)
10600 (python_string_to_target_string)
10601 (python_string_to_target_python_string)
10602 (python_string_to_host_string, gdbpy_obj_to_string)
10603 (get_addr_from_python): Use gdbpy_ref.
10607 * python/py-unwind.c (pyuw_object_attribute_to_pointer): Use
10612 * python/python.c (eval_python_command, gdbpy_decode_line)
10613 (gdbpy_run_events, gdbpy_start_type_printers)
10614 (gdbpy_apply_type_printers): Use gdbpy_ref.
10618 * python/py-param.c (get_doc_string, compute_enum_values): Use
10623 * python/py-inferior.c (find_thread_object, build_inferior_list):
10628 * python/py-framefilter.c (py_print_frame): Use gdbpy_ref.
10632 * python/py-finishbreakpoint.c (bpfinishpy_out_of_scope): Use
10637 * python/py-cmd.c (cmdpy_completer_helper): Use gdbpy_ref. Remove
10639 (cmdpy_completer_handle_brkchars, cmdpy_completer, cmdpy_init):
10644 * python/py-breakpoint.c (gdbpy_breakpoint_cond_says_stop): Use
10649 * python/py-arch.c (archpy_disassemble): Use gdbpy_ref. Don't
10650 decref results of PyArg_ParseTupleAndKeywords.
10654 * python/python.c (python_run_simple_file): Use
10655 unique_xmalloc_ptr, gdbpy_ref.
10659 * python/py-prettyprint.c (print_stack_unless_memory_error)
10660 (print_string_repr, print_children): Use gdbpy_ref.
10661 (dummy_python_frame): New class.
10662 (dummy_python_frame::dummy_python_frame): Rename from
10663 push_dummy_python_frame.
10664 (py_restore_tstate): Remove.
10668 * python/py-framefilter.c (py_print_frame): Use gdbpy_ref.
10672 * python/python.c (ensure_python_env, restore_python_env):
10674 * python/python-internal.h (ensure_python_env): Don't declare.
10675 * varobj.h (varobj_ensure_python_env): Don't declare.
10676 * varobj.c (varobj_ensure_python_env): Remove.
10680 * varobj.c (varobj_value_get_print_value): Use
10681 gdbpy_enter_varobj.
10685 * python/py-prettyprint.c (print_string_repr, print_children):
10687 * python/py-lazy-string.c (gdbpy_extract_lazy_string): Change type
10689 * varobj.c (varobj_value_get_print_value): Update.
10690 * python/python-internal.h (gdbpy_extract_lazy_string): Update.
10694 * varobj.c (varobj_get_display_hint)
10695 (dynamic_varobj_has_child_method, install_new_value_visualizer)
10696 (varobj_set_visualizer, free_variable): Use
10697 gdbpy_enter_varobj.
10701 * python/python.c (python_command): Use gdbpy_enter, gdbpy_ref.
10702 (do_finish_initialization): New function. Use gdbpy_ref.
10703 (gdbpy_finish_initialization): Use gdbpy_enter. Call
10704 do_finish_initialization.
10708 * python/py-param.c (get_set_value, get_show_value): Use
10709 gdbpy_enter, gdbpy_ref.
10713 * python/py-function.c (fnpy_call): Use gdbpy_enter, gdbpy_ref.
10717 * python/py-cmd.c (cmdpy_function): Use gdbpy_enter, gdbpy_ref.
10721 * python/py-varobj.c (py_varobj_iter_dtor, py_varobj_iter_next):
10722 Use gdbpy_enter_varobj.
10726 * varobj.c (gdbpy_enter_varobj): New constructor.
10727 * python/python-internal.h (gdbpy_enter_varobj): New class.
10728 * python/py-varobj.c (py_varobj_get_iterator): Use
10729 gdbpy_enter_varobj.
10733 * python/py-xmethods.c (gdbpy_get_xmethod_result_type): Use
10734 gdbpy_enter, gdbpy_ref, unique_xmalloc_ptr.
10735 (gdbpy_invoke_xmethod): Use gdbpy_ref, gdbpy_enter.
10736 (gdbpy_get_xmethod_arg_types): Use gdbpy_ref,
10737 unique_xmalloc_ptr.
10738 (gdbpy_get_xmethod_arg_types): Use gdbpy_ref, gdbpy_enter.
10742 * python/py-xmethods.c (invoke_match_method): Use
10747 * python/py-xmethods.c (gdbpy_get_matching_xmethod_workers): use
10748 gdbpy_enter, gdbpy_ref.
10752 * python/python.c (python_interactive_command): Use gdbpy_enter.
10756 * python/python.c (gdbpy_before_prompt_hook): Use gdbpy_enter,
10761 * python/py-prettyprint.c (gdbpy_apply_val_pretty_printer): Use
10762 gdbpy_enter, gdbpy_ref, unique_xmalloc_ptr.
10766 * utils.h (htab_deleter): New struct.
10767 (htab_up): New typedef.
10768 * python/py-framefilter.c (gdbpy_apply_frame_filter): Use
10769 gdbpy_enter, gdbpy_ref, htab_up.
10773 * python/py-unwind.c (pending_frame_invalidate): Remove.
10774 (pyuw_sniffer): Use gdbpy_enter and gdbpy_ref.
10778 * python/py-xmethods.c (gdbpy_free_xmethod_worker_data)
10779 (gdbpy_clone_xmethod_worker_data): Use gdbpy_enter.
10783 * python/py-type.c (save_objfile_types): Use gdbpy_enter.
10787 * python/python.c (gdbpy_eval_from_control_command)
10788 (gdbpy_source_script, gdbpy_run_events)
10789 (gdbpy_source_objfile_script, gdbpy_execute_objfile_script)
10790 (gdbpy_free_type_printers, gdbpy_finish_initialization): Use
10795 * python/py-progspace.c (py_free_pspace): Use gdbpy_enter.
10799 * python/py-objfile.c (py_free_objfile): Use gdbpy_enter.
10803 * python/py-inferior.c (python_on_normal_stop, python_on_resume)
10804 (python_on_inferior_call_pre, python_on_inferior_call_post)
10805 (python_on_memory_change, python_on_register_change)
10806 (python_inferior_exit, python_new_objfile, add_thread_object)
10807 (delete_thread_object, py_free_inferior): Use gdbpy_enter.
10811 * python/py-finishbreakpoint.c (bpfinishpy_handle_stop)
10812 (bpfinishpy_handle_exit): Use gdbpy_enter.
10816 * python/py-cmd.c (cmdpy_destroyer)
10817 (cmdpy_completer_handle_brkchars, cmdpy_completer): Use
10822 * python/py-breakpoint.c (gdbpy_breakpoint_cond_says_stop): Use
10824 (gdbpy_breakpoint_has_cond): Likewise.
10828 * python/python.c (gdbpy_enter): New constructor.
10829 (~gdbpy_enter): New destructor.
10830 (restore_python_env, ensure_python_env): Rewrite.
10831 * python/python-internal.h (gdbpy_enter): New class.
10835 * python/py-symbol.c (gdbpy_lookup_symbol): Use gdbpy_ref.
10839 * python/py-value.c (value_has_field, get_field_flag)
10840 (get_field_type, valpy_getitem, convert_value_from_python): Use
10845 * python/python.c (gdbpy_progspaces, gdbpy_objfiles): Use
10850 * python/py-prettyprint.c (search_pp_list)
10851 (find_pretty_printer_from_objfiles)
10852 (find_pretty_printer_from_progspace)
10853 (find_pretty_printer_from_gdb, find_pretty_printer)
10854 (gdbpy_get_display_hint, gdbpy_get_varobj_pretty_printer): Use
10859 * python/py-param.c (call_doc_function): Use gdbpy_ref.
10863 * python/py-linetable.c (build_line_table_tuple_from_pcs)
10864 (ltpy_get_all_source_lines): Use gdbpy_ref.
10868 * python/py-framefilter.c (extract_sym, extract_value)
10869 (get_py_iter_from_func, bootstrap_python_frame_filters): Use
10874 * python/py-breakpoint.c (gdbpy_breakpoints): Use gdbpy_ref.
10878 * python/py-inferior.c (gdbpy_inferiors): Use gdbpy_ref.
10882 * python/py-function.c (convert_values_to_python, fnpy_init): Use
10887 * python/py-cmd.c (gdbpy_string_to_argv): Use gdbpy_ref.
10891 * python/py-type.c (convert_field, make_fielditem, typy_fields)
10892 (typy_range): Use gdbpy_ref.
10896 * python/py-threadevent.c (create_thread_event_object): Use
10898 * python/py-stopevent.c (create_stop_event_object): Simplify.
10899 (emit_stop_event): Use gdbpy_ref.
10900 * python/py-signalevent.c (create_signal_event_object): Use
10902 * python/py-newobjfileevent.c (create_new_objfile_event_object)
10903 (emit_new_objfile_event, create_clear_objfiles_event_object)
10904 (emit_clear_objfiles_event): Use gdbpy_ref.
10905 * python/py-infevents.c (create_inferior_call_event_object)
10906 (create_register_changed_event_object)
10907 (create_memory_changed_event_object, emit_inferior_call_event)
10908 (emit_memory_changed_event, emit_register_changed_event): Use
10910 * python/py-exitedevent.c (create_exited_event_object)
10911 (emit_exited_event): Use gdbpy_ref.
10912 * python/py-event.h (evpy_emit_event): Remove
10913 CPYCHECKER_STEALS_REFERENCE_TO_ARG annotation.
10914 * python/py-event.c (evpy_emit_event): Use gdbpy_ref.
10915 * python/py-continueevent.c (emit_continue_event): Use
10917 * python/py-breakpoint.c (gdbpy_breakpoint_created)
10918 (gdbpy_breakpoint_deleted, gdbpy_breakpoint_modified): Use
10920 * python/py-bpevent.c (create_breakpoint_event_object): Use
10925 * python/py-ref.h: New file.
10929 * cli-out.c (cli_ui_out::do_redirect): Change return type to
10931 * cli-out.h (cli_ui_out::do_redirect): Likewise.
10932 * mi/mi-out.c (mi_ui_out::do_redirect): Likewise.
10933 * mi/mi-out.h (mi_ui_out::do_redirect): Likewise.
10934 * ui-out.c (ui_out::redirect): Likewise.
10935 * ui-out.h (ui_out::redirect, ui_out::do_redirect): Likewise.
10936 * cli/cli-logging.c (set_logging_redirect): Update call site of
10938 (handle_redirections): Likewise.
10939 * scm-ports.c (ioscm_with_output_to_port_worker): Likewise.
10940 * top.c (execute_command_to_string): Likewise.
10941 * utils.c (do_ui_out_redirect_pop): Likewise.
10945 * stack.c (_initialize_stack): Update "frame" command help message.
10949 * d-exp.y (CastExpression): Emit UNOP_CAST_TYPE.
10953 * x86-linux-nat.h: Include gdb_proc_service.h.
10957 * ser-base.h: Include serial.h.
10961 * ppc-linux-tdep.h: Include ppc-tdep.h.
10965 * nat/amd64-linux-siginfo.h: Include signal.h.
10969 * nat/aarch64-linux-hw-point.h: Include break-common.h.
10973 * mi/mi-parse.h: Include mi-cmds.h.
10977 * inf-loop.c: Don't include "target.h".
10978 * inf-loop.h: Include it here.
10982 * dfp.h: Include "dboulest.h" and "expression.h".
10986 * ax-gdb.h: Include "ax.h".
10990 * Makefile.in (HFILES_NO_SRCDIR): Replace gdb_ptrace.h
10991 with nat/gdb_ptrace.h.
10995 * mips-fbsd-tdep.c (mips_fbsd_sigframe_init): Move && to
10997 (mips64_fbsd_sigframe_init): Likewise.
11001 * mips-fbsd-tdep.c (_initialize_mips_fbsd_tdep): Use
11002 GDB_OSABI_FREEBSD instead of GDB_OSABI_FREEBSD_ELF.
11006 * Makefile.in (ALLDEPFILES): Add mips-fbsd-nat.c.
11007 * NEWS: Mention new FreeBSD/mips native configuration.
11008 * config/mips/fbsd.mh: New file.
11009 * configure.host: Add mips*-*-freebsd*.
11010 * mips-fbsd-nat.c: New file.
11014 * Makefile.in (ALL_TARGET_OBS): Add mips-fbsd-tdep.o.
11015 (ALLDEPFILES): Add mips-fbsd-tdep.c.
11016 * NEWS: Mention new FreeBSD/mips target.
11017 * configure.tgt: Add mips*-*-freebsd*.
11018 * mips-fbsd-tdep.c: New file.
11019 * mips-fbsd-tdep.h: New file.
11023 * dwarf2loc.c (write_pieced_value): Don't use VALUE_FRAME_ID (to),
11024 use c->frame_id when the piece location is DWARF_VALUE_REGISTER.
11028 Update copyright year range in all GDB files.
11032 * config/djgpp/fnchange.lst: Add entry for gdb/ChangeLog-2016.
11034 For older changes see ChangeLog-2016.
11040 version-control: never