Remove regcache_raw_read_part
[external/binutils.git] / gdb / ChangeLog
1 2018-05-30  Simon Marchi  <simon.marchi@ericsson.com>
2
3         * regcache.h (regcache_raw_read_part): Remove, update callers to
4         use readable_regcache::raw_read_part instead.
5         * regcache.c (regcache_raw_read_part): Remove.
6
7 2018-05-30  Simon Marchi  <simon.marchi@ericsson.com>
8
9         * regcache.h (regcache_cooked_read): Remove, update callers to
10         use readable_regcache::cooked_read instead.
11         * regcache.c (regcache_cooked_read): Remove.
12
13 2018-05-30  Simon Marchi  <simon.marchi@ericsson.com>
14
15         * regcache.h (regcache_raw_write): Remove, update callers to use
16         regcache::raw_write instead.
17         * regcache.c (regcache_raw_write): Remove.
18
19 2018-05-30  Simon Marchi  <simon.marchi@ericsson.com>
20
21         * regcache.h (regcache_raw_read): Remove, update callers to use
22         readable_regcache::raw_read instead.
23         * regcache.c (regcache_raw_read): Remove.
24
25 2018-05-30  Simon Marchi  <simon.marchi@ericsson.com>
26
27         * regcache.h (regcache_raw_update): Remove, update callers to
28         use readable_regcache::raw_update instead.
29         * regcache.c (regcache_raw_update): Remove.
30
31 2018-05-30  Simon Marchi  <simon.marchi@ericsson.com>
32
33         * regcache.h (regcache_register_status): Remove, update callers
34         to use reg_buffer::get_register_status directly instead.
35         * regcache.c (regcache_register_status): Remove.
36
37 2018-05-30  Simon Marchi  <simon.marchi@ericsson.com>
38
39         * regcache.h (regcache_get_ptid): Remove, update all callers to
40         call regcache::ptid instead.
41         * regcache.c (regcache_get_ptid): Remove.
42
43 2018-05-30  Simon Marchi  <simon.marchi@ericsson.com>
44
45         * Makefile.in (ALL_TARGET_OBS): Add or1k-tdep.o.
46
47 2018-05-30  Pedro Alves  <palves@redhat.com>
48
49         * common/common-exceptions.h (exception_rethrow): Use
50         ATTRIBUTE_NORETURN.
51
52 2018-05-29  Simon Marchi  <simon.marchi@polymtl.ca>
53
54         * breakpoint.c (print_solib_event, check_status_catch_solib):
55         Remove struct keyword in range-based for loops.
56         * dbxread.c (find_corresponding_bincl_psymtab): Likewise.
57         * dwarf2read.c (compute_delayed_physnames, rust_union_quirks);
58         Likewise.
59         * linespec.c (find_superclass_methods, search_minsyms_for_name):
60         Likewise.
61         * symfile.c (addr_info_make_relative): Likewise.
62         * thread.c (value_in_thread_stack_temporaries): Likewise.
63
64 2018-05-29  Weimin Pan  <weimin.pan@oracle.com>
65
66         * minsyms.h (lookup_minimal_symbol_and_objfile): Remove declaration.
67         * minsyms.c (lookup_minimal_symbol_and_objfile): Remove definition.
68         * coff-pe-read.c (add_pe_forwarded_sym): Replace
69         lookup_minimal_symbol_and_objfile with lookup_bound_minimal_symbol.
70         * glibc-tdep.c (glibc_skip_solib_resolver): Likewise.
71         * jit.c (jit_breakpoint_re_set_internal): Likewise.
72         * printcmd.c (info_address_command): Likewise.
73
74 2018-05-29  Tom Tromey  <tom@tromey.com>
75
76         * windows-nat.c (handle_exception): Update fall-through comment.
77
78 2018-05-29  Tom Tromey  <tom@tromey.com>
79
80         * progspace.h (so_list_ptr): Remove typedef.  Don't declare VEC.
81         (struct program_space) <added_solibs>: Now a std::vector.
82         * breakpoint.c (print_solib_event): Update.
83         (check_status_catch_solib): Update.
84         * progspace.c (clear_program_space_solib_cache): Update.
85         * solib.c (update_solib_list): Update.
86
87 2018-05-29  Tom Tromey  <tom@tromey.com>
88
89         * python/py-type.c (typy_richcompare): Update.
90         * guile/scm-type.c (tyscm_equal_p_type_smob): Update.
91         * gdbtypes.h (types_deeply_equal): Return bool.
92         (types_equal): Likewise.
93         * gdbtypes.c (type_equality_entry_d): Remove typedef.  Don't
94         declare VEC.
95         (check_types_equal): Change worklist to std::vector.  Return
96         bool.
97         (struct type_equality_entry): Add constructor.
98         (compare_maybe_null_strings): Return bool.
99         (check_types_worklist): Return bool.  Change worklist to
100         std::vector.
101         (types_deeply_equal): Use std::vector.
102         (types_equal): Return bool.
103         (compare_maybe_null_strings): Simplify.
104
105 2018-05-29  Tom Tromey  <tom@tromey.com>
106
107         * record-btrace.c (tp_t): Remove typedef.  Don't declare VEC.
108
109 2018-05-29  Tom Tromey  <tom@tromey.com>
110
111         * objc-lang.h: Don't include cp-support.h.
112         * common/gdb_vecs.h (const_char_ptr): Remove typedef.  Don't
113         declare VEC.
114
115 2018-05-27  Tom Tromey  <tom@tromey.com>
116
117         * Makefile.in (DEPFILES): Don't reference REMOTE_OBS.
118
119 2018-05-25  Tom Tromey  <tom@tromey.com>
120
121         * value.c (value::location): Initialize.
122
123 2018-05-25  Tom Tromey  <tom@tromey.com>
124
125         * dbxread.c (init_bincl_list): Remove.
126         (bincl_list): Now a std::vector.
127         (bincls_allocated, next_bincl): Remove.
128         (free_bincl_list, do_free_bincl_list_cleanup)
129         (make_cleanup_free_bincl_list): Remove.
130         (dbx_read_symtab, elfstab_build_psymtabs): Use scoped_restore,
131         unique_xmalloc_ptr.
132         (find_corresponding_bincl_psymtab, read_dbx_symtab): Update.
133         (struct header_file_location): Add constructor.
134         (add_bincl_to_list): Remove.
135
136 2018-05-25  Tom Tromey  <tom@tromey.com>
137
138         * tui/tui.c (tui_enable): Update.
139         * mi/mi-interp.c (mi_interp::init): Update.
140         * interps.h (class interp) <name>: New method.
141         <m_name>: Rename from name.
142         (~scoped_restore_interp): Update.
143         * interps.c (interp::interp): Update.
144         (interp_add, interp_set, interp_lookup_existing)
145         (current_interp_named_p): Update.
146
147 2018-05-25  Tom Tromey  <tom@tromey.com>
148
149         * interps.c (interp_name): Remove.
150         * mi/mi-interp.c (mi_interp::init): Update.
151         * interps.h (interp_name): Remove.
152         (~scoped_restore_interp): Update.
153         * tui/tui.c (tui_enable): Update.
154
155 2018-05-25  Tom Tromey  <tom@tromey.com>
156
157         * utils.c (fputs_maybe_filtered): Update.
158         * linespec.c (decode_line_full): Update.
159         * mi/mi-interp.c (mi_on_normal_stop_1, mi_tsv_modified)
160         (mi_print_breakpoint_for_event, mi_solib_loaded)
161         (mi_solib_unloaded, mi_command_param_changed, mi_memory_changed)
162         (mi_user_selected_context_changed): Update.
163         * mi/mi-main.c (mi_execute_command): Update.
164         * cli/cli-script.c (execute_control_command): Update.
165         * python/python.c (execute_gdb_command): Update.
166         * solib.c (info_sharedlibrary_command): Update.
167         * interps.c (interp_ui_out): Remove.
168         * interps.h (interp_ui_out): Remove.
169
170 2018-05-25  Tom Tromey  <tom@tromey.com>
171
172         * tui/tui-interp.c (as_tui_interp): Use dynamic_cast.
173         * mi/mi-interp.c (as_mi_interp): Use dynamic_cast.
174         * cli/cli-interp.c (as_cli_interp): Use dynamic_cast.
175
176 2018-05-25  Tom Tromey  <tom@tromey.com>
177
178         * cli/cli-interp.c (safe_execute_command): Use scoped_restore.
179         * interps.c (interp_exec): Use scoped_restore.
180
181 2018-05-25  Tom Tromey  <tom@tromey.com>
182
183         * remote.c (remote_target::remote_file_get): Use
184         gdb::byte_vector.
185         (remote_target::remote_file_put): Likewise.
186
187 2018-05-25  Tom Tromey  <tom@tromey.com>
188
189         * coff-pe-read.c (struct read_pe_section_data) <section_name>: Now
190         a std::string.
191         (get_pe_section_index, add_pe_exported_sym): Update.
192         (read_pe_exported_syms): Use gdb::def_vector.
193
194 2018-05-25  Tom Tromey  <tom@tromey.com>
195
196         * frame.c (remove_prev_frame): Remove.
197         (get_prev_frame_if_no_cycle): Use TRY/CATCH.
198
199 2018-05-25  Maciej W. Rozycki  <macro@mips.com>
200
201         * mips-linux-tdep.h (mips_supply_fpregset, mips_fill_fpregset):
202         Remove prototypes.
203         * mips-linux-nat.c (supply_fpregset): Always call
204         `mips64_supply_fpregset' rather than `mips_supply_fpregset'.
205         (fill_fpregset): Always call `mips64_fill_fpregset' rather than
206         `mips_fill_fpregset'.
207         * mips-linux-tdep.c (mips_supply_fpregset)
208         (mips_supply_fpregset_wrapper, mips_fill_fpregset)
209         (mips_fill_fpregset_wrapper): Remove functions.
210         (mips64_supply_fpregset, mips64_fill_fpregset): Update comments.
211         (mips_linux_fpregset): Remove variable.
212         (mips_linux_iterate_over_regset_sections): Use
213         `mips64_linux_fpregset' in place of `mips_linux_fpregset'.
214         (mips_linux_o32_sigframe_init): Remove comment.
215
216 2018-05-25  Pedro Alves  <palves@redhat.com>
217
218         * remote.c (struct vCont_action_support, MAXTHREADLISTRESULTS)
219         (struct readahead_cache, struct packet_reg, struct
220         remote_arch_state, class remote_state): Move higher up in the
221         file.
222         (remote_target::m_remote_state): Now an object instead of a pointer.
223         (remote_target::get_remote_state): Adjust.
224
225 2018-05-24  Andrew Burgess  <andrew.burgess@embecosm.com>
226
227         * stack.c (select_and_print_frame): Delete.
228         (struct function_bounds): Move struct within function.
229         (func_command): Most content moved into new function
230         find_frame_for_function, use new function, print result, add
231         function comment.
232         (find_frame_for_function): New function, now returns a result.
233
234 2018-05-24  Philippe Waroquiers  <philippe.waroquiers@skynet.be>
235
236         * stack.c (iterate_over_block_arg_vars): Fix comment.
237         (print_frame_arg_vars): Pass stream in cb_data, not gdb_stdout.
238
239 2018-05-24  Andrew Burgess  <andrew.burgess@embecosm.com>
240
241         PR gdb/23203
242         * frame.c
243         (scoped_restore_selected_frame::scoped_restore_selected_frame):
244         Define.
245         (scoped_restore_selected_frame::~scoped_restore_selected_frame):
246         Define.
247         * frame.h (class scoped_restore_selected_frame): New class.
248         * stack.c (print_frame_local_vars): Remove catching and rethrowing
249         of any exception, use scoped_restore_selected_frame to restore the
250         frame instead.
251
252 2018-05-24  Pedro Alves  <palves@redhat.com>
253
254         * darwin-nat.h (darwin_nat_target::create_inferior): Mark with
255         override.
256
257 2018-05-23  Tom Tromey  <tom@tromey.com>
258
259         * complaints.c (struct complaints): Remove.
260         (symfile_complaint_book): Remove.
261         (series): New global.
262         (complaint_internal): Update.
263         (clear_complaints): Update.
264
265 2018-05-23  Tom Tromey  <tom@tromey.com>
266
267         * complaints.c (counters): New global.
268         (struct complain): Remove.
269         (struct complaints) <root>: Remove.
270         (complaint_sentinel): Remove.
271         (symfile_complaint_book): Update.
272         (find_complaint) Remove.
273         (complaint_internal, clear_complaints): Update.
274
275 2018-05-23  Tom Tromey  <tom@tromey.com>
276
277         * complaints.c (struct complain) <file, line>: Remove.
278         (find_complaint): Remove file, line parameters.
279         (complaint_internal): Update.
280
281 2018-05-23  Tom Tromey  <tom@tromey.com>
282
283         * complaints.c (vcomplaint): Remove.
284         (complaint_internal) Merge in contents of vcomplaint.
285
286 2018-05-23  Tom Tromey  <tom@tromey.com>
287
288         * complaints.c (struct complaints) <explanation>: Remove.
289         (symfile_explanations): Remove.
290         (symfile_complaint_book): Update.
291         (vcomplaint): Update.
292         (struct explanation): Remove.
293
294 2018-05-23  Tom Tromey  <tom@tromey.com>
295
296         * complaints.c (symfile_complaints): Remove.
297         (complaint_internal): Remove "complaints" parameter.
298         (clear_complaints, vcomplaint): Remove "c" parameter.
299         (get_complaints): Remove.
300         * dwarf2read.c (dwarf2_statement_list_fits_in_line_number_section_complaint)
301         (dwarf2_debug_line_missing_file_complaint)
302         (dwarf2_debug_line_missing_end_sequence_complaint)
303         (dwarf2_complex_location_expr_complaint)
304         (dwarf2_const_value_length_mismatch_complaint)
305         (dwarf2_section_buffer_overflow_complaint)
306         (dwarf2_macro_malformed_definition_complaint)
307         (dwarf2_invalid_attrib_class_complaint)
308         (create_addrmap_from_index, dw2_symtab_iter_next)
309         (dw2_expand_marked_cus)
310         (dw2_debug_names_iterator::find_vec_in_debug_names)
311         (dw2_debug_names_iterator::next, dw2_debug_names_iterator::next)
312         (create_debug_type_hash_table, init_cutu_and_read_dies)
313         (partial_die_parent_scope, add_partial_enumeration)
314         (skip_one_die, fixup_go_packaging, quirk_rust_enum, process_die)
315         (dwarf2_compute_name, dwarf2_physname, read_namespace_alias)
316         (read_import_statement, read_file_scope, create_dwo_cu_reader)
317         (create_cus_hash_table, create_dwp_hash_table)
318         (inherit_abstract_dies, read_func_scope, read_call_site_scope)
319         (dwarf2_rnglists_process, dwarf2_ranges_process)
320         (dwarf2_add_type_defn, dwarf2_attach_fields_to_type)
321         (dwarf2_add_member_fn, get_alignment, maybe_set_alignment)
322         (handle_struct_member_die, process_structure_scope)
323         (read_array_type, read_common_block, read_module_type)
324         (read_tag_pointer_type, read_typedef, read_base_type)
325         (read_subrange_type, load_partial_dies, partial_die_info::read)
326         (partial_die_info::read, partial_die_info::read)
327         (partial_die_info::read, read_checked_initial_length_and_offset)
328         (dwarf2_string_attr, read_formatted_entries)
329         (dwarf_decode_line_header)
330         (lnp_state_machine::check_line_address, dwarf_decode_lines_1)
331         (new_symbol, dwarf2_const_value_attr, lookup_die_type)
332         (read_type_die_1, determine_prefix, dwarf2_get_ref_die_offset)
333         (dwarf2_get_attr_constant_value, dwarf2_fetch_constant_bytes)
334         (get_signatured_type, get_DW_AT_signature_type)
335         (decode_locdesc, file_file_name, consume_improper_spaces)
336         (skip_form_bytes, skip_unknown_opcode, dwarf_parse_macro_header)
337         (dwarf_decode_macro_bytes, dwarf_decode_macros)
338         (dwarf2_symbol_mark_computed, set_die_type)
339         (read_attribute_value): Update.
340         * stap-probe.c (handle_stap_probe, get_stap_base_address):
341         Update.
342         * dbxread.c (unknown_symtype_complaint)
343         (lbrac_mismatch_complaint, repeated_header_complaint)
344         (set_namestring, function_outside_compilation_unit_complaint)
345         (read_dbx_symtab, process_one_symbol): Update.
346         * gdbtypes.c (stub_noname_complaint): Update.
347         * windows-nat.c (handle_unload_dll): Update.
348         * coffread.c (coff_symtab_read, enter_linenos, decode_type)
349         (decode_base_type): Update.
350         * xcoffread.c (bf_notfound_complaint, ef_complaint)
351         (eb_complaint, record_include_begin, record_include_end)
352         (enter_line_range, xcoff_next_symbol_text, read_xcoff_symtab)
353         (process_xcoff_symbol, read_symbol)
354         (function_outside_compilation_unit_complaint)
355         (scan_xcoff_symtab): Update.
356         * machoread.c (macho_symtab_read, macho_add_oso_symfile): Update.
357         * buildsym.c (finish_block_internal, make_blockvector)
358         (end_symtab_get_static_block, augment_type_symtab): Update.
359         * dtrace-probe.c (dtrace_process_dof)
360         (dtrace_static_probe_ops::get_probes): Update.
361         * complaints.h (struct complaint): Don't declare.
362         (symfile_complaints): Remove.
363         (complaint_internal): Remove "complaints" parameter.
364         (complaint): Likewise.
365         (clear_complaints): Likewise.
366         * symfile.c (syms_from_objfile_1, finish_new_objfile)
367         (reread_symbols): Update.
368         * dwarf2-frame.c (dwarf2_restore_rule, execute_cfa_program)
369         (dwarf2_frame_cache, decode_frame_entry): Update.
370         * dwarf2loc.c (dwarf_reg_to_regnum): Update.
371         * objc-lang.c (lookup_objc_class, lookup_child_selector)
372         (info_selectors_command): Update.
373         * macrotab.c (macro_include, check_for_redefinition)
374         (macro_undef): Update.
375         * objfiles.c (filter_overlapping_sections): Update.
376         * stabsread.c (invalid_cpp_abbrev_complaint)
377         (reg_value_complaint, stabs_general_complaint, dbx_lookup_type)
378         (define_symbol, error_type, read_type, rs6000_builtin_type)
379         (stabs_method_name_from_physname, read_member_functions)
380         (read_cpp_abbrev, read_baseclasses, read_tilde_fields)
381         (attach_fields_to_type, complain_about_struct_wipeout)
382         (read_range_type, read_args, common_block_start)
383         (common_block_end, cleanup_undefined_types_1, scan_file_globals):
384         Update.
385         * mdebugread.c (index_complaint, unknown_ext_complaint)
386         (basic_type_complaint, bad_tag_guess_complaint)
387         (bad_rfd_entry_complaint, unexpected_type_code_complaint)
388         (reg_value_complaint, parse_symbol, parse_type, upgrade_type)
389         (parse_procedure, parse_lines)
390         (function_outside_compilation_unit_complaint)
391         (parse_partial_symbols, psymtab_to_symtab_1, cross_ref)
392         (bad_tag_guess_complaint, reg_value_complaint): Update.
393         * cp-support.c (demangled_name_complaint): Update.
394         * macroscope.c (sal_macro_scope): Update.
395         * dwarf-index-write.c (class debug_names): Update.
396
397 2018-05-23  Tom Tromey  <tom@tromey.com>
398
399         * complaints.c (clear_complaints): Remove "noisy" parameter.
400         * complaints.h (clear_complaints): Update.
401         * symfile.c (syms_from_objfile_1, finish_new_objfile)
402         (reread_symbols): Update.
403
404 2018-05-23  Tom Tromey  <tom@tromey.com>
405
406         * complaints.c (enum complaint_series): Remove FIRST_MESSAGE,
407         SUBSEQUENT_MESSAGE.
408         (vcomplaint, clear_complaints): Update.
409         (symfile_explanations): Remove some messages.
410
411 2018-05-23  Tom Tromey  <tom@tromey.com>
412
413         * complaints.c (internal_complaint): Remove.
414         * complaints.h (internal_complaint): Remove.
415
416 2018-05-22  Maciej W. Rozycki  <macro@mips.com>
417
418         * i387-tdep.c (i387_collect_xsave): Make `i' unsigned.
419
420 2018-05-22  Pedro Alves  <palves@redhat.com>
421
422         * remote-fileio.c (remote_fileio_reply, remote_fileio_ioerror)
423         (remote_fileio_badfd, remote_fileio_return_errno)
424         (remote_fileio_return_success, remote_fileio_func_open)
425         (remote_fileio_func_open, remote_fileio_func_close)
426         (remote_fileio_func_read, remote_fileio_func_write)
427         (remote_fileio_func_lseek, remote_fileio_func_rename)
428         (remote_fileio_func_unlink, remote_fileio_func_stat)
429         (remote_fileio_func_fstat, remote_fileio_func_gettimeofday)
430         (remote_fileio_func_isatty, remote_fileio_func_system): Add
431         remote_target parameter.
432         (remote_fio_func_map) <func>: Add remote_target parameter.
433         (do_remote_fileio_request, remote_fileio_request):
434         * remote-fileio.h (remote_fileio_request):
435         * remote-notif.c (remote_notif_ack, remote_notif_parse, ): Add
436         remote_target parameter.
437         (remote_notif_process, handle_notification): Adjust to pass down
438         the remote.
439         (remote_notif_state_allocate): Add remote_target parameter.  Save
440         it.
441         * remote-notif.h (struct remote_target): Forward declare.
442         (struct notif_client) <parse, ack, can_get_pending_events>: Add
443         remote_target parameter.
444         (struct remote_notif_state) <remote>: New field.
445         (remote_notif_ack, remote_notif_parse): Add remote_target
446         parameter.
447         (remote_notif_state_allocate, remote_notif_state_allocate): Add
448         remote_target parameter.
449         * remote.c (OPAQUETHREADBYTES, threadref, gdb_ext_thread_info)
450         (threads_listing_context, rmt_thread_action, protocol_feature)
451         (packet_reg, stop_reply, stop_reply_p, enum packet_support)
452         (packet_result, struct threads_listing_context, remote_state):
453         Move definitions and declarations higher up.
454         (remote_target) <~remote_target>: Declare.
455         (remote_download_command_source, remote_file_put, remote_file_get)
456         (remote_file_delete, remote_hostio_pread, remote_hostio_pwrite)
457         (remote_hostio_pread_vFile, remote_hostio_send_command)
458         (remote_hostio_set_filesystem, remote_hostio_open)
459         (remote_hostio_close, remote_hostio_unlink, remote_state)
460         (get_remote_state, get_remote_packet_size, get_memory_packet_size)
461         (get_memory_write_packet_size, get_memory_read_packet_size)
462         (append_pending_thread_resumptions, remote_detach_1)
463         (append_resumption, remote_resume_with_vcont)
464         (add_current_inferior_and_thread, wait_ns, wait_as)
465         (process_stop_reply, remote_notice_new_inferior)
466         (process_initial_stop_replies, remote_add_thread)
467         (btrace_sync_conf, remote_btrace_maybe_reopen)
468         (remove_new_fork_children, kill_new_fork_children)
469         (discard_pending_stop_replies, stop_reply_queue_length)
470         (check_pending_events_prevent_wildcard_vcont)
471         (discard_pending_stop_replies_in_queue, stop_reply)
472         (remote_notif_remove_queued_reply, stop_reply *queued_stop_reply)
473         (peek_stop_reply, remote_parse_stop_reply, remote_stop_ns)
474         (remote_interrupt_as, remote_interrupt_ns)
475         (remote_get_noisy_reply, remote_query_attached)
476         (remote_add_inferior, remote_current_thread, get_current_thread)
477         (set_thread, set_general_thread, set_continue_thread)
478         (set_general_process, write_ptid)
479         (remote_unpack_thread_info_response, remote_get_threadinfo)
480         (parse_threadlist_response, remote_get_threadlist)
481         (remote_threadlist_iterator, remote_get_threads_with_ql)
482         (remote_get_threads_with_qxfer)
483         (remote_get_threads_with_qthreadinfo, extended_remote_restart)
484         (get_offsets, remote_check_symbols, remote_supported_packet)
485         (remote_query_supported, remote_packet_size)
486         (remote_serial_quit_handler, remote_detach_pid)
487         (remote_vcont_probe, remote_resume_with_hc)
488         (send_interrupt_sequence, interrupt_query)
489         (remote_notif_get_pending_events, fetch_register_using_p)
490         (send_g_packet, process_g_packet, fetch_registers_using_g)
491         (store_register_using_P, store_registers_using_G)
492         (set_remote_traceframe, check_binary_download)
493         (remote_write_bytes_aux, remote_write_bytes, remote_read_bytes_1)
494         (remote_xfer_live_readonly_partial, remote_read_bytes)
495         (remote_send_printf, remote_flash_write, readchar)
496         (remote_serial_write, putpkt, putpkt_binary, skip_frame)
497         (read_frame, getpkt, getpkt_or_notif_sane_1, getpkt_sane)
498         (getpkt_or_notif_sane, remote_vkill, remote_kill_k)
499         (extended_remote_disable_randomization, extended_remote_run)
500         (send_environment_packet, extended_remote_environment_support)
501         (extended_remote_set_inferior_cwd, remote_write_qxfer)
502         (remote_read_qxfer, push_stop_reply, vcont_r_supported)
503         (packet_command): Now methods of ...
504         (remote_target): ... this class.
505         (m_remote_state) <remote_target>: New field.
506         (struct remote_state) <stop_reply_queue,
507         remote_async_inferior_event_token, wait_forever_enabled_p>: New
508         fields.
509         (remote_state::remote_state): Allocate stop_reply_queue.
510         (remote_state): Delete global.
511         (get_remote_state_raw): Delete.
512         (remote_target::get_remote_state): Allocate m_remote_state on
513         demand.
514         (get_current_remote_target): New.
515         (remote_ops, extended_remote_ops): Delete.
516         (wait_forever_enabled_p, remote_async_inferior_event_token):
517         Delete, moved to struct remote_state.
518         (remote_target::close): Delete self.  Destruction bits split to
519         ...
520         (remote_target::~remote_target): ... this.
521         (show_memory_packet_size): Adjust to use
522         get_current_remote_target.
523         (struct protocol_feature) <func>: Add remote_target parameter.
524         All callers adjusted.
525         (curr_quit_handler_target): New.
526         (remote_serial_quit_handler): Reimplement.
527         (remote_target::open_1): Adjust to use get_current_remote_target.
528         Heap-allocate remote_target/extended_remote_target instances.
529         (vcont_builder::vcont_builder): Add remote_target parameter, and
530         save it in m_remote.  All callers adjusted.
531         (vcont_builder::m_remote): New field.
532         (vcont_builder::restart, vcont_builder::flush)
533         (vcont_builder::push_action): Use it.
534         (remote_target::commit_resume): Use it.
535         (struct queue_iter_param) <remote>: New field.
536         (remote_target::remove_new_fork_children): Fill in 'remote' field.
537         (check_pending_event_prevents_wildcard_vcont_callback_data): New.
538         (check_pending_event_prevents_wildcard_vcont_callback)
539         (remote_target::check_pending_events_prevent_wildcard_vcont)
540         (remote_target::discard_pending_stop_replies)
541         (remote_target::discard_pending_stop_replies_in_queue)
542         (remote_target::remote_notif_remove_queued_reply): Fill in
543         'remote' field.
544         (remote_notif_get_pending_events): New.
545         (remote_target::readchar, remote_target::remote_serial_write):
546         Save/restore curr_quit_handler_target.
547         (putpkt): New.
548         (kill_new_fork_children): Fill in 'remote' field.
549         (packet_command): Use get_current_remote_target, defer to
550         remote_target method of same name.
551         (scoped_remote_fd::scoped_remote_fd): Add 'remote_target'
552         parameter, and save it in m_remote.  All callers adjusted.
553         (scoped_remote_fd::release): Use m_remote.
554         (scoped_remote_fd::m_remote): New field.
555         (remote_file_put, remote_file_get, remote_file_delete): Use
556         get_current_remote_target, defer to remote_target method of same
557         name.
558         (remote_btrace_reset): Add remote_state paremeter.  Update all
559         callers.
560         (remote_async_inferior_event_handler). Pass down 'data'.
561         (remote_new_objfile): Use get_current_remote_target.
562         (remote_target::vcont_r_supported): New.
563         (set_range_stepping): Use get_current_remote_target and
564         remote_target::vcont_r_supported.
565         (_initialize_remote): Don't allocate 'remote_state' and
566         'stop_reply_queue' globals.
567         * remote.h (struct remote_target): Forward declare.
568         (getpkt, putpkt, remote_notif_get_pending_events): Add
569         'remote_target' parameter.
570
571 2018-05-22  Pedro Alves  <palves@redhat.com>
572
573         * remote.c (vcont_builder): Now a class.  Make all data members
574         private.
575         (vcont_builder) <vcont_builder, restart, flush, push_action>:
576         Declare methods.
577         (vcont_builder_restart): Rename to ...
578         (vcont_builder::restart): ... this.
579         (vcont_builder_flush): Rename to ...
580         (vcont_builder::flush): ... this.
581         (vcont_builder_push_action): Rename to ...
582         (vcont_builder::push_action): ... this.
583         (remote_target::commit_resume): Adjust.
584
585 2018-05-22  Pedro Alves  <palves@redhat.com>
586
587         * remote.c (DEFAULT_MAX_MEMORY_PACKET_SIZE): Rename to ...
588         (DEFAULT_MAX_MEMORY_PACKET_SIZE_FIXED): ... this.
589         (get_fixed_memory_packet_size): New.
590         (get_memory_packet_size): Use it.
591         (set_memory_packet_size): Don't override the config size with
592         DEFAULT_MAX_MEMORY_PACKET_SIZE.
593         (show_memory_packet_size): Use get_fixed_memory_packet_size.
594         Don't refer to get_memory_packet_size if not connected to a remote
595         target.  Show "(default)" if configured size is 0.
596
597 2018-05-22  Pedro Alves  <palves@redhat.com>
598
599         * remote.c (remote_target::mourn_inferior): Move
600         discard_pending_stop_replies call here from ...
601         (_initialize_remote): ... here.
602
603 2018-05-22  Pedro Alves  <palves@redhat.com>
604
605         * remote.c (compare_section_command): Remove set_general_process
606         call.
607
608 2018-05-22  Pedro Alves  <palves@redhat.com>
609
610         * remote.c (struct packet_reg, struct remote_arch_state):
611         Move higher up in the file.
612         (remote_state) <m_arch_states>: Store remote_arch_state values
613         instead of remote_arch_state pointers.
614         (remote_state::get_remote_arch_state): Adjust.
615
616 2018-05-22  Pedro Alves  <palves@redhat.com>
617
618         * remote.c: Include <unordered_map>.
619         (remote_state): Now a class.
620         (remote_state) <get_remote_arch_state>: Declare method.
621         <get_remote_arch_state>: New field.
622         (remote_arch_state) <remote_arch_state>: Declare ctor.
623         <regs>: Now a unique_ptr.
624         (remote_gdbarch_data_handle): Delete.
625         (get_remote_arch_state): Delete.
626         (remote_state::get_remote_arch_state): New.
627         (get_remote_state): Adjust to call remote_state's
628         get_remote_arch_state method.
629         (init_remote_state): Delete, bits factored out to ...
630         (remote_arch_state::remote_arch_state): ... this new method.
631         (get_remote_packet_size, get_memory_packet_size)
632         (process_g_packet, remote_target::fetch_registers)
633         (remote_target::prepare_to_store, store_registers_using_G)
634         (remote_target::store_registers, remote_target::get_trace_status):
635         Adjust to call remote_state's method.
636         (_initialize_remote): Remove reference to
637         remote_gdbarch_data_handle.
638
639 2018-05-22  Pedro Alves  <palves@redhat.com>
640
641         * remote.c (struct readahead_cache) <invalidate, invalidate_fd,
642         pread>: New method declarations.
643         (remote_target::open_1): Adjust.
644         (readahead_cache_invalidate): Rename to ...
645         (readahead_cache::invalidate): ... this, and adjust to be a class
646         method.
647         (readahead_cache_invalidate_fd): Rename to ...
648         (readahead_cache::invalidate_fd): ... this, and adjust to be a
649         class method.
650         (remote_hostio_pwrite): Adjust.
651         (remote_hostio_pread_from_cache): Rename to ...
652         (readahead_cache::pread): ... this, and adjust to be a class
653         method.
654         (remote_hostio_close): Adjust.
655
656 2018-05-22  Pedro Alves  <palves@redhat.com>
657
658         * remote.c (remote_hostio_close_cleanup): Delete.
659         (class scoped_remote_fd): New.
660         (remote_file_put, remote_file_get): Use it.
661
662 2018-05-22  Pedro Alves  <palves@redhat.com>
663
664         (struct vCont_action_support): Use bool and initialize all fields.
665         (struct readahead_cache): Initialize all fields.
666         (remote_state): Use bool and initialize all fields.
667         (remote_state::remote_state, remote_state::~remote_state): New.
668         (new_remote_state): Delete.
669         (_initialize_remote): Use new to allocate remote_state.
670
671 2018-05-22  Pedro Alves  <palves@redhat.com>
672             張俊芝  <zjz@zjz.name>
673
674         PR gdb/22973
675         * c-exp.y: Include "c-support.h".
676         (parse_number, c_parse_escape, lex_one_token): Use TOLOWER instead
677         of tolower.  Use c_ident_is_alpha to scan names.
678         * c-lang.c: Include "c-support.h".
679         (convert_ucn, convert_octal, convert_hex, convert_escape): Use
680         ISXDIGIT instead of isxdigit and ISDIGIT instead of isdigit.
681         * c-support.h: New file, with bits factored out from ...
682         * cp-name-parser.y: ... this file.
683         Include "c-support.h".
684         (cp_ident_is_alpha, cp_ident_is_alnum): Deleted, moved to
685         c-support.h and renamed.
686         (symbol_end, yylex): Adjust.
687
688 2018-05-22  Pedro Franco de Carvalho  <pedromfc@linux.vnet.ibm.com>
689
690         * arch/ppc-linux-common.c (ppc_linux_has_isa205): Change the
691         parameter type to CORE_ADDR.
692         * arch/ppc-linux-common.h (ppc_linux_has_isa205): Change the
693         parameter type in declaration to CORE_ADDR.
694         * ppc-linux-tdep.c (ppc_linux_core_read_description): Call
695         target_auxv_search to get AT_HWCAP and use the result to get the
696         target description.
697         * ppc-linux-nat.c (ppc_linux_get_hwcap): Change the return type
698         to CORE_ADDR. Remove the cast of the return value to unsigned
699         long. Fix error predicate of target_auxv_search.
700         (ppc_linux_nat_target::read_description): Change the type of the
701         hwcap variable to CORE_ADDR.
702
703 2018-05-22  Pedro Franco de Carvalho  <pedromfc@linux.vnet.ibm.com>
704
705         * rs6000-tdep.c (rs6000_gdbarch_init): Assign 1 to have_dfp only
706         if the size of fpscr is larger than 32 bits.
707
708 2018-05-22  Pedro Franco de Carvalho  <pedromfc@linux.vnet.ibm.com>
709
710         * ppc-linux-tdep.c (ppc_linux_vsxregset): New function.
711         (ppc32_linux_vsxregmap): New global.
712         (ppc32_linux_vsxregset): Initialize with ppc32_linux_vsxregmap,
713         regcache_supply_regset, and regcache_collect_regset.
714         * ppc-linux-tdep.h (ppc_linux_vsxregset): Declare.
715         * ppc-linux-nat.c (supply_vsxregset, fill_vsxregset): Remove.
716         (fetch_vsx_register, store_vsx_register): Remove.
717         (fetch_vsx_registers): Add regno parameter. Get regset using
718         ppc_linux_vsxregset. Use regset to supply registers.
719         (store_vsx_registers): Add regno parameter. Get regset using
720         ppc_linux_vsxregset. Use regset to collect registers.
721         (fetch_register): Call fetch_vsx_registers instead of
722         fetch_vsx_register.
723         (store_register): Call store_vsx_registers instead of
724         store_vsx_register.
725         (fetch_ppc_registers): Call fetch_vsx_registers with -1 for the
726         new regno parameter.
727         (store_ppc_registers): Call store_vsx_registers with -1 for the
728         new regno parameter.
729         * rs6000-tdep.c (ppc_vsx_support_p, ppc_supply_vsxreget)
730         (ppc_collect_vsxregset): Remove.
731
732 2018-05-22  Pedro Franco de Carvalho  <pedromfc@linux.vnet.ibm.com>
733
734         * ppc-tdep.h (struct ppc_reg_offsets): Remove vector register
735         offset fields.
736         * ppc-fbsd-tdep.c (ppc32_fbsd_reg_offsets): Remove initializers
737         for vector register offset fields.
738         (ppc64_fbsd_reg_offsets): Likewise.
739         * ppc-nbsd-tdep.c (_initialize_ppcnbsd_tdep): Remove assignment
740         to vector register offset fields.
741         * ppc-obsd-tdep.c (_initialize_ppcnbsd_tdep): Remove assignment
742         to vector register offset fields.
743         * ppc-obsd-nat.c (_initialize_ppcobsd_nat): Remove assignment to
744         vector register offset fields.
745         * rs6000-aix-tdep.c (rs6000_aix32_reg_offsets): Remove
746         initializers for vector register offset fields.
747         (rs6000_aix64_reg_offsets): Likewise.
748         * rs6000-tdep.c (ppc_vrreg_offset): Remove.
749         (ppc_supply_vrregset): Remove.
750         (ppc_collect_vrregset): Remove.
751         * ppc-linux-tdep.c (ppc_linux_collect_vrregset): New function.
752         (ppc_linux_vrregset) : New function.
753         (ppc32_le_linux_vrregmap, ppc32_be_linux_vrregmap)
754         (ppc32_le_linux_vrregset, ppc32_be_linux_vrregset): New globals.
755         (ppc32_linux_vrregset): Remove.
756         (ppc_linux_iterate_over_regset_sections): Call ppc_linux_vrregset
757         and use result instead of ppc32_linux_vrregset.
758         (ppc32_linux_reg_offsets): Remove initializers for vector register
759         offset fields.
760         (ppc64_linux_reg_offsets): Likewise.
761         * ppc-linux-tdep.h (ppc_linux_vrregset): New declaration.
762         * ppc-linux-nat.c: Include regset.h.
763         (gdb_vrregset_t): Adjust comment to account for little-endian
764         mode.
765         (supply_vrregset, fill_vrregset): Remove.
766         (fetch_altivec_register, store_altivec_register): Remove.
767         (fetch_altivec_registers): Add regno parameter. Get regset using
768         ppc_linux_vrregset. Use regset to supply registers.
769         (store_altivec_registers): Add regno parameter. Get regset using
770         ppc_linux_vrregset. Use regset to collect registers.
771         (fetch_register): Call fetch_altivec_registers instead of
772         fetch_altivec_register.
773         (store_register): Call store_altivec_registers instead of
774         store_altivec_register.
775         (fetch_ppc_registers): Call fetch_altivec_registers with -1 for
776         the new regno parameter.
777         (store_ppc_registers): Call store_altivec_registers with -1 for
778         the new regno parameter.
779
780 2018-05-22  Pedro Franco de Carvalho  <pedromfc@linux.vnet.ibm.com>
781
782         * arch/ppc-linux-common.h (PPC_LINUX_SIZEOF_VRREGSET)
783         (PPC_LINUX_SIZEOF_VSXREGSET): Define.
784         * ppc-linux-nat.c (SIZEOF_VSXREGS, SIZEOF_VRREGS): Remove.
785         (gdb_vrregset_t): Change array type size to
786         PPC_LINUX_SIZEOF_VRREGSET.
787         (gdb_vsxregset_t): Change array type size to
788         PPC_LINUX_SIZEOF_VSXREGSET.
789         * ppc-linux-tdep.c (ppc_linux_iterate_over_regset_sections):
790         Change integer literals to PPC_LINUX_SIZEOF_VRREGSET and
791         PPC_LINUX_SIZEOF_VSXREGSET.
792
793 2018-05-22  Pedro Franco de Carvalho  <pedromfc@linux.vnet.ibm.com>
794
795         * configure.nat <linux powerpc>: Add ppc-linux.o to NATDEPFILES.
796         * ppc-linux-nat.c (ppc_linux_target_wordsize): Move to
797         nat/ppc-linux.c.
798         (ppc_linux_nat_target::auxv_parse): Get thread id tid. Call
799         ppc_linux_target_wordsize with tid.
800         (ppc_linux_nat_target::read_description): Call ppc_linux_target
801         wordsize with tid.
802         * nat/ppc-linux.c: Include nat/gdb_ptrace.h.
803         (ppc64_64bit_inferior_p): Add static and inline specifiers.
804         (ppc_linux_target_wordsize): Move here from ppc-linux-nat.c. Add
805         tid parameter. Remove static specifier.
806         * nat/ppc-linux.h (ppc64_64bit_inferior_p): Remove declaration.
807         (ppc_linux_target_wordsize): New declaration.
808
809 2018-05-22  Pedro Franco de Carvalho  <pedromfc@linux.vnet.ibm.com>
810
811         * arch/ppc-linux-common.c: New file.
812         * arch/ppc-linux-common.h: New file.
813         * arch/ppc-linux-tdesc.h: New file.
814         * configure.tgt (powerpc*-*-linux*): Add arch/ppc-linux-common.o.
815         * Makefile.in (ALL_TARGET_OBS): Add arch/ppc-linux-common.o.
816         (HFILES_NO_SRCDIR): Add arch/ppc-linux-common.h and
817         arch/ppc-linux-tdesc.h.
818         * ppc-linux-nat.c: Include arch/ppc-linux-common.h and
819         arch/ppc-linux-tdesc.h.
820         (ppc_linux_nat_target::read_description): Remove target
821         description matching code. Fill a ppc_linux_features struct and
822         call ppc_linux_match_description with it. Move comment about ISA
823         2.05 to ppc-linux-common.c.
824         * ppc-linux-tdep.c: Include arch/ppc-linux-common.h and
825         arch/ppc-linux-tdesc.h.
826         (ppc_linux_core_read_description): Remove target description
827         matching code. Fill a ppc_linux_features struct and call
828         ppc_linux_match_description with it.
829         * ppc-linux-tdep.h (tdesc_powerpc_32l, tdesc_powerpc_64l)
830         (tdesc_powerpc_altivec32l, tdesc_powerpc_altivec64l)
831         (tdesc_powerpc_cell32l, tdesc_powerpc_cell64l)
832         (tdesc_powerpc_vsx32l, tdesc_powerpc_vsx64l)
833         (tdesc_powerpc_isa205_32l, tdesc_powerpc_isa205_64l)
834         (tdesc_powerpc_isa205_altivec32l, tdesc_powerpc_isa205_altivec64l)
835         (tdesc_powerpc_isa205_vsx32l, tdesc_powerpc_isa205_vsx64l)
836         (tdesc_powerpc_e500l): Remove.
837
838 2018-05-22  Joel Brobecker  <brobecker@adacore.com>
839
840         * ada-lang.c (catch_assert_command): Pass empty string instead
841         of NULL for excep_string argument.
842
843 2018-05-22  Maciej W. Rozycki  <macro@mips.com>
844
845         * mips-linux-nat.c (mips64_linux_register_addr): Return -1 if
846         the width of the requested register exceeds the width of the
847         `ptrace' data type.
848
849 2018-05-21  Tom Tromey  <tom@tromey.com>
850
851         * printcmd.c (output_command): Remove.
852         (output_command_const): Rename to output_command.
853         * valprint.h (output_command): Rename from output_command_const.
854         * tracepoint.c (trace_dump_actions): Call output_command.
855
856 2018-05-21  Tom Tromey  <tom@tromey.com>
857
858         * mi/mi-cmd-catch.c (mi_cmd_catch_assert)
859         (mi_cmd_catch_exception, mi_cmd_catch_handlers): Update.
860         * ada-lang.h (create_ada_exception_catchpoint): Update.
861         * ada-lang.c (struct ada_catchpoint) <excep_string>: Now a
862         std::string.
863         (create_excep_cond_exprs, ~ada_catchpoint)
864         (should_stop_exception, print_one_exception)
865         (print_mention_exception, print_recreate_exception): Update.
866         (ada_get_next_arg): Remove.
867         (catch_ada_exception_command_split): Use std::string.  Change type
868         of "excep_string", "cond_string".
869         (catch_ada_exception_command): Update.
870         (create_ada_exception_catchpoint): Change type of excep_string.
871         (ada_exception_sal): Remove excep_string parameter.
872         (~ada_catchpoint): Remove.
873
874 2018-05-21  Tom Tromey  <tom@tromey.com>
875
876         * ada-lang.c (ada_collect_symbol_completion_matches): Remove
877         cleanup.
878
879 2018-05-21  Tom Tromey  <tom@tromey.com>
880
881         * ada-lang.c (ada_exception_message_1, ada_exception_message):
882         Return unique_xmalloc_ptr.
883         (print_it_exception): Update.
884
885 2018-05-21  Tom Tromey  <tom@tromey.com>
886
887         * tracepoint.c (trace_dump_actions): Use std::string.
888
889 2018-05-21  Tom Tromey  <tom@tromey.com>
890
891         * symfile.c (reread_symbols): Use std::string for original_name.
892
893 2018-05-21  Tom Tromey  <tom@tromey.com>
894
895         * dwarf2read.c (dwarf2_read_debug_names): Use std::unique_ptr.
896         (mapped_index_base): Use DISABLE_COPY_AND_ASSIGN.  Default
897         constructor.
898
899 2018-05-20  Simon Marchi  <simon.marchi@polymtl.ca>
900
901         * common/traits.h (HAVE_IS_TRIVIALLY_COPYABLE): Rename the wrong
902         instance to...
903         (HAVE_IS_TRIVIALLY_CONSTRUCTIBLE): ... this.
904         * objfiles.c (get_objfile_bfd_data): Allocate
905         objfile_per_bfd_storage with obstack_new when allocating on
906         obstack.
907
908 2018-05-20  Simon Marchi  <simon.marchi@ericsson.com>
909
910         * ada-lang.c (cache_symbol): Use XOBNEW and/or XOBNEWVEC and/or
911         OBSTACK_ZALLOC.
912         * dwarf2-frame.c (dwarf2_build_frame_info): Likewise.
913         * hppa-tdep.c (hppa_init_objfile_priv_data): Likewise.
914         * mdebugread.c (mdebug_build_psymtabs): Likewise.
915         (add_pending): Likewise.
916         (parse_symbol): Likewise.
917         (parse_partial_symbols): Likewise.
918         (psymtab_to_symtab_1): Likewise.
919         (new_psymtab): Likewise.
920         (elfmdebug_build_psymtabs): Likewise.
921         * minsyms.c (terminate_minimal_symbol_table): Likewise.
922         * objfiles.c (get_objfile_bfd_data): Likewise.
923         (objfile_register_static_link): Likewise.
924         * psymtab.c (allocate_psymtab): Likewise.
925         * stabsread.c (read_member_functions): Likewise.
926         * xcoffread.c (xcoff_end_psymtab): Likewise.
927
928 2018-05-20  Simon Marchi  <simon.marchi@ericsson.com>
929
930         * common/traits.h (HAVE_IS_TRIVIALLY_COPYABLE): Define if
931         compiler supports std::is_trivially_constructible.
932         * common/poison.h: Include obstack.h.
933         (IsMallocable): Define to is_trivially_constructible if the
934         compiler supports it, define to true_type otherwise.
935         (xobnew): New.
936         (XOBNEW): Redefine.
937         (xobnewvec): New.
938         (XOBNEWVEC): Redefine.
939         * gdb_obstack.h (obstack_zalloc): New.
940         (OBSTACK_ZALLOC): Redefine.
941         (obstack_calloc): New.
942         (OBSTACK_CALLOC): Redefine.
943         (obstack_new): New.
944         * gdbarch.sh: Include gdb_obstack in gdbarch.h.
945         (gdbarch_obstack): New declaration in gdbarch.h, definition in
946         gdbarch.c.
947         (GDBARCH_OBSTACK_CALLOC, GDBARCH_OBSTACK_ZALLOC): Use
948         obstack_calloc/obstack_zalloc.
949         (gdbarch_obstack_zalloc): Remove.
950         * target-descriptions.c (tdesc_data_init): Use obstack_new.
951
952 2018-05-19  Philippe Waroquiers  <philippe.waroquiers@skynet.be>
953
954         * stack.c (backtrace_command_1): Remove useless variable int i.
955
956 2018-05-19  Philippe Waroquiers  <philippe.waroquiers@skynet.be>
957
958         * stack.c (print_frame_info): Fix comment.
959
960 2018-05-18  Tom Tromey  <tom@tromey.com>
961
962         * dwarf2read.c (struct dwz_file): Add constructor, initializers.
963         <dwz_bfd>: Now a gdb_bfd_ref_ptr.
964         (~dwarf2_per_objfile): Update
965         (dwarf2_get_dwz_file): Use new.
966         * dwarf2read.h (struct dwarf2_per_objfile) <dwz_file>: Now a
967         unique_ptr.
968
969 2018-05-18  Tom Tromey  <tom@tromey.com>
970
971         * dwarf2read.h (struct dwarf2_per_objfile) <dwp_file>: Now a
972         unique_ptr.
973         * dwarf2read.c (struct dwp_file): Add constructor and
974         initializers.
975         (open_and_init_dwp_file): Return a unique_ptr.
976         (dwarf2_per_objfile, create_dwp_hash_table)
977         (create_dwo_unit_in_dwp_v1, create_dwo_unit_in_dwp_v2)
978         (lookup_dwo_unit_in_dwp): Update.
979         (open_and_init_dwp_file, get_dwp_file): Update.
980
981 2018-05-18  Tom Tromey  <tom@tromey.com>
982
983         * dwarf2read.c (dwarf2_per_objfile): Update.
984         (struct mapped_index): Add initializers.
985         (dwarf2_read_index): Use new.
986         (dw2_symtab_iter_init): Update.
987         * dwarf2read.h (struct dwarf2_per_objfile) <index_table>: Now a
988         unique_ptr.
989
990 2018-05-18  Simon Marchi  <simon.marchi@ericsson.com>
991
992         * dwarf2read.c (mapped_index) <total_size>: Remove.
993
994 2018-05-18  Simon Marchi  <simon.marchi@ericsson.com>
995
996         * unittests/format_pieces-selftests.c (test_format_specifier):
997         Add ARI comments.
998
999 2018-05-18  Tom Tromey  <tom@tromey.com>
1000
1001         * c-typeprint.c (maybe_print_hole): New function.
1002         (c_print_type_struct_field_offset): Update.
1003         (c_type_print_base_struct_union): Call maybe_print_hole.
1004
1005 2018-05-17  Keith Seitz  <keiths@redhat.com>
1006
1007         * breakpoint.c (build_bpstat_chain): New function, moved from
1008         bpstat_stop_status.
1009         (bpstat_stop_status): Add optional parameter, `stop_chain'.
1010         If no stop chain is passed, call build_bpstat_chain to build it.
1011         * breakpoint.h (build_bpstat_chain): Declare.
1012         (bpstat_stop_status): Move documentation here from breakpoint.c.
1013         * infrun.c (handle_signal_stop): Before eliding inlined frames,
1014         build the stop chain and pass it to skip_inline_frames.
1015         Pass this stop chain to bpstat_stop_status.
1016         * inline-frame.c: Include breakpoint.h.
1017         (stopped_by_user_bp_inline_frame): New function.
1018         (skip_inline_frames): Add parameter `stop_chain'.
1019         Move documention to inline-frame.h.
1020         If non-NULL, use stopped_by_user_bp_inline_frame to determine
1021         whether the frame should be elided.
1022         * inline-frame.h (skip_inline_frames): Add parameter `stop_chain'.
1023         Add moved documentation and update for new parameter.
1024
1025 2018-05-17  Simon Marchi  <simon.marchi@ericsson.com>
1026
1027         PR cli/14975
1028         * Makefile.in (SUBDIR_UNITTESTS_SRCS): Add
1029         unittests/format_pieces-selftests.c.
1030         * common/format.h (format_piece) <operator==>: New.
1031         (format_pieces) <operator[]>: Remove.
1032         * common/format.c (format_pieces::format_pieces): Handle \e.
1033         * unittests/format_pieces-selftests.c: New.
1034
1035 2018-05-17  Tom Tromey  <tom@tromey.com>
1036
1037         PR symtab/23010:
1038         * dwarf2read.c (load_cu, dw2_do_instantiate_symtab)
1039         (dw2_instantiate_symtab): Add skip_partial parameter.
1040         (dw2_find_last_source_symtab, dw2_map_expand_apply)
1041         (dw2_lookup_symbol, dw2_expand_symtabs_for_function)
1042         (dw2_expand_all_symtabs, dw2_expand_symtabs_with_fullname)
1043         (dw2_expand_symtabs_matching_one)
1044         (dw2_find_pc_sect_compunit_symtab)
1045         (dw2_debug_names_lookup_symbol)
1046         (dw2_debug_names_expand_symtabs_for_function): Update.
1047         (init_cutu_and_read_dies): Add skip_partial parameter.
1048         (process_psymtab_comp_unit, build_type_psymtabs_1)
1049         (process_skeletonless_type_unit, load_partial_comp_unit)
1050         (psymtab_to_symtab_1): Update.
1051         (load_full_comp_unit): Add skip_partial parameter.
1052         (process_imported_unit_die, dwarf2_read_addr_index)
1053         (follow_die_offset, dwarf2_fetch_die_loc_sect_off)
1054         (dwarf2_fetch_constant_bytes, dwarf2_fetch_die_type_sect_off)
1055         (read_signatured_type): Update.
1056
1057 2018-05-17  Simon Marchi  <simon.marchi@ericsson.com>
1058
1059         * value.c (release_value): Remove unused variable.
1060         (record_latest_value): Likewise.
1061         (access_value_history): Likewise.
1062         (preserve_values): Likewise.
1063
1064 2018-05-17  Tom Tromey  <tom@tromey.com>
1065
1066         * extension.h (struct ext_lang_type_printers) <py_type_printers>:
1067         Initialize.
1068
1069 2018-05-16  Maciej W. Rozycki  <macro@mips.com>
1070
1071         PR gdb/22286
1072         * linux-nat-trad.c (linux_nat_trad_target::fetch_register):
1073         Also handle registers whose width is not a multiple of
1074         PTRACE_TYPE_RET.
1075         (linux_nat_trad_target::store_register): Likewise.
1076
1077 2018-05-16  Tom Tromey  <tom@tromey.com>
1078
1079         * gdbcore.h (core_bfd): Redefine.
1080         * corelow.c (core_target::close): Update.
1081         (core_target_open): Update.
1082         * progspace.h (struct program_space) <cbfd>: Now a
1083         gdb_bfd_ref_ptr.
1084
1085 2018-05-16  Tom Tromey  <tom@tromey.com>
1086
1087         PR cli/19551:
1088         * symfile-add-flags.h (enum symfile_add_flags)
1089         <SYMFILE_NOT_FILENAME>: New constant.
1090         * symfile.c (read_symbols): Use SYMFILE_NOT_FILENAME.  Get
1091         objfile name from BFD.
1092         (symbol_file_add_with_addrs): Check SYMFILE_NOT_FILENAME.
1093         * minidebug.c (find_separate_debug_file_in_section): Put
1094         ".gnu_debugdata" into BFD's file name.
1095
1096 2018-05-16  Simon Marchi  <simon.marchi@ericsson.com>
1097
1098         * regcache.c (regcache_read_ftype, regcache_write_ftype):
1099         Remove.
1100
1101 2018-05-15  Tamar Christina  <tamar.christina@arm.com>
1102
1103         PR binutils/21446
1104         * aarch64-tdep.c (aarch64_analyze_prologue,
1105         aarch64_software_single_step, aarch64_displaced_step_copy_insn):
1106         Indicate not interested in errors.
1107
1108 2018-05-15  Maciej W. Rozycki  <macro@mips.com>
1109
1110         * mips-linux-nat.c (mips_linux_nat_target::fetch_registers):
1111         Supply the MIPS_ZERO_REGNUM register.
1112
1113 2018-05-15  Maciej W. Rozycki  <macro@mips.com>
1114
1115         * mips-tdep.c (mask_address_var): Make variable static.
1116
1117 2018-05-14  Tom Tromey  <tom@tromey.com>
1118
1119         * dwarf2read.c (rust_union_quirks): Clear rust_unions.
1120
1121 2018-05-11  Andrew Burgess  <andrew.burgess@embecosm.com>
1122
1123         * i387-tdep.c (i387_collect_xsave): Use FXSAVE_MXCSR_ADDR not
1124         FXSAVE_ADDR for the mxcsr register.
1125
1126 2018-05-11  Max Filippov  <jcmvbkbc@gmail.com>
1127
1128         * configure.tgt (xtensa*-*-linux*): Drop gdb_target definition.
1129
1130 2018-05-11  Pedro Alves  <palves@redhat.com>
1131
1132         * corelow.c (core_target) <core_target>: No longer inline.
1133         Initialize m_core_gdbarch, m_core_vec and build the section table
1134         here.
1135         <~core_target>: New.
1136         <core_gdbarch, get_core_register_section>: New methods.
1137         <m_core_section_table, m_core_vec, m_core_gdbarch>: New fields,
1138         factored out from ...
1139         <core_data, core_vec, core_gdbarch>: ... these deleted globals.
1140         (core_ops): Delete.
1141         (sniff_core_bfd): Add gdbarch parameter.
1142         (core_close): Delete, merged into ...
1143         (core_target::close): ... here.  Delete self.
1144         (core_close_cleanup): Delete.
1145         (core_target_open): Allocate a core_target on the heap.  Use a
1146         unique_ptr instead of a cleanup.  Bits moved into the core_target
1147         ctor.  Adjust to use core_target methods instead of globals.
1148         (get_core_register_section): Rename to ...
1149         (core_target::get_core_register_section): ... this and adjust.
1150         (struct get_core_registers_cb_data): New.
1151         (get_core_registers_cb): Use it.  Use bool.
1152         (core_target::fetch_registers, core_target::files_info)
1153         (core_target::xfer_partial, core_target::read_description)
1154         (core_target::pid_to, core_target::thread_name): Adjust to
1155         reference class fields instead of globals.
1156         * target.h (struct target_ops_deleter, target_ops_up): New.
1157
1158 2018-05-11  Pedro Alves  <palves@redhat.com>
1159
1160         * corefile.c (core_file_command): Move to corelow.c.
1161         * corelow.c (the_core_target): Delete.
1162         (core_file_command): Moved from corefile.c.  Check exec_bfd
1163         instead of the_core_target.  Use target_detach instead of calling
1164         into the_core_target directly.
1165         (maybe_say_no_core_file_now): New.
1166         (core_target::detach): Use it.
1167         (_initialize_corelow): Remove references to the_core_target.
1168         * gdbcore.h (the_core_target): Delete.
1169
1170 2018-05-11  Tom Tromey  <tromey@redhat.com>
1171             Pedro Alves  <palves@redhat.com>
1172
1173         * corefile.c (core_bfd): Remove.
1174         * gdbcore.h (core_bfd): Now a macro.
1175         * progspace.h (struct program_space) <cbfd>: New field.
1176
1177 2018-05-11  Tom Tromey  <tom@tromey.com>
1178
1179         * mdebugread.c (parse_partial_symbols, psymtab_to_symtab_1): Use
1180         gdb::def_vector.
1181
1182 2018-05-10  Tom Tromey  <tom@tromey.com>
1183
1184         * configure: Rebuild.
1185         * warning.m4 (AM_GDB_WARNINGS): Use -Wimplicit-fallthrough=3.
1186
1187 2018-05-10  Joel Brobecker  <brobecker@adacore.com>
1188
1189         PR server/23158:
1190         * regformats/regdat.sh: Adjust script, following the addition
1191         of the new expedite_regs parameter to init_target_desc.
1192
1193 2018-05-10  Omair Javaid  <omair.javaid@linaro.org>
1194     
1195         PR gdb/23127
1196         * aarch64-linux-tdep.c (aarch64_linux_init_abi): Add call to
1197         set_gdbarch_significant_addr_bit.
1198         * aarch64-tdep.c (aarch64_gdbarch_init): Remove call to
1199         set_gdbarch_significant_addr_bit.
1200         * utils.c (address_significant): Update to sign extend addr.
1201
1202 2018-05-09  Max Filippov  <jcmvbkbc@gmail.com>
1203
1204         * xtensa-linux-tdep.c (xtensa-tdep.h): New include.
1205         (xtensa_linux_init_abi): Limit tdep->num_regs by
1206         tdep->num_nopriv_regs.
1207         * xtensa-tdep.c (xtensa_derive_tdep): Calculate
1208         tdep->num_nopriv_regs and only copy it to tdep->num_regs if it's
1209         not initialized.
1210
1211 2018-05-08  Simon Marchi  <simon.marchi@ericsson.com>
1212
1213         * unittests/string_view-selftests.c: Define GNULIB_NAMESPACE.
1214
1215 2018-05-08  Andrew Burgess  <andrew.burgess@embecosm.com>
1216
1217         * common/x86-xstate.h (I387_FCTRL_INIT_VAL): New constant.
1218         (I387_MXCSR_INIT_VAL): New constant.
1219         * amd64-tdep.c (amd64_supply_xsave): Only read state from xsave
1220         buffer if it was supplied by the inferior.
1221         * i387-tdep.c (i387_supply_fsave): Use I387_MXCSR_INIT_VAL.
1222         (i387_xsave_get_clear_bv): New function.
1223         (i387_supply_xsave): Only read x87 control registers from the
1224         xsave buffer if the feature is enabled, and the state will have
1225         been written, otherwise, provide a suitable default.
1226         (i387_collect_xsave): Pre-clear all registers in xsave buffer,
1227         including x87 control registers.  Update control registers if they
1228         have changed from the default value, and mark features as enabled
1229         as required.
1230         * i387-tdep.h (i387_xsave_get_clear_bv): Declare.
1231
1232 2018-05-08  Ulrich Weigand  <uweigand@de.ibm.com>
1233
1234         * spu-tdep.c (info_spu_event_command): Fix output formatting.
1235
1236 2018-05-07  Tom Tromey  <tom@tromey.com>
1237
1238         * configure: Rebuild.
1239         * warning.m4 (AM_GDB_WARNINGS): Add -Wduplicated-cond.
1240
1241 2018-05-07  Tom Tromey  <tom@tromey.com>
1242
1243         PR tdep/20362:
1244         * arm-tdep.c (arm_record_vfp_data_proc_insn): Properly mask off D
1245         bit.  Use correct value for VDIV.
1246
1247 2018-05-04  Tom Tromey  <tom@tromey.com>
1248
1249         * configure: Rebuild.
1250         * warning.m4 (AM_GDB_WARNINGS): Add -Wimplicit-fallthrough.
1251
1252 2018-05-04  Tom Tromey  <tom@tromey.com>
1253
1254         * linux-record.c (record_linux_system_call) <case
1255         RECORD_SYS_RECVFROM>: Add "break".
1256
1257 2018-05-04  Tom Tromey  <tom@tromey.com>
1258
1259         * mi/mi-main.c (mi_cmd_trace_frame_collected) <REGISTERS_FORMAT>:
1260         Add missing "break".
1261         * mi/mi-cmd-stack.c (mi_cmd_stack_list_locals) <NO_FRAME_FILTERS>:
1262         Add missing "break".
1263
1264 2018-05-04  Tom Tromey  <tom@tromey.com>
1265
1266         * rs6000-tdep.c (ppc_process_record_op4)
1267         (ppc_process_record_op63): Add fall-through comment.
1268
1269 2018-05-04  Tom Tromey  <tom@tromey.com>
1270
1271         * i386-tdep.c (i386_process_record): Add fall-through comment.
1272
1273 2018-05-04  Tom Tromey  <tom@tromey.com>
1274
1275         * stabsread.c (define_symbol) <case 'p'>: Add fall-through
1276         comment.
1277
1278 2018-05-04  Tom Tromey  <tom@tromey.com>
1279
1280         * riscv-tdep.c (riscv_isa_xlen): Add fall-through comment.
1281         * utils.c (can_dump_core) <LIMIT_CUR>: Add fall-through comment.
1282         * eval.c (fetch_subexp_value) <MEMORY_ERROR>: Add fall-through
1283         comment.
1284         * d-valprint.c (d_val_print) <TYPE_CODE_STRUCT>: Add fall-through
1285         comment.
1286         * coffread.c (coff_symtab_read) <C_LABEL>: Add fall-through
1287         comment.
1288
1289 2018-05-04  Tom Tromey  <tom@tromey.com>
1290
1291         * dwarf2loc.c (unimplemented): Add ATTRIBUTE_NORETURN.
1292
1293 2018-05-04  Tom Tromey  <tom@tromey.com>
1294
1295         * s390-tdep.c (s390_process_record): Fix fall-through comments.
1296         * xcoffread.c (scan_xcoff_symtab): Move comment later.
1297         * symfile.c (section_is_mapped): Fix fall-through comment.
1298         * stabsread.c (define_symbol, read_member_functions): Fix
1299         fall-through comment.
1300         * s390-linux-tdep.c (s390_process_record): Fix fall-through
1301         comment.
1302         * remote.c (remote_wait_as): Fix fall-through comment.
1303         * p-exp.y (yylex): Fix fall-through comment.
1304         * nat/x86-dregs.c (x86_length_and_rw_bits): Fix fall-through
1305         comment.
1306         * msp430-tdep.c (msp430_gdbarch_init): Fix fall-through comment.
1307         * mdebugread.c (parse_partial_symbols): Fix fall-through comment.
1308         * jv-exp.y (yylex): Fix fall-through comment.
1309         * go-exp.y (lex_one_token): Fix fall-through comment.
1310         * gdbtypes.c (get_discrete_bounds, rank_one_type): Fix
1311         fall-through comment.
1312         * f-exp.y (yylex): Fix fall-through comment.
1313         * dwarf2read.c (process_die): Fix fall-through comments.
1314         * dbxread.c (process_one_symbol): Fix fall-through comment.
1315         * d-exp.y (lex_one_token): Fix fall-through comment.
1316         * cp-name-parser.y (yylex): Fix fall-through comment.
1317         * coffread.c (coff_symtab_read): Fix fall-through comment.
1318         * c-exp.y (lex_one_token): Fix fall-through comment.
1319         * arm-tdep.c (arm_decode_miscellaneous): Fix fall-through
1320         comment.
1321         * arch/arm.c (arm_instruction_changes_pc): Fix fall-through
1322         comment.
1323
1324 2018-05-04  Tom Tromey  <tom@tromey.com>
1325
1326         PR python/22730:
1327         * NEWS: Mention gdb.execute change.
1328         * gdbcmd.h (execute_control_command): Don't declare.
1329         * python/python.c (execute_gdb_command): Use read_command_lines_1,
1330         execute_control_commands, execute_control_commands_to_string.
1331         * cli/cli-script.h (execute_control_commands)
1332         (execute_control_commands_to_string): Declare.
1333         (execute_control_command): Add from_tty parameter.
1334         * cli/cli-script.c (execute_control_commands)
1335         (execute_control_commands_to_string): New functions.
1336         (execute_user_command): Use execute_control_commands.
1337         (execute_control_command_1): Add "from_tty" parameter.  Update.
1338         (execute_control_command): Likewise.
1339
1340 2018-05-04  Tom Tromey  <tom@tromey.com>
1341
1342         PR python/22731:
1343         * NEWS: Mention that breakpoint commands are writable.
1344         * python/py-breakpoint.c (bppy_set_commands): New function.
1345         (breakpoint_object_getset) <"commands">: Use it.
1346
1347 2018-05-04  Tom Tromey  <tom@tromey.com>
1348
1349         * tracepoint.c (actions_command): Update.
1350         * mi/mi-cmd-break.c (mi_command_line_array)
1351         (mi_command_line_array_cnt, mi_command_line_array_ptr)
1352         (mi_read_next_line): Remove.
1353         (mi_cmd_break_commands): Update.
1354         * cli/cli-script.h (read_command_lines, read_command_lines_1): Use
1355         function_view.
1356         * cli/cli-script.c (get_command_line): Update.
1357         (process_next_line): Use function_view.  Constify.
1358         (recurse_read_control_structure, read_command_lines)
1359         (read_command_lines_1): Change argument types to function_view.
1360         (do_define_command, document_command): Update.
1361         * breakpoint.h (check_tracepoint_command): Don't declare.
1362         * breakpoint.c (check_tracepoint_command): Remove.
1363         (commands_command_1, create_tracepoint_from_upload): Update.
1364
1365 2018-05-04  Tom Tromey  <tom@tromey.com>
1366
1367         PR gdb/11750:
1368         * cli/cli-script.h (enum command_control_type) <define_control>:
1369         New constant.
1370         * cli/cli-script.c (multi_line_command_p): Handle define_control.
1371         (build_command_line, execute_control_command_1)
1372         (process_next_line): Likewise.
1373         (do_define_command): New function, extracted from define_command.
1374         (define_command): Use it.
1375
1376 2018-05-04  Tom Tromey  <tom@tromey.com>
1377
1378         * tracepoint.c (actions_command): Update.
1379         * cli/cli-script.h (read_command_lines): Update.
1380         * cli/cli-script.c (read_command_lines): Constify prompt_arg.
1381         (MAX_TMPBUF): Remove define.
1382         (define_command): Use string_printf.
1383         (document_command): Likewise.
1384         * breakpoint.c (commands_command_1): Update.
1385
1386 2018-05-04  Tom Tromey  <tom@tromey.com>
1387
1388         * top.c (execute_command): Update.
1389         * cli/cli-script.h (print_command_lines): Now varargs.
1390         * cli/cli-script.c (print_command_lines): Now varargs.
1391         (execute_control_command_1) <case while_control, case if_control>:
1392         Update.
1393
1394 2018-05-04  Tom Tromey  <tom@tromey.com>
1395
1396         * tracepoint.c (all_tracepoint_actions): Rename from
1397         all_tracepoint_actions_and_cleanup.  Change return type.
1398         (actions_command, encode_actions_1, encode_actions)
1399         (trace_dump_actions, tdump_command): Update.
1400         * remote.c (remote_download_command_source): Update.
1401         * python/python.c (gdbpy_eval_from_control_command)
1402         (python_command, python_interactive_command): Update.
1403         * mi/mi-cmd-break.c (mi_cmd_break_commands): Update.
1404         * guile/guile.c (guile_command)
1405         (gdbscm_eval_from_control_command, guile_command): Update.
1406         * compile/compile.c (compile_code_command)
1407         (compile_print_command, compile_to_object): Update.
1408         * cli/cli-script.h (struct command_lines_deleter): New.
1409         (counted_command_line): New typedef.
1410         (struct command_line): Add constructor, destructor.
1411         <body_list>: Remove.
1412         <body_list_0, body_list_1>: New members.
1413         (command_line_up): Remove typedef.
1414         (read_command_lines, read_command_lines_1, get_command_line):
1415         Update.
1416         (copy_command_lines): Don't declare.
1417         * cli/cli-script.c (build_command_line): Use "new".
1418         (get_command_line): Return counted_command_line.
1419         (print_command_lines, execute_user_command)
1420         (execute_control_command_1, while_command, if_command): Update.
1421         (realloc_body_list): Remove.
1422         (process_next_line, recurse_read_control_structure): Update.
1423         (read_command_lines, read_command_lines_1): Return counted_command_line.
1424         (free_command_lines): Use "delete".
1425         (copy_command_lines): Remove.
1426         (define_command, document_command, show_user_1): Update.
1427         * cli/cli-decode.h (struct cmd_list_element) <user_commands>: Now
1428         a counted_command_line.
1429         * breakpoint.h (counted_command_line): Remove typedef.
1430         (breakpoint_set_commands): Update.
1431         * breakpoint.c (check_no_tracepoint_commands)
1432         (validate_commands_for_breakpoint): Update.
1433         (breakpoint_set_commands): Change commands to be a
1434         counted_command_line.
1435         (commands_command_1, update_dprintf_command_list)
1436         (create_tracepoint_from_upload): Update.
1437
1438 2018-05-04  Tom Tromey  <tom@tromey.com>
1439
1440         * cli/cli-decode.h (cmd_list_element): New constructor.
1441         (~cmd_list_element): New destructor.
1442         (struct cmd_list_element): Add initializers.
1443         * cli/cli-decode.c (do_add_cmd): Use "new".
1444         (delete_cmd): Use "delete".
1445
1446 2018-05-04  Jan Kratochvil  <jan.kratochvil@redhat.com>
1447             Pedro Alves <palves@redhat.com>
1448
1449         PR breakpoints/19806 and support for PR external/20207.
1450         * NEWS: Mention Aarch64 watchpoint improvements.
1451         * aarch64-linux-nat.c (aarch64_linux_stopped_data_address): Fix missed
1452         watchpoints and PR external/20207 watchpoints.
1453         * nat/aarch64-linux-hw-point.c
1454         (kernel_supports_any_contiguous_range): New.
1455         (aarch64_watchpoint_offset): New.
1456         (aarch64_watchpoint_length): Support PR external/20207 watchpoints.
1457         (aarch64_point_encode_ctrl_reg): New parameter offset, new asserts.
1458         (aarch64_point_is_aligned): Support PR external/20207 watchpoints.
1459         (aarch64_align_watchpoint): New parameters aligned_offset_p and
1460         next_addr_orig_p.  Support PR external/20207 watchpoints.
1461         (aarch64_downgrade_regs): New.
1462         (aarch64_dr_state_insert_one_point): New parameters offset and
1463         addr_orig.
1464         (aarch64_dr_state_remove_one_point): Likewise.
1465         (aarch64_handle_breakpoint): Update caller.
1466         (aarch64_handle_aligned_watchpoint): Likewise.
1467         (aarch64_handle_unaligned_watchpoint): Support addr_orig and
1468         aligned_offset.
1469         (aarch64_linux_set_debug_regs): Remove const from state.  Call
1470         aarch64_downgrade_regs.
1471         (aarch64_show_debug_reg_state): Print also dr_addr_orig_wp.
1472         * nat/aarch64-linux-hw-point.h (DR_CONTROL_LENGTH): Rename to ...
1473         (DR_CONTROL_MASK): ... this.
1474         (struct aarch64_debug_reg_state): New field dr_addr_orig_wp.
1475         (unsigned int aarch64_watchpoint_offset): New prototype.
1476         (aarch64_linux_set_debug_regs): Remove const from state.
1477         * utils.c (align_up, align_down): Move to ...
1478         * common/common-utils.c (align_up, align_down): ... here.
1479         * utils.h (align_up, align_down): Move to ...
1480         * common/common-utils.h (align_up, align_down): ... here.
1481
1482 2018-05-04  Joel Brobecker  <brobecker@adacore.com>
1483
1484         * sparc-tdep.c (sparc_structure_return_p): Re-implement to
1485         match the ABI as summarized in GCC's gcc/config/sparc/sparc.c.
1486         (sparc_arg_by_memory_p): Renamed from sparc_arg_on_registers_p.
1487         Re-implement to match the ABI as summarized in GCC's
1488         gcc/config/sparc/sparc.c.  All callers updated.
1489         (sparc32_store_arguments): Remove assertion.
1490
1491 2018-05-04  Tom Tromey  <tom@tromey.com>
1492
1493         * printcmd.c: Don't include tui.h.
1494         (decode_format): Use skip_spaces.
1495
1496 2018-05-04  Tom Tromey  <tom@tromey.com>
1497
1498         PR gdb/22619:
1499         * printcmd.c (last_count): New global.
1500         (x_command): Use saved count when repeating.
1501
1502 2018-05-04  Tom Tromey  <tom@tromey.com>
1503
1504         * nto-procfs.c (do_closedir_cleanup): Remove.
1505         (procfs_pidlist): Use gdb_dir_up.
1506         * procfs.c (do_closedir_cleanup): Remove.
1507         (proc_update_threads): Use gdb_dir_up.
1508         * common/filestuff.h (struct gdb_dir_deleter): New.
1509         (gdb_dir_up): New typedef.
1510
1511 2018-05-04  Tom Tromey  <tom@tromey.com>
1512
1513         * ada-lang.c (print_mention_exception): Use std::string.
1514
1515 2018-05-04  Tom Tromey  <tom@tromey.com>
1516
1517         * ada-lang.c (create_excep_cond_exprs): Update.
1518         (ada_exception_catchpoint_cond_string): Use std::string.
1519
1520 2018-05-04  Tom Tromey  <tom@tromey.com>
1521
1522         * ada-lang.c (xget_renaming_scope): Return std::string.
1523         (old_renaming_is_invisible): Update.
1524
1525 2018-05-04  Tom Tromey  <tom@tromey.com>
1526
1527         * bfd-target.c (target_bfd::m_bfd): Now a gdb_bfd_ref_ptr.
1528         (target_bfd::target_bfd, target_bfd::~target_bfd): Update.
1529
1530 2018-05-04  Ulrich Weigand  <uweigand@de.ibm.com>
1531
1532         * spu-linux-nat.c (spu_linux_nat_target::wait): Fix syntax error.
1533
1534 2018-05-04  Tom Tromey  <tom@tromey.com>
1535
1536         * remote.c (remote_query_supported_append): Change type.
1537         (remote_check_symbols): Update.
1538
1539 2018-05-04  Paul Pluzhnikov  <ppluzhnikov@google.com>
1540
1541         PR gdb/11420
1542         * configure.ac: Prepend libpython.
1543         * python/python-config.py: Likewise.
1544         * configure: Regenerate.
1545
1546 2018-05-03  Simon Marchi  <simon.marchi@ericsson.com>
1547
1548         * Makefile.in (%.c: %.l): Use -t instead of --stdout.
1549
1550 2018-05-03  Pedro Alves  <palves@redhat.com>
1551
1552         * s390-linux-nat.c
1553         (s390_linux_nat_target::have_continuable_watchpoint): Mark with
1554         override.  Write 'true' instead of '1'.
1555         (s390_linux_nat_target::watchpoint_addr_within_range): Remove
1556         declaration.
1557
1558 2018-05-02  Pedro Alves  <palves@redhat.com>
1559
1560         * aarch64-fbsd-nat.c (_initialize_aarch64_fbsd_nat): Use
1561         add_inf_child_target.
1562         * aarch64-linux-nat.c (_initialize_aarch64_linux_nat): Use
1563         add_inf_child_target.
1564         * aix-thread.c (aix_thread_target_info): New.
1565         (aix_thread_target) <shortname, longname, doc>: Delete.
1566         <info>: New.
1567         * alpha-bsd-nat.c (_initialize_alphabsd_nat): Use
1568         add_inf_child_target.
1569         * alpha-linux-nat.c (_initialize_alpha_linux_nat): Use
1570         add_inf_child_target.
1571         * amd64-fbsd-nat.c (_initialize_amd64fbsd_nat): Use
1572         add_inf_child_target.
1573         * amd64-linux-nat.c (_initialize_amd64_linux_nat): Use
1574         add_inf_child_target.
1575         * amd64-nbsd-nat.c (_initialize_amd64nbsd_nat): Use
1576         add_inf_child_target.
1577         * amd64-obsd-nat.c (_initialize_amd64obsd_nat): Use
1578         add_inf_child_target.
1579         * arm-fbsd-nat.c (_initialize_arm_fbsd_nat): Use
1580         add_inf_child_target.
1581         * arm-linux-nat.c (_initialize_arm_linux_nat): Use
1582         add_inf_child_target.
1583         * arm-nbsd-nat.c (_initialize_arm_netbsd_nat): Use
1584         add_inf_child_target.
1585         * bfd-target.c (target_bfd_target_info): New.
1586         (target_bfd) <shortname, longname, doc>: Delete.
1587         <info>: New.
1588         * bsd-kvm.c (bsd_kvm_target_info): New.
1589         (bsd_kvm_target) <shortname, longname, doc>: Delete.
1590         <info>: New.
1591         (bsd_kvm_target::open): Rename to ...
1592         (bsd_kvm_target_open): ... this.  Adjust.
1593         * bsd-uthread.c (bsd_uthread_target_info): New.
1594         (bsd_uthread_target) <shortname, longname, doc>: Delete.
1595         <info>: New.
1596         * corefile.c (core_file_command): Adjust.
1597         * corelow.c (core_target_info): New.
1598         (core_target) <shortname, longname, doc>: Delete.
1599         <info>: New.
1600         (core_target::open): Rename to ...
1601         (core_target_open): ... this.  Adjust.
1602         * ctf.c (ctf_target_info): New.
1603         (ctf_target) <shortname, longname, doc>: Delete.
1604         <info>: New.
1605         (ctf_target::open): Rename to ...
1606         (ctf_target_open): ... this.
1607         (_initialize_ctf): Adjust.
1608         * exec.c (exec_target_info): New.
1609         (exec_target) <shortname, longname, doc>: Delete.
1610         <info>: New.
1611         (exec_target::open): Rename to ...
1612         (exec_target_open): ... this.
1613         * gdbcore.h (core_target_open): Declare.
1614         * go32-nat.c (_initialize_go32_nat): Use add_inf_child_target.
1615         * hppa-linux-nat.c (_initialize_hppa_linux_nat): Use
1616         add_inf_child_target.
1617         * hppa-nbsd-nat.c (_initialize_hppanbsd_nat): Use
1618         add_inf_child_target.
1619         * hppa-obsd-nat.c (_initialize_hppaobsd_nat): Use
1620         add_inf_child_target.
1621         * i386-darwin-nat.c (_initialize_i386_darwin_nat): Use
1622         add_inf_child_target.
1623         * i386-fbsd-nat.c (_initialize_i386fbsd_nat): Use
1624         add_inf_child_target.
1625         * i386-gnu-nat.c (_initialize_i386gnu_nat): Use
1626         add_inf_child_target.
1627         * i386-linux-nat.c (_initialize_i386_linux_nat): Use
1628         add_inf_child_target.
1629         * i386-nbsd-nat.c (_initialize_i386nbsd_nat): Use
1630         add_inf_child_target.
1631         * i386-obsd-nat.c (_initialize_i386obsd_nat): Use
1632         add_inf_child_target.
1633         * ia64-linux-nat.c (_initialize_ia64_linux_nat): Use
1634         add_inf_child_target.
1635         * inf-child.c (inf_child_target_info): New.
1636         (inf_child_target::info): New.
1637         (inf_child_open_target): Remove 'target' parameter.  Use
1638         get_native_target instead.
1639         (inf_child_target::open): Delete.
1640         (add_inf_child_target): New.
1641         * inf-child.h (inf_child_target) <shortname, longname, doc, open>:
1642         Delete.
1643         <info>: New.
1644         (add_inf_child_target): Declare.
1645         (inf_child_open_target): Declare.
1646         * linux-thread-db.c (thread_db_target_info): New.
1647         (thread_db_target) <shortname, longname, doc>: Delete.
1648         <info>: New.
1649         * m32r-linux-nat.c (_initialize_m32r_linux_nat): Use
1650         add_inf_child_target.
1651         * m68k-bsd-nat.c (_initialize_m68kbsd_nat): Use
1652         add_inf_child_target.
1653         * m68k-linux-nat.c (_initialize_m68k_linux_nat): Use
1654         add_inf_child_target.
1655         * m88k-bsd-nat.c (_initialize_m88kbsd_nat): Use
1656         add_inf_child_target.
1657         * make-target-delegates (print_class): Adjust.
1658         * mips-fbsd-nat.c (_initialize_mips_fbsd_nat): Use
1659         add_inf_child_target.
1660         * mips-linux-nat.c (_initialize_mips_linux_nat): Use
1661         add_inf_child_target.
1662         * mips-nbsd-nat.c (_initialize_mipsnbsd_nat): Use
1663         add_inf_child_target.
1664         * mips64-obsd-nat.c (_initialize_mips64obsd_nat): Use
1665         add_inf_child_target.
1666         * nto-procfs.c (nto_native_target_info): New.
1667         (nto_procfs_target_native) <shortname, longname, doc>:
1668         Delete.
1669         <info>: New.
1670         (nto_procfs_target_info): New.
1671         (nto_procfs_target_procfs) <shortname, longname, doc>:
1672         Delete.
1673         <info>: New.
1674         (init_procfs_targets): Adjust.
1675         * ppc-fbsd-nat.c (_initialize_ppcfbsd_nat): Use
1676         add_inf_child_target.
1677         * ppc-linux-nat.c (_initialize_ppc_linux_nat): Use
1678         add_inf_child_target.
1679         * ppc-nbsd-nat.c (_initialize_ppcnbsd_nat): Use
1680         add_inf_child_target.
1681         * ppc-obsd-nat.c (_initialize_ppcobsd_nat): Use
1682         add_inf_child_target.
1683         * ravenscar-thread.c (ravenscar_target_info): New.
1684         (ravenscar_thread_target) <shortname, longname, doc>:
1685         Delete.
1686         <info>: New.
1687         * record-btrace.c (record_btrace_target_info):
1688         (record_btrace_target) <shortname, longname, doc>: Delete.
1689         <info>: New.
1690         (record_btrace_target::open): Rename to ...
1691         (record_btrace_target_open): ... this.  Adjust.
1692         * record-full.c (record_longname, record_doc): New.
1693         (record_full_base_target) <shortname, longname, doc>: Delete.
1694         <info>: New.
1695         (record_full_target_info): New.
1696         (record_full_target): <shortname>: Delete.
1697         <info>: New.
1698         (record_full_core_open_1, record_full_open_1): Update comments.
1699         (record_full_base_target::open): Rename to ...
1700         (record_full_open): ... this.
1701         (cmd_record_full_restore): Update.
1702         (_initialize_record_full): Update.
1703         * remote-sim.c (remote_sim_target_info): New.
1704         (gdbsim_target) <shortname, longname, doc>: Delete.
1705         <info>: New.
1706         (gdbsim_target::open): Rename to ...
1707         (gdbsim_target_open): ... this.
1708         (_initialize_remote_sim): Adjust.
1709         * remote.c (remote_doc): New.
1710         (remote_target_info): New.
1711         (remote_target) <shortname, longname, doc>: Delete.
1712         <info>: New.
1713         (extended_remote_target_info): New.
1714         (extended_remote_target) <shortname, longname, doc>: Delete.
1715         <info>: New.
1716         (remote_target::open_1): Make static.  Adjust.
1717         * rs6000-nat.c (_initialize_rs6000_nat): Use add_inf_child_target.
1718         * s390-linux-nat.c (_initialize_s390_nat): Use
1719         add_inf_child_target.
1720         * sh-nbsd-nat.c (_initialize_shnbsd_nat): Use
1721         add_inf_child_target.
1722         * sol-thread.c (thread_db_target_info): New.
1723         (sol_thread_target) <shortname, longname, doc>: Delete.
1724         <info>: New.
1725         * sparc-linux-nat.c (_initialize_sparc_linux_nat): Use
1726         add_inf_child_target.
1727         * sparc-nbsd-nat.c (_initialize_sparcnbsd_nat): Use
1728         add_inf_child_target.
1729         * sparc64-fbsd-nat.c (_initialize_sparc64fbsd_nat): Use
1730         add_inf_child_target.
1731         * sparc64-linux-nat.c (_initialize_sparc64_linux_nat): Use
1732         add_inf_child_target.
1733         * sparc64-nbsd-nat.c (_initialize_sparc64nbsd_nat): Use
1734         add_inf_child_target.
1735         * sparc64-obsd-nat.c (_initialize_sparc64obsd_nat): Use
1736         add_inf_child_target.
1737         * spu-linux-nat.c (_initialize_spu_nat): Use
1738         add_inf_child_target.
1739         * spu-multiarch.c (spu_multiarch_target_info): New.
1740         (spu_multiarch_target) <shortname, longname, doc>: Delete.
1741         <info>: New.
1742         * target-delegates.c: Regenerate.
1743         * target.c: Include <unordered_map>.
1744         (target_ops_p): Delete.
1745         (DEF_VEC_P(target_ops_p)): Delete.
1746         (target_factories): New.
1747         (test_target_info): New.
1748         (test_target_ops::info): New.
1749         (open_target): Adjust to use target_factories.
1750         (add_target_with_completer): Rename to ...
1751         (add_target): ... this.  Change prototype.  Register target_info
1752         and open callback in target_factories.  Register target_info in
1753         command context instead of target_ops.
1754         (add_target): Delete old implementation.
1755         (add_deprecated_target_alias): Change prototype.  Adjust.
1756         (the_native_target): New.
1757         (set_native_target, get_native_target): New.
1758         (find_default_run_target): Use the_native_target.
1759         (find_attach_target, find_run_target): Simplify.
1760         (target_ops::open): Delete.
1761         (dummy_target_info): New.
1762         (dummy_target::shortname, dummy_target::longname)
1763         (dummy_target::doc): Delete.
1764         (dummy_target::info): New.
1765         (debug_target::shortname, debug_target::longname)
1766         (debug_target::doc): Delete.
1767         (debug_target::info): New.
1768         * target.h (struct target_info): New.
1769         (target_ops::~target_ops): Add comment.
1770         (target_ops::info): New.
1771         (target_ops::shortname, target_ops::longname, target_ops::doc): No
1772         longer virtual.  Implement in terms of target_info.
1773         (set_native_target, get_native_target): Declare.
1774         (target_open_ftype): New.
1775         (add_target, add_target_with_completer)
1776         (add_deprecated_target_alias): Change prototype.
1777         (test_target) <shortname, longname, doc>: Delete.
1778         <info>: New.
1779         * tilegx-linux-nat.c (_initialize_tile_linux_nat): Use
1780         add_inf_child_target.
1781         * tracefile-tfile.c (tfile_target_info): New.
1782         (tfile_target) <shortname, longname, doc>: Delete.
1783         <info>: New.
1784         (tfile_target::open): Rename to ...
1785         (tfile_target_open): ... this.
1786         (_initialize_tracefile_tfile): Adjust.
1787         * vax-bsd-nat.c (_initialize_vaxbsd_nat): Use
1788         add_inf_child_target.
1789         * windows-nat.c (_initialize_windows_nat): Use
1790         add_inf_child_target.
1791         * xtensa-linux-nat.c (_initialize_xtensa_linux_nat): Use
1792         add_inf_child_target.
1793
1794 2018-05-02  Pedro Alves  <palves@redhat.com>
1795
1796         * linux-nat.h (linux_nat_target) <low_new_thread,
1797         low_delete_thread, low_new_fork, low_forget_process,
1798         low_prepare_to_resume, low_siginfo_fixup, low_status_is_event>:
1799         New virtual methods.
1800         (linux_nat_set_new_thread, linux_nat_set_delete_thread)
1801         (linux_nat_new_fork_ftype, linux_nat_set_new_fork)
1802         (linux_nat_forget_process_ftype, linux_nat_set_forget_process)
1803         (linux_nat_forget_process, linux_nat_set_siginfo_fixup)
1804         (linux_nat_set_prepare_to_resume, linux_nat_set_status_is_event):
1805         Delete.
1806         * linux-fork.c (delete_fork): Adjust to call low method.
1807         * linux-nat.c (linux_nat_new_thread, linux_nat_delete_thread)
1808         (linux_nat_new_fork, linux_nat_forget_process_hook)
1809         (linux_nat_prepare_to_resume, linux_nat_siginfo_fixup)
1810         (linux_nat_status_is_event):
1811         (linux_nat_target::follow_fork, lwp_free, add_lwp, detach_one_lwp)
1812         (linux_resume_one_lwp_throw, linux_handle_extended_wait): Adjust
1813         to call low method.
1814         (sigtrap_is_event): Rename to ...
1815         (linux_nat_target::low_status_is_event): ... this.
1816         (linux_nat_set_status_is_event): Delete.
1817         (save_stop_reason, linux_nat_wait_1)
1818         (linux_nat_target::mourn_inferior, siginfo_fixup): Adjust to call
1819         low methods.
1820         (linux_nat_set_new_thread, linux_nat_set_delete_thread)
1821         (linux_nat_set_new_fork, linux_nat_set_forget_process)
1822         (linux_nat_forget_process, linux_nat_set_siginfo_fixup)
1823         (linux_nat_set_prepare_to_resume): Delete.
1824         * aarch64-linux-nat.c: All linux_nat_set_* callbacks converted to
1825         low virtual methods.
1826         * amd64-linux-nat.c: Likewise.
1827         * arm-linux-nat.c: Likewise.
1828         * i386-linux-nat.c: Likewise.
1829         * ia64-linux-nat.c: Likewise.
1830         * mips-linux-nat.c: Likewise.
1831         * ppc-linux-nat.c: Likewise.
1832         * s390-linux-nat.c: Likewise.
1833         * sparc64-linux-nat.c: Likewise.
1834         * x86-linux-nat.c: Likewise.
1835         * x86-linux-nat.h: Include "nat/x86-linux.h".
1836         (x86_linux_nat_target) <low_new_fork, low_forget_process,
1837         low_prepare_to_resume, low_new_thread, low_delete_thread>:
1838         Override methods.
1839
1840 2018-05-02  Pedro Alves  <palves@redhat.com>
1841
1842         * target.h (target_ops)
1843         <stopped_by_sw_breakpoint, supports_stopped_by_sw_breakpoint,
1844         stopped_by_hw_breakpoint, supports_stopped_by_hw_breakpoint,
1845         stopped_by_watchpoint, have_continuable_watchpoint,
1846         stopped_data_address, watchpoint_addr_within_range,
1847         can_accel_watchpoint_condition, can_run, thread_alive,
1848         has_all_memory, has_memory, has_stack, has_registers,
1849         has_execution, can_async_p, is_async_p, supports_non_stop,
1850         always_non_stop_p, can_execute_reverse, supports_multi_process,
1851         supports_enable_disable_tracepoint,
1852         supports_disable_randomization, supports_string_tracing,
1853         supports_evaluation_of_breakpoint_conditions,
1854         can_run_breakpoint_commands, filesystem_is_local,
1855         can_download_tracepoint, get_trace_state_variable_value,
1856         set_trace_notes, get_tib_address, use_agent, can_use_agent,
1857         record_is_replaying, record_will_replay,
1858         augmented_libraries_svr4_read>: Adjust to return bool.
1859         * aarch64-linux-nat.c: All implementations adjusted.
1860         * aix-thread.c: All implementations adjusted.
1861         * arm-linux-nat.c: All implementations adjusted.
1862         * breakpoint.c: All implementations adjusted.
1863         * bsd-kvm.c: All implementations adjusted.
1864         * bsd-uthread.c: All implementations adjusted.
1865         * corelow.c: All implementations adjusted.
1866         * ctf.c: All implementations adjusted.
1867         * darwin-nat.c: All implementations adjusted.
1868         * darwin-nat.h: All implementations adjusted.
1869         * exec.c: All implementations adjusted.
1870         * fbsd-nat.c: All implementations adjusted.
1871         * fbsd-nat.h: All implementations adjusted.
1872         * gnu-nat.c: All implementations adjusted.
1873         * gnu-nat.h: All implementations adjusted.
1874         * go32-nat.c: All implementations adjusted.
1875         * ia64-linux-nat.c: All implementations adjusted.
1876         * inf-child.c: All implementations adjusted.
1877         * inf-child.h: All implementations adjusted.
1878         * inf-ptrace.c: All implementations adjusted.
1879         * inf-ptrace.h: All implementations adjusted.
1880         * linux-nat.c: All implementations adjusted.
1881         * linux-nat.h: All implementations adjusted.
1882         * mips-linux-nat.c: All implementations adjusted.
1883         * nto-procfs.c: All implementations adjusted.
1884         * ppc-linux-nat.c: All implementations adjusted.
1885         * procfs.c: All implementations adjusted.
1886         * ravenscar-thread.c: All implementations adjusted.
1887         * record-btrace.c: All implementations adjusted.
1888         * record-full.c: All implementations adjusted.
1889         * remote-sim.c: All implementations adjusted.
1890         * remote.c: All implementations adjusted.
1891         * s390-linux-nat.c: All implementations adjusted.
1892         * sol-thread.c: All implementations adjusted.
1893         * spu-multiarch.c: All implementations adjusted.
1894         * target-delegates.c: All implementations adjusted.
1895         * target.c: All implementations adjusted.
1896         * target.h: All implementations adjusted.
1897         * tracefile-tfile.c: All implementations adjusted.
1898         * tracefile.c: All implementations adjusted.
1899         * tracefile.h: All implementations adjusted.
1900         * windows-nat.c: All implementations adjusted.
1901         * x86-linux-nat.h: All implementations adjusted.
1902         * x86-nat.h: All implementations adjusted.
1903
1904 2018-05-02  Pedro Alves  <palves@redhat.com>
1905
1906         * make-target-delegates (scan_target_h): Don't trim lines here.
1907         Replace sequences of tabs and/or whitespace with a single
1908         whitespace.
1909         (top level, parsing methods): Trim each line before processing it
1910         here.
1911
1912 2018-05-02  Pedro Alves  <palves@redhat.com>
1913             John Baldwin  <jhb@freebsd.org>
1914
1915         * target.h (enum strata) <debug_stratum>: New.
1916         (struct target_ops) <all delegation methods>: Replace by C++
1917         virtual methods, and drop "to_" prefix.  All references updated
1918         throughout.
1919         <to_shortname, to_longname, to_doc, to_data,
1920         to_have_steppable_watchpoint, to_have_continuable_watchpoint,
1921         to_has_thread_control, to_attach_no_wait>: Delete, replaced by
1922         virtual methods.  All references updated throughout.
1923         <can_attach, supports_terminal_ours, can_create_inferior,
1924         get_thread_control_capabilities, attach_no_wait>: New
1925         virtual methods.
1926         <insert_breakpoint, remove_breakpoint>: Now
1927         TARGET_DEFAULT_NORETURN methods.
1928         <info_proc>: Now returns bool.
1929         <to_magic>: Delete.
1930         (OPS_MAGIC): Delete.
1931         (current_target): Delete.  All references replaced by references
1932         to ...
1933         (target_stack): ... this.  New.
1934         (target_shortname, target_longname): Adjust.
1935         (target_can_run): Now a function declaration.
1936         (default_child_has_all_memory, default_child_has_memory)
1937         (default_child_has_stack, default_child_has_registers)
1938         (default_child_has_execution): Remove target_ops parameter.
1939         (complete_target_initialization): Delete.
1940         (memory_breakpoint_target): New template class.
1941         (test_target_ops): Refactor as a C++ class with virtual methods.
1942         * make-target-delegates (NAME_PART): Tighten.
1943         (POINTER_PART, CP_SYMBOL): New.
1944         (SIMPLE_RETURN_PART): Reimplement.
1945         (VEC_RETURN_PART): Expect less.
1946         (RETURN_PART, VIRTUAL_PART): New.
1947         (METHOD): Adjust to C++ virtual methods.
1948         (scan_target_h): Remove reference to C99.
1949         (dname): Output "target_ops::" prefix.
1950         (write_function_header): Adjust to output a C++ class method.
1951         (write_declaration): New.
1952         (write_delegator): Adjust to output a C++ class method.
1953         (tdname): Output "dummy_target::" prefix.
1954         (write_tdefault, write_debugmethod): Adjust to output a C++ class
1955         method.
1956         (tdefault_names, debug_names): Delete.
1957         (return_types, tdefaults, styles, argtypes_array): New.
1958         (top level): All methods are delegators.
1959         (print_class): New.
1960         (top level): Print dummy_target and debug_target classes.
1961         * target-delegates.c: Regenerate.
1962         * target-debug.h (target_debug_print_enum_info_proc_what)
1963         (target_debug_print_thread_control_capabilities)
1964         (target_debug_print_thread_info_p): New.
1965         * target.c (dummy_target): Delete.
1966         (the_dummy_target, the_debug_target): New.
1967         (target_stack): Now extern.
1968         (set_targetdebug): Push/unpush debug target.
1969         (default_child_has_all_memory, default_child_has_memory)
1970         (default_child_has_stack, default_child_has_registers)
1971         (default_child_has_execution): Remove target_ops parameter.
1972         (complete_target_initialization): Delete.
1973         (add_target_with_completer): No longer call
1974         complete_target_initialization.
1975         (target_supports_terminal_ours): Use regular delegation.
1976         (update_current_target): Delete.
1977         (push_target): No longer check magic number.  Don't call
1978         update_current_target.
1979         (unpush_target): Don't call update_current_target.
1980         (target_is_pushed): No longer check magic number.
1981         (target_require_runnable): Skip for all stratums over
1982         process_stratum.
1983         (target_ops::info_proc): New.
1984         (target_info_proc): Use find_target_at and
1985         find_default_run_target.
1986         (target_supports_disable_randomization): Use regular delegation.
1987         (target_get_osdata): Use find_target_at.
1988         (target_ops::open, target_ops::close, target_ops::can_attach)
1989         (target_ops::attach, target_ops::can_create_inferior)
1990         (target_ops::create_inferior, target_ops::can_run)
1991         (target_can_run): New.
1992         (default_fileio_target): Use regular delegation.
1993         (target_ops::fileio_open, target_ops::fileio_pwrite)
1994         (target_ops::fileio_pread, target_ops::fileio_fstat)
1995         (target_ops::fileio_close, target_ops::fileio_unlink)
1996         (target_ops::fileio_readlink): New.
1997         (target_fileio_open_1, target_fileio_unlink)
1998         (target_fileio_readlink): Always call the target method.  Handle
1999         FILEIO_ENOSYS.
2000         (return_zero, return_zero_has_execution): Delete.
2001         (init_dummy_target): Delete.
2002         (dummy_target::dummy_target, dummy_target::shortname)
2003         (dummy_target::longname, dummy_target::doc)
2004         (debug_target::debug_target, debug_target::shortname)
2005         (debug_target::longname, debug_target::doc): New.
2006         (target_supports_delete_record): Use regular delegation.
2007         (setup_target_debug): Delete.
2008         (maintenance_print_target_stack): Skip debug_stratum.
2009         (initialize_targets): Instantiate the_dummy_target and
2010         the_debug_target.
2011         * auxv.c (target_auxv_parse): Remove 'ops' parameter.  Adjust to
2012         use target_stack.
2013         (target_auxv_search, fprint_target_auxv): Adjust.
2014         (info_auxv_command): Adjust to use target_stack.
2015         * auxv.h (target_auxv_parse): Remove 'ops' parameter.
2016         * exceptions.c (print_flush): Handle a NULL target_stack.
2017         * regcache.c (target_ops_no_register): Refactor as class with
2018         virtual methods.
2019
2020         * exec.c (exec_target): New class.
2021         (exec_ops): Now an exec_target.
2022         (exec_open, exec_close_1, exec_get_section_table)
2023         (exec_xfer_partial, exec_files_info, exec_has_memory)
2024         (exec_make_note_section): Refactor as exec_target methods.
2025         (exec_file_clear, ignore, exec_remove_breakpoint, init_exec_ops):
2026         Delete.
2027         (exec_target::find_memory_regions): New.
2028         (_initialize_exec): Don't call init_exec_ops.
2029         * gdbcore.h (exec_file_clear): Delete.
2030
2031         * corefile.c (core_target): Delete.
2032         (core_file_command): Adjust.
2033         * corelow.c (core_target): New class.
2034         (the_core_target): New.
2035         (core_close): Remove target_ops parameter.
2036         (core_close_cleanup): Adjust.
2037         (core_target::close): New.
2038         (core_open, core_detach, get_core_registers, core_files_info)
2039         (core_xfer_partial, core_thread_alive, core_read_description)
2040         (core_pid_to_str, core_thread_name, core_has_memory)
2041         (core_has_stack, core_has_registers, core_info_proc): Rework as
2042         core_target methods.
2043         (ignore, core_remove_breakpoint, init_core_ops): Delete.
2044         (_initialize_corelow): Initialize the_core_target.
2045         * gdbcore.h (core_target): Delete.
2046         (the_core_target): New.
2047
2048         * ctf.c: (ctf_target): New class.
2049         (ctf_ops): Now a ctf_target.
2050         (ctf_open, ctf_close, ctf_files_info, ctf_fetch_registers)
2051         (ctf_xfer_partial, ctf_get_trace_state_variable_value)
2052         (ctf_trace_find, ctf_traceframe_info): Refactor as ctf_target
2053         methods.
2054         (init_ctf_ops): Delete.
2055         (_initialize_ctf): Don't call it.
2056         * tracefile-tfile.c (tfile_target): New class.
2057         (tfile_ops): Now a tfile_target.
2058         (tfile_open, tfile_close, tfile_files_info)
2059         (tfile_get_tracepoint_status, tfile_trace_find)
2060         (tfile_fetch_registers, tfile_xfer_partial)
2061         (tfile_get_trace_state_variable_value, tfile_traceframe_info):
2062         Refactor as tfile_target methods.
2063         (tfile_xfer_partial_features): Remove target_ops parameter.
2064         (init_tfile_ops): Delete.
2065         (_initialize_tracefile_tfile): Don't call it.
2066         * tracefile.c (tracefile_has_all_memory, tracefile_has_memory)
2067         (tracefile_has_stack, tracefile_has_registers)
2068         (tracefile_thread_alive, tracefile_get_trace_status): Refactor as
2069         tracefile_target methods.
2070         (init_tracefile_ops): Delete.
2071         (tracefile_target::tracefile_target): New.
2072         * tracefile.h: Include "target.h".
2073         (tracefile_target): New class.
2074         (init_tracefile_ops): Delete.
2075
2076         * spu-multiarch.c (spu_multiarch_target): New class.
2077         (spu_ops): Now a spu_multiarch_target.
2078         (spu_thread_architecture, spu_region_ok_for_hw_watchpoint)
2079         (spu_fetch_registers, spu_store_registers, spu_xfer_partial)
2080         (spu_search_memory, spu_mourn_inferior): Refactor as
2081         spu_multiarch_target methods.
2082         (init_spu_ops): Delete.
2083         (_initialize_spu_multiarch): Remove references to init_spu_ops,
2084         complete_target_initialization.
2085
2086         * ravenscar-thread.c (ravenscar_thread_target): New class.
2087         (ravenscar_ops): Now a ravenscar_thread_target.
2088         (ravenscar_resume, ravenscar_wait, ravenscar_update_thread_list)
2089         (ravenscar_thread_alive, ravenscar_pid_to_str)
2090         (ravenscar_fetch_registers, ravenscar_store_registers)
2091         (ravenscar_prepare_to_store, ravenscar_stopped_by_sw_breakpoint)
2092         (ravenscar_stopped_by_hw_breakpoint)
2093         (ravenscar_stopped_by_watchpoint, ravenscar_stopped_data_address)
2094         (ravenscar_mourn_inferior, ravenscar_core_of_thread)
2095         (ravenscar_get_ada_task_ptid): Refactor as ravenscar_thread_target
2096         methods.
2097         (init_ravenscar_thread_ops): Delete.
2098         (_initialize_ravenscar): Remove references to
2099         init_ravenscar_thread_ops and complete_target_initialization.
2100
2101         * bsd-uthread.c (bsd_uthread_ops_hack): Delete.
2102         (bsd_uthread_target): New class.
2103         (bsd_uthread_ops): Now a bsd_uthread_target.
2104         (bsd_uthread_activate): Adjust to refer to bsd_uthread_ops.
2105         (bsd_uthread_close, bsd_uthread_mourn_inferior)
2106         (bsd_uthread_fetch_registers, bsd_uthread_store_registers)
2107         (bsd_uthread_wait, bsd_uthread_resume, bsd_uthread_thread_alive)
2108         (bsd_uthread_update_thread_list, bsd_uthread_extra_thread_info)
2109         (bsd_uthread_pid_to_str): Refactor as bsd_uthread_target methods.
2110         (bsd_uthread_target): Delete function.
2111         (_initialize_bsd_uthread): Remove reference to
2112         complete_target_initialization.
2113
2114         * bfd-target.c (target_bfd_data): Delete.  Fields folded into ...
2115         (target_bfd): ... this new class.
2116         (target_bfd_xfer_partial, target_bfd_get_section_table)
2117         (target_bfd_close): Refactor as target_bfd methods.
2118         (target_bfd::~target_bfd): New.
2119         (target_bfd_reopen): Adjust.
2120         (target_bfd::close): New.
2121
2122         * record-btrace.c (record_btrace_target): New class.
2123         (record_btrace_ops): Now a record_btrace_target.
2124         (record_btrace_open, record_btrace_stop_recording)
2125         (record_btrace_disconnect, record_btrace_close)
2126         (record_btrace_async, record_btrace_info)
2127         (record_btrace_insn_history, record_btrace_insn_history_range)
2128         (record_btrace_insn_history_from, record_btrace_call_history)
2129         (record_btrace_call_history_range)
2130         (record_btrace_call_history_from, record_btrace_record_method)
2131         (record_btrace_is_replaying, record_btrace_will_replay)
2132         (record_btrace_xfer_partial, record_btrace_insert_breakpoint)
2133         (record_btrace_remove_breakpoint, record_btrace_fetch_registers)
2134         (record_btrace_store_registers, record_btrace_prepare_to_store)
2135         (record_btrace_to_get_unwinder)
2136         (record_btrace_to_get_tailcall_unwinder, record_btrace_resume)
2137         (record_btrace_commit_resume, record_btrace_wait)
2138         (record_btrace_stop, record_btrace_can_execute_reverse)
2139         (record_btrace_stopped_by_sw_breakpoint)
2140         (record_btrace_supports_stopped_by_sw_breakpoint)
2141         (record_btrace_stopped_by_hw_breakpoint)
2142         (record_btrace_supports_stopped_by_hw_breakpoint)
2143         (record_btrace_update_thread_list, record_btrace_thread_alive)
2144         (record_btrace_goto_begin, record_btrace_goto_end)
2145         (record_btrace_goto, record_btrace_stop_replaying_all)
2146         (record_btrace_execution_direction)
2147         (record_btrace_prepare_to_generate_core)
2148         (record_btrace_done_generating_core): Refactor as
2149         record_btrace_target methods.
2150         (init_record_btrace_ops): Delete.
2151         (_initialize_record_btrace): Remove reference to
2152         init_record_btrace_ops.
2153         * record-full.c (RECORD_FULL_IS_REPLAY): Adjust to always refer to
2154         the execution_direction global.
2155         (record_full_base_target, record_full_target)
2156         (record_full_core_target): New classes.
2157         (record_full_ops): Now a record_full_target.
2158         (record_full_core_ops): Now a record_full_core_target.
2159         (record_full_target::detach, record_full_target::disconnect)
2160         (record_full_core_target::disconnect)
2161         (record_full_target::mourn_inferior, record_full_target::kill):
2162         New.
2163         (record_full_open, record_full_close, record_full_async): Refactor
2164         as methods of the record_full_base_target class.
2165         (record_full_resume, record_full_commit_resume): Refactor
2166         as methods of the record_full_target class.
2167         (record_full_wait, record_full_stopped_by_watchpoint)
2168         (record_full_stopped_data_address)
2169         (record_full_stopped_by_sw_breakpoint)
2170         (record_full_supports_stopped_by_sw_breakpoint)
2171         (record_full_stopped_by_hw_breakpoint)
2172         (record_full_supports_stopped_by_hw_breakpoint): Refactor as
2173         methods of the record_full_base_target class.
2174         (record_full_store_registers, record_full_xfer_partial)
2175         (record_full_insert_breakpoint, record_full_remove_breakpoint):
2176         Refactor as methods of the record_full_target class.
2177         (record_full_can_execute_reverse, record_full_get_bookmark)
2178         (record_full_goto_bookmark, record_full_execution_direction)
2179         (record_full_record_method, record_full_info, record_full_delete)
2180         (record_full_is_replaying, record_full_will_replay)
2181         (record_full_goto_begin, record_full_goto_end, record_full_goto)
2182         (record_full_stop_replaying): Refactor as methods of the
2183         record_full_base_target class.
2184         (record_full_core_resume, record_full_core_kill)
2185         (record_full_core_fetch_registers)
2186         (record_full_core_prepare_to_store)
2187         (record_full_core_store_registers, record_full_core_xfer_partial)
2188         (record_full_core_insert_breakpoint)
2189         (record_full_core_remove_breakpoint)
2190         (record_full_core_has_execution): Refactor
2191         as methods of the record_full_core_target class.
2192         (record_full_base_target::supports_delete_record): New.
2193         (init_record_full_ops): Delete.
2194         (init_record_full_core_ops): Delete.
2195         (record_full_save): Refactor as method of the
2196         record_full_base_target class.
2197         (_initialize_record_full): Remove references to
2198         init_record_full_ops and init_record_full_core_ops.
2199
2200         * remote.c (remote_target, extended_remote_target): New classes.
2201         (remote_ops): Now a remote_target.
2202         (extended_remote_ops): Now an extended_remote_target.
2203         (remote_insert_fork_catchpoint, remote_remove_fork_catchpoint)
2204         (remote_insert_vfork_catchpoint, remote_remove_vfork_catchpoint)
2205         (remote_insert_exec_catchpoint, remote_remove_exec_catchpoint)
2206         (remote_pass_signals, remote_set_syscall_catchpoint)
2207         (remote_program_signals, )
2208         (remote_thread_always_alive): Remove target_ops parameter.
2209         (remote_thread_alive, remote_thread_name)
2210         (remote_update_thread_list, remote_threads_extra_info)
2211         (remote_static_tracepoint_marker_at)
2212         (remote_static_tracepoint_markers_by_strid)
2213         (remote_get_ada_task_ptid, remote_close, remote_start_remote)
2214         (remote_open): Refactor as methods of remote_target.
2215         (extended_remote_open, extended_remote_detach)
2216         (extended_remote_attach, extended_remote_post_attach):
2217         (extended_remote_supports_disable_randomization)
2218         (extended_remote_create_inferior): : Refactor as method of
2219         extended_remote_target.
2220         (remote_set_permissions, remote_open_1, remote_detach)
2221         (remote_follow_fork, remote_follow_exec, remote_disconnect)
2222         (remote_resume, remote_commit_resume, remote_stop)
2223         (remote_interrupt, remote_pass_ctrlc, remote_terminal_inferior)
2224         (remote_terminal_ours, remote_wait, remote_fetch_registers)
2225         (remote_prepare_to_store, remote_store_registers)
2226         (remote_flash_erase, remote_flash_done, remote_files_info)
2227         (remote_kill, remote_mourn, remote_insert_breakpoint)
2228         (remote_remove_breakpoint, remote_insert_watchpoint)
2229         (remote_watchpoint_addr_within_range)
2230         (remote_remove_watchpoint, remote_region_ok_for_hw_watchpoint)
2231         (remote_check_watch_resources, remote_stopped_by_sw_breakpoint)
2232         (remote_supports_stopped_by_sw_breakpoint)
2233         (remote_stopped_by_hw_breakpoint)
2234         (remote_supports_stopped_by_hw_breakpoint)
2235         (remote_stopped_by_watchpoint, remote_stopped_data_address)
2236         (remote_insert_hw_breakpoint, remote_remove_hw_breakpoint)
2237         (remote_verify_memory): Refactor as methods of remote_target.
2238         (remote_write_qxfer, remote_read_qxfer): Remove target_ops
2239         parameter.
2240         (remote_xfer_partial, remote_get_memory_xfer_limit)
2241         (remote_search_memory, remote_rcmd, remote_memory_map)
2242         (remote_pid_to_str, remote_get_thread_local_address)
2243         (remote_get_tib_address, remote_read_description): Refactor as
2244         methods of remote_target.
2245         (remote_target::fileio_open, remote_target::fileio_pwrite)
2246         (remote_target::fileio_pread, remote_target::fileio_close): New.
2247         (remote_hostio_readlink, remote_hostio_fstat)
2248         (remote_filesystem_is_local, remote_can_execute_reverse)
2249         (remote_supports_non_stop, remote_supports_disable_randomization)
2250         (remote_supports_multi_process, remote_supports_cond_breakpoints)
2251         (remote_supports_enable_disable_tracepoint)
2252         (remote_supports_string_tracing)
2253         (remote_can_run_breakpoint_commands, remote_trace_init)
2254         (remote_download_tracepoint, remote_can_download_tracepoint)
2255         (remote_download_trace_state_variable, remote_enable_tracepoint)
2256         (remote_disable_tracepoint, remote_trace_set_readonly_regions)
2257         (remote_trace_start, remote_get_trace_status)
2258         (remote_get_tracepoint_status, remote_trace_stop)
2259         (remote_trace_find, remote_get_trace_state_variable_value)
2260         (remote_save_trace_data, remote_get_raw_trace_data)
2261         (remote_set_disconnected_tracing, remote_core_of_thread)
2262         (remote_set_circular_trace_buffer, remote_traceframe_info)
2263         (remote_get_min_fast_tracepoint_insn_len)
2264         (remote_set_trace_buffer_size, remote_set_trace_notes)
2265         (remote_use_agent, remote_can_use_agent, remote_enable_btrace)
2266         (remote_disable_btrace, remote_teardown_btrace)
2267         (remote_read_btrace, remote_btrace_conf)
2268         (remote_augmented_libraries_svr4_read, remote_load)
2269         (remote_pid_to_exec_file, remote_can_do_single_step)
2270         (remote_execution_direction, remote_thread_handle_to_thread_info):
2271         Refactor as methods of remote_target.
2272         (init_remote_ops, init_extended_remote_ops): Delete.
2273         (remote_can_async_p, remote_is_async_p, remote_async)
2274         (remote_thread_events, remote_upload_tracepoints)
2275         (remote_upload_trace_state_variables): Refactor as methods of
2276         remote_target.
2277         (_initialize_remote): Remove references to init_remote_ops and
2278         init_extended_remote_ops.
2279
2280         * remote-sim.c (gdbsim_target): New class.
2281         (gdbsim_fetch_register, gdbsim_store_register, gdbsim_kill)
2282         (gdbsim_load, gdbsim_create_inferior, gdbsim_open, gdbsim_close)
2283         (gdbsim_detach, gdbsim_resume, gdbsim_interrupt)
2284         (gdbsim_wait, gdbsim_prepare_to_store, gdbsim_xfer_partial)
2285         (gdbsim_files_info, gdbsim_mourn_inferior, gdbsim_thread_alive)
2286         (gdbsim_pid_to_str, gdbsim_has_all_memory, gdbsim_has_memory):
2287         Refactor as methods of gdbsim_target.
2288         (gdbsim_ops): Now a gdbsim_target.
2289         (init_gdbsim_ops): Delete.
2290         (gdbsim_cntrl_c): Adjust.
2291         (_initialize_remote_sim): Remove reference to init_gdbsim_ops.
2292
2293         * amd64-linux-nat.c (amd64_linux_nat_target): New class.
2294         (the_amd64_linux_nat_target): New.
2295         (amd64_linux_fetch_inferior_registers)
2296         (amd64_linux_store_inferior_registers): Refactor as methods of
2297         amd64_linux_nat_target.
2298         (_initialize_amd64_linux_nat): Adjust.  Set linux_target.
2299         * i386-linux-nat.c: Don't include "linux-nat.h".
2300         (i386_linux_nat_target): New class.
2301         (the_i386_linux_nat_target): New.
2302         (i386_linux_fetch_inferior_registers)
2303         (i386_linux_store_inferior_registers, i386_linux_resume): Refactor
2304         as methods of i386_linux_nat_target.
2305         (_initialize_i386_linux_nat): Adjust.  Set linux_target.
2306         * inf-child.c (inf_child_ops): Delete.
2307         (inf_child_fetch_inferior_registers)
2308         (inf_child_store_inferior_registers): Delete.
2309         (inf_child_post_attach, inf_child_prepare_to_store): Refactor as
2310         methods of inf_child_target.
2311         (inf_child_target::supports_terminal_ours)
2312         (inf_child_target::terminal_init)
2313         (inf_child_target::terminal_inferior)
2314         (inf_child_target::terminal_ours_for_output)
2315         (inf_child_target::terminal_ours, inf_child_target::interrupt)
2316         (inf_child_target::pass_ctrlc, inf_child_target::terminal_info):
2317         New.
2318         (inf_child_open, inf_child_disconnect, inf_child_close)
2319         (inf_child_mourn_inferior, inf_child_maybe_unpush_target)
2320         (inf_child_post_startup_inferior, inf_child_can_run)
2321         (inf_child_pid_to_exec_file): Refactor as methods of
2322         inf_child_target.
2323         (inf_child_follow_fork): Delete.
2324         (inf_child_target::can_create_inferior)
2325         (inf_child_target::can_attach): New.
2326         (inf_child_target::has_all_memory, inf_child_target::has_memory)
2327         (inf_child_target::has_stack, inf_child_target::has_registers)
2328         (inf_child_target::has_execution): New.
2329         (inf_child_fileio_open, inf_child_fileio_pwrite)
2330         (inf_child_fileio_pread, inf_child_fileio_fstat)
2331         (inf_child_fileio_close, inf_child_fileio_unlink)
2332         (inf_child_fileio_readlink, inf_child_use_agent)
2333         (inf_child_can_use_agent): Refactor as methods of
2334         inf_child_target.
2335         (return_zero, inf_child_target): Delete.
2336         (inf_child_target::inf_child_target): New.
2337         * inf-child.h: Include "target.h".
2338         (inf_child_target): Delete function prototype.
2339         (inf_child_target): New class.
2340         (inf_child_open_target, inf_child_mourn_inferior)
2341         (inf_child_maybe_unpush_target): Delete.
2342         * inf-ptrace.c (inf_ptrace_target::~inf_ptrace_target): New.
2343         (inf_ptrace_follow_fork, inf_ptrace_insert_fork_catchpoint)
2344         (inf_ptrace_remove_fork_catchpoint, inf_ptrace_create_inferior)
2345         (inf_ptrace_post_startup_inferior, inf_ptrace_mourn_inferior)
2346         (inf_ptrace_attach, inf_ptrace_post_attach, inf_ptrace_detach)
2347         (inf_ptrace_detach_success, inf_ptrace_kill, inf_ptrace_resume)
2348         (inf_ptrace_wait, inf_ptrace_xfer_partial)
2349         (inf_ptrace_thread_alive, inf_ptrace_files_info)
2350         (inf_ptrace_pid_to_str, inf_ptrace_auxv_parse): Refactor as
2351         methods of inf_ptrace_target.
2352         (inf_ptrace_target): Delete function.
2353         * inf-ptrace.h: Include "inf-child.h".
2354         (inf_ptrace_target): Delete function declaration.
2355         (inf_ptrace_target): New class.
2356         (inf_ptrace_trad_target, inf_ptrace_detach_success): Delete.
2357         * linux-nat.c (linux_target): New.
2358         (linux_ops, linux_ops_saved, super_xfer_partial): Delete.
2359         (linux_nat_target::~linux_nat_target): New.
2360         (linux_child_post_attach, linux_child_post_startup_inferior)
2361         (linux_child_follow_fork, linux_child_insert_fork_catchpoint)
2362         (linux_child_remove_fork_catchpoint)
2363         (linux_child_insert_vfork_catchpoint)
2364         (linux_child_remove_vfork_catchpoint)
2365         (linux_child_insert_exec_catchpoint)
2366         (linux_child_remove_exec_catchpoint)
2367         (linux_child_set_syscall_catchpoint, linux_nat_pass_signals)
2368         (linux_nat_create_inferior, linux_nat_attach, linux_nat_detach)
2369         (linux_nat_resume, linux_nat_stopped_by_watchpoint)
2370         (linux_nat_stopped_data_address)
2371         (linux_nat_stopped_by_sw_breakpoint)
2372         (linux_nat_supports_stopped_by_sw_breakpoint)
2373         (linux_nat_stopped_by_hw_breakpoint)
2374         (linux_nat_supports_stopped_by_hw_breakpoint, linux_nat_wait)
2375         (linux_nat_kill, linux_nat_mourn_inferior)
2376         (linux_nat_xfer_partial, linux_nat_thread_alive)
2377         (linux_nat_update_thread_list, linux_nat_pid_to_str)
2378         (linux_nat_thread_name, linux_child_pid_to_exec_file)
2379         (linux_child_static_tracepoint_markers_by_strid)
2380         (linux_nat_is_async_p, linux_nat_can_async_p)
2381         (linux_nat_supports_non_stop, linux_nat_always_non_stop_p)
2382         (linux_nat_supports_multi_process)
2383         (linux_nat_supports_disable_randomization, linux_nat_async)
2384         (linux_nat_stop, linux_nat_close, linux_nat_thread_address_space)
2385         (linux_nat_core_of_thread, linux_nat_filesystem_is_local)
2386         (linux_nat_fileio_open, linux_nat_fileio_readlink)
2387         (linux_nat_fileio_unlink, linux_nat_thread_events): Refactor as
2388         methods of linux_nat_target.
2389         (linux_nat_wait_1, linux_xfer_siginfo, linux_proc_xfer_partial)
2390         (linux_proc_xfer_spu, linux_nat_xfer_osdata): Remove target_ops
2391         parameter.
2392         (check_stopped_by_watchpoint): Adjust.
2393         (linux_xfer_partial): Delete.
2394         (linux_target_install_ops, linux_target, linux_nat_add_target):
2395         Delete.
2396         (linux_nat_target::linux_nat_target): New.
2397         * linux-nat.h: Include "inf-ptrace.h".
2398         (linux_nat_target): New.
2399         (linux_target, linux_target_install_ops, linux_nat_add_target):
2400         Delete function declarations.
2401         (linux_target): Declare global.
2402         * linux-thread-db.c (thread_db_target): New.
2403         (thread_db_target::thread_db_target): New.
2404         (thread_db_ops): Delete.
2405         (the_thread_db_target): New.
2406         (thread_db_detach, thread_db_wait, thread_db_mourn_inferior)
2407         (thread_db_update_thread_list, thread_db_pid_to_str)
2408         (thread_db_extra_thread_info)
2409         (thread_db_thread_handle_to_thread_info)
2410         (thread_db_get_thread_local_address, thread_db_get_ada_task_ptid)
2411         (thread_db_resume): Refactor as methods of thread_db_target.
2412         (init_thread_db_ops): Delete.
2413         (_initialize_thread_db): Remove reference to init_thread_db_ops.
2414         * x86-linux-nat.c: Don't include "linux-nat.h".
2415         (super_post_startup_inferior): Delete.
2416         (x86_linux_nat_target::~x86_linux_nat_target): New.
2417         (x86_linux_child_post_startup_inferior)
2418         (x86_linux_read_description, x86_linux_enable_btrace)
2419         (x86_linux_disable_btrace, x86_linux_teardown_btrace)
2420         (x86_linux_read_btrace, x86_linux_btrace_conf): Refactor as
2421         methods of x86_linux_nat_target.
2422         (x86_linux_create_target): Delete.  Bits folded ...
2423         (x86_linux_add_target): ... here.  Now takes a linux_nat_target
2424         pointer.
2425         * x86-linux-nat.h: Include "linux-nat.h" and "x86-nat.h".
2426         (x86_linux_nat_target): New class.
2427         (x86_linux_create_target): Delete.
2428         (x86_linux_add_target): Now takes a linux_nat_target pointer.
2429         * x86-nat.c (x86_insert_watchpoint, x86_remove_watchpoint)
2430         (x86_region_ok_for_watchpoint, x86_stopped_data_address)
2431         (x86_stopped_by_watchpoint, x86_insert_hw_breakpoint)
2432         (x86_remove_hw_breakpoint, x86_can_use_hw_breakpoint)
2433         (x86_stopped_by_hw_breakpoint): Remove target_ops parameter and
2434         make extern.
2435         (x86_use_watchpoints): Delete.
2436         * x86-nat.h: Include "breakpoint.h" and "target.h".
2437         (x86_use_watchpoints): Delete.
2438         (x86_can_use_hw_breakpoint, x86_region_ok_for_hw_watchpoint)
2439         (x86_stopped_by_watchpoint, x86_stopped_data_address)
2440         (x86_insert_watchpoint, x86_remove_watchpoint)
2441         (x86_insert_hw_breakpoint, x86_remove_hw_breakpoint)
2442         (x86_stopped_by_hw_breakpoint): New declarations.
2443         (x86_nat_target): New template class.
2444
2445         * ppc-linux-nat.c (ppc_linux_nat_target): New class.
2446         (the_ppc_linux_nat_target): New.
2447         (ppc_linux_fetch_inferior_registers)
2448         (ppc_linux_can_use_hw_breakpoint)
2449         (ppc_linux_region_ok_for_hw_watchpoint)
2450         (ppc_linux_ranged_break_num_registers)
2451         (ppc_linux_insert_hw_breakpoint, ppc_linux_remove_hw_breakpoint)
2452         (ppc_linux_insert_mask_watchpoint)
2453         (ppc_linux_remove_mask_watchpoint)
2454         (ppc_linux_can_accel_watchpoint_condition)
2455         (ppc_linux_insert_watchpoint, ppc_linux_remove_watchpoint)
2456         (ppc_linux_stopped_data_address, ppc_linux_stopped_by_watchpoint)
2457         (ppc_linux_watchpoint_addr_within_range)
2458         (ppc_linux_masked_watch_num_registers)
2459         (ppc_linux_store_inferior_registers, ppc_linux_auxv_parse)
2460         (ppc_linux_read_description): Refactor as methods of
2461         ppc_linux_nat_target.
2462         (_initialize_ppc_linux_nat): Adjust.  Set linux_target.
2463
2464         * procfs.c (procfs_xfer_partial): Delete forward declaration.
2465         (procfs_target): New class.
2466         (the_procfs_target): New.
2467         (procfs_target): Delete function.
2468         (procfs_auxv_parse, procfs_attach, procfs_detach)
2469         (procfs_fetch_registers, procfs_store_registers, procfs_wait)
2470         (procfs_xfer_partial, procfs_resume, procfs_pass_signals)
2471         (procfs_files_info, procfs_kill_inferior, procfs_mourn_inferior)
2472         (procfs_create_inferior, procfs_update_thread_list)
2473         (procfs_thread_alive, procfs_pid_to_str)
2474         (procfs_can_use_hw_breakpoint, procfs_stopped_by_watchpoint)
2475         (procfs_stopped_data_address, procfs_insert_watchpoint)
2476         (procfs_remove_watchpoint, procfs_region_ok_for_hw_watchpoint)
2477         (proc_find_memory_regions, procfs_info_proc)
2478         (procfs_make_note_section): Refactor as methods of procfs_target.
2479         (_initialize_procfs): Adjust.
2480         * sol-thread.c (sol_thread_target): New class.
2481         (sol_thread_ops): Now a sol_thread_target.
2482         (sol_thread_detach, sol_thread_resume, sol_thread_wait)
2483         (sol_thread_fetch_registers, sol_thread_store_registers)
2484         (sol_thread_xfer_partial, sol_thread_mourn_inferior)
2485         (sol_thread_alive, solaris_pid_to_str, sol_update_thread_list)
2486         (sol_get_ada_task_ptid): Refactor as methods of sol_thread_target.
2487         (init_sol_thread_ops): Delete.
2488         (_initialize_sol_thread): Adjust.  Remove references to
2489         init_sol_thread_ops and complete_target_initialization.
2490
2491         * windows-nat.c (windows_nat_target): New class.
2492         (windows_fetch_inferior_registers)
2493         (windows_store_inferior_registers, windows_resume, windows_wait)
2494         (windows_attach, windows_detach, windows_pid_to_exec_file)
2495         (windows_files_info, windows_create_inferior)
2496         (windows_mourn_inferior, windows_interrupt, windows_kill_inferior)
2497         (windows_close, windows_pid_to_str, windows_xfer_partial)
2498         (windows_get_tib_address, windows_get_ada_task_ptid)
2499         (windows_thread_name, windows_thread_alive): Refactor as
2500         windows_nat_target methods.
2501         (do_initial_windows_stuff): Adjust.
2502         (windows_target): Delete function.
2503         (_initialize_windows_nat): Adjust.
2504
2505         * darwin-nat.c (darwin_resume, darwin_wait_to, darwin_interrupt)
2506         (darwin_mourn_inferior, darwin_kill_inferior)
2507         (darwin_create_inferior, darwin_attach, darwin_detach)
2508         (darwin_pid_to_str, darwin_thread_alive, darwin_xfer_partial)
2509         (darwin_pid_to_exec_file, darwin_get_ada_task_ptid)
2510         (darwin_supports_multi_process): Refactor as darwin_nat_target
2511         methods.
2512         (darwin_resume_to, darwin_files_info): Delete.
2513         (_initialize_darwin_inferior): Rename to ...
2514         (_initialize_darwin_nat): ... this.  Adjust to C++ification.
2515         * darwin-nat.h: Include "inf-child.h".
2516         (darwin_nat_target): New class.
2517         (darwin_complete_target): Delete.
2518         * i386-darwin-nat.c (i386_darwin_nat_target): New class.
2519         (darwin_target): New.
2520         (i386_darwin_fetch_inferior_registers)
2521         (i386_darwin_store_inferior_registers): Refactor as methods of
2522         darwin_nat_target.
2523         (darwin_complete_target): Delete, with ...
2524         (_initialize_i386_darwin_nat): ... bits factored out here.
2525
2526         * alpha-linux-nat.c (alpha_linux_nat_target): New class.
2527         (the_alpha_linux_nat_target): New.
2528         (alpha_linux_register_u_offset): Refactor as
2529         alpha_linux_nat_target method.
2530         (_initialize_alpha_linux_nat): Adjust.
2531         * linux-nat-trad.c (inf_ptrace_register_u_offset): Delete.
2532         (inf_ptrace_fetch_register, inf_ptrace_fetch_registers)
2533         (inf_ptrace_store_register, inf_ptrace_store_registers): Refact as
2534         methods of linux_nat_trad_target.
2535         (linux_trad_target): Delete.
2536         * linux-nat-trad.h (linux_trad_target): Delete function.
2537         (linux_nat_trad_target): New class.
2538         * mips-linux-nat.c (mips_linux_nat_target): New class.
2539         (super_fetch_registers, super_store_registers, super_close):
2540         Delete.
2541         (the_mips_linux_nat_target): New.
2542         (mips64_linux_regsets_fetch_registers)
2543         (mips64_linux_regsets_store_registers)
2544         (mips64_linux_fetch_registers, mips64_linux_store_registers)
2545         (mips_linux_register_u_offset, mips_linux_read_description)
2546         (mips_linux_can_use_hw_breakpoint)
2547         (mips_linux_stopped_by_watchpoint)
2548         (mips_linux_stopped_data_address)
2549         (mips_linux_region_ok_for_hw_watchpoint)
2550         (mips_linux_insert_watchpoint, mips_linux_remove_watchpoint)
2551         (mips_linux_close): Refactor as methods of mips_linux_nat.
2552         (_initialize_mips_linux_nat): Adjust to C++ification.
2553
2554         * aix-thread.c (aix_thread_target): New class.
2555         (aix_thread_ops): Now an aix_thread_target.
2556         (aix_thread_detach, aix_thread_resume, aix_thread_wait)
2557         (aix_thread_fetch_registers, aix_thread_store_registers)
2558         (aix_thread_xfer_partial, aix_thread_mourn_inferior)
2559         (aix_thread_thread_alive, aix_thread_pid_to_str)
2560         (aix_thread_extra_thread_info, aix_thread_get_ada_task_ptid):
2561         Refactor as methods of aix_thread_target.
2562         (init_aix_thread_ops): Delete.
2563         (_initialize_aix_thread): Remove references to init_aix_thread_ops
2564         and complete_target_initialization.
2565         * rs6000-nat.c (rs6000_xfer_shared_libraries): Delete.
2566         (rs6000_nat_target): New class.
2567         (the_rs6000_nat_target): New.
2568         (rs6000_fetch_inferior_registers, rs6000_store_inferior_registers)
2569         (rs6000_xfer_partial, rs6000_wait, rs6000_create_inferior)
2570         (rs6000_xfer_shared_libraries): Refactor as rs6000_nat_target methods.
2571         (super_create_inferior): Delete.
2572         (_initialize_rs6000_nat): Adjust to C++ification.
2573
2574         * arm-linux-nat.c (arm_linux_nat_target): New class.
2575         (the_arm_linux_nat_target): New.
2576         (arm_linux_fetch_inferior_registers)
2577         (arm_linux_store_inferior_registers, arm_linux_read_description)
2578         (arm_linux_can_use_hw_breakpoint, arm_linux_insert_hw_breakpoint)
2579         (arm_linux_remove_hw_breakpoint)
2580         (arm_linux_region_ok_for_hw_watchpoint)
2581         (arm_linux_insert_watchpoint, arm_linux_remove_watchpoint)
2582         (arm_linux_stopped_data_address, arm_linux_stopped_by_watchpoint)
2583         (arm_linux_watchpoint_addr_within_range): Refactor as methods of
2584         arm_linux_nat_target.
2585         (_initialize_arm_linux_nat): Adjust to C++ification.
2586
2587         * aarch64-linux-nat.c (aarch64_linux_nat_target): New class.
2588         (the_aarch64_linux_nat_target): New.
2589         (aarch64_linux_fetch_inferior_registers)
2590         (aarch64_linux_store_inferior_registers)
2591         (aarch64_linux_child_post_startup_inferior)
2592         (aarch64_linux_read_description)
2593         (aarch64_linux_can_use_hw_breakpoint)
2594         (aarch64_linux_insert_hw_breakpoint)
2595         (aarch64_linux_remove_hw_breakpoint)
2596         (aarch64_linux_insert_watchpoint, aarch64_linux_remove_watchpoint)
2597         (aarch64_linux_region_ok_for_hw_watchpoint)
2598         (aarch64_linux_stopped_data_address)
2599         (aarch64_linux_stopped_by_watchpoint)
2600         (aarch64_linux_watchpoint_addr_within_range)
2601         (aarch64_linux_can_do_single_step): Refactor as methods of
2602         aarch64_linux_nat_target.
2603         (super_post_startup_inferior): Delete.
2604         (_initialize_aarch64_linux_nat): Adjust to C++ification.
2605
2606         * hppa-linux-nat.c (hppa_linux_nat_target): New class.
2607         (the_hppa_linux_nat_target): New.
2608         (hppa_linux_fetch_inferior_registers)
2609         (hppa_linux_store_inferior_registers): Refactor as methods of
2610         hppa_linux_nat_target.
2611         (_initialize_hppa_linux_nat): Adjust to C++ification.
2612
2613         * ia64-linux-nat.c (ia64_linux_nat_target): New class.
2614         (the_ia64_linux_nat_target): New.
2615         (ia64_linux_insert_watchpoint, ia64_linux_remove_watchpoint)
2616         (ia64_linux_stopped_data_address)
2617         (ia64_linux_stopped_by_watchpoint, ia64_linux_fetch_registers)
2618         (ia64_linux_store_registers, ia64_linux_xfer_partial): Refactor as
2619         ia64_linux_nat_target methods.
2620         (super_xfer_partial): Delete.
2621         (_initialize_ia64_linux_nat): Adjust to C++ification.
2622
2623         * m32r-linux-nat.c (m32r_linux_nat_target): New class.
2624         (the_m32r_linux_nat_target): New.
2625         (m32r_linux_fetch_inferior_registers)
2626         (m32r_linux_store_inferior_registers): Refactor as
2627         m32r_linux_nat_target methods.
2628         (_initialize_m32r_linux_nat): Adjust to C++ification.
2629
2630         * m68k-linux-nat.c (m68k_linux_nat_target): New class.
2631         (the_m68k_linux_nat_target): New.
2632         (m68k_linux_fetch_inferior_registers)
2633         (m68k_linux_store_inferior_registers): Refactor as
2634         m68k_linux_nat_target methods.
2635         (_initialize_m68k_linux_nat): Adjust to C++ification.
2636
2637         * s390-linux-nat.c (s390_linux_nat_target): New class.
2638         (the_s390_linux_nat_target): New.
2639         (s390_linux_fetch_inferior_registers)
2640         (s390_linux_store_inferior_registers, s390_stopped_by_watchpoint)
2641         (s390_insert_watchpoint, s390_remove_watchpoint)
2642         (s390_can_use_hw_breakpoint, s390_insert_hw_breakpoint)
2643         (s390_remove_hw_breakpoint, s390_region_ok_for_hw_watchpoint)
2644         (s390_auxv_parse, s390_read_description): Refactor as methods of
2645         s390_linux_nat_target.
2646         (_initialize_s390_nat): Adjust to C++ification.
2647
2648         * sparc-linux-nat.c (sparc_linux_nat_target): New class.
2649         (the_sparc_linux_nat_target): New.
2650         (_initialize_sparc_linux_nat): Adjust to C++ification.
2651         * sparc-nat.c (sparc_fetch_inferior_registers)
2652         (sparc_store_inferior_registers): Remove target_ops parameter.
2653         * sparc-nat.h (sparc_fetch_inferior_registers)
2654         (sparc_store_inferior_registers): Remove target_ops parameter.
2655         * sparc64-linux-nat.c (sparc64_linux_nat_target): New class.
2656         (the_sparc64_linux_nat_target): New.
2657         (_initialize_sparc64_linux_nat): Adjust to C++ification.
2658
2659         * spu-linux-nat.c (spu_linux_nat_target): New class.
2660         (the_spu_linux_nat_target): New.
2661         (spu_child_post_startup_inferior, spu_child_post_attach)
2662         (spu_child_wait, spu_fetch_inferior_registers)
2663         (spu_store_inferior_registers, spu_xfer_partial)
2664         (spu_can_use_hw_breakpoint): Refactor as spu_linux_nat_target
2665         methods.
2666         (_initialize_spu_nat): Adjust to C++ification.
2667
2668         * tilegx-linux-nat.c (tilegx_linux_nat_target): New class.
2669         (the_tilegx_linux_nat_target): New.
2670         (fetch_inferior_registers, store_inferior_registers):
2671         Refactor as methods.
2672         (_initialize_tile_linux_nat): Adjust to C++ification.
2673
2674         * xtensa-linux-nat.c (xtensa_linux_nat_target): New class.
2675         (the_xtensa_linux_nat_target): New.
2676         (xtensa_linux_fetch_inferior_registers)
2677         (xtensa_linux_store_inferior_registers): Refactor as
2678         xtensa_linux_nat_target methods.
2679         (_initialize_xtensa_linux_nat): Adjust to C++ification.
2680
2681         * fbsd-nat.c (USE_SIGTRAP_SIGINFO): Delete.
2682         (fbsd_pid_to_exec_file, fbsd_find_memory_regions)
2683         (fbsd_find_memory_regions, fbsd_info_proc, fbsd_xfer_partial)
2684         (fbsd_thread_alive, fbsd_pid_to_str, fbsd_thread_name)
2685         (fbsd_update_thread_list, fbsd_resume, fbsd_wait)
2686         (fbsd_stopped_by_sw_breakpoint)
2687         (fbsd_supports_stopped_by_sw_breakpoint, fbsd_follow_fork)
2688         (fbsd_insert_fork_catchpoint, fbsd_remove_fork_catchpoint)
2689         (fbsd_insert_vfork_catchpoint, fbsd_remove_vfork_catchpoint)
2690         (fbsd_post_startup_inferior, fbsd_post_attach)
2691         (fbsd_insert_exec_catchpoint, fbsd_remove_exec_catchpoint)
2692         (fbsd_set_syscall_catchpoint)
2693         (super_xfer_partial, super_resume, super_wait)
2694         (fbsd_supports_stopped_by_hw_breakpoint): Delete.
2695         (fbsd_handle_debug_trap): Remove target_ops parameter.
2696         (fbsd_nat_add_target): Delete.
2697         * fbsd-nat.h: Include "inf-ptrace.h".
2698         (fbsd_nat_add_target): Delete.
2699         (USE_SIGTRAP_SIGINFO): Define.
2700         (fbsd_nat_target): New class.
2701
2702         * amd64-bsd-nat.c (amd64bsd_fetch_inferior_registers)
2703         (amd64bsd_store_inferior_registers): Remove target_ops parameter.
2704         (amd64bsd_target): Delete.
2705         * amd64-bsd-nat.h: New file.
2706         * amd64-fbsd-nat.c: Include "amd64-bsd-nat.h" instead of
2707         "x86-bsd-nat.h".
2708         (amd64_fbsd_nat_target): New class.
2709         (the_amd64_fbsd_nat_target): New.
2710         (amd64fbsd_read_description): Refactor as method of
2711         amd64_fbsd_nat_target.
2712         (amd64_fbsd_nat_target::supports_stopped_by_hw_breakpoint): New.
2713         (_initialize_amd64fbsd_nat): Adjust to C++ification.
2714         * amd64-nat.h (amd64bsd_target): Delete function declaration.
2715         * i386-bsd-nat.c (i386bsd_fetch_inferior_registers)
2716         (i386bsd_store_inferior_registers): Remove target_ops parameter.
2717         (i386bsd_target): Delete.
2718         * i386-bsd-nat.h (i386bsd_target): Delete function declaration.
2719         (i386bsd_fetch_inferior_registers)
2720         (i386bsd_store_inferior_registers): Declare.
2721         (i386_bsd_nat_target): New class.
2722         * i386-fbsd-nat.c (i386_fbsd_nat_target): New class.
2723         (the_i386_fbsd_nat_target): New.
2724         (i386fbsd_resume, i386fbsd_read_description): Refactor as
2725         i386_fbsd_nat_target methods.
2726         (i386_fbsd_nat_target::supports_stopped_by_hw_breakpoint): New.
2727         (_initialize_i386fbsd_nat): Adjust to C++ification.
2728         * x86-bsd-nat.c (super_mourn_inferior): Delete.
2729         (x86bsd_mourn_inferior, x86bsd_target): Delete.
2730         (_initialize_x86_bsd_nat): Adjust to C++ification.
2731         * x86-bsd-nat.h: Include "x86-nat.h".
2732         (x86bsd_target): Delete declaration.
2733         (x86bsd_nat_target): New class.
2734
2735         * aarch64-fbsd-nat.c (aarch64_fbsd_nat_target): New class.
2736         (the_aarch64_fbsd_nat_target): New.
2737         (aarch64_fbsd_fetch_inferior_registers)
2738         (aarch64_fbsd_store_inferior_registers): Refactor as methods of
2739         aarch64_fbsd_nat_target.
2740         (_initialize_aarch64_fbsd_nat): Adjust to C++ification.
2741         * alpha-bsd-nat.c (alpha_bsd_nat_target): New class.
2742         (the_alpha_bsd_nat_target): New.
2743         (alphabsd_fetch_inferior_registers)
2744         (alphabsd_store_inferior_registers): Refactor as
2745         alpha_bsd_nat_target methods.
2746         (_initialize_alphabsd_nat): Refactor as methods of
2747         alpha_bsd_nat_target.
2748         * amd64-nbsd-nat.c: Include "amd64-bsd-nat.h".
2749         (the_amd64_nbsd_nat_target): New.
2750         (_initialize_amd64nbsd_nat): Adjust to C++ification.
2751         * amd64-obsd-nat.c: Include "amd64-bsd-nat.h".
2752         (the_amd64_obsd_nat_target): New.
2753         (_initialize_amd64obsd_nat): Adjust to C++ification.
2754         * arm-fbsd-nat.c (arm_fbsd_nat_target): New.
2755         (the_arm_fbsd_nat_target): New.
2756         (arm_fbsd_fetch_inferior_registers)
2757         (arm_fbsd_store_inferior_registers, arm_fbsd_read_description):
2758         (_initialize_arm_fbsd_nat): Refactor as methods of
2759         arm_fbsd_nat_target.
2760         (_initialize_arm_fbsd_nat): Adjust to C++ification.
2761         * arm-nbsd-nat.c (arm_netbsd_nat_target): New class.
2762         (the_arm_netbsd_nat_target): New.
2763         (armnbsd_fetch_registers, armnbsd_store_registers): Refactor as
2764         arm_netbsd_nat_target.
2765         (_initialize_arm_netbsd_nat): Adjust to C++ification.
2766         * hppa-nbsd-nat.c (hppa_nbsd_nat_target): New class.
2767         (the_hppa_nbsd_nat_target): New.
2768         (hppanbsd_fetch_registers, hppanbsd_store_registers): Refactor as
2769         hppa_nbsd_nat_target methods.
2770         (_initialize_hppanbsd_nat): Adjust to C++ification.
2771         * hppa-obsd-nat.c (hppa_obsd_nat_target): New class.
2772         (the_hppa_obsd_nat_target): New.
2773         (hppaobsd_fetch_registers, hppaobsd_store_registers): Refactor as
2774         methods of hppa_obsd_nat_target.
2775         (_initialize_hppaobsd_nat): Adjust to C++ification.  Use
2776         add_target.
2777         * i386-nbsd-nat.c (the_i386_nbsd_nat_target): New.
2778         (_initialize_i386nbsd_nat): Adjust to C++ification.  Use
2779         add_target.
2780         * i386-obsd-nat.c (the_i386_obsd_nat_target): New.
2781         (_initialize_i386obsd_nat): Use add_target.
2782         * m68k-bsd-nat.c (m68k_bsd_nat_target): New class.
2783         (the_m68k_bsd_nat_target): New.
2784         (m68kbsd_fetch_inferior_registers)
2785         (m68kbsd_store_inferior_registers): Refactor as methods of
2786         m68k_bsd_nat_target.
2787         (_initialize_m68kbsd_nat): Adjust to C++ification.
2788         * mips-fbsd-nat.c (mips_fbsd_nat_target): New class.
2789         (the_mips_fbsd_nat_target): New.
2790         (mips_fbsd_fetch_inferior_registers)
2791         (mips_fbsd_store_inferior_registers): Refactor as methods of
2792         mips_fbsd_nat_target.
2793         (_initialize_mips_fbsd_nat): Adjust to C++ification.  Use
2794         add_target.
2795         * mips-nbsd-nat.c (mips_nbsd_nat_target): New class.
2796         (the_mips_nbsd_nat_target): New.
2797         (mipsnbsd_fetch_inferior_registers)
2798         (mipsnbsd_store_inferior_registers): Refactor as methods of
2799         mips_nbsd_nat_target.
2800         (_initialize_mipsnbsd_nat): Adjust to C++ification.
2801         * mips64-obsd-nat.c (mips64_obsd_nat_target): New class.
2802         (the_mips64_obsd_nat_target): New.
2803         (mips64obsd_fetch_inferior_registers)
2804         (mips64obsd_store_inferior_registers): Refactor as methods of
2805         mips64_obsd_nat_target.
2806         (_initialize_mips64obsd_nat): Adjust to C++ification.  Use
2807         add_target.
2808         * nbsd-nat.c (nbsd_pid_to_exec_file): Refactor as method of
2809         nbsd_nat_target.
2810         * nbsd-nat.h: Include "inf-ptrace.h".
2811         (nbsd_nat_target): New class.
2812         * obsd-nat.c (obsd_pid_to_str, obsd_update_thread_list)
2813         (obsd_wait): Refactor as methods of obsd_nat_target.
2814         (obsd_add_target): Delete.
2815         * obsd-nat.h: Include "inf-ptrace.h".
2816         (obsd_nat_target): New class.
2817         * ppc-fbsd-nat.c (ppc_fbsd_nat_target): New class.
2818         (the_ppc_fbsd_nat_target): New.
2819         (ppcfbsd_fetch_inferior_registers)
2820         (ppcfbsd_store_inferior_registers): Refactor as methods of
2821         ppc_fbsd_nat_target.
2822         (_initialize_ppcfbsd_nat): Adjust to C++ification.  Use
2823         add_target.
2824         * ppc-nbsd-nat.c (ppc_nbsd_nat_target): New class.
2825         (the_ppc_nbsd_nat_target): New.
2826         (ppcnbsd_fetch_inferior_registers)
2827         (ppcnbsd_store_inferior_registers): Refactor as methods of
2828         ppc_nbsd_nat_target.
2829         (_initialize_ppcnbsd_nat): Adjust to C++ification.
2830         * ppc-obsd-nat.c (ppc_obsd_nat_target): New class.
2831         (the_ppc_obsd_nat_target): New.
2832         (ppcobsd_fetch_registers, ppcobsd_store_registers): Refactor as
2833         methods of ppc_obsd_nat_target.
2834         (_initialize_ppcobsd_nat): Adjust to C++ification.  Use
2835         add_target.
2836         * sh-nbsd-nat.c (sh_nbsd_nat_target): New class.
2837         (the_sh_nbsd_nat_target): New.
2838         (shnbsd_fetch_inferior_registers)
2839         (shnbsd_store_inferior_registers): Refactor as methods of
2840         sh_nbsd_nat_target.
2841         (_initialize_shnbsd_nat): Adjust to C++ification.
2842         * sparc-nat.c (sparc_xfer_wcookie): Make extern.
2843         (inf_ptrace_xfer_partial): Delete.
2844         (sparc_xfer_partial, sparc_target): Delete.
2845         * sparc-nat.h (sparc_fetch_inferior_registers)
2846         (sparc_store_inferior_registers, sparc_xfer_wcookie): Declare.
2847         (sparc_target): Delete function declaration.
2848         (sparc_target): New template class.
2849         * sparc-nbsd-nat.c (the_sparc_nbsd_nat_target): New.
2850         (_initialize_sparcnbsd_nat): Adjust to C++ification.
2851         * sparc64-fbsd-nat.c (the_sparc64_fbsd_nat_target): New.
2852         (_initialize_sparc64fbsd_nat): Adjust to C++ification.  Use
2853         add_target.
2854         * sparc64-nbsd-nat.c (the_sparc64_nbsd_nat_target): New.
2855         (_initialize_sparc64nbsd_nat): Adjust to C++ification.
2856         * sparc64-obsd-nat.c (the_sparc64_obsd_nat_target): New.
2857         (_initialize_sparc64obsd_nat): Adjust to C++ification.  Use
2858         add_target.
2859         * vax-bsd-nat.c (vax_bsd_nat_target): New class.
2860         (the_vax_bsd_nat_target): New.
2861         (vaxbsd_fetch_inferior_registers)
2862         (vaxbsd_store_inferior_registers): Refactor as vax_bsd_nat_target
2863         methods.
2864         (_initialize_vaxbsd_nat): Adjust to C++ification.
2865
2866         * bsd-kvm.c (bsd_kvm_target): New class.
2867         (bsd_kvm_ops): Now a bsd_kvm_target.
2868         (bsd_kvm_open, bsd_kvm_close, bsd_kvm_xfer_partial)
2869         (bsd_kvm_files_info, bsd_kvm_fetch_registers)
2870         (bsd_kvm_thread_alive, bsd_kvm_pid_to_str): Refactor as methods of
2871         bsd_kvm_target.
2872         (bsd_kvm_return_one): Delete.
2873         (bsd_kvm_add_target): Adjust to C++ification.
2874
2875         * nto-procfs.c (nto_procfs_target, nto_procfs_target_native)
2876         (nto_procfs_target_procfs): New classes.
2877         (procfs_open_1, procfs_thread_alive, procfs_update_thread_list)
2878         (procfs_files_info, procfs_pid_to_exec_file, procfs_attach)
2879         (procfs_post_attach, procfs_wait, procfs_fetch_registers)
2880         (procfs_xfer_partial, procfs_detach, procfs_insert_breakpoint)
2881         (procfs_remove_breakpoint, procfs_insert_hw_breakpoint)
2882         (procfs_remove_hw_breakpoint, procfs_resume)
2883         (procfs_mourn_inferior, procfs_create_inferior, procfs_interrupt)
2884         (procfs_kill_inferior, procfs_store_registers)
2885         (procfs_pass_signals, procfs_pid_to_str, procfs_can_run): Refactor
2886         as methods of nto_procfs_target.
2887         (nto_procfs_ops): Now an nto_procfs_target_procfs.
2888         (nto_native_ops): Delete.
2889         (procfs_open, procfs_native_open): Delete.
2890         (nto_native_ops): Now an nto_procfs_target_native.
2891         (init_procfs_targets): Adjust to C++ification.
2892         (procfs_can_use_hw_breakpoint, procfs_remove_hw_watchpoint)
2893         (procfs_insert_hw_watchpoint, procfs_stopped_by_watchpoint):
2894         Refactor as methods of nto_procfs_target.
2895
2896         * go32-nat.c (go32_nat_target): New class.
2897         (the_go32_nat_target): New.
2898         (go32_attach, go32_resume, go32_wait, go32_fetch_registers)
2899         (go32_store_registers, go32_xfer_partial, go32_files_info)
2900         (go32_kill_inferior, go32_create_inferior, go32_mourn_inferior)
2901         (go32_terminal_init, go32_terminal_info, go32_terminal_inferior)
2902         (go32_terminal_ours, go32_pass_ctrlc, go32_thread_alive)
2903         (go32_pid_to_str): Refactor as methods of go32_nat_target.
2904         (go32_target): Delete.
2905         (_initialize_go32_nat): Adjust to C++ification.
2906
2907         * gnu-nat.c (gnu_wait, gnu_resume, gnu_kill_inferior)
2908         (gnu_mourn_inferior, gnu_create_inferior, gnu_attach, gnu_detach)
2909         (gnu_stop, gnu_thread_alive, gnu_xfer_partial)
2910         (gnu_find_memory_regions, gnu_pid_to_str): Refactor as methods of
2911         gnu_nat_target.
2912         (gnu_target): Delete.
2913         * gnu-nat.h (gnu_target): Delete.
2914         (gnu_nat_target): New class.
2915         * i386-gnu-nat.c (gnu_base_target): New.
2916         (i386_gnu_nat_target): New class.
2917         (the_i386_gnu_nat_target): New.
2918         (_initialize_i386gnu_nat): Adjust to C++ification.
2919
2920 2018-05-02  Pedro Alves  <palves@redhat.com>
2921
2922         * bfd-target.c (target_bfd_xclose): Rename to ...
2923         (target_bfd_close): ... this.
2924         (target_bfd_reopen): Adjust.
2925         * target.c (target_close): Remove references to to_xclose.
2926         * target.h (target_ops::to_xclose): Delete.
2927         (target_ops::to_close): Update comments.
2928
2929 2018-05-02  Pedro Alves  <palves@redhat.com>
2930
2931         * alpha-linux-nat.c: Include "linux-nat-trad.h" instead of
2932         "linux-nat.h".
2933         * configure.nat (alpha-linux, linux-mips): Add linux-nat-trad.o.
2934         * inf-ptrace.c (inf_ptrace_register_u_offset)
2935         (inf_ptrace_fetch_register, inf_ptrace_fetch_registers)
2936         (inf_ptrace_store_register, inf_ptrace_store_registers)
2937         (inf_ptrace_trad_target): Move to ...
2938         * linux-nat-trad.c: ... this new file.
2939         * linux-nat-trad.h: New file.
2940         * linux-nat.c (linux_target_install_ops): Make extern.
2941         (linux_trad_target): Delete.
2942         * linux-nat.h (linux_trad_target): Delete declaration.
2943         (linux_target_install_ops): Declare.
2944         * mips-linux-nat.c: Include "linux-nat-trad.h" instead of
2945         "linux-nat.h".
2946
2947 2018-05-02  Pedro Alves  <palves@redhat.com>
2948
2949         * i386-sol2-nat.c (_initialize_amd64_sol2_nat): Don't call
2950         procfs_target/add_target here.
2951         * procfs.c (procfs_target): Make static.
2952         (_initialize_procfs): Call add_target here.
2953         * procfs.h (struct target_ops): Remove forward declaration.
2954         (procfs_target): Remove declaration.
2955         * sparc-sol2-nat.c (_initialize_sparc_sol2_nat): Delete.
2956
2957 2018-05-02  Pedro Alves  <palves@redhat.com>
2958
2959         * procfs.c (procfs_stopped_by_watchpoint)
2960         (procfs_insert_watchpoint, procfs_remove_watchpoint)
2961         (procfs_region_ok_for_hw_watchpoint, procfs_stopped_data_address):
2962         Forward declare.
2963         (procfs_use_watchpoints): Delete, move contents...
2964         (procfs_target): ... here.
2965         * procfs.h (procfs_use_watchpoints): Delete declaration.
2966         * i386-sol2-nat.c (_initialize_amd64_sol2_nat): Don't call
2967         procfs_use_watchpoints.
2968         * sparc-sol2-nat.c (_initialize_sparc_sol2_nat): Don't call
2969         procfs_use_watchpoints.
2970
2971 2018-05-02  Tom Tromey  <tom@tromey.com>
2972
2973         PR python/20084:
2974         * python/python.c (gdbpy_parameter_value): Handle var_zuinteger
2975         and var_zuinteger_unlimited.
2976         * python/py-param.c (struct parm_constant): Add PARAM_ZUINTEGER
2977         and PARAM_ZUINTEGER_UNLIMITED.
2978         (set_parameter_value): Handle var_zuinteger and
2979         var_zuinteger_unlimited.
2980         (add_setshow_generic): Likewise.
2981         (parmpy_init): Likewise.
2982
2983 2018-04-28  Dan Robertson  <danlrobertson89@gmail.com>
2984
2985         PR rust/23124
2986         * gdb/rust-exp.y (convert_params_to_types): Ensure that the params
2987         pointer is not null before dereferencing it.
2988
2989 2018-04-30  Tom Tromey  <tom@tromey.com>
2990
2991         * darwin-nat-info.c (darwin_debug_regions_recurse): Remove use of
2992         is_mi_like_p.
2993
2994 2018-04-30  Tom Tromey  <tom@tromey.com>
2995
2996         * breakpoint.c (mention): Remove use of is_mi_like_p.
2997         (print_mention_ranged_breakpoint): Likewise.
2998         * break-catch-throw.c (print_it_exception_catchpoint): Remove use
2999         of is_mi_like_p.
3000
3001 2018-04-30  Tom Tromey  <tom@tromey.com>
3002
3003         * tracepoint.c (tvariables_info_1): Remove use of is_mi_like_p.
3004
3005 2018-04-30  Tom Tromey  <tom@tromey.com>
3006
3007         * spu-tdep.c (info_spu_mailbox_list, info_spu_dma_cmdlist)
3008         (info_spu_event_command): Remove some uses of is_mi_like_p.
3009
3010 2018-04-30  Tom Tromey  <tom@tromey.com>
3011
3012         * python/py-framefilter.c (py_print_single_arg)
3013         (enumerate_locals, py_print_args, py_print_frame): Remove some
3014         uses of is_mi_like_p.
3015
3016 2018-04-30  Tom Tromey  <tom@tromey.com>
3017
3018         * ui-out.c: Update.
3019         * cli-out.h (cli_ui_out::do_is_mi_like_p): Update.
3020         * ui-out.h (ui_out::is_mi_like_p): Now const.
3021         (ui_out::do_is_mi_like_p): Now const.
3022         * mi/mi-out.h (mi_ui_out::do_is_mi_like_p): Update.
3023
3024 2018-04-30  Tom Tromey  <tom@tromey.com>
3025
3026         * varobj.c (varobj_set_visualizer): Use new_reference.
3027         * python/python.c (gdbpy_decode_line): Use new_reference.
3028         * python/py-cmd.c (cmdpy_function, cmdpy_completer_helper): Use
3029         new_reference.
3030
3031 2018-04-30  Tom Tromey  <tom@tromey.com>
3032
3033         * varobj.c (install_new_value): Use new_reference.
3034         * value.h (value_incref): Return void.  Swap intro comment with
3035         value_decref.
3036         * value.c (set_value_parent): Use new_reference.
3037         (value_incref): Return void.  Update intro comment.
3038         (release_value): Use new_reference.
3039         * dwarf2loc.c (dwarf2_evaluate_loc_desc_full): Use new_reference.
3040
3041 2018-04-30  Tom Tromey  <tom@tromey.com>
3042
3043         * symfile-mem.c (symbol_file_add_from_memory): Use new_reference.
3044         * gdb_bfd.h (new_bfd_ref): Remove.
3045         (gdb_bfd_open): Update comment.
3046         * gdb_bfd.c (gdb_bfd_open, gdb_bfd_fopen, gdb_bfd_openr)
3047         (gdb_bfd_openw, gdb_bfd_openr_iovec, gdb_bfd_record_inclusion)
3048         (gdb_bfd_fdopenr): Use new_reference.
3049         * exec.c (exec_file_attach): Use new_reference.
3050
3051 2018-04-30  Tom Tromey  <tom@tromey.com>
3052
3053         * common/gdb_ref_ptr.h (ref_ptr::new_reference): New static
3054         method.
3055
3056 2018-04-30  Tom Tromey  <tom@tromey.com>
3057
3058         * jit.c (jit_read_code_entry): Use type_align.
3059         * i386-tdep.c (i386_gdbarch_init): Don't call
3060         set_gdbarch_long_long_align_bit.
3061         * gdbarch.sh: Remove long_long_align_bit.
3062         * gdbarch.c, gdbarch.h: Rebuild.
3063         * arc-tdep.c (arc_type_align): New function.
3064         (arc_gdbarch_init): Use arc_type_align.  Don't call
3065         set_gdbarch_long_long_align_bit.
3066
3067 2018-04-30  Tom Tromey  <tom@tromey.com>
3068
3069         * rust-lang.c (rust_type_alignment): Remove.
3070         (rust_composite_type): Use type_align.
3071
3072 2018-04-30  Tom Tromey  <tom@tromey.com>
3073
3074         * NEWS: Mention Type.align.
3075         * python/py-type.c (typy_get_alignof): New function.
3076         (type_object_getset): Add "alignof".
3077
3078 2018-04-30  Tom Tromey  <tom@tromey.com>
3079
3080         PR exp/17095:
3081         * NEWS: Update.
3082         * std-operator.def (UNOP_ALIGNOF): New operator.
3083         * expprint.c (dump_subexp_body_standard) <case UNOP_ALIGNOF>:
3084         New.
3085         * eval.c (evaluate_subexp_standard) <case UNOP_ALIGNOF>: New.
3086         * c-lang.c (c_op_print_tab): Add alignof.
3087         * c-exp.y (ALIGNOF): New token.
3088         (exp): Add "ALIGNOF" production.
3089         (ident_tokens): Add _Alignof and alignof.
3090
3091 2018-04-30  Tom Tromey  <tom@tromey.com>
3092
3093         * i386-tdep.c (i386_type_align): New function.
3094         (i386_gdbarch_init): Update.
3095         * gdbarch.sh (type_align): New method.
3096         * gdbarch.c, gdbarch.h: Rebuild.
3097         * arch-utils.h (default_type_align): Declare.
3098         * arch-utils.c (default_type_align): New function.
3099         * gdbtypes.h (TYPE_ALIGN_BITS): New define.
3100         (struct type) <align_log2>: New field.
3101         <instance_flags>: Now a bitfield.
3102         (TYPE_RAW_ALIGN): New macro.
3103         (type_align, type_raw_align, set_type_align): Declare.
3104         * gdbtypes.c (type_align, type_raw_align, set_type_align): New
3105         functions.
3106         * dwarf2read.c (quirk_rust_enum): Set type alignment.
3107         (get_alignment, maybe_set_alignment): New functions.
3108         (read_structure_type, read_enumeration_type, read_array_type)
3109         (read_set_type, read_tag_pointer_type, read_tag_reference_type)
3110         (read_subrange_type, read_base_type): Set type alignment.
3111
3112 2018-04-30  Simon Marchi  <simon.marchi@ericsson.com>
3113
3114         * dwarf2read.c (read_index_from_section): Use bool.
3115
3116 2018-04-29  Fabian Groffen  <grobian@gentoo.org>
3117
3118         PR gdb/22950
3119         * proc-events.c (init_syscall_table): Guard usage os SYS_uuidsys
3120         with #ifdef.
3121
3122 2018-04-29  John Reiser  <jreiser@BitWagon.com>
3123
3124         PR build/22873
3125         * gdb/Makefile.in: (.c:.l, .c:.y): Write the target only in the
3126         last step, and do it atomically.
3127
3128 2018-04-27  Alexandre Oliva  <aoliva@redhat.com>
3129
3130         * compile/compile-c-types.c (convert_int, convert_float):
3131         Update for C FE v1.
3132
3133 2018-04-27  Tom Tromey  <tom@tromey.com>
3134
3135         PR rust/22545:
3136         * rust-lang.c (rust_inclusive_range_type_p): New function.
3137         (rust_range): Handle inclusive ranges.
3138         (rust_compute_range): Likewise.
3139         * rust-exp.y (struct rust_op) <inclusive>: New field.
3140         (DOTDOTEQ): New constant.
3141         (range_expr): Add "..=" productions.
3142         (operator_tokens): Add "..=" token.
3143         (ast_range): Add "inclusive" parameter.
3144         (convert_ast_to_expression) <case OP_RANGE>: Handle inclusive
3145         ranges.
3146         * parse.c (operator_length_standard) <case OP_RANGE>: Handle new
3147         bounds values.
3148         * expression.h (enum range_type) <NONE_BOUND_DEFAULT_EXCLUSIVE,
3149         LOW_BOUND_DEFAULT_EXCLUSIVE>: New constants.
3150         Update comments.
3151         * expprint.c (print_subexp_standard): Handle new bounds values.
3152         (dump_subexp_body_standard): Likewise.
3153
3154 2018-04-27  Tom Tromey  <tom@tromey.com>
3155
3156         * configure: Rebuild.
3157         * warning.m4 (AM_GDB_WARNINGS): Add -Wsuggest-override.
3158         * dwarf2loc.c (class dwarf_evaluate_loc_desc): Use "override", not
3159         "OVERRIDE".
3160         (class symbol_needs_eval_context): Likewise.
3161         * dwarf2read.c (mock_mapped_index::symbol_name_count)
3162         (mock_mapped_index::symbol_name_at): Use "override".  Remove
3163         "virtual".
3164         * dwarf2-frame.c (dwarf_expr_executor::get_addr_index): Use
3165         "override".
3166         (class dwarf_expr_executor): Use "override", not "OVERRIDE".
3167         * aarch64-tdep.c (instruction_reader::read): Use "override".
3168         (instruction_reader_test::read): Likewise.
3169         * arm-tdep.c (instruction_reader::read): Use "override".
3170         (instruction_reader_thumb::read): Likewise.
3171
3172 2018-04-26  Andrzej Kaczmarek  <andrzej.kaczmarek@codecoup.pl>
3173
3174         PR remote/9665
3175         * remote.c (send_g_packet): Use putpkt/getpkt/packet_check_result
3176         instead of remote_send.
3177         (remote_send): Remove.
3178
3179 2018-04-26  Pedro Alves  <palves@redhat.com>
3180
3181         * elfread.c (elf_gnu_ifunc_resolver_return_stop): Use
3182         find_function_start_sal instead of find_pc_line.
3183
3184 2018-04-26  Pedro Alves  <palves@redhat.com>
3185
3186         * breakpoint.c (set_breakpoint_location_function): Handle
3187         mst_data_gnu_ifunc.
3188         * c-exp.y (variable production): Handle mst_data_gnu_ifunc.
3189         * elfread.c (elf_symtab_read): Give data symbols with
3190         BSF_GNU_INDIRECT_FUNCTION set mst_data_gnu_ifunc type.
3191         (elf_rel_plt_read): Update comment.
3192         * linespec.c (convert_linespec_to_sals): Handle
3193         mst_data_gnu_ifunc.
3194         (minsym_found): Handle mst_data_gnu_ifunc.
3195         * minsyms.c (msymbol_is_function, minimal_symbol_reader::record)
3196         (find_solib_trampoline_target): Handle mst_data_gnu_ifunc.
3197         * parse.c (find_minsym_type_and_address): Handle
3198         mst_data_gnu_ifunc.
3199         * symmisc.c (dump_msymbols): Handle mst_data_gnu_ifunc.
3200         * symtab.c (find_gnu_ifunc): Handle mst_data_gnu_ifunc.
3201         * symtab.h (minimal_symbol_type) <mst_text_gnu_ifunc>: Update
3202         comment.
3203         <mst_data_gnu_ifunc>: New enumerator.
3204
3205 2018-04-26  Pedro Alves  <palves@redhat.com>
3206
3207         * minsyms.c (lookup_minimal_symbol_by_pc_section_1): Rename to ...
3208         (lookup_minimal_symbol_by_pc_section): ... this.  Replace
3209         'want_trampoline' parameter by a lookup_msym_prefer parameter.
3210         Handle it.
3211         (lookup_minimal_symbol_by_pc_section): Delete old implementation.
3212         (lookup_minimal_symbol_by_pc): Adjust.
3213         (in_gnu_ifunc_stub): Prefer GNU ifunc symbols.
3214         (lookup_solib_trampoline_symbol_by_pc): Adjust.
3215         * minsyms.h (lookup_msym_prefer): New enum.
3216         (lookup_minimal_symbol_by_pc_section): Replace 'want_trampoline'
3217         parameter by a lookup_msym_prefer parameter.
3218
3219 2018-04-26  Pedro Alves  <palves@redhat.com>
3220
3221         * elfread.c (elf_gnu_ifunc_record_cache): Check if the symbol name
3222         ends in "@plt" instead of looking at the symbol's section.
3223
3224 2018-04-26  Pedro Alves  <palves@redhat.com>
3225
3226         * blockframe.c (cache_pc_function_is_gnu_ifunc): Delete.  Remove
3227         all references.
3228         (find_pc_partial_function_gnu_ifunc): Rename to ...
3229         (find_pc_partial_function): ... this, and remove references to
3230         'is_gnu_ifunc_p'.
3231         (find_pc_partial_function): Delete old implementation.
3232         * symtab.h (find_pc_partial_function_gnu_ifunc): Delete.
3233
3234 2018-04-26  Pedro Alves  <palves@redhat.com>
3235
3236         * linespec.c (struct bound_minimal_symbol_search_key): New.
3237         (convert_linespec_to_sals): Sort minimal symbols earlier.  Don't
3238         skip first line if we found a GNU ifunc minimal symbol by name.
3239         (compare_msymbols): Change parameters to work with a destructured
3240         lhs minsym.
3241         (compare_msymbols_for_qsort, compare_msymbols_for_bsearch): New
3242         functions.
3243
3244 2018-04-26  Pedro Alves  <palves@redhat.com>
3245
3246         * breakpoint.c (set_breakpoint_location_function): Don't resolve
3247         ifunc targets here.  Instead, if we have an ifunc minsym, use its
3248         address/name.
3249         (add_location_to_breakpoint): Store the minsym and the objfile in
3250         the breakpoint location.
3251         * breakpoint.h (bp_location) <msymbol, objfile>: New fields.
3252         * linespec.c (minsym_found): Resolve GNU ifunc targets here.
3253         Record the minsym in the sal.
3254         * symtab.h (symtab_and_line) <msymbol>: New field.
3255
3256 2018-04-26  Pedro Alves  <palves@redhat.com>
3257
3258         * elfread.c (elf_gnu_ifunc_resolve_by_got): Don't write to *ADDR_P
3259         unless we actually resolved the ifunc.
3260
3261 2018-04-26  Pedro Alves  <palves@redhat.com>
3262
3263         * c-exp.y (variable production): Prefer ifunc minsyms over
3264         regular function symbols.
3265         * symtab.c (find_gnu_ifunc): New function.
3266         * minsyms.h (lookup_msym_prefer): New enum.
3267         (lookup_minimal_symbol_by_pc_section): Replace 'want_trampoline'
3268         parameter by a lookup_msym_prefer parameter.
3269         * symtab.h (find_gnu_ifunc): New declaration.
3270
3271 2018-04-26  Pedro Alves  <palves@redhat.com>
3272
3273         * blockframe.c (find_gnu_ifunc_target_type): New function.
3274         (find_function_type): New.
3275         * eval.c (evaluate_var_msym_value): For GNU ifunc types, always
3276         return a value with a memory address.
3277         (eval_call): For calls to GNU ifunc functions, try to find the
3278         type of the target function from the type that the resolver
3279         returns.
3280         * gdbtypes.c (objfile_type): Don't install a return type for ifunc
3281         symbols.
3282         * infcall.c (find_function_return_type): Delete.
3283         (find_function_addr): Add 'function_type' parameter.  For calls to
3284         GNU ifunc functions, try to find the type of the target function
3285         from the type that the resolver returns, and return it via
3286         FUNCTION_TYPE.
3287         (call_function_by_hand_dummy): Adjust to use the function type
3288         returned by find_function_addr.
3289         (find_function_addr): Add 'function_type' parameter and move
3290         description here.
3291         * symtab.h (find_function_type, find_gnu_ifunc_target_type): New
3292         declarations.
3293
3294 2018-04-26  Pedro Alves  <palves@redhat.com>
3295
3296         * c-exp.y (variable production): Skip finding an alias for ifunc
3297         symbols.
3298
3299 2018-04-26  Pedro Alves  <palves@redhat.com>
3300
3301         * elfread.c (elf_rel_plt_read): Look for relocations for .got.plt too.
3302
3303 2018-04-25  Pedro Alves  <palves@redhat.com>
3304
3305         * infcmd.c (kill_command): Print the pid as string, not the whole
3306         thread's ptid.  Add comment.  s/has been killed/killed/ in output
3307         message.
3308         * remote.c (remote_detach_1): Print the pid as string, not the
3309         whole thread's ptid.
3310
3311 2018-04-24  Jan Kratochvil  <jan.kratochvil@redhat.com>
3312             Sergio Durigan Junior  <sergiodj@redhat.com>
3313             Pedro Alves  <palves@redhat.com>
3314
3315         * infcmd.c (kill_command): Print message when inferior has
3316         been killed.
3317         * inferior.c (print_inferior_events): Remove 'static'.  Set as
3318         '1'.
3319         (add_inferior): Improve message printed when
3320         'print_inferior_events' is on.
3321         (exit_inferior): Remove message printed when
3322         'print_inferior_events' is on.
3323         (detach_inferior): Improve message printed when
3324         'print_inferior_events' is on.
3325         (initialize_inferiors): Use 'add_inferior_silent' to set
3326         'current_inferior_'.
3327         * inferior.h (print_inferior_events): Declare here as
3328         'extern'.
3329         * infrun.c (follow_fork_inferior): Print '[Attaching...]' or
3330         '[Detaching...]' messages when 'print_inferior_events' is on.
3331         Use 'add_thread_silent' instead of 'add_thread'.  Add '[' and ']'
3332         as prefix/suffix for messages.  Remove periods.  Fix erroneous
3333         'Detaching after fork from child...', replace it by '... from
3334         parent...'.
3335         (handle_vfork_child_exec_or_exit): Add '[' and ']' as
3336         prefix/suffix when printing 'Detaching...' messages.  Print
3337         them when 'print_inferior_events' is on.
3338         * remote.c (remote_detach_1): Print message when detaching
3339         from inferior and '!is_fork_parent'.
3340
3341 2018-04-24  Tom Tromey  <tom@tromey.com>
3342
3343         * cli-out.h: Reindent.
3344
3345 2018-04-24  Tom Tromey  <tom@tromey.com>
3346
3347         * cli-out.c (cli_ui_out::out_field_fmt): Remove.
3348         (cli_ui_out::do_field_string): Use fputs_filtered.
3349         * cli-out.h (class cli_ui_out) <out_field_fmt>: Remove.
3350
3351 2018-04-23  Tom Tromey  <tom@tromey.com>
3352
3353         * guile/scm-frame.c (gdbscm_frame_read_var): Use
3354         gdb::unique_xmalloc_ptr.
3355
3356 2018-04-23  Tom Tromey  <tom@tromey.com>
3357
3358         * configure: Rebuild.
3359
3360 2018-04-22  Rajendra SY  <rajendra.sy@gmail.com>
3361
3362         PR gdb/23095
3363         * gdb/testsuite/gdb.base/break-probes.exp: Pass shlib_load to
3364         prepare_for_testing.  Set normal_bp to r_debug_state if target
3365         is bsd.
3366
3367 2018-04-21  Pedro Alves  <palves@redhat.com>
3368             Rajendra SY  <rajendra.sy@gmail.com>
3369
3370         * inf-ptrace.c (inf_ptrace_attach): Mark the thread as executing.
3371         * remote.c (extended_remote_attach): In all-stop mode, mark the
3372         thread as executing.
3373
3374 2018-04-19  Philippe Waroquiers  <philippe.waroquiers@skynet.be>
3375
3376         * thread.c (thread_apply_all_command): Fix comment.
3377         (thread_command): Fix comment.
3378
3379 2018-04-10  Alan Hayward  <alan.hayward@arm.com>
3380
3381         * common/tdesc.h (tdesc_create_feature): Remove xml filename
3382         parameter.
3383         * features/aarch64-core.c (create_feature_aarch64_core):
3384         Regenerate.
3385         * features/aarch64-fpu.c (create_feature_aarch64_fpu):
3386         Likewise.
3387         * features/i386/32bit-avx.c (create_feature_i386_32bit_avx):
3388         Likewise.
3389         * features/i386/32bit-avx512.c
3390         (create_feature_i386_32bit_avx512): Likewise.
3391         * features/i386/32bit-core.c (create_feature_i386_32bit_core):
3392         Likewise.
3393         * features/i386/32bit-linux.c (create_feature_i386_32bit_linux):
3394         Likewise.
3395         * features/i386/32bit-mpx.c (create_feature_i386_32bit_mpx):
3396         Likewise.
3397         * features/i386/32bit-pkeys.c (create_feature_i386_32bit_pkeys):
3398         Likewise.
3399         * features/i386/32bit-sse.c (create_feature_i386_32bit_sse):
3400         Likewise.
3401         * features/i386/64bit-avx.c (create_feature_i386_64bit_avx):
3402         Likewise.
3403         * features/i386/64bit-avx512.c
3404         (create_feature_i386_64bit_avx512): Likewise.
3405         * features/i386/64bit-core.c (create_feature_i386_64bit_core):
3406         Likewise.
3407         * features/i386/64bit-linux.c (create_feature_i386_64bit_linux):
3408         Likewise.
3409         * features/i386/64bit-mpx.c (create_feature_i386_64bit_mpx):
3410         Likewise.
3411         * features/i386/64bit-pkeys.c (create_feature_i386_64bit_pkeys):
3412         Likewise.
3413         * features/i386/64bit-segments.c
3414         (create_feature_i386_64bit_segments): Likewise.
3415         * features/i386/64bit-sse.c (create_feature_i386_64bit_sse):
3416         Likewise.
3417         * features/i386/x32-core.c
3418         (create_feature_i386_x32_core): Likewise.
3419         * features/tic6x-c6xp.c (create_feature_tic6x_c6xp): Likewise.
3420         * features/tic6x-core.c (create_feature_tic6x_core): Likewise.
3421         * features/tic6x-gp.c (create_feature_tic6x_gp): Likewise.
3422         * target-descriptions.c: In generated code, don't pass xml
3423         filename.
3424
3425 2018-04-18  Alan Hayward  <alan.hayward@arm.com>
3426
3427         * common/tdesc.c (print_xml_feature::visit_pre): Add xml parsing.
3428         (print_xml_feature::visit_post): Likewise.
3429         (print_xml_feature::visit): Likewise.
3430         * common/tdesc.h (tdesc_get_features_xml): Use const tdesc.
3431         (print_xml_feature): Add new class.
3432         * regformats/regdat.sh: Null xmltarget on feature targets.
3433         * target-descriptions.c (struct target_desc): Add xmltarget.
3434         (maintenance_check_tdesc_xml_convert): Add unittest function.
3435         (tdesc_get_features_xml): Add function to get xml.
3436         (maintenance_check_xml_descriptions): Test xml generation.
3437         * xml-tdesc.c (string_read_description_xml): Add function.
3438         * xml-tdesc.h (string_read_description_xml): Add declaration.
3439
3440 2018-04-18  Alan Hayward  <alan.hayward@arm.com>
3441
3442         * features/Makefile: Add feature marker to targets with new style
3443         target descriptions.
3444         * regformats/aarch64.dat: Regenerate.
3445         * regformats/i386/amd64-avx-avx512-linux.dat: Likewise.
3446         * regformats/i386/amd64-avx-linux.dat: Likewise.
3447         * regformats/i386/amd64-avx-mpx-avx512-pku-linux.dat: Likewise.
3448         * regformats/i386/amd64-avx-mpx-linux.dat: Likewise.
3449         * regformats/i386/amd64-linux.dat: Likewise.
3450         * regformats/i386/amd64-mpx-linux.dat: Likewise.
3451         * regformats/i386/amd64.dat: Likewise.
3452         * regformats/i386/i386-avx-avx512-linux.dat: Likewise.
3453         * regformats/i386/i386-avx-linux.dat: Likewise.
3454         * regformats/i386/i386-avx-mpx-avx512-pku-linux.dat: Likewise.
3455         * regformats/i386/i386-avx-mpx-linux.dat: Likewise.
3456         * regformats/i386/i386-linux.dat: Likewise.
3457         * regformats/i386/i386-mmx-linux.dat: Likewise.
3458         * regformats/i386/i386-mpx-linux.dat: Likewise.
3459         * regformats/i386/i386.dat: Likewise.
3460         * regformats/i386/x32-avx-avx512-linux.dat: Likewise.
3461         * regformats/i386/x32-avx-linux.dat: Likewise.
3462         * regformats/i386/x32-linux.dat: Likewise.
3463         * regformats/tic6x-c62x-linux.dat: Likewise.
3464         * regformats/tic6x-c64x-linux.dat: Likewise.
3465         * regformats/tic6x-c64xp-linux.dat: Likewise.
3466         * regformats/regdat.sh: Parse feature marker.
3467
3468 2018-04-18  Alan Hayward  <alan.hayward@arm.com>
3469
3470         * common/tdesc.h (tdesc_architecture_name): Add new declaration.
3471         (tdesc_osabi_name): Likewise.
3472         * target-descriptions.c (tdesc_architecture_name): Add new
3473         function.
3474         (tdesc_osabi_name): Likewise.
3475
3476 2018-04-18  Alan Hayward  <alan.hayward@arm.com>
3477
3478         * common/tdesc.c (tdesc_predefined_type): Move to here.
3479         (tdesc_named_type): Likewise.
3480         (tdesc_create_vector): Likewise.
3481         (tdesc_create_struct): Likewise.
3482         (tdesc_set_struct_size): Likewise.
3483         (tdesc_create_union): Likewise.
3484         (tdesc_create_flags): Likewise.
3485         (tdesc_create_enum): Likewise.
3486         (tdesc_add_field): Likewise.
3487         (tdesc_add_typed_bitfield): Likewise.
3488         (tdesc_add_bitfield): Likewise.
3489         (tdesc_add_flag): Likewise.
3490         (tdesc_add_enum_value): Likewise.
3491         * common/tdesc.h (struct tdesc_type_builtin): Likewise.
3492         (struct tdesc_type_vector): Likewise.
3493         (struct tdesc_type_field): Likewise.
3494         (struct tdesc_type_with_fields): Likewise.
3495         (tdesc_create_enum): Add declaration.
3496         (tdesc_add_typed_bitfield): Likewise.
3497         (tdesc_add_enum_value): Likewise.
3498         * target-descriptions.c (tdesc_type_field): Move from here.
3499         (tdesc_type_builtin): Likewise.
3500         (tdesc_type_vector): Likewise.
3501         (tdesc_type_with_fields): Likewise.
3502         (tdesc_predefined_types): Likewise.
3503         (tdesc_named_type): Likewise.
3504         (tdesc_create_vector): Likewise.
3505         (tdesc_create_struct): Likewise.
3506         (tdesc_set_struct_size): Likewise.
3507         (tdesc_create_union): Likewise.
3508         (tdesc_create_flags): Likewise.
3509         (tdesc_create_enum): Likewise.
3510         (tdesc_add_field): Likewise.
3511         (tdesc_add_typed_bitfield): Likewise.
3512         (tdesc_add_bitfield): Likewise.
3513         (tdesc_add_flag): Likewise.
3514         (tdesc_add_enum_value): Likewise.
3515         * gdb/target-descriptions.h (tdesc_create_enum): Likewise.
3516         (tdesc_add_typed_bitfield): Likewise.
3517         (tdesc_add_enum_value): Likewise.
3518
3519 2018-04-18  Alan Hayward  <alan.hayward@arm.com>
3520
3521         * common/tdesc.c (tdesc_feature::accept): Move to here.
3522         (tdesc_feature::operator==): Likewise.
3523         (tdesc_create_reg): Likewise.
3524         * common/tdesc.h (tdesc_type_kind): Likewise.
3525         (struct tdesc_type): Likewise.
3526         (struct tdesc_feature): Likewise.
3527         * regformats/regdat.sh: Create a feature.
3528         * target-descriptions.c (tdesc_type_kind): Move from here.
3529         (tdesc_type): Likewise.
3530         (tdesc_type_up): Likewise.
3531         (tdesc_feature): Likewise.
3532         (tdesc_create_reg): Likewise.
3533
3534 2018-04-18  Alan Hayward  <alan.hayward@arm.com>
3535
3536         * Makefile.in: Add arch/tdesc.c
3537         * common/tdesc.c: New file.
3538         * common/tdesc.h (tdesc_element_visitor): Move to here.
3539         (tdesc_element): Likewise.
3540         (tdesc_reg): Likewise.
3541         (tdesc_reg_up): Likewise.
3542         * regformats/regdef.h (reg): Add offset to constructors.
3543         * target-descriptions.c (tdesc_element_visitor): Move from here.
3544         (tdesc_element): Likewise.
3545         (tdesc_reg): Likewise.
3546         (tdesc_reg_up): Likewise.
3547
3548 2018-04-17  Tom Tromey  <tom@tromey.com>
3549
3550         * dwarf2read.c (quirk_rust_enum): Conditionally drop the
3551         discriminant field.
3552
3553 2018-04-17  Tom Tromey  <tom@tromey.com>
3554
3555         * dwarf2read.c (quirk_rust_enum): Handle unions correctly.
3556
3557 2018-04-17  Andreas Arnez  <arnez@linux.vnet.ibm.com>
3558
3559         * symtab.c (print_symbol_info): Skip printing filename and line
3560         number when `last' is NULL.
3561         (symtab_symbol_info): Use empty string instead of NULL for first
3562         invocation of print_symbol_info.
3563         (rbreak_command): Pass NULL to `last' parameter of
3564         print_symbol_info.
3565
3566 2018-04-16  Simon Marchi  <simon.marchi@ericsson.com>
3567
3568         * linux-tdep.c (linux_spu_make_corefile_notes): Return note_data
3569         instead of nullptr.
3570
3571 2018-04-16  Pedro Alves  <palves@redhat.com>
3572
3573         * MAINTAINERS (sh): Remove.
3574         * Makefile.in (ALL_TARGET_OBS): Remove sh64-tdep.o.
3575         (HFILES_NO_SRCDIR): Remove sh64-tdep.h.
3576         (ALLDEPFILES): Remove sh64-tdep.c.
3577         * NEWS: Mentions that support for SH-5/SH64 is removed.
3578         * configure.tgt (sh*-*-linux*): Remove reference to sh64-tdep.o.
3579         (sh*-*-openbsd*): Ditto.
3580         (sh64-*-elf*): Remove.
3581         (sh*): Remove.
3582         * regcache.c (cooked_write_test): Remove bfd_mach_sh5 case.
3583         * sh-linux-tdep.c: Remove reference to bfd_mach_sh5.
3584         * sh-tdep.c: No longer include "sh64-tdep.h".
3585         (sh_gdbarch_init): Remove reference to bfd_mach_sh5.
3586         * sh64-tdep.c, sh64-tdep.h: Remove files.
3587
3588 2018-04-16  Pedro Alves  <palves@redhat.com>
3589
3590         * MAINTAINERS: Remove m88k.
3591         * Makefile.in (ALL_TARGET_OBS): Remove m88k-tdep.o.
3592         (HFILES_NO_SRCDIR): Remove m88k-tdep.h.
3593         (ALLDEPFILES): Remove m88k-bsd-nat.c and m88k-tdep.c.
3594         * NEWS: Mention that support for m88k was removed.
3595         * configure.host (m88*-*-*): Remove support.
3596         * configure.nat (m88k-*-*): Remove support.
3597         * configure.tgt (m88*-*-openbsd*): Remove.
3598         * m88k-bsd-nat.c, m88k-tdep.c, m88k-tdep.h: Delete.
3599
3600 2018-04-15  Simon Marchi  <simon.marchi@polymtl.ca>
3601
3602         * configure.tgt (x86_tobjs): New variable.
3603         (amd64_tobjs, i386_tobjs): Use it.
3604
3605 2018-04-13  Andreas Arnez  <arnez@linux.vnet.ibm.com>
3606
3607         * symtab.c (print_symbol_info): Precede the symbol definition by
3608         the line number when available.
3609         * NEWS: Advertise this enhancement.
3610
3611 2018-04-13  Markus Metzger  <markus.t.metzger@intel.com>
3612
3613         * NEWS (New options): announce set/show record btrace cpu.
3614         * btrace.c: Include record-btrace.h.
3615         (btrace_compute_ftrace_pt): Skip enabling errata workarounds if
3616         the vendor is unknown.
3617         (btrace_compute_ftrace_1): Add cpu parameter.  Update callers.
3618         Maybe overwrite the btrace configuration's cpu.
3619         (btrace_compute_ftrace): Add cpu parameter.  Update callers.
3620         (btrace_fetch): Add cpu parameter.  Update callers.
3621         (btrace_maint_update_pt_packets): Call record_btrace_get_cpu.
3622         Maybe overwrite the btrace configuration's cpu.  Skip enabling
3623         errata workarounds if the vendor is unknown.
3624         * python/py-record-btrace.c: Include record-btrace.h.
3625         (recpy_bt_begin, recpy_bt_end, recpy_bt_instruction_history)
3626         (recpy_bt_function_call_history): Call record_btrace_get_cpu.
3627         * record-btrace.c (record_btrace_cpu_state_kind): New.
3628         (record_btrace_cpu): New.
3629         (set_record_btrace_cpu_cmdlist): New.
3630         (record_btrace_get_cpu): New.
3631         (require_btrace_thread, record_btrace_info)
3632         (record_btrace_resume_thread): Call record_btrace_get_cpu.
3633         (cmd_set_record_btrace_cpu_none): New.
3634         (cmd_set_record_btrace_cpu_auto): New.
3635         (cmd_set_record_btrace_cpu): New.
3636         (cmd_show_record_btrace_cpu): New.
3637         (_initialize_record_btrace): Initialize set/show record btrace cpu
3638         commands.
3639         * record-btrace.h (record_btrace_get_cpu): New.
3640
3641 2018-04-13  Markus Metzger  <markus.t.metzger@intel.com>
3642
3643         * record.c (set_record_command): Fix typo in message.
3644
3645 2018-04-13  Markus Metzger  <markus.t.metzger@intel.com>
3646
3647         * record-btrace.c (cmd_set_record_btrace): Print sub-commands.
3648
3649 2018-04-13  Markus Metzger  <markus.t.metzger@intel.com>
3650
3651         * infrun.c (process_event_stop_test): Call
3652         gdbarch_in_indirect_branch_thunk.
3653         * gdbarch.sh (in_indirect_branch_thunk): New.
3654         * gdbarch.c: Regenerated.
3655         * gdbarch.h: Regenerated.
3656         * x86-tdep.h: New.
3657         * x86-tdep.c: New.
3658         * Makefile.in (ALL_TARGET_OBS): Add x86-tdep.o.
3659         (HFILES_NO_SRCDIR): Add x86-tdep.h.
3660         (ALLDEPFILES): Add x86-tdep.c.
3661         * arch-utils.h (default_in_indirect_branch_thunk): New.
3662         * arch-utils.c (default_in_indirect_branch_thunk): New.
3663         * i386-tdep: Include x86-tdep.h.
3664         (i386_in_indirect_branch_thunk): New.
3665         (i386_elf_init_abi): Set in_indirect_branch_thunk gdbarch
3666         function.
3667         * amd64-tdep: Include x86-tdep.h.
3668         (amd64_in_indirect_branch_thunk): New.
3669         (amd64_init_abi): Set in_indirect_branch_thunk gdbarch function.
3670
3671 2018-04-12  Jan Kratochvil  <jan.kratochvil@redhat.com>
3672
3673         PR gdb/23053
3674         * dwarf-index-write.c (data_buf::grow) (write_one_signatured_type)
3675         (recursively_write_psymbols) (debug_names::recursively_write_psymbols)
3676         (debug_names::write_one_signatured_type): Fix -D_GLIBCXX_DEBUG
3677         regression.
3678
3679 2018-04-12  Tom Tromey  <tom@tromey.com>
3680
3681         * rust-lang.c (rust_print_struct_def): Remove univariant code.
3682         (rust_evaluate_subexp): Likewise.
3683
3684 2018-04-12  Pedro Alves  <palves@redhat.com>
3685
3686         * procfs.c (procfs_detach): Make forward declaration's prototype
3687         match definition's protototype.
3688         (proc_get_LDT_entry): Remove stale do_cleanups call.
3689
3690 2018-04-12  Pedro Alves  <palves@redhat.com>
3691
3692         * target.h (target_ops::to_has_exited): Delete.
3693         (target_has_exited): Delete.
3694         * target-delegates.c: Regenerate.
3695
3696 2018-04-11  Pedro Alves  <palves@redhat.com>
3697
3698         * target.c (fileio_fh_t::t): Add comment.
3699         (target_fileio_pwrite, target_fileio_pread, target_fileio_fstat)
3700         (target_fileio_close): Handle a NULL target.
3701         (invalidate_fileio_fh): New.
3702         (target_close): Call it.
3703         * remote.c (remote_hostio_send_command): No longer check whether
3704         remote_desc is open.
3705
3706 2018-04-11  Pedro Alves  <palves@redhat.com>
3707
3708         * target.c (fileio_fh_t): Make it a named struct instead of a
3709         typedef.
3710         (fileio_fh_t::is_closed): New method.
3711         (DEF_VEC_O (fileio_fh_t)): Remove.
3712         (fileio_fhandles): Now a std::vector.
3713         (is_closed_fileio_fh): Delete.
3714         (acquire_fileio_fd): Adjust.  Rename parameters.
3715         (release_fileio_fd): Adjust.
3716         (fileio_fd_to_fh): Reimplement as a function instead of a macro.
3717         (target_fileio_pwrite, target_fileio_pread, target_fileio_fstat)
3718         (target_fileio_close): Adjust.
3719
3720 2018-04-10  Simon Marchi  <simon.marchi@ericsson.com>
3721
3722         * auto-load.c (auto_load_safe_path_vec_update): Iterate by
3723         index.
3724
3725 2018-04-10  Pedro Alves  <palves@redhat.com>
3726
3727         * gdbthread.h (finish_thread_state_cleanup): Delete declaration.
3728         (scoped_finish_thread_state): New class.
3729         * infcmd.c (run_command_1): Use it instead of finish_thread_state
3730         cleanup.
3731         * infrun.c (proceed, prepare_for_detach, wait_for_inferior)
3732         (fetch_inferior_event, normal_stop): Likewise.
3733         * thread.c (finish_thread_state_cleanup): Delete.
3734
3735 2018-04-09  Simon Marchi  <simon.marchi@polymtl.ca>
3736             Pedro Alves  <palves@redhat.com>
3737
3738         * value.c: Include "selftest.h" and "common/array-view.h".
3739         (struct range) <operator ==>: New.
3740         (test_ranges_contain): New.
3741         (check_ranges_vector): New.
3742         (test_insert_into_bit_range_vector): New.
3743         (_initialize_values): Register selftests.
3744         * common/array-view.h (operator==, operator!=): New.
3745
3746 2018-04-09  Simon Marchi  <simon.marchi@polymtl.ca>
3747
3748         * common/gdb_vecs.h (unordered_remove): Add overload that takes
3749         an iterator.
3750         * inline-frame.c: Include <algorithm>.
3751         (struct inline_state): Add constructor.
3752         (inline_state_s): Remove.
3753         (DEF_VEC_O(inline_state_s)): Remove.
3754         (inline_states): Change type to std::vector.
3755         (find_inline_frame_state): Adjust to std::vector.
3756         (allocate_inline_frame_state): Remove.
3757         (clear_inline_frame_state): Adjust to std::vector.
3758         (skip_inline_frames): Adjust to std::vector.
3759
3760 2018-04-09  Simon Marchi  <simon.marchi@polymtl.ca>
3761
3762         * tracepoint.h (struct trace_state_variable): Add constructor.
3763         <name>: Change type to std::string.
3764         * tracepoint.c (tsv_s): Remove.
3765         (DEF_VEC_O(tsv_s)): Remove.
3766         (tvariables): Change to std::vector.
3767         (create_trace_state_variable): Adjust to std::vector.
3768         (find_trace_state_variable): Likewise.
3769         (find_trace_state_variable_by_number): Likewise.
3770         (delete_trace_state_variable): Likewise.
3771         (trace_variable_command): Adjust to std::string.
3772         (delete_trace_variable_command): Likewise.
3773         (tvariables_info_1): Adjust to std::vector.
3774         (save_trace_state_variables): Likewise.
3775         (start_tracing): Likewise.
3776         (merge_uploaded_trace_state_variables): Adjust to std::vector
3777         and std::string.
3778         * target.h (struct target_ops)
3779         <to_download_trace_state_variable>: Pass reference to
3780         trace_state_variable.
3781         * target-debug.h (target_debug_print_const_trace_state_variable_r): New.
3782         * target-delegates.c: Re-generate.
3783         * mi/mi-interp.c (mi_tsv_created): Adjust to std::string.
3784         (mi_tsv_deleted): Likewise.
3785         * mi/mi-main.c (mi_cmd_trace_frame_collected): Likewise.
3786         * remote.c (remote_download_trace_state_variable): Change
3787         pointer to reference and adjust.
3788         * make-target-delegates (parse_argtypes): Handle references.
3789         (write_function_header): Likewise.
3790         (munge_type): Likewise.
3791
3792 2018-04-09  Simon Marchi  <simon.marchi@polymtl.ca>
3793
3794         * Makefile.in (SUBDIR_UNITTESTS_SRCS): Add
3795         string_view-selftests.c.
3796         * unittests/basic_string_view/capacity/1.cc: Adapt to GDB
3797         testsuite.
3798         * unittests/basic_string_view/cons/char/1.cc: Likewise.
3799         * unittests/basic_string_view/cons/char/2.cc: Likewise.
3800         * unittests/basic_string_view/cons/char/3.cc: Likewise.
3801         * unittests/basic_string_view/element_access/char/1.cc:
3802         Likewise.
3803         * unittests/basic_string_view/element_access/char/empty.cc:
3804         Likewise.
3805         * unittests/basic_string_view/element_access/char/front_back.cc:
3806         Likewise.
3807         * unittests/basic_string_view/inserters/char/2.cc: Likewise.
3808         * unittests/basic_string_view/modifiers/remove_prefix/char/1.cc:
3809         Likewise.
3810         * unittests/basic_string_view/modifiers/remove_suffix/char/1.cc:
3811         Likewise.
3812         * unittests/basic_string_view/modifiers/swap/char/1.cc:
3813         Likewise.
3814         * unittests/basic_string_view/operations/compare/char/1.cc:
3815         Likewise.
3816         * unittests/basic_string_view/operations/compare/char/13650.cc:
3817         Likewise.
3818         * unittests/basic_string_view/operations/copy/char/1.cc:
3819         Likewise.
3820         * unittests/basic_string_view/operations/data/char/1.cc:
3821         Likewise.
3822         * unittests/basic_string_view/operations/find/char/1.cc:
3823         Likewise.
3824         * unittests/basic_string_view/operations/find/char/2.cc:
3825         Likewise.
3826         * unittests/basic_string_view/operations/find/char/3.cc:
3827         Likewise.
3828         * unittests/basic_string_view/operations/find/char/4.cc:
3829         Likewise.
3830         * unittests/basic_string_view/operations/rfind/char/1.cc:
3831         Likewise.
3832         * unittests/basic_string_view/operations/rfind/char/2.cc:
3833         Likewise.
3834         * unittests/basic_string_view/operations/rfind/char/3.cc:
3835         Likewise.
3836         * unittests/basic_string_view/operations/substr/char/1.cc:
3837         Likewise.
3838         * unittests/basic_string_view/operators/char/2.cc: Likewise.
3839         * unittests/string_view-selftests.c: New file.
3840
3841 2018-04-09  Simon Marchi  <simon.marchi@polymtl.ca>
3842
3843         * unittests/basic_string_view/capacity/1.cc: New file.
3844         * unittests/basic_string_view/capacity/empty_neg.cc: New file.
3845         * unittests/basic_string_view/cons/char/1.cc: New file.
3846         * unittests/basic_string_view/cons/char/2.cc: New file.
3847         * unittests/basic_string_view/cons/char/3.cc: New file.
3848         * unittests/basic_string_view/cons/wchar_t/1.cc: New file.
3849         * unittests/basic_string_view/cons/wchar_t/2.cc: New file.
3850         * unittests/basic_string_view/cons/wchar_t/3.cc: New file.
3851         * unittests/basic_string_view/element_access/char/1.cc: New file.
3852         * unittests/basic_string_view/element_access/char/2.cc: New file.
3853         * unittests/basic_string_view/element_access/char/empty.cc: New file.
3854         * unittests/basic_string_view/element_access/char/front_back.cc: New file.
3855         * unittests/basic_string_view/element_access/wchar_t/1.cc: New file.
3856         * unittests/basic_string_view/element_access/wchar_t/2.cc: New file.
3857         * unittests/basic_string_view/element_access/wchar_t/empty.cc: New file.
3858         * unittests/basic_string_view/element_access/wchar_t/front_back.cc: New file.
3859         * unittests/basic_string_view/include.cc: New file.
3860         * unittests/basic_string_view/inserters/char/1.cc: New file.
3861         * unittests/basic_string_view/inserters/char/2.cc: New file.
3862         * unittests/basic_string_view/inserters/char/3.cc: New file.
3863         * unittests/basic_string_view/inserters/pod/10081-out.cc: New file.
3864         * unittests/basic_string_view/inserters/wchar_t/1.cc: New file.
3865         * unittests/basic_string_view/inserters/wchar_t/2.cc: New file.
3866         * unittests/basic_string_view/inserters/wchar_t/3.cc: New file.
3867         * unittests/basic_string_view/literals/types.cc: New file.
3868         * unittests/basic_string_view/literals/values.cc: New file.
3869         * unittests/basic_string_view/modifiers/remove_prefix/char/1.cc: New file.
3870         * unittests/basic_string_view/modifiers/remove_prefix/wchar_t/1.cc: New file.
3871         * unittests/basic_string_view/modifiers/remove_suffix/char/1.cc: New file.
3872         * unittests/basic_string_view/modifiers/remove_suffix/wchar_t/1.cc: New file.
3873         * unittests/basic_string_view/modifiers/swap/char/1.cc: New file.
3874         * unittests/basic_string_view/modifiers/swap/wchar_t/1.cc: New file.
3875         * unittests/basic_string_view/operations/compare/char/1.cc: New file.
3876         * unittests/basic_string_view/operations/compare/char/13650.cc: New file.
3877         * unittests/basic_string_view/operations/compare/char/2.cc: New file.
3878         * unittests/basic_string_view/operations/compare/char/70483.cc: New file.
3879         * unittests/basic_string_view/operations/compare/wchar_t/1.cc: New file.
3880         * unittests/basic_string_view/operations/compare/wchar_t/13650.cc: New file.
3881         * unittests/basic_string_view/operations/compare/wchar_t/2.cc: New file.
3882         * unittests/basic_string_view/operations/copy/char/1.cc: New file.
3883         * unittests/basic_string_view/operations/copy/wchar_t/1.cc: New file.
3884         * unittests/basic_string_view/operations/data/char/1.cc: New file.
3885         * unittests/basic_string_view/operations/data/wchar_t/1.cc: New file.
3886         * unittests/basic_string_view/operations/find/char/1.cc: New file.
3887         * unittests/basic_string_view/operations/find/char/2.cc: New file.
3888         * unittests/basic_string_view/operations/find/char/3.cc: New file.
3889         * unittests/basic_string_view/operations/find/char/4.cc: New file.
3890         * unittests/basic_string_view/operations/find/wchar_t/1.cc: New file.
3891         * unittests/basic_string_view/operations/find/wchar_t/2.cc: New file.
3892         * unittests/basic_string_view/operations/find/wchar_t/3.cc: New file.
3893         * unittests/basic_string_view/operations/find/wchar_t/4.cc: New file.
3894         * unittests/basic_string_view/operations/rfind/char/1.cc: New file.
3895         * unittests/basic_string_view/operations/rfind/char/2.cc: New file.
3896         * unittests/basic_string_view/operations/rfind/char/3.cc: New file.
3897         * unittests/basic_string_view/operations/rfind/wchar_t/1.cc: New file.
3898         * unittests/basic_string_view/operations/rfind/wchar_t/2.cc: New file.
3899         * unittests/basic_string_view/operations/rfind/wchar_t/3.cc: New file.
3900         * unittests/basic_string_view/operations/string_conversion/1.cc: New file.
3901         * unittests/basic_string_view/operations/substr/char/1.cc: New file.
3902         * unittests/basic_string_view/operations/substr/wchar_t/1.cc: New file.
3903         * unittests/basic_string_view/operators/char/2.cc: New file.
3904         * unittests/basic_string_view/operators/wchar_t/2.cc: New file.
3905         * unittests/basic_string_view/range_access/char/1.cc: New file.
3906         * unittests/basic_string_view/range_access/wchar_t/1.cc: New file.
3907         * unittests/basic_string_view/requirements/explicit_instantiation/1.cc: New file.
3908         * unittests/basic_string_view/requirements/explicit_instantiation/char/1.cc: New file.
3909         * unittests/basic_string_view/requirements/explicit_instantiation/char16_t/1.cc: New file.
3910         * unittests/basic_string_view/requirements/explicit_instantiation/char32_t/1.cc: New file.
3911         * unittests/basic_string_view/requirements/explicit_instantiation/wchar_t/1.cc: New file.
3912         * unittests/basic_string_view/requirements/typedefs.cc: New file.
3913         * unittests/basic_string_view/typedefs.cc: New file.
3914         * unittests/basic_string_view/types/1.cc: New file.
3915
3916 2018-04-09  Simon Marchi  <simon.marchi@polymtl.ca>
3917
3918         * common/gdb_string_view.h: Remove libstdc++ implementation
3919         details, adjust to gdb reality.
3920         * common/gdb_string_view.tcc: Likewise.
3921         * cli/cli-script.c (struct string_view): Remove.
3922         (user_args) <m_args>: Change element type to gdb::string_view.
3923         (user_args::insert_args): Adjust.
3924
3925 2018-04-09  Simon Marchi  <simon.marchi@polymtl.ca>
3926
3927         * common/gdb_string_view.h: New file.
3928         * common/gdb_string_view.tcc: New file.
3929
3930 2018-04-09  Simon Marchi  <simon.marchi@polymtl.ca>
3931
3932         * ax_cxx_compile_stdcxx.m4: Sync with upstream.
3933         * configure: Re-generate.
3934
3935 2018-04-09  Pedro Alves  <palves@redhat.com>
3936
3937         * gdbarch.sh: Include "observable.h" instead of "observer.h".
3938         (set_target_gdbarch): Call
3939         gdb::observers::architecture_changed.notify instead of
3940         observer_notify_architecture_changed.
3941
3942 2018-04-07  Simon Marchi  <simon.marchi@polymtl.ca>
3943
3944         * tracepoint.c (struct current_traceframe_cleanup): Remove.
3945         (do_restore_current_traceframe_cleanup): Remove.
3946         (restore_current_traceframe_cleanup_dtor): Remove.
3947         (make_cleanup_restore_current_traceframe): Remove.
3948         (scoped_restore_current_traceframe::scoped_restore_current_traceframe):
3949         New.
3950         * tracepoint.h (struct scoped_restore_current_traceframe): New.
3951         * infrun.c (fetch_inferior_event): Use
3952         scoped_restore_current_traceframe.
3953
3954 2018-04-07  Simon Marchi  <simon.marchi@polymtl.ca>
3955
3956         * dwarf2read.h (struct dwarf2_per_objfile) <n_type_units>:
3957         Remove.
3958         <n_allocated_type_units>: Remove.
3959         <all_type_units>: Change to std::vector.
3960         * dwarf2read.c (dwarf2_per_objfile::~dwarf2_per_objfile): Adjust
3961         to std::vector change.
3962         (dwarf2_per_objfile::get_cutu): Likewise.
3963         (dwarf2_per_objfile::get_tu): Likewise.
3964         (create_signatured_type_table_from_index): Likewise.
3965         (create_signatured_type_table_from_debug_names): Likewise.
3966         (dw2_symtab_iter_next): Likewise.
3967         (dw2_print_stats): Likewise.
3968         (dw2_expand_all_symtabs): Likewise.
3969         (dw2_expand_marked_cus): Likewise.
3970         (dw2_debug_names_iterator::next): Likewise.
3971         (dwarf2_initialize_objfile): Likewise.
3972         (add_signatured_type_cu_to_table): Likewise.
3973         (create_all_type_units): Likewise.
3974         (add_type_unit): Likewise.
3975         (struct tu_abbrev_offset): Add constructor.
3976         (build_type_psymtabs_1): Adjust to std::vector change.
3977         (print_tu_stats): Likewise.
3978         * dwarf-index-write.c (check_dwarf64_offsets): Likewise.
3979         (write_debug_names): Likewise.
3980
3981 2018-04-07  Simon Marchi  <simon.marchi@polymtl.ca>
3982
3983         * dwarf2read.h (struct dwarf2_per_objfile) <all_comp_units>: Likewise.
3984         Make an std::vector.
3985         <n_comp_units>: Remove.
3986         * dwarf2read.c (dwarf2_per_objfile::~dwarf2_per_objfile): Adjust
3987         to std::vector change.
3988         (dwarf2_per_objfile::get_cutu): Likewise.
3989         (dwarf2_per_objfile::get_cu): Likewise.
3990         (create_cus_from_index): Likewise.
3991         (create_addrmap_from_index): Likewise.
3992         (create_addrmap_from_aranges): Likewise.
3993         (dwarf2_read_index): Likewise.
3994         (dw2_find_last_source_symtab): Likewise.
3995         (dw2_map_symtabs_matching_filename): Likewise.
3996         (dw2_symtab_iter_next): Likewise.
3997         (dw2_print_stats): Likewise.
3998         (dw2_expand_all_symtabs): Likewise.
3999         (dw2_expand_symtabs_with_fullname): Likewise.
4000         (dw2_expand_marked_cus): Likewise.
4001         (dw2_map_symbol_filenames): Likewise.
4002         (create_cus_from_debug_names): Likewise.
4003         (dwarf2_read_debug_names): Likewise.
4004         (dw2_debug_names_iterator::next): Likewise.
4005         (dwarf2_initialize_objfile): Likewise.
4006         (set_partial_user): Likewise.
4007         (dwarf2_build_psymtabs_hard): Likewise.
4008         (read_comp_units_from_section): Remove arguments, adjust to
4009         std::vector change.
4010         (create_all_comp_units): Adjust to std::vector and
4011         read_comp_units_from_section changes.
4012         (dwarf2_find_containing_comp_unit): Adjust to std::vector
4013         change.
4014         * dwarf-index-write.c (check_dwarf64_offsets): Likewise.
4015         (psyms_seen_size): Likewise.
4016         (write_gdbindex): Likewise.
4017         (write_debug_names): Likewise.
4018
4019 2018-04-07  Simon Marchi  <simon.marchi@polymtl.ca>
4020
4021         * dwarf2read.c (create_cus_from_index_list): Replace objfile arg
4022         with dwarf2_per_objfile.
4023         (create_cus_from_index): Likewise.
4024         (create_signatured_type_table_from_index): Likewise.
4025         (dwarf2_read_index): Likewise.
4026         (dwarf2_initialize_objfile): Likewise.
4027         (dwarf2_fetch_die_loc_sect_off):  Get dwarf2_per_objfile from
4028         per_cu rather than get_dwarf2_per_objfile.
4029
4030 2018-04-07  Simon Marchi  <simon.marchi@polymtl.ca>
4031
4032         * dwarf2read.h (struct signatured_type): Forward declare.
4033         (struct dwarf2_per_objfile) <get_cutu, get_cu, get_tu>:
4034         New methods.
4035         * dwarf2read.c (dwarf2_per_objfile::get_cutu): Rename from...
4036         (dw2_get_cutu): ...this.
4037         (dwarf2_per_objfile::get_cu): Rename from...
4038         (dw2_get_cu): ...this.
4039         (dwarf2_per_objfile::get_tu): New.
4040         (create_addrmap_from_index): Adjust.
4041         (create_addrmap_from_aranges): Adjust.
4042         (dw2_find_last_source_symtab): Adjust.
4043         (dw2_map_symtabs_matching_filename): Adjust.
4044         (dw2_symtab_iter_next): Adjust.
4045         (dw2_print_stats): Adjust.
4046         (dw2_expand_all_symtabs): Adjust.
4047         (dw2_expand_symtabs_with_fullname): Adjust.
4048         (dw2_expand_marked_cus): Adjust.
4049         (dw_expand_symtabs_matching_file_matcher): Adjust.
4050         (dw2_map_symbol_filenames): Adjust.
4051         (dw2_debug_names_iterator::next): Adjust.
4052         (dwarf2_initialize_objfile): Adjust.
4053         (set_partial_user): Adjust.
4054         (dwarf2_build_psymtabs_hard): Adjust.
4055
4056 2018-04-07  Simon Marchi  <simon.marchi@polymtl.ca>
4057
4058         * dwarf2read.c (create_signatured_type_table_from_debug_names):
4059         Remove unused variables.
4060         (dw2_map_symtabs_matching_filename): Likewise.
4061         (dwarf2_record_block_ranges): Likewise.
4062         (dwarf2_read_addr_index): Likewise.
4063         (follow_die_offset): Likewise.
4064
4065 2018-04-07  Simon Marchi  <simon.marchi@polymtl.ca>
4066
4067         * progspace.c (clone_program_space): Pass SYMFILE_DEFER_BP_RESET
4068         to symbol_file_add_main.
4069
4070 2018-04-07  Simon Marchi  <simon.marchi@polymtl.ca>
4071
4072         PR mi/22299
4073         * mi/mi-console.c (do_fputc_async_safe): New.
4074         (mi_console_file::write_async_safe): New.
4075         (mi_console_file::flush): Adjust calls to fputstrn_unfiltered.
4076         * mi/mi-console.h (class mi_console_file) <write_async_safe>:
4077         New.
4078         * ui-file.c (ui_file::putstrn): Adjust call to
4079         fputstrn_unfiltered.
4080         * utils.c (printchar): Replace do_fputs and do_fprintf
4081         parameters by do_fputc.
4082         (fputstr_filtered): Adjust call to printchar.
4083         (fputstr_unfiltered): Likewise.
4084         (fputstrn_filtered): Likewise.
4085         (fputstrn_unfiltered): Add do_fputc parameter, pass to
4086         printchar.
4087         * utils.h (do_fputc_ftype): New typedef.
4088         (fputstrn_unfiltered): Add do_fputc parameter.
4089
4090 2018-04-07  Simon Marchi  <simon.marchi@polymtl.ca>
4091
4092         * regformats/i386/i386-avx.dat: Remove.
4093
4094 2018-04-07  Simon Marchi  <simon.marchi@ericsson.com>
4095
4096         PR gdb/22979
4097         * amd64-tdep.c (amd64_none_init_abi): New function.
4098         (amd64_x32_none_init_abi): New function.
4099         (_initialize_amd64_tdep): Register handlers for x86-64 and
4100         x64_32 with GDB_OSABI_NONE.
4101         * osabi.c (gdbarch_init_osabi): Allow running handlers for the
4102         GDB_OSABI_NONE osabi.
4103
4104 2018-04-07  Simon Marchi  <simon.marchi@ericsson.com>
4105
4106         PR gdb/22980
4107         * defs.h (enum gdb_osabi): Remove GDB_OSABI_UNINITIALIZED, add
4108         GDB_OSABI_NONE.
4109         * arch-utils.c (gdbarch_info_init): Don't set info->osabi.
4110         * osabi.c (gdb_osabi_names): Add "unknown" entry.
4111
4112 2018-04-07  Simon Marchi  <simon.marchi@ericsson.com>
4113
4114         * common/byte-vector.h (char_vector): New type.
4115         * target.h (target_read_alloc): Return
4116         gdb::optional<byte_vector>.
4117         (target_read_stralloc): Return gdb::optional<char_vector>.
4118         (target_get_osdata): Return gdb::optional<char_vector>.
4119         * target.c (target_read_alloc_1): Templatize.  Replacement
4120         manual memory management with vector.
4121         (target_read_alloc): Change return type, adjust.
4122         (target_read_stralloc): Change return type, adjust.
4123         (target_get_osdata): Change return type, adjust.
4124         * auxv.c (struct auxv_info) <length>: Remove.
4125         <data>: Change type to gdb::optional<byte_vector>.
4126         (auxv_inferior_data_cleanup): Free auxv_info with delete.
4127         (get_auxv_inferior_data): Allocate auxv_info with new, adjust.
4128         (target_auxv_search): Adjust.
4129         (fprint_target_auxv): Adjust.
4130         * avr-tdep.c (avr_io_reg_read_command): Adjust.
4131         * linux-tdep.c (linux_spu_make_corefile_notes): Adjust.
4132         (linux_make_corefile_notes): Adjust.
4133         * osdata.c (get_osdata): Adjust.
4134         * remote.c (remote_get_threads_with_qxfer): Adjust.
4135         (remote_memory_map): Adjust.
4136         (remote_traceframe_info): Adjust.
4137         (btrace_read_config): Adjust.
4138         (remote_read_btrace): Adjust.
4139         (remote_pid_to_exec_file): Adjust.
4140         * solib-aix.c (solib_aix_get_library_list): Adjust.
4141         * solib-dsbt.c (decode_loadmap): Don't free buf.
4142         (dsbt_get_initial_loadmaps): Adjust.
4143         * solib-svr4.c (svr4_current_sos_via_xfer_libraries): Adjust.
4144         * solib-target.c (solib_target_current_sos): Adjust.
4145         * tracepoint.c (sdata_make_value): Adjust.
4146         * xml-support.c (xinclude_start_include): Adjust.
4147         (xml_fetch_content_from_file): Adjust.
4148         * xml-support.h (xml_fetch_another): Change return type.
4149         (xml_fetch_content_from_file): Change return type.
4150         * xml-syscall.c (xml_init_syscalls_info): Adjust.
4151         * xml-tdesc.c (file_read_description_xml): Adjust.
4152         (fetch_available_features_from_target): Change return type.
4153         (target_fetch_description_xml): Adjust.
4154         (target_read_description_xml): Adjust.
4155
4156 2018-04-06  Tom Tromey  <tom@tromey.com>
4157
4158         * value.c (~value): Update.
4159         (struct value) <contents>: Now unique_xmalloc_ptr.
4160         (value_contents_bits_eq, allocate_value_contents)
4161         (value_contents_raw, value_contents_all_raw)
4162         (value_contents_for_printing, value_contents_for_printing_const)
4163         (set_value_enclosing_type): Update.
4164
4165 2018-04-06  Tom Tromey  <tom@tromey.com>
4166
4167         * value.c (range_s): Remove typedef, VEC.
4168         (struct range): Add operator<.
4169         (range_lessthan): Remove.
4170         (ranges_contain): Change type.
4171         (~value): Update.
4172         (struct value) <unavailable, optimized_out>: Now std::vector.
4173         (value_entirely_available)
4174         (value_entirely_covered_by_range_vector)
4175         (value_entirely_unavailable, value_entirely_optimized_out):
4176         Update.
4177         (insert_into_bit_range_vector): Change argument type.
4178         (find_first_range_overlap): Likewise.
4179         (struct ranges_and_idx, value_contents_bits_eq)
4180         (require_not_optimized_out, require_available): Update.
4181         (ranges_copy_adjusted): Change argument types.
4182         (value_optimized_out, value_copy, value_fetch_lazy): Update.
4183
4184 2018-04-06  Tom Tromey  <tom@tromey.com>
4185
4186         * value.c (~value): Update.
4187         (struct value) <parent>: Now a value_ref_ptr.
4188         (value_parent, set_value_parent, value_address, value_copy):
4189         Update.
4190
4191 2018-04-06  Tom Tromey  <tom@tromey.com>
4192
4193         * value.c (struct value): Add constructor, destructor, and member
4194         initializers.
4195         (allocate_value_lazy, value_decref): Update.
4196
4197 2018-04-06  Tom Tromey  <tom@tromey.com>
4198
4199         * value.c (struct value) <released, next>: Remove.
4200         (all_values): Now a std::vector.
4201         (allocate_value_lazy): Update.
4202         (value_next): Remove.
4203         (value_mark, value_free_to_mark, release_value)
4204         (value_release_to_mark): Update.
4205
4206 2018-04-06  Tom Tromey  <tom@tromey.com>
4207
4208         * value.h (fetch_subexp_value, value_release_to_mark): Update.
4209         (free_value_chain): Remove.
4210         * value.c (free_value_chain): Remove.
4211         (value_release_to_mark): Return a std::vector.
4212         * ppc-linux-nat.c (num_memory_accesses): Change "chain" to a
4213         std::vector.
4214         (check_condition): Update.
4215         * eval.c (fetch_subexp_value): Change "val_chain" to a
4216         std::vector.
4217         * breakpoint.c (update_watchpoint): Update.
4218         (can_use_hardware_watchpoint): Change "vals" to a std::vector.
4219
4220 2018-04-06  Tom Tromey  <tom@tromey.com>
4221
4222         * value.h (free_all_values): Remove.
4223         * value.c (free_all_values): Remove.
4224
4225 2018-04-06  Tom Tromey  <tom@tromey.com>
4226
4227         * value.c (VALUE_HISTORY_CHUNK, struct value_history_chunk)
4228         (value_history_chain, value_history_count): Remove.
4229         (value_history): New global.
4230         (record_latest_value, access_value_history, show_values)
4231         (preserve_values): Update.
4232
4233 2018-04-06  Tom Tromey  <tom@tromey.com>
4234
4235         * varobj.h (struct varobj) <value>: Now a value_ref_ptr.
4236         * varobj.c (varobj_set_display_format, varobj_set_value)
4237         (install_default_visualizer, construct_visualizer)
4238         (install_new_value, ~varobj, varobj_get_value_type)
4239         (my_value_of_variable, varobj_editable_p): Update.
4240         * c-varobj.c (c_describe_child, c_value_of_variable)
4241         (cplus_number_of_children, cplus_describe_child): Update.
4242         * ada-varobj.c (ada_number_of_children, ada_name_of_child)
4243         (ada_path_expr_of_child, ada_value_of_child, ada_type_of_child)
4244         (ada_value_of_variable, ada_value_is_changeable_p): Update.
4245
4246 2018-04-06  Tom Tromey  <tom@tromey.com>
4247
4248         * printcmd.c (last_examine_address): Change type to
4249         value_ref_ptr.
4250         (do_examine, x_command): Update.
4251
4252 2018-04-06  Tom Tromey  <tom@tromey.com>
4253
4254         * value.c (release_value): Update.
4255         * breakpoint.h (struct watchpoint) <val>: Now a value_ref_ptr.
4256         (struct bpstats) <val>: Now a value_ref_ptr.
4257         * breakpoint.c (update_watchpoint, breakpoint_init_inferior)
4258         (~bpstats, bpstats, bpstat_clear_actions, watchpoint_check)
4259         (~watchpoint, print_it_watchpoint, watch_command_1)
4260         (invalidate_bp_value_on_memory_change): Update.
4261
4262 2018-04-06  Tom Tromey  <tom@tromey.com>
4263
4264         * varobj.c (varobj_clear_saved_item)
4265         (update_dynamic_varobj_children, install_new_value, ~varobj):
4266         Update.
4267         * value.h (value_incref): Move declaration earlier.
4268         (value_decref): Rename from value_free.
4269         (struct value_ref_policy): New.
4270         (value_ref_ptr): New typedef.
4271         (struct value_deleter): Remove.
4272         (gdb_value_up): Remove typedef.
4273         (release_value): Change return type.
4274         (release_value_or_incref): Remove.
4275         * value.c (set_value_parent): Update.
4276         (value_incref): Change return type.
4277         (value_decref): Rename from value_free.
4278         (value_free_to_mark, free_all_values, free_value_chain): Update.
4279         (release_value): Return value_ref_ptr.
4280         (release_value_or_incref): Remove.
4281         (record_latest_value, set_internalvar, clear_internalvar):
4282         Update.
4283         * stack.c (info_frame_command): Don't call value_free.
4284         * python/py-value.c (valpy_dealloc, valpy_new)
4285         (value_to_value_object): Update.
4286         * printcmd.c (do_examine): Update.
4287         * opencl-lang.c (lval_func_free_closure): Update.
4288         * mi/mi-main.c (register_changed_p): Don't call value_free.
4289         * mep-tdep.c (mep_frame_prev_register): Don't call value_free.
4290         * m88k-tdep.c (m88k_frame_prev_register): Don't call value_free.
4291         * m68hc11-tdep.c (m68hc11_frame_prev_register): Don't call
4292         value_free.
4293         * guile/scm-value.c (vlscm_free_value_smob)
4294         (vlscm_scm_from_value): Update.
4295         * frame.c (frame_register_unwind, frame_unwind_register_signed)
4296         (frame_unwind_register_unsigned, get_frame_register_bytes)
4297         (put_frame_register_bytes): Don't call value_free.
4298         * findvar.c (address_from_register): Don't call value_free.
4299         * dwarf2read.c (dwarf2_compute_name): Don't call value_free.
4300         * dwarf2loc.c (entry_data_value_free_closure)
4301         (value_of_dwarf_reg_entry, free_pieced_value_closure)
4302         (dwarf2_evaluate_loc_desc_full): Update.
4303         * breakpoint.c (update_watchpoint, breakpoint_init_inferior)
4304         (~bpstats, bpstats, bpstat_clear_actions, watchpoint_check)
4305         (~watchpoint, watch_command_1)
4306         (invalidate_bp_value_on_memory_change): Update.
4307         * alpha-tdep.c (alpha_register_to_value): Don't call value_free.
4308
4309 2018-04-06  Simon Marchi  <simon.marchi@polymtl.ca>
4310
4311         PR gdb/23022
4312         * warning.m4: Add -Wno-error=deprecated-register.
4313         * configure: Re-generate.
4314
4315 2018-04-05  Tom Tromey  <tom@tromey.com>
4316
4317         * linespec.h: Remove include of "vec.h".
4318
4319 2018-04-05  Tom Tromey  <tom@tromey.com>
4320
4321         * linespec.c (typep): Remove typedef.
4322         (find_methods, find_superclass_methods): Take a std::vector.
4323         (find_method): Use std::vector.
4324
4325 2018-04-05  Tom Tromey  <tom@tromey.com>
4326
4327         * utils.c (compare_strings): Remove.
4328         * utils.h (compare_strings): Remove.
4329         * objc-lang.h (find_imps): Update.
4330         * objc-lang.c (find_methods): Take a std::vector.
4331         (uniquify_strings, find_imps): Likewise.
4332         * linespec.c (find_methods): Take a std::vector.
4333         (decode_objc): Use std::vector.
4334         (add_all_symbol_names_from_pspace, find_superclass_methods): Take
4335         a std::vector.
4336         (find_method, find_function_symbols): Use std::vector.
4337
4338 2018-04-05  Tom Tromey  <tom@tromey.com>
4339
4340         * completer.c (completion_tracker::completion_tracker): Remove
4341         cast.
4342         (completion_tracker::discard_completions): Likewise.
4343         * breakpoint.c (ambiguous_names_p): Remove cast.
4344         * ada-lang.c (_initialize_ada_language): Remove cast.
4345         * utils.h (streq): Update.
4346         (streq_hash): Add new declaration.
4347         * utils.c (streq): Return bool.
4348         (streq_hash): New function.
4349
4350 2018-04-05  Tom Tromey  <tom@tromey.com>
4351
4352         * linespec.c (event_location_to_sals) <case ADDRESS_LOCATION>:
4353         Remove a string copy.
4354
4355 2018-04-05  Tom Tromey  <tom@tromey.com>
4356
4357         * linespec.c (filter_results): Use std::vector.
4358         (decode_line_2, decode_line_full): Update.
4359
4360 2018-04-05  Tom Tromey  <tom@tromey.com>
4361
4362         * linespec.c (canonical_to_fullform): Return std::string.
4363         (filter_results): Update.
4364         (struct decode_line_2_item): Add constructor.
4365         <fullform, displayform>: Now std::string.
4366         (decode_line_2_compare_items): Now a std::sort comparator.
4367         (decode_line_2): Update.
4368
4369 2018-04-05  Tom Tromey  <tom@tromey.com>
4370
4371         * linespec.c (copy_token_string): Return a unique_xmalloc_ptr.
4372         (unexpected_linespec_error): Update.
4373         (linespec_parse_basic, parse_linespec): Update.
4374
4375 2018-04-05  Tom Tromey  <tom@tromey.com>
4376
4377         * linespec.c (linespec_parse_basic): Reindent.
4378
4379 2018-04-05  Tom Tromey  <tom@tromey.com>
4380
4381         * minsyms.h (iterate_over_minimal_symbols): Update.
4382         * minsyms.c (iterate_over_minimal_symbols): Take a
4383         gdb::function_view.
4384         * linespec.c (struct collect_minsyms): Remove.
4385         (compare_msyms): Now a std::sort comparator.
4386         (add_minsym): Add parameters.
4387         (search_minsyms_for_name): Update.  Use std::vector.
4388
4389 2018-04-03  Tom Tromey  <tom@tromey.com>
4390
4391         * mipsread.c (read_alphacoff_dynamic_symtab): Use
4392         gdb::byte_vector.
4393
4394 2018-04-02  Weimin Pan  <weimin.pan@oracle.com>
4395
4396         * MAINTAINERS (Write After Approval): Add Weimin Pan.
4397
4398 2018-04-02  Weimin Pan  <weimin.pan@oracle.com>
4399
4400         PR gdb/16959
4401         * cp-valprint.c: (cp_print_static_field) Fix infinite recursion when 
4402         printing static type.
4403
4404 2018-04-01  Tom Tromey  <tom@tromey.com>
4405
4406         * rs6000-nat.c (rs6000_ptrace_ldinfo): Return a byte_vector.
4407         (rs6000_xfer_shared_libraries): Update.
4408
4409 2018-04-01  Simon Marchi  <simon.marchi@polymtl.ca>
4410
4411         * common/gdb_vecs.h (char_ptr): Remove.
4412         * tracepoint.c (encode_actions_1): Remove usage of char_ptr.
4413
4414 2018-03-30  Simon Marchi  <simon.marchi@polymtl.ca>
4415
4416         * guile/scm-utils.c (gdbscm_parse_function_args): Replace VEC
4417         with std::vector.
4418         * common/gdb_vecs.h (DEF_VEC_P (char_ptr)): Remove.
4419
4420 2018-03-30  Simon Marchi  <simon.marchi@polymtl.ca>
4421
4422         * tracepoint.h (struct uploaded_tp): Initialize fields.
4423         <actions, step_actions, cmd_strings>: Change type to
4424         std::vector<char *>.
4425         * tracepoint.c (get_uploaded_tp): Allocate with new.
4426         (free_uploaded_tps): Free with delete.
4427         (parse_tracepoint_definition): Adjust to std::vector change.
4428         * breakpoint.c (read_uploaded_action): Likewise.
4429         (create_tracepoint_from_upload): Likewise.
4430         * ctf.c (ctf_write_uploaded_tp): Likewise.
4431         (SET_ARRAY_FIELD): Likewise.
4432         * tracefile-tfile.c (tfile_write_uploaded_tp): Likewise.
4433
4434 2018-03-30  Tom Tromey  <tom@tromey.com>
4435
4436         * solib-svr4.c (lm_info_read): Use gdb::byte_vector.  Return
4437         std::unique_ptr.
4438         (svr4_keep_data_in_core): Update.
4439         (svr4_read_so_list): Update.
4440
4441 2018-03-30  Tom Tromey  <tom@tromey.com>
4442
4443         * windows-nat.c (handle_output_debug_string, handle_exception):
4444         Update.
4445         * target.h (target_read_string): Update.
4446         * target.c (target_read_string): Change "string" to
4447         unique_xmalloc_ptr.
4448         * solib-svr4.c (open_symbol_file_object, svr4_read_so_list):
4449         Update.
4450         * solib-frv.c (frv_current_sos): Update.
4451         * solib-dsbt.c (dsbt_current_sos): Update.
4452         * solib-darwin.c (darwin_current_sos): Update.
4453         * linux-thread-db.c (inferior_has_bug): Update.
4454         * expprint.c (print_subexp_standard) <case OP_OBJC_MSGCALL>:
4455         Update.  Remove alloca.
4456         * ada-lang.c (ada_main_name): Update.
4457
4458 2018-03-30  Tom Tromey  <tom@tromey.com>
4459
4460         * dwarf2read.c (struct free_dwo_file_cleanup_data): Remove.
4461         (struct dwo_file_deleter): New.
4462         (dwo_file_up): New typedef.
4463         (open_and_init_dwo_file): Use dwo_file_up.
4464         (free_dwo_file_cleanup): Remove.
4465
4466 2018-03-30  Tom Tromey  <tom@tromey.com>
4467
4468         * dwarf2read.c (free_dwo_file): Remove "objfile" parameter.
4469         (free_dwo_file_cleanup, free_dwo_file_from_slot): Update.
4470
4471 2018-03-30  Tom Tromey  <tom@tromey.com>
4472
4473         * dwarf2read.c (class free_cached_comp_units): New class.
4474         (dw2_instantiate_symtab, dwarf2_build_psymtabs_hard): Use it.
4475         (free_cached_comp_units): Remove function.
4476
4477 2018-03-30  Tom Tromey  <tom@tromey.com>
4478
4479         * utils.h (make_cleanup_unpush_target): Remove.
4480         * inf-ptrace.c (struct target_unpusher): New.
4481         (target_unpush_up) New typedef.
4482         (inf_ptrace_create_inferior, inf_ptrace_attach): Use
4483         target_unpush_up.
4484         * utils.c (do_unpush_target, make_cleanup_unpush_target): Remove.
4485
4486 2018-03-27  Tom Tromey  <tom@tromey.com>
4487
4488         * utils.c (prompt_for_continue): Use unique_xmalloc_ptr.
4489
4490 2018-03-27  Pedro Alves  <palves@redhat.com>
4491             Tom Tromey  <tom@tromey.com>
4492
4493         * top.c (class gdb_readline_wrapper_cleanup): Add constructor,
4494         destructor.  Now a class.
4495         (gdb_readline_wrapper_cleanup): Remove function.
4496         (gdb_readline_wrapper): Remove cleanups.
4497
4498 2018-03-27  Tom Tromey  <tom@tromey.com>
4499
4500         * typeprint.h (struct type_print_options) <local_typedefs,
4501         global_typedefs>: Remove "struct" keyword.
4502         (class typedef_hash_table): New class.
4503         (recursively_update_typedef_hash, add_template_parameters)
4504         (create_typedef_hash, free_typedef_hash, copy_typedef_hash)
4505         (find_typedef_in_hash): Don't declare.
4506         * typeprint.c (struct typedef_hash_table): Move to typeprint.h.
4507         (typedef_hash_table::recursively_update): Rename from
4508         recursively_update_typedef_hash.  Now a member.
4509         (typedef_hash_table::add_template_parameters): Rename from
4510         add_template_parameters.  Now a member.
4511         (typedef_hash_table::typedef_hash_table): Now a constructor;
4512         rename from create_typedef_hash.
4513         (typedef_hash_table::~typedef_hash_table): Now a destructor;
4514         rename from free_typedef_hash.
4515         (do_free_typedef_hash, make_cleanup_free_typedef_hash)
4516         (do_free_global_table): Remove.
4517         (typedef_hash_table::typedef_hash_table): New constructor; renamed
4518         from copy_type_recursive.
4519         (create_global_typedef_table): Remove.
4520         (typedef_hash_table::find_global_typedef): Now a member of
4521         typedef_hash_table.
4522         (typedef_hash_table::find_typedef): Rename from
4523         find_typedef_in_hash; now a member.
4524         (whatis_exp): Update.
4525         * extension.h (struct ext_lang_type_printers): Add constructor and
4526         destructor.
4527         (start_ext_lang_type_printers, free_ext_lang_type_printers): Don't
4528         declare.
4529         * extension.c (ext_lang_type_printers::ext_lang_type_printers):
4530         Now a constructor; rename from start_ext_lang_type_printers.
4531         (ext_lang_type_printers): Now a destructor; rename from
4532         free_ext_lang_type_printers.
4533         * c-typeprint.c (find_typedef_for_canonicalize, c_print_type_1):
4534         Update.
4535         (c_type_print_base_struct_union): Update.  Remove cleanups.
4536
4537 2018-03-27  Tom Tromey  <tom@tromey.com>
4538
4539         * dwarf-index-write.c: Include <cmath>.
4540
4541 2018-03-27  Joel Brobecker  <brobecker@adacore.com>
4542
4543         * NEWS: Add entry describing new "set|show varsize-limit" command.
4544         * ada-lang.c (_initialize_ada_language): Add "set/show varsize-limit"
4545         command.
4546         * printcmd.c (_initialize_printcmd): Add "set var" alias of
4547         "set variable".
4548
4549 2018-03-27  Simon Marchi  <simon.marchi@ericsson.com>
4550
4551         * Makefile.in (COMMON_SFILES): Add dwarf-index-common.c and
4552         dwarf-index-write.c
4553         (HFILES_NO_SRCDIR): Add dwarf-index-common.h and dwarf2read.h.
4554         * dwarf-index-common.c: New file.
4555         * dwarf-index-common.h: New file.
4556         * dwarf-index-write.c: New file.
4557         * dwarf2read.c: Include dwarf2read.h and dwarf-index-common.h.
4558         (struct dwarf2_section_info): Move from here.
4559         (dwarf2_section_info_def): Likewise.
4560         (DEF_VEC_O (dwarf2_section_info_def)): Likewise.
4561         (offset_type): Likewise.
4562         (DW2_GDB_INDEX_SYMBOL_STATIC_SET_VALUE): Likewise.
4563         (DW2_GDB_INDEX_SYMBOL_KIND_SET_VALUE): Likewise.
4564         (DW2_GDB_INDEX_CU_SET_VALUE): Likewise.
4565         (byte_swap): Likewise.
4566         (MAYBE_SWAP): Likewise.
4567         (dwarf2_per_cu_ptr): Likewise.
4568         (DEF_VEC_P (dwarf2_per_cu_ptr)): Likewise.
4569         (struct tu_stats): Likewise.
4570         (struct dwarf2_per_objfile): Likewise.
4571         (struct dwarf2_per_cu_data): Likewise.
4572         (struct signatured_type): Likewise.
4573         (sig_type_ptr): Likewise.
4574         (DEF_VEC_P (sig_type_ptr)): Likewise.
4575         (INDEX4_SUFFIX): Likewise.
4576         (INDEX5_SUFFIX): Likewise.
4577         (DEBUG_STR_SUFFIX): Likewise.
4578         (dwarf2_read_section): Make non-static.
4579         (mapped_index_string_hash): Move from here.
4580         (dwarf5_djb_hash): Likewise.
4581         (file_write): Likewise.
4582         (class data_buf): Likewise.
4583         (struct symtab_index_entry): Likewise.
4584         (struct mapped_symtab): Likewise.
4585         (find_slot): Likewise.
4586         (hash_expand): Likewise.
4587         (add_index_entry): Likewise.
4588         (uniquify_cu_indices): Likewise.
4589         (class c_str_view): Likewise.
4590         (class c_str_view_hasher): Likewise.
4591         (class vector_hasher): Likewise.
4592         (write_hash_table): Likewise.
4593         (psym_index_map): Likewise.
4594         (struct addrmap_index_data): Likewise.
4595         (add_address_entry): Likewise.
4596         (add_address_entry_worker): Likewise.
4597         (write_address_map): Likewise.
4598         (symbol_kind): Likewise.
4599         (write_psymbols): Likewise.
4600         (struct signatured_type_index_data): Likewise.
4601         (write_one_signatured_type): Likewise.
4602         (recursively_count_psymbols): Likewise.
4603         (recursively_write_psymbols): Likewise.
4604         (class debug_names): Likewise.
4605         (check_dwarf64_offsets): Likewise.
4606         (psyms_seen_size): Likewise.
4607         (write_gdbindex): Likewise.
4608         (write_debug_names): Likewise.
4609         (assert_file_size): Likewise.
4610         (write_psymtabs_to_index): Likewise.
4611         (save_gdb_index_command): Likewise.
4612         (_initialize_dwarf2_read): Don't register the "save gdb-index"
4613         command.
4614         * dwarf2read.h: New file.
4615
4616 2018-03-27  Joel Brobecker  <brobecker@adacore.com>
4617
4618         PR gdb/22670
4619         * dwarf2read.c (dwarf2_physname): Do not return the demangled
4620         symbol name if the CU's language stores symbol names in linkage
4621         format.
4622         * language.h (struct language_defn)
4623         <la_store_sym_names_in_linkage_form_p>: New field.  Adjust
4624         all instances of this struct.
4625
4626 2018-03-26  Tom Tromey  <tom@tromey.com>
4627
4628         * stack.c (backtrace_command_1): Remove verbose code.
4629
4630 2018-03-26  Tom Tromey  <tom@tromey.com>
4631
4632         * python/py-framefilter.c (py_print_type): Don't catch
4633         exceptions.  Return void.
4634         (py_print_value): Likewise.
4635         (py_print_single_arg): Likewise.
4636         (enumerate_args): Don't catch exceptions.
4637         (py_print_args): Likewise.
4638         (py_print_frame): Likewise.
4639         (gdbpy_apply_frame_filter): Catch exceptions here.
4640
4641 2018-03-26  Tom Tromey  <tom@tromey.com>
4642
4643         * stack.c (_initialize_stack): Remove trailing newlines from help
4644         text.  Add "Usage" line to "backtrace" help.
4645
4646 2018-03-26  Tom Tromey  <tom@tromey.com>
4647
4648         PR python/16486:
4649         * python/py-framefilter.c (py_print_args): Call wrap_hint.
4650
4651 2018-03-26  Tom Tromey  <tom@tromey.com>
4652
4653         * python/py-framefilter.c (py_print_single_arg): Return
4654         EXT_LANG_BT_ERROR from catch.
4655
4656 2018-03-26  Tom Tromey  <tom@tromey.com>
4657
4658         PR backtrace/15584:
4659         * stack.c (backtrace_command_1): Move some code into no-filters
4660         "if".
4661
4662 2018-03-26  Tom Tromey  <tom@tromey.com>
4663
4664         * python/py-framefilter.c (throw_quit_or_print_exception): New
4665         function.
4666         (gdbpy_apply_frame_filter): Use it.
4667
4668 2018-03-26  Tom Tromey  <tom@tromey.com>
4669
4670         PR cli/17716:
4671         * python/py-framefilter.c (py_print_type, py_print_value)
4672         (enumerate_args, py_print_args, gdbpy_apply_frame_filter): Use
4673         RETURN_MASK_ERROR.
4674
4675 2018-03-26  Tom Tromey  <tom@tromey.com>
4676
4677         * python/py-framefilter.c (enumerate_args): Use
4678         gdb::unique_xmalloc_ptr.
4679
4680 2018-03-26  Tom Tromey  <tom@tromey.com>
4681
4682         * python/py-framefilter.c (py_print_frame): Return
4683         EXT_LANG_BT_OK.
4684         (gdbpy_apply_frame_filter): Update comment.
4685         * extension.h (enum ext_lang_bt_status) <EXT_LANG_BT_COMPLETED>:
4686         Remove.
4687         <EXT_LANG_BT_NO_FILTERS>: Change value.
4688
4689 2018-03-26  Tom Tromey  <tom@tromey.com>
4690
4691         PR backtrace/15582:
4692         * stack.c (backtrace_command): Parse "hide" argument.
4693         * python/py-framefilter.c (py_print_frame): Handle PRINT_HIDE.
4694         * extension.h (enum frame_filter_flags) <PRINT_HIDE>: New
4695         constant.
4696
4697 2018-03-26  Tom Tromey  <tom@tromey.com>
4698
4699         * stack.c (backtrace_command_1): Remove "show_locals" parameter,
4700         add "flags".
4701         (backtrace_command): Remove "fulltrace", add "flags".
4702
4703 2018-03-26  Tom Tromey  <tom@tromey.com>
4704
4705         * stack.c (backtrace_command): Rewrite command line parsing.
4706
4707 2018-03-26  Simon Marchi  <simon.marchi@ericsson.com>
4708
4709         * dwarf2read.c (DEF_VEC_I(offset_type)): Remove.
4710
4711 2018-03-26  Simon Marchi  <simon.marchi@ericsson.com>
4712
4713         * filename-seen-cache.h: Add include guard.
4714
4715 2018-03-26  Keith Seitz  <keiths@redhat.com>
4716
4717         * symfile.c (place_section): Remove "struct" from section_addr_info
4718         in comment.
4719         * windows-nat.c (struct safe_symbol_file_add_args) <addrs>: Remove
4720         "struct" keyword from section_addr_info.
4721
4722 2018-03-26  Alan Hayward  <alan.hayward@arm.com>
4723
4724         * regformats/regdef.h (reg): Add constructors.
4725
4726 2018-03-25  Pedro Alves  <palves@redhat.com>
4727
4728         * eval.c (evaluate_funcall): Swap OP_VAR_MSYM_VALUE/OP_VAR_VALUE
4729         if then/else bodies in var_func_name extraction.
4730
4731 2018-03-23  Weimin Pan  <weimin.pan@oracle.com>
4732
4733         * minsyms.c (lookup_minimal_symbol_and_objfile): Use
4734         lookup_minimal_symbol() to find symbol entry.
4735         * minsyms.h (lookup_minimal_symbol_and_objfile): Update comment.
4736
4737 2018-03-23  Keith Seitz  <keiths@redhat.com>
4738
4739         PR c++/22968
4740         * dwarf2read.c (scan_partial_symbols): Scan structs/classes for
4741         nested type definitions for C++, too.
4742
4743 2018-03-23  Tom Tromey  <tom@tromey.com>
4744
4745         * machoread.c (struct oso_el): Add a constructor.  Don't define as
4746         a typedef.
4747         (macho_register_oso): Remove.
4748         (macho_symtab_read): Take a std::vector.
4749         (oso_el_compare_name): Now a std::sort comparator.
4750         (macho_symfile_read_all_oso): Take a std::vector.
4751         (macho_symfile_read): Use std::vector.  Remove cleanups.
4752
4753 2018-03-22  Tom Tromey  <tom@tromey.com>
4754
4755         * record-full.c (record_full_exec_insn): Use gdb::byte_vector.
4756         (record_full_goto_bookmark): Use std::string.
4757
4758 2018-03-22  Pedro Franco de Carvalho  <pedromfc@linux.vnet.ibm.com>
4759
4760         PR tdep/18295
4761         * rs6000-tdep.c (skip_prologue): Match both stwux and stdux
4762         a single mask.
4763
4764 2018-03-22  Pedro Franco de Carvalho  <pedromfc@linux.vnet.ibm.com>
4765
4766         * rs6000-tdep.c (store_insn_p): New function.
4767         (skip_prologue): New variable alloca_reg_offset. Set lr_reg
4768         and cr_reg to their unshifted values. Use store_insn_p to
4769         match LR saves using either R1 or fdata->alloca_reg. Use
4770         store_insn_p to match CR saves. Set alloca_reg_offset
4771         when alloca_reg and framep are set. Remove lr_reg shift
4772         when assigning to fdata->lr_register.
4773
4774 2018-03-22  Andreas Arnez  <arnez@linux.vnet.ibm.com>
4775
4776         * linux-tdep.c (linux_info_proc): For "info proc cmdline", print
4777         command line args instead of emitting a warning.
4778
4779 2018-03-22  Simon Marchi  <simon.marchi@polymtl.ca>
4780
4781         * tracepoint.h (struct static_tracepoint_marker): Initialize
4782         fields, define default constructor, move constructor and move
4783         assignment, disable the rest.
4784         <str_id, extra>: Make std::string.
4785         (release_static_tracepoint_marker): Remove.
4786         (free_current_marker): Remove.
4787         * tracepoint.c (free_current_marker): Remove.
4788         (parse_static_tracepoint_marker_definition): Adjust to
4789         std::string, use new hex2str overload.
4790         (release_static_tracepoint_marker): Remove.
4791         (print_one_static_tracepoint_marker): Get marker by reference
4792         and adjust to std::string.
4793         (info_static_tracepoint_markers_command): Adjust to std::vector
4794         changes
4795         * target.h (static_tracepoint_marker_p): Remove typedef.
4796         (DEF_VEC_P(static_tracepoint_marker_p)): Remove.
4797         (struct target_ops) <to_static_tracepoint_marker_at>: Return
4798         bool.
4799         <to_static_tracepoint_markers_by_strid>: Return std::vector.
4800         * target-debug.h
4801         (target_debug_print_VEC_static_tracepoint_marker_p_p): Remove.
4802         (target_debug_print_std_vector_static_tracepoint_marker): New.
4803         (target_debug_print_struct_static_tracepoint_marker_p): Rename
4804         to...
4805         (target_debug_print_static_tracepoint_marker_p): ... this.
4806         * target-delegates.c: Re-generate.
4807         * breakpoint.h (struct tracepoint) <static_trace_marker_id>:
4808         Make std::string.
4809         * breakpoint.c (init_breakpoint_sal): Adjust to std::string.
4810         (decode_static_tracepoint_spec): Adjust to std::vector.
4811         (tracepoint_print_one_detail): Adjust to std::string.
4812         (strace_marker_decode_location): Adjust to std::string.
4813         (update_static_tracepoint): Adjust to std::string, remove call
4814         to release_static_tracepoint_marker.
4815         * linux-nat.c (linux_child_static_tracepoint_markers_by_strid):
4816         Adjust to std::vector.
4817         * remote.c (remote_static_tracepoint_marker_at): Return bool.
4818         (remote_static_tracepoint_markers_by_strid): Adjust to
4819         std::vector.
4820         * common/rsp-low.h (hex2str): New overload with explicit count
4821         of bytes.
4822         * common/rsp-low.c (hex2str): New overload with explicit count
4823         of bytes.
4824         * unittests/rsp-low-selftests.c (test_hex2str): New function.
4825         (_initialize_rsp_low_selftests): Add test_hex2str test.
4826         * unittests/tracepoint-selftests.c
4827         (test_parse_static_tracepoint_marker_definition): Adjust to
4828         std::string.
4829
4830 2018-03-22  Simon Marchi  <simon.marchi@polymtl.ca>
4831
4832         * tracepoint.c (parse_static_tracepoint_marker_definition):
4833         Consider case where the definition is followed by more
4834         definitions.
4835         * Makefile.in (SUBDIR_UNITTESTS_SRCS): Add
4836         tracepoint-selftests.c.
4837         * unittests/tracepoint-selftests.c: New.
4838
4839 2018-03-21  Pedro Franco de Carvalho  <pedromfc@linux.vnet.ibm.com>
4840
4841         * MAINTAINERS (Write After Approval): Add Pedro Franco de
4842         Carvalho.
4843
4844 2018-03-20  Stephen Roberts  <stephen.roberts@arm.com>
4845
4846         * symtab.c (find_pc_sect_line): fixed indentation.
4847
4848 2018-03-20  Stephen Roberts  <stephen.roberts@arm.com>
4849
4850         * symtab.c (find_pc_sect_line): now uses binary search.
4851
4852 2018-03-19  Tom Tromey  <tom@tromey.com>
4853
4854         * rust-exp.y (struct_expr_tail, struct_expr_list): Add plain
4855         "IDENT" production.
4856
4857 2018-03-19  Pedro Alves  <palves@redhat.com>
4858             Tom Tromey  <tom@tromey.com>
4859
4860         * unittests/observable-selftests.c: New file.
4861         * common/observable.h: New file.
4862         * observable.h: New file.
4863         * ada-lang.c, ada-tasks.c, agent.c, aix-thread.c, annotate.c,
4864         arm-tdep.c, auto-load.c, auxv.c, break-catch-syscall.c,
4865         breakpoint.c, bsd-uthread.c, cli/cli-interp.c, cli/cli-setshow.c,
4866         corefile.c, dummy-frame.c, event-loop.c, event-top.c, exec.c,
4867         extension.c, frame.c, gdbarch.c, guile/scm-breakpoint.c,
4868         infcall.c, infcmd.c, inferior.c, inflow.c, infrun.c, jit.c,
4869         linux-tdep.c, linux-thread-db.c, m68klinux-tdep.c,
4870         mi/mi-cmd-break.c, mi/mi-interp.c, mi/mi-main.c, objfiles.c,
4871         ppc-linux-nat.c, ppc-linux-tdep.c, printcmd.c, procfs.c,
4872         python/py-breakpoint.c, python/py-finishbreakpoint.c,
4873         python/py-inferior.c, python/py-unwind.c, ravenscar-thread.c,
4874         record-btrace.c, record-full.c, record.c, regcache.c, remote.c,
4875         riscv-tdep.c, sol-thread.c, solib-aix.c, solib-spu.c, solib.c,
4876         spu-multiarch.c, spu-tdep.c, stack.c, symfile-mem.c, symfile.c,
4877         symtab.c, thread.c, top.c, tracepoint.c, tui/tui-hooks.c,
4878         tui/tui-interp.c, valops.c: Update all users.
4879         * tui/tui-hooks.c (tui_bp_created_observer)
4880         (tui_bp_deleted_observer, tui_bp_modified_observer)
4881         (tui_inferior_exit_observer, tui_before_prompt_observer)
4882         (tui_normal_stop_observer, tui_register_changed_observer):
4883         Remove.
4884         (tui_observers_token): New global.
4885         (attach_or_detach, tui_attach_detach_observers): New functions.
4886         (tui_install_hooks, tui_remove_hooks): Use
4887         tui_attach_detach_observers.
4888         * record-btrace.c (record_btrace_thread_observer): Remove.
4889         (record_btrace_thread_observer_token): New global.
4890         * observer.sh: Remove.
4891         * observer.c: Rename to observable.c.
4892         * observable.c (namespace gdb_observers): Define new objects.
4893         (observer_debug): Move into gdb_observers namespace.
4894         (struct observer, struct observer_list, xalloc_observer_list_node)
4895         (xfree_observer_list_node, generic_observer_attach)
4896         (generic_observer_detach, generic_observer_notify): Remove.
4897         (_initialize_observer): Update.
4898         Don't include observer.inc.
4899         * Makefile.in (generated_files): Remove observer.h, observer.inc.
4900         (clean mostlyclean): Likewise.
4901         (observer.h, observer.inc): Remove targets.
4902         (SUBDIR_UNITTESTS_SRCS): Add observable-selftests.c.
4903         (COMMON_SFILES): Use observable.c, not observer.c.
4904         * .gitignore: Remove observer.h.
4905
4906 2018-03-18  Tom Tromey  <tom@tromey.com>
4907
4908         * solib.c (gdb_bfd_lookup_symbol_from_symtab): Use
4909         gdb::def_vector.
4910         (bfd_lookup_symbol_from_dyn_symtab): Likewise.
4911
4912 2018-03-17  Tom Tromey  <tom@tromey.com>
4913
4914         * auto-load.c (auto_load_objfile_script_1): Use std::string.
4915
4916 2018-03-17  Tom Tromey  <tom@tromey.com>
4917
4918         * target.c (class scoped_target_fd): New.
4919         (target_fileio_close_cleanup): Remove.
4920         (target_fileio_read_alloc_1): Use scoped_target_fd.
4921
4922 2018-03-16  Simon Marchi  <simon.marchi@polymtl.ca>
4923
4924         * silent-rules.mk: New.
4925         * Makefile.in: Include silent-rules.mk
4926         (srcdir, VPATH, top_srcdir): Move up.
4927         (COMPILE): Add ECHO_CXX.
4928         (test-cp-name-parser$(EXEEXT)): Add ECHO_CXXLD.
4929         (init.c): Add ECHO_INIT_C.
4930         (gdb$(EXEEXT)): Add SILENCE and ECHO_CXXLD.
4931         (version.c): Add ECHO_GEN.
4932         (printcmd.o): Add ECHO_CXX.
4933         (target-float.o): Add ECHO_CXX.
4934         (ada-exp.o): Add ECHO_CXX.
4935         (stamp-xml): Add SILENCE and ECHO_GEN_XML_BUILTIN.
4936         (insight$(EXEEXT)): Add ECHO_CXXLD.
4937         * gnulib/configure.ac: Add AM_SILENT_RULES.
4938         * gnulib/aclocal.m4: Re-generate.
4939         * gnulib/configure: Re-generate.
4940         * gnulib/import/Makefile.in: Re-generate.
4941
4942 2018-03-16  Tom Tromey  <tom@tromey.com>
4943
4944         * xcoffread.c (xcoff_symfile_offsets): Change type of "addrs".
4945         * utils.h (make_cleanup_free_section_addr_info): Don't declare.
4946         * utils.c (do_free_section_addr_info)
4947         (make_cleanup_free_section_addr_info): Remove.
4948         * symfile.h (struct other_sections): Add constructor.
4949         (struct section_addr_info): Remove.
4950         (section_addr_info): New typedef.
4951         (struct sym_fns) <sym_offsets>: Change type of parameter.
4952         (build_section_addr_info_from_objfile)
4953         (relative_addr_info_to_section_offsets, addr_info_make_relative)
4954         (default_symfile_offsets, symbol_file_add)
4955         (symbol_file_add_from_bfd)
4956         (build_section_addr_info_from_section_table): Update.
4957         (alloc_section_addr_info, free_section_addr_info): Don't declare.
4958         * symfile.c (alloc_section_addr_info): Remove.
4959         (build_section_addr_info_from_section_table): Change return type.
4960         Update.
4961         (build_section_addr_info_from_bfd)
4962         (build_section_addr_info_from_objfile): Likewise.
4963         (free_section_addr_info): Remove.
4964         (relative_addr_info_to_section_offsets): Change type of "addrs".
4965         (addrs_section_compar): Now a std::sort comparator.
4966         (addrs_section_sort): Change return type.
4967         (addr_info_make_relative): Change type of "addrs".  Update.
4968         (default_symfile_offsets, syms_from_objfile_1)
4969         (syms_from_objfile, symbol_file_add_with_addrs): Likewise.
4970         (symbol_file_add_separate): Update.
4971         (symbol_file_add): Change type of "addrs".  Update.
4972         (add_symbol_file_command): Update.  Remove cleanups.
4973         * symfile-mem.c (symbol_file_add_from_memory): Update.  Remove
4974         cleanups.
4975         * symfile-debug.c (debug_sym_offsets): Change type of "info".
4976         * solib.c (solib_read_symbols): Update.
4977         * objfiles.c (objfile_relocate): Update.  Remove cleanups.
4978         * machoread.c (macho_symfile_offsets): Update.
4979         * jit.c (jit_bfd_try_read_symtab): Update.
4980
4981 2018-03-15  Simon Marchi  <simon.marchi@polymtl.ca>
4982
4983         * Makefile.in (SUBDIR_UNITTESTS_SRCS): Add
4984         unittests/utils-selftests.c.
4985         * unittests/utils-selftests.c: New file.
4986
4987 2018-03-14  Tom Tromey  <tom@tromey.com>
4988
4989         PR cli/14977:
4990         * printcmd.c (printf_c_string, printf_wide_c_string): Special case
4991         for NULL.
4992
4993 2018-03-14  Tom Tromey  <tom@tromey.com>
4994
4995         PR cli/19918:
4996         * printcmd.c (printf_pointer): Allow "-" in format.
4997
4998 2018-03-14  Tom Tromey  <tom@tromey.com>
4999
5000         * printcmd.c (_initialize_printcmd): Add usage to printf.
5001
5002 2018-03-14  Yao Qi  <qiyao@sourceware.org>
5003
5004         * MAINTAINERS: Update my email address.
5005
5006 2018-03-13  Tom Tromey  <tom@tromey.com>
5007
5008         * machoread.c (macho_check_dsym): Change filenamep to a
5009         std::string*.
5010         (macho_symfile_read): Update.
5011         * symfile.c (load_command): Use std::string.
5012
5013 2018-03-12  Andrew Burgess  <andrew.burgess@embecosm.com>
5014
5015         * riscv-tdep.c (riscv_sw_breakpoint_from_kind): Add localization
5016         to error message string.
5017         (riscv_register_name): Use xsnprintf instead of sprintf.
5018         (riscv_insn::fetch_instruction): Use gdb_assert instead of
5019         internal_error.
5020         (riscv_print_arg_location): Use gdb_assert_not_reached instead of
5021         error.
5022         (riscv_push_dummy_call): Likewise.
5023
5024 2018-03-12  Tom Tromey  <tom@tromey.com>
5025
5026         * rs6000-aix-tdep.c (rs6000_aix_core_xfer_shared_libraries_aix):
5027         Use gdb::byte_vector.
5028         * arm-tdep.c (arm_exidx_new_objfile): Use gdb::byte_vector.
5029
5030 2018-03-12  Yao Qi  <yao.qi@linaro.org>
5031
5032         * ia64-libunwind-tdep.c (libunwind_get_reg_special): Change
5033         parameter type to readable_regcache.
5034         * ia64-libunwind-tdep.h (libunwind_get_reg_special): Update
5035         the declaration.
5036
5037 2018-03-11  Tom Tromey  <tom@tromey.com>
5038
5039         * dwarf2read.c (struct nextfield): Add initializers.
5040         (struct nextfnfield): Remove.
5041         (struct fnfieldlist): Add initializers.  Remove "length" and
5042         "head", use std::vector.
5043         (struct decl_field_list): Remove.
5044         (struct field_info): Add initializers.
5045         <fields, baseclasses>: Now std::vector.
5046         <nbaseclasses, nfnfields, typedef_field_list_count,
5047         nested_types_list_count>: Remove.
5048         (dwarf2_add_field, dwarf2_add_type_defn)
5049         (dwarf2_attach_fields_to_type, dwarf2_add_member_fn)
5050         (dwarf2_attach_fn_fields_to_type, handle_struct_member_die)
5051         (process_structure_scope): Update.
5052
5053 2018-03-11  Tom Tromey  <tom@tromey.com>
5054
5055         * dwarf2read.c (sort_tu_by_abbrev_offset): Change to be suitable
5056         for use by std::sort.
5057         (build_type_psymtabs_1): Use std::vector.
5058
5059 2018-03-09  Eli Zaretskii  <eliz@gnu.org>
5060
5061         * top.c (print_gdb_configuration): Reflect LIBIPT, LIBMEMCHECK,
5062         and LIBMPFR in the printed configuration.
5063
5064 2018-03-08  Tom Tromey  <tom@tromey.com>
5065
5066         * source.c (get_filename_and_charpos): Use scoped_fd.
5067         * nto-procfs.c (procfs_open_1): Use scoped_fd.
5068         (procfs_pidlist): Likewise.
5069         * procfs.c (proc_get_LDT_entry): Use scoped_fd.
5070         (iterate_over_mappings): Likewise.
5071
5072 2018-03-08  Tom Tromey  <tom@tromey.com>
5073
5074         * infcall.c (struct call_return_meta_info)
5075         <stack_temporaries_enabled>: Remove.
5076         (get_call_return_value, call_function_by_hand_dummy): Update.
5077         * thread.c (disable_thread_stack_temporaries): Remove.
5078         (enable_thread_stack_temporaries): Remove.
5079         (thread_stack_temporaries_enabled_p): Return bool.
5080         (push_thread_stack_temporary, value_in_thread_stack_temporaries)
5081         (get_last_thread_stack_temporary): Update.
5082         * eval.c (evaluate_subexp): Update.
5083         * gdbthread.h (class enable_thread_stack_temporaries): Now a
5084         class, not a function.
5085         (value_ptr, value_vec): Remove typedefs.
5086         (class thread_info) <stack_temporaries_enabled>: Now bool.
5087         <stack_temporaries>: Now a std::vector.
5088         (thread_stack_temporaries_enabled_p)
5089         (value_in_thread_stack_temporaries): Return bool.
5090
5091 2018-03-08  Simon Marchi  <simon.marchi@ericsson.com>
5092
5093         * remote.c (putpkt_binary): Fix omitted bytes reporting.
5094         (getpkt_or_notif_sane_1): Likewise.
5095
5096 2018-03-08  Simon Marchi  <simon.marchi@polymtl.ca>
5097
5098         * build-id.c (build_id_to_debug_bfd): Use std::string.
5099
5100 2018-03-08  Simon Marchi  <simon.marchi@polymtl.ca>
5101
5102         * build-id.c (find_separate_debug_file_by_buildid): Return
5103         std::string.
5104         * build-id.h (find_separate_debug_file_by_buildid): Return
5105         std::string.
5106         * coffread.c (coff_symfile_read): Adjust to std::string.
5107         * elfread.c (elf_symfile_read): Adjust to std::string.
5108         * symfile.c (separate_debug_file_exists): Change parameter to
5109         std::string.
5110         (find_separate_debug_file): Return std::string.
5111         (find_separate_debug_file_by_debuglink): Return std::string.
5112         * symfile.h (find_separate_debug_file_by_debuglink): Return
5113         std::string.
5114
5115 2018-03-08  Simon Marchi  <simon.marchi@polymtl.ca>
5116
5117         * common/xml-utils.c (xml_escape_text): Move code to...
5118         (xml_escape_text_append): ... this new function.
5119         * common/xml-utils.h (xml_escape_text_append): New declaration.
5120         * unittests/xml-utils-selftests.c (test_xml_escape_text_append):
5121         New function.
5122         (_initialize_xml_utils): register test_xml_escape_text_append as
5123         a selftest.
5124
5125 2018-03-07  Alan Hayward  <alan.hayward@arm.com>
5126
5127         * defs.h: Remove MAX_REGISTER_SIZE.
5128         * regcache.c (init_regcache_descr): Remove MAX_REGISTER_SIZE
5129         asserts.
5130         * python/py-unwind.c (pyuw_sniffer): Likewise.
5131
5132 2018-03-07  Tom Tromey  <tom@tromey.com>
5133
5134         * linux-tdep.c (linux_info_proc): Update.
5135         * target.h (struct target_ops) <to_fileio_readlink>: Return
5136         optional<string>.
5137         (target_fileio_readlink): Return optional<string>.
5138         * remote.c (remote_hostio_readlink): Return optional<string>.
5139         * inf-child.c (inf_child_fileio_readlink): Return
5140         optional<string>.
5141         * target.c (target_fileio_readlink): Return optional<string>.
5142
5143 2018-03-07  Andrew Burgess  <andrew.burgess@embecosm.com>
5144
5145         * regcache.c (cooked_read_test): Add riscv to the list of
5146         architectures that have a save_reggroup.
5147
5148 2018-03-07  Andreas Arnez  <arnez@linux.vnet.ibm.com>
5149
5150         * gnu-v3-abi.c (gnuv3_rtti_type): Add early exit if the given
5151         value is not a dynamic class object.
5152
5153 2018-03-06  Tom Tromey  <tom@tromey.com>
5154
5155         * rust-exp.y: Formatting fixes.
5156
5157 2018-03-06  Andrew Burgess  <andrew.burgess@embecosm.com>
5158
5159         * riscv-tdep.c (riscv_register_name): Remove target description
5160         support.
5161         (riscv_gdbarch_init): Remove target description check.
5162
5163 2018-03-06  Andrew Burgess  <andrew.burgess@embecosm.com>
5164
5165         * riscv-tdep.c: Remove 'Contributed by ...' lines from header
5166         comment.
5167         * riscv-tdep.h: Likewise.
5168
5169 2018-03-06  Andrew Burgess  <andrew.burgess@embecosm.com>
5170
5171         * riscv-tdep.c (riscv_pseudo_register_read): Delete.
5172         (riscv_pseudo_register_write): Delete.
5173         (riscv_gdbarch_init): Remove all use of pseudo registers.
5174
5175 2018-03-06  Simon Marchi  <simon.marchi@polymtl.ca>
5176
5177         * record-btrace.c (btrace_print_lines): Replace cleanup
5178         parameter with RAII equivalents.
5179         (btrace_insn_history): Replace cleanup with RAII equivalents.
5180         * ui-out.h (make_cleanup_ui_out_list_begin_end,
5181         make_cleanup_ui_out_tuple_begin_end): Remove.
5182         * ui-out.c (struct ui_out_end_cleanup_data, do_cleanup_end,
5183         make_cleanup_ui_out_end, make_cleanup_ui_out_tuple_begin_end,
5184         make_cleanup_ui_out_list_begin_end): Remove.
5185
5186 2018-03-06  Simon Marchi  <simon.marchi@polymtl.ca>
5187
5188         * record-btrace.c (record_btrace_maybe_mark_async_event): Change
5189         parameter types to std::vector.  Use bool.
5190         (record_btrace_wait): Replace VEC(tp_t) with
5191         std::vector<thread_info *>.
5192         * common/gdb_vecs.h (unordered_remove, ordered_remove): New.
5193
5194 2018-03-06  Simon Marchi  <simon.marchi@polymtl.ca>
5195
5196         * record-btrace.c (record_btrace_disable_callback): Remove.
5197         (struct scoped_btrace_disable): New.
5198         (record_btrace_open): Use scoped_btrace_disable.
5199
5200 2018-03-06  Andrew Burgess  <andrew.burgess@embecosm.com>
5201
5202         * riscv-tdep.c (riscv_return_value): Change type to ULONGEST for
5203         reading values from registers.
5204
5205 2018-03-06  Andrew Burgess  <andrew.burgess@embecosm.com>
5206
5207         * riscv-tdep.c (riscv_push_dummy_call): Use core_addr_to_string_nz
5208         where appropriate.
5209
5210 2018-03-06  Andrew Burgess  <andrew.burgess@embecosm.com>
5211
5212         * riscv-tdep.c (riscv_print_arg_location): Add header comment,
5213         change parameter type.  Use GDB's print functions, and use
5214         core_addr_to_string where appropriate.
5215         (riscv_push_dummy_call): Use core_addr_to_string where
5216         appropriate, update call to riscv_print_arg_location, and reindent
5217         a few lines.
5218         (riscv_return_value): Update call to riscv_print_arg_location.
5219
5220 2018-03-06  Andrew Burgess  <andrew.burgess@embecosm.com>
5221             Tim Newsome <tim@sifive.com>
5222             Albert Ou <a0u@eecs.berkeley.edu>
5223             Darius Rad <darius@bluespec.com>
5224
5225         * Makefile.in (ALL_TARGET_OBS): Add riscv-tdep.o
5226         (HFILES_NO_SRCDIR): Add riscv-tdep.h.
5227         (ALLDEPFILES): Add riscv-tdep.c
5228         * configure.tgt: Add riscv support.
5229         * riscv-tdep.c: New file.
5230         * riscv-tdep.h: New file.
5231         * NEWS: Mention new target.
5232         * MAINTAINERS: Add entry for riscv.
5233
5234 2018-03-06  Andrew Burgess  <andrew.burgess@embecosm.com>
5235
5236         * amd64-tdep.c (amd64_classify_aggregate): Ignore zero sized
5237         fields within aggregates.
5238
5239 2018-03-04  Simon Marchi  <simon.marchi@polymtl.ca>
5240
5241         * record-btrace.c (btrace_print_lines): Change type of flags to
5242         gdb_disassembly_flags.
5243
5244 2018-03-04  John Baldwin  <jhb@FreeBSD.org>
5245
5246         * fbsd-nat.c: Include "inf-ptrace.h".
5247         (USE_SIGTRAP_SIGINFO): Conditionally define.
5248         [USE_SIGTRAP_SIGINFO] (fbsd_handle_debug_trap): New function.
5249         (fbsd_wait) [USE_SIGTRAP_SIGINFO]: Call "fbsd_handle_debug_trap".
5250         [USE_SIGTRAP_SIGINFO] (fbsd_stopped_by_sw_breakpoint): New
5251         function.
5252         [USE_SIGTRAP_SIGINFO] (fbsd_supports_stopped_by_sw_breakpoint):
5253         Likewise.
5254         [USE_SIGTRAP_SIGINFO] (fbsd_supports_stopped_by_hw_breakpoint):
5255         Likewise.
5256         (fbsd_nat_add_target) [USE_SIGTRAP_SIGINFO]: Set
5257         "stopped_by_sw_breakpoint", "supports_stopped_by_sw_breakpoint",
5258         "supports_stopped_by_hw_breakpoint" target methods.
5259
5260 2018-03-04  John Baldwin  <jhb@FreeBSD.org>
5261
5262         * NEWS (Changes since GDB 8.1): Add "set/show debug fbsd-nat".
5263         * fbsd-nat.c (debug_fbsd_nat): New variable.
5264         (show_fbsd_nat_debug): New function.
5265         (fbsd_wait): Log LWP info if "debug_fbsd_nat" is enabled.
5266         (_initialize_fbsd_nat): Add "fbsd-nat" debug boolean command.
5267
5268 2018-03-04  John Baldwin  <jhb@FreeBSD.org>
5269
5270         * nat/x86-dregs.c (x86_dr_stopped_by_hw_breakpoint): New function.
5271         * nat/x86-dregs.h (x86_dr_stopped_by_hw_breakpoint): New
5272         prototype.
5273         * x86-nat.c (x86_stopped_by_hw_breakpoint): New function.
5274         (x86_use_watchpoints): Set "stopped_by_hw_breakpoint" target
5275         method.
5276
5277 2018-03-02  Simon Marchi  <simon.marchi@polymtl.ca>
5278
5279         * common/gdb_vecs.c (free_char_ptr_vec): Remove.
5280         * common/gdb_vecs.h (free_char_ptr_vec): Remove.
5281
5282 2018-03-02  Simon Marchi  <simon.marchi@polymtl.ca>
5283
5284         * charset.c (struct charset_vector): New.
5285         (charsets): Change type to charset_vector.
5286         (find_charset_names): Adjust.
5287         (add_one): Adjust.
5288         (_initialize_charset): Adjust.
5289
5290 2018-03-02  Simon Marchi  <simon.marchi@polymtl.ca>
5291
5292         * progspace.h (struct program_space) <deleted_solibs>: Change
5293         type to std::vector<std::string>.
5294         * progspace.c (clear_program_space_solib_cache): Adjust.
5295         * breakpoint.c (print_solib_event): Adjust.
5296         (check_status_catch_solib): Adjust.
5297         * solib.c (update_solib_list): Adjust.
5298         * ui-out.h (class ui_out) <field_string>: New overload.
5299         * ui-out.c (ui_out::field_string): New overload.
5300
5301 2018-03-02  Simon Marchi  <simon.marchi@polymtl.ca>
5302
5303         * progspace.h (struct program_space): Add constructor and
5304         destructor, initialize fields.
5305         (add_program_space): Remove.
5306         * progspace.c (add_program_space): Rename to...
5307         (program_space::program_space): ... this.
5308         (release_program_space): Rename to...
5309         (program_space::~program_space): ... this.
5310         (delete_program_space): Use delete to delete program_space.
5311         (initialize_progspace): Use new to allocate program_space.
5312         * inferior.c (add_inferior_with_spaces): Likewise.
5313         (clone_inferior_command): Likewise.
5314         * infrun.c (follow_fork_inferior): Likewise.
5315         (handle_vfork_child_exec_or_exit): Likewise.
5316
5317 2018-03-02  Simon Marchi  <simon.marchi@polymtl.ca>
5318
5319         * common/gdb_vecs.h (make_cleanup_free_char_ptr_vec): Remove.
5320         (delim_string_to_char_ptr_vec): Return std::vector of
5321         gdb::unique_xmalloc_ptr.
5322         (dirnames_to_char_ptr_vec_append): Take std::vector of
5323         gdb::unique_xmalloc_ptr.
5324         (dirnames_to_char_ptr_vec): Return std::vector of
5325         gdb::unique_xmalloc_ptr.
5326         * common/gdb_vecs.c (delim_string_to_char_ptr_vec_append):
5327         Take std::vector of gdb::unique_xmalloc_ptr, adjust the code.
5328         (delim_string_to_char_ptr_vec): Return an std::vector of
5329         gdb::unique_xmalloc_ptr, adjust the code.
5330         (dirnames_to_char_ptr_vec_append): Take an std::vector of
5331         gdb::unique_xmalloc_ptr, adjust the code.
5332         (dirnames_to_char_ptr_vec): Return an std::vector of
5333         gdb::unique_xmalloc_ptr, adjust the code.
5334         * auto-load.c (auto_load_safe_path_vec): Change type to
5335         std::vector of gdb::unique_xmalloc_ptr.
5336         (auto_load_expand_dir_vars): Return an std::vector of
5337         gdb::unique_xmalloc_ptr, adjust the code.
5338         (auto_load_safe_path_vec_update): Adjust.
5339         (filename_is_in_auto_load_safe_path_vec): Adjust.
5340         (auto_load_objfile_script_1): Adjust.
5341         * build-id.c (build_id_to_debug_bfd): Adjust.
5342         * linux-thread-db.c (thread_db_load_search): Adjust.
5343         * source.c (add_path): Adjust.
5344         (openp): Adjust.
5345         * symfile.c (find_separate_debug_file): Adjust.
5346         * utils.c (do_free_char_ptr_vec): Remove.
5347         (make_cleanup_free_char_ptr_vec): Remove.
5348
5349 2018-03-01  Sergio Durigan Junior  <sergiodj@redhat.com>
5350
5351         PR gdb/22907
5352         * common/pathstuff.c: Conditionally include "<windows.h>".
5353
5354 2018-03-01  Georg Sauthoff  <mail@georg.so>
5355
5356         PR gdb/22888
5357         * gcore.in: Quote variables and switch interpreter to bash.
5358
5359 2018-03-01  Tom Tromey  <tom@tromey.com>
5360
5361         * dwarf2read.c (alloc_discriminant_info): Fix default_index
5362         assertion.  Add assertion for discriminant_index.
5363         (quirk_rust_enum): Use correct base type name in univariant case.
5364
5365 2018-03-01  Simon Marchi  <simon.marchi@ericsson.com>
5366
5367         * record.c (get_call_history_modifiers): Return a
5368         record_print_flags.
5369         (cmd_record_call_history): Adjust.
5370         * record-btrace.c (record_btrace_call_history): Adjust.
5371         (record_btrace_call_history_range): Adjust.
5372         (record_btrace_call_history_from): Adjust.
5373         * target-debug.h (target_debug_print_record_print_flags): New.
5374         * target-delegates.c: Re-generate.
5375         * target.c (target_call_history): Change flags type.
5376         (target_call_history_from): Likewise.
5377         (target_call_history_range): Likewise.
5378         * target.h (struct target_ops) <target_call_history>: Likewise.
5379         (target_call_history_from): Likewise.
5380         (target_call_history_range): Likewise.
5381
5382 2018-02-28  Sergio Durigan Junior  <sergiodj@redhat.com>
5383             Simon Marchi  <simon.marchi@polymtl.ca>
5384
5385         * common/common-utils.c: Include "sys/stat.h".
5386         (is_regular_file): Move here from "source.c"; change return
5387         type to "bool".
5388         * common/common-utils.h (is_regular_file): New prototype.
5389         * common/pathstuff.c (contains_dir_separator): New function.
5390         * common/pathstuff.h (contains_dir_separator): New prototype.
5391         * source.c: Don't include "sys/stat.h".
5392         (is_regular_file): Move to "common/common-utils.c".
5393
5394 2018-02-28  Sergio Durigan Junior  <sergiodj@redhat.com>
5395
5396         * Makefile.in (COMMON_SFILES): Add "common/pathstuff.c".
5397         (HFILES_NO_SRCDIR): Add "common/pathstuff.h".
5398         * auto-load.c: Include "common/pathstuff.h".
5399         * common/common-def.h (current_directory): Move here.
5400         * common/gdb_tilde_expand.c (gdb_tilde_expand_up): New
5401         function.
5402         * common/gdb_tilde_expand.h (gdb_tilde_expand_up): New
5403         prototype.
5404         * common/pathstuff.c: New file.
5405         * common/pathstuff.h: New file.
5406         * compile/compile.c: Include "common/pathstuff.h".
5407         * defs.h (current_directory): Move to "common/common-defs.h".
5408         * dwarf2read.c: Include "common/pathstuff.h".
5409         * exec.c: Likewise.
5410         * guile/scm-safe-call.c: Likewise.
5411         * linux-thread-db.c: Likewise.
5412         * main.c: Likewise.
5413         * nto-tdep.c: Likewise.
5414         * objfiles.c: Likewise.
5415         * source.c: Likewise.
5416         * symtab.c: Likewise.
5417         * utils.c: Include "common/pathstuff.h".
5418         (gdb_realpath): Move to "common/pathstuff.c".
5419         (gdb_realpath_keepfile): Likewise.
5420         (gdb_abspath): Likewise.
5421         * utils.h (gdb_realpath): Move to "common/pathstuff.h".
5422         (gdb_realpath_keepfile): Likewise.
5423         (gdb_abspath): Likewise.
5424
5425 2018-02-28  John Baldwin  <jhb@FreeBSD.org>
5426
5427         * fbsd-nat.c (fbsd_resume): Use PT_SETSTEP for stepping and a
5428         wildcard process pid for super_resume for kernels with a
5429         specific bug.
5430
5431 2018-02-27  Phil Muldoon  <pmuldoon@redhat.com>
5432
5433         * compile/compile.c (get_args): Add additional comments
5434         explaining function.
5435
5436 2018-02-27  Simon Marchi  <simon.marchi@polymtl.ca>
5437             Tom Tromey  <tom@tromey.com>
5438
5439         * target.h (memory_write_request_s): Remove typedef.  Don't define
5440         VEC.
5441         (target_write_memory_blocks): Change argument to std::vector.
5442         (struct memory_write_request): Add constructor.
5443         * target-memory.c (compare_block_starting_address): Return bool.
5444         Change argument types.
5445         (claim_memory): Change arguments to use std::vector.
5446         (split_regular_and_flash_blocks, blocks_to_erase)
5447         (compute_garbled_blocks): Likewise.
5448         (cleanup_request_data, cleanup_write_requests_vector): Remove.
5449         (target_write_memory_blocks): Change argument to std::vector.
5450         * symfile.c (struct load_section_data): Add constructor and
5451         destructor.  Use std::vector for "requests".
5452         (struct load_progress_data): Add initializers.
5453         (load_section_callback): Update.  Use "new".
5454         (clear_memory_write_data): Remove.
5455         (generic_load): Update.
5456
5457 2018-02-27  Alan Hayward  <alan.hayward@arm.com>
5458
5459         * arch/aarch64.h: Use common/tdesc.h.
5460
5461 2018-02-26  Maciej W. Rozycki  <macro@mips.com>
5462
5463         * mips-tdep.c (mips_gdbarch_init): Don't use a 32-bit BFD
5464         architecture with a 64-bit ABI.
5465
5466 2018-02-26  Maciej W. Rozycki  <macro@mips.com>
5467
5468         * gdb/mips-tdep.c (mips_gdbarch_init): Reorder ABI determination
5469         ahead of target description loading.
5470
5471 2018-02-26  Tom Tromey  <tom@tromey.com>
5472
5473         * stack.c (backtrace_command_1): Update.
5474         * python/python-internal.h (gdbpy_apply_frame_filter): Change type
5475         of "flags".
5476         * python/py-framefilter.c (py_print_frame)
5477         (gdbpy_apply_frame_filter): Change type of "flags".
5478         * mi/mi-cmd-stack.c (mi_apply_ext_lang_frame_filter): Change type
5479         of "flags".
5480         (mi_cmd_stack_list_frames, mi_cmd_stack_list_locals)
5481         (mi_cmd_stack_list_args, mi_cmd_stack_list_variables): Update.
5482         * extension.h (enum frame_filter_flag): Rename from
5483         frame_filter_flags.
5484         (frame_filter_flags): Define using DEF_ENUM_FLAGS_TYPE.
5485         (apply_ext_lang_frame_filter): Change type of "flags".
5486         * extension.c (apply_ext_lang_frame_filter): Change type of
5487         "flags".
5488         * extension-priv.h (struct extension_language_ops)
5489         <apply_frame_filter>: Change type of "flags".
5490
5491 2018-02-26  Tom Tromey  <tom@tromey.com>
5492
5493         PR python/16497:
5494         * stack.c (backtrace_command_1): Set PRINT_MORE_FRAMES flag.  Fix
5495         off-by-one in py_end computation.
5496         * python/py-framefilter.c (gdbpy_apply_frame_filter): Handle
5497         PRINT_MORE_FRAMES.
5498         * extension.h (enum frame_filter_flags) <PRINT_MORE_FRAMES>: New
5499         constant.
5500
5501 2018-02-26  Tom Tromey  <tom@tromey.com>
5502
5503         * dwarf2read.c (struct variant_field): New.
5504         (struct nextfield) <variant>: New field.
5505         (dwarf2_add_field): Handle DW_TAG_variant_part.
5506         (dwarf2_attach_fields_to_type): Attach a discriminant_info to a
5507         discriminated union.
5508         (read_structure_type): Handle DW_TAG_variant_part.
5509         (handle_struct_member_die): New function, extracted from
5510         process_structure_scope.  Handle DW_TAG_variant.
5511         (process_structure_scope): Handle discriminated unions.  Call
5512         handle_struct_member_die.
5513
5514 2018-02-26  Tom Tromey  <tom@tromey.com>
5515
5516         * rust-lang.h (rust_last_path_segment): Declare.
5517         * rust-lang.c (rust_last_path_segment): Now public.  Change
5518         contract.
5519         (struct disr_info): Remove.
5520         (RUST_ENUM_PREFIX, RUST_ENCODED_ENUM_REAL)
5521         (RUST_ENCODED_ENUM_HIDDEN, rust_union_is_untagged)
5522         (rust_get_disr_info, rust_tuple_variant_type_p): Remove.
5523         (rust_enum_p, rust_enum_variant): New function.
5524         (rust_underscore_fields): Remove "offset" parameter.
5525         (rust_print_enum): New function.
5526         (rust_val_print) <TYPE_CODE_UNION>: Remove enum code.
5527         <TYPE_CODE_STRUCT>: Call rust_print_enum when appropriate.
5528         (rust_print_struct_def): Add "for_rust_enum" parameter.  Handle
5529         enums.
5530         (rust_internal_print_type): New function, from rust_print_type.
5531         Remove enum code.
5532         (rust_print_type): Call rust_internal_print_type.
5533         (rust_evaluate_subexp) <STRUCTOP_ANONYMOUS, STRUCTOP_STRUCT>:
5534         Update enum handling.
5535         * dwarf2read.c (struct dwarf2_cu) <rust_unions>: New field.
5536         (rust_fully_qualify, alloc_discriminant_info, quirk_rust_enum)
5537         (rust_union_quirks): New functions.
5538         (process_full_comp_unit, process_full_type_unit): Call
5539         rust_union_quirks.
5540         (process_structure_scope): Update rust_unions if necessary.
5541
5542 2018-02-26  Tom Tromey  <tom@tromey.com>
5543
5544         * value.h (value_union_variant): Declare.
5545         * valops.c (value_union_variant): New function.
5546         * gdbtypes.h (TYPE_FLAG_DISCRIMINATED_UNION): New macro.
5547         (struct discriminant_info): New.
5548         (enum dynamic_prop_node_kind) <DYN_PROP_DISCRIMINATED>: New
5549         enumerator.
5550         (struct main_type) <flag_discriminated_union>: New field.
5551
5552 2018-02-26  Tom Tromey  <tom@tromey.com>
5553
5554         * Makefile.in (SUBDIR_UNITTESTS_SRCS): Add
5555         unittests/unpack-selftests.c.
5556         * unittests/unpack-selftests.c: New file.
5557         * value.c (unpack_bits_as_long): Fix bugs in non-bitfield cases.
5558
5559 2018-02-26  Yao Qi  <yao.qi@linaro.org>
5560
5561         * dwarf2read.c (struct partial_die_info) <read>: New method.
5562         (read_partial_die): Remove the declaration.
5563         (load_partial_dies): Update.
5564         (partial_die_info::partial_die_info):
5565         (read_partial_die): Change it to partial_die_info::read.
5566
5567 2018-02-26  Yao Qi  <yao.qi@linaro.org>
5568
5569         * dwarf2read.c (struct partial_die_info) <fixup>: New method.
5570         (fixup_partial_die): Remove declaration.
5571         (scan_partial_symbols): Update.
5572         (partial_die_parent_scope): Likewise.
5573         (partial_die_full_name): Likewise.
5574         (fixup_partial_die): Change it to partial_die_info::fixup.
5575
5576 2018-02-26  Yao Qi  <yao.qi@linaro.org>
5577
5578         * dwarf2read.c (read_partial_die): Update the declaration.
5579         (load_partial_dies): Caller update.
5580         (read_partial_die): Remove one argument abbrev_len.
5581
5582 2018-02-26  Yao Qi  <yao.qi@linaro.org>
5583
5584         * dwarf2read.c (struct partial_die_info): Add ctor, delete
5585         assignment operator.
5586         (load_partial_dies): Use ctor and copy ctor.
5587         (read_partial_die): Update.
5588         (dwarf2_cu::find_partial_die): Use ctor.
5589
5590 2018-02-26  Yao Qi  <yao.qi@linaro.org>
5591
5592         * dwarf2read.c (struct dwarf2_cu) <find_partial_die>: New method.
5593         (find_partial_die_in_comp_unit): Change it to
5594         dwarf2_cu::find_partial_die.
5595         (find_partial_die): Update.
5596
5597 2018-02-26  Yao Qi  <yao.qi@linaro.org>
5598
5599         * dwarf2read.c (read_partial_die): Remove the code checking abbrev
5600         is NULL.
5601
5602 2018-02-26  Yao Qi  <yao.qi@linaro.org>
5603
5604         * dwarf2read.c (load_partial_dies): Move the location of XOBNEW.
5605
5606 2018-02-26  Alan Hayward  <alan.hayward@arm.com>
5607
5608         * arch/amd64.h: Use common/tdesc.h.
5609         * arch/i386.c: Likewise.
5610         * arch/i386.h: Likewise.
5611         * arch/tic6x.c: Likewise.
5612         * arch/tdesc.h: Move file from here...
5613         * common/tdesc.h: ...to here.
5614         * features/aarch64-core.c: Regenerate.
5615         * features/aarch64-fpu.c: Regenerate.
5616         * features/i386/32bit-avx.c: Regenerate.
5617         * features/i386/32bit-avx512.c: Regenerate.
5618         * features/i386/32bit-core.c: Regenerate.
5619         * features/i386/32bit-linux.c: Regenerate.
5620         * features/i386/32bit-mpx.c: Regenerate.
5621         * features/i386/32bit-pkeys.c: Regenerate.
5622         * features/i386/32bit-sse.c: Regenerate.
5623         * features/i386/64bit-avx.c: Regenerate.
5624         * features/i386/64bit-avx512.c: Regenerate.
5625         * features/i386/64bit-core.c: Regenerate.
5626         * features/i386/64bit-linux.c: Regenerate.
5627         * features/i386/64bit-mpx.c: Regenerate.
5628         * features/i386/64bit-pkeys.c: Regenerate.
5629         * features/i386/64bit-segments.c: Regenerate.
5630         * features/i386/64bit-sse.c: Regenerate.
5631         * features/i386/x32-core.c: Regenerate.
5632         * features/tic6x-c6xp.c: Regenerate.
5633         * features/tic6x-core.c: Regenerate.
5634         * features/tic6x-gp.c: Regenerate.
5635         * target-descriptions.c: Use common/tdesc.h.
5636         * target-descriptions.h: Likewise.
5637
5638 2018-02-24  Tom Tromey  <tom@tromey.com>
5639
5640         * linux-thread-db.c (try_thread_db_load_from_pdir_1)
5641         (try_thread_db_load_from_dir, thread_db_load_search): Use
5642         std::string.
5643         (info_auto_load_libthread_db_compare): Return bool.  Change
5644         argument types.
5645         (info_auto_load_libthread_db): Use std::vector, std::string.
5646         Remove cleanups.
5647
5648 2018-02-24  Tom Tromey  <tom@tromey.com>
5649
5650         * i386-tdep.c (i386_fast_tracepoint_valid_at): "msg" now a
5651         std::string.
5652         * gdbarch.sh (fast_tracepoint_valid_at): Change "msg" to a
5653         std::string*.
5654         * gdbarch.c: Rebuild.
5655         * gdbarch.h: Rebuild.
5656         * breakpoint.c (check_fast_tracepoint_sals): Use std::string.
5657         * arch-utils.h (default_fast_tracepoint_valid_at): Update.
5658         * arch-utils.c (default_fast_tracepoint_valid_at): "msg" now a
5659         std::string*.
5660
5661 2018-02-23  Simon Marchi  <simon.marchi@polymtl.ca>
5662
5663         * gdbtypes.h (sect_offset): Change type to uint64_t.
5664         (sect_offset_str): New function.
5665         * dwarf2read.c (create_addrmap_from_aranges): Use
5666         sect_offset_str.
5667         (error_check_comp_unit_head): Likewise.
5668         (create_debug_type_hash_table): Likewise.
5669         (read_cutu_die_from_dwo): Likewise.
5670         (init_cutu_and_read_dies): Likewise.
5671         (init_cutu_and_read_dies_no_follow): Likewise.
5672         (process_psymtab_comp_unit_reader): Likewise.
5673         (partial_die_parent_scope): Likewise.
5674         (peek_die_abbrev): Likewise.
5675         (process_queue): Likewise.
5676         (dwarf2_physname): Likewise.
5677         (read_namespace_alias): Likewise.
5678         (read_import_statement): Likewise.
5679         (create_dwo_cu_reader): Likewise.
5680         (create_cus_hash_table): Likewise.
5681         (lookup_dwo_cutu): Likewise.
5682         (inherit_abstract_dies): Likewise.
5683         (read_func_scope): Likewise.
5684         (read_call_site_scope): Likewise.
5685         (dwarf2_add_member_fn): Likewise.
5686         (read_common_block): Likewise.
5687         (read_module_type): Likewise.
5688         (read_typedef): Likewise.
5689         (read_subrange_type): Likewise.
5690         (load_partial_dies): Likewise.
5691         (read_partial_die): Likewise.
5692         (find_partial_die): Likewise.
5693         (read_str_index): Likewise.
5694         (dwarf2_string_attr): Likewise.
5695         (build_error_marker_type): Likewise.
5696         (lookup_die_type): Likewise.
5697         (dump_die_shallow): Likewise.
5698         (follow_die_ref): Likewise.
5699         (dwarf2_fetch_die_loc_sect_off): Likewise.
5700         (dwarf2_fetch_constant_bytes): Likewise.
5701         (follow_die_sig): Likewise.
5702         (get_signatured_type): Likewise.
5703         (get_DW_AT_signature_type): Likewise.
5704         (dwarf2_find_containing_comp_unit): Likewise.
5705         (set_die_type): Likewise.
5706
5707 2018-02-21  John Baldwin  <jhb@FreeBSD.org>
5708
5709         * arch/aarch64.c: Include "common-defs.h".
5710         * arch/amd64.c: Likewise.
5711         * arch/i386.c: Likewise.
5712
5713 2018-02-21  Tom Tromey  <tom@tromey.com>
5714
5715         * value.h: (extract_field_op): Update.
5716         * eval.c (extract_field_op): Return a const char *.
5717         * expression.h (parse_expression_for_completion): Update.
5718         * completer.c (complete_expression): Update.
5719         (add_struct_fields): Make fieldname const.
5720         * parse.c (expout_completion_name): Now a unique_xmalloc_ptr.
5721         (mark_completion_tag, parse_exp_in_context_1): Update.
5722         (parse_expression_for_completion): Change "name" to
5723         unique_xmalloc_ptr*.
5724
5725 2018-02-21  Tom Tromey  <tom@tromey.com>
5726
5727         * infcall.c (call_function_by_hand_dummy): Use std::vector.
5728
5729 2018-02-21  Yao Qi  <yao.qi@linaro.org>
5730
5731         * avr-tdep.c (avr_read_pc): Change parameter type to
5732         readable_regcache.
5733         * gdbarch.sh (read_pc): Likewise.
5734         * gdbarch.c: Re-generated.
5735         * gdbarch.h: Re-generated.
5736         * hppa-tdep.c (hppa_read_pc): Change parameter type to
5737         readable_regcache.
5738         * ia64-tdep.c (ia64_read_pc): Likewise.
5739         * mips-tdep.c (mips_read_pc): Likewise.
5740         * spu-tdep.c (spu_read_pc): Likewise.
5741
5742 2018-02-21  Yao Qi  <yao.qi@linaro.org>
5743
5744         * Makefile.in (COMMON_SFILES): Add regcache-dump.c
5745         * regcache-dump.c: New file.
5746         * regcache.c: Move register_dump to regcache-dump.c.
5747         (maintenance_print_registers): Likewise.
5748         (maintenance_print_raw_registers): Likewise.
5749         (maintenance_print_cooked_registers): Likewise.
5750         (maintenance_print_register_groups): Likewise.
5751         (maintenance_print_remote_registers): Likewise.
5752         (_initialize_regcache): Likewise.
5753         * regcache.h (register_dump): Moved from regcache.c.
5754
5755 2018-02-21  Yao Qi  <yao.qi@linaro.org>
5756
5757         * regcache.c (regcache::regcache): Update.
5758         (regcache::invalidate): Move it to detached_regcache::invalidate.
5759         (get_thread_arch_aspace_regcache): Update.
5760         (regcache::raw_update): Update.
5761         (regcache::cooked_read): Remove some code.
5762         (regcache::cooked_read_value): Likewise.
5763         (regcache::raw_write): Remove assert on m_readonly_p.
5764         (regcache::raw_supply_integer): Move it to
5765         detached_regcache::raw_supply_integer.
5766         (regcache::raw_supply_zeroed): Likewise.
5767         * regcache.h (detached_regcache) <raw_supply_integer>: New
5768         declaration.
5769         <raw_supply_zeroed, invalidate>: Likewise.
5770         (regcache) <raw_supply_integer, raw_supply_zeroed>: Removed.
5771         <invalidate>: Likewise.
5772         <m_readonly_p>: Removed.
5773
5774 2018-02-21  Yao Qi  <yao.qi@linaro.org>
5775
5776         * infcmd.c (get_return_value): Let stop_regs point to
5777         get_current_regcache.
5778         * regcache.c (regcache::regcache): Remove.
5779         (register_dump_reg_buffer): New class.
5780         (regcache_print): Adjust.
5781         * regcache.h (regcache): Remove constructors.
5782
5783 2018-02-21  Yao Qi  <yao.qi@linaro.org>
5784
5785         * regcache.c (class register_dump): New class.
5786         (register_dump_regcache, register_dump_none): New class.
5787         (register_dump_remote, register_dump_groups): New class.
5788         (regcache_print): Update.
5789         * regcache.h (regcache_dump_what): Move it to regcache.c.
5790         (regcache) <dump>: Remove.
5791
5792 2018-02-21  Yao Qi  <yao.qi@linaro.org>
5793
5794         * jit.c (struct jit_unwind_private) <regcache>: Change its type to
5795          reg_buffer_rw *.
5796         (jit_unwind_reg_set_impl): Call raw_supply.
5797         (jit_frame_sniffer): Use reg_buffer_rw.
5798         * record-full.c (record_full_core_regbuf): Change its type.
5799         (record_full_core_open_1): Use reg_buffer_rw.
5800         (record_full_close): Likewise.
5801         (record_full_core_fetch_registers): Use regcache->raw_supply.
5802         (record_full_core_store_registers): Likewise.
5803         * regcache.c (regcache::get_register_status): Move it to
5804         reg_buffer.
5805         (regcache_raw_set_cached_value): Remove.
5806         (regcache::raw_set_cached_value): Remove.
5807         (regcache::raw_write): Call raw_supply.
5808         (regcache::raw_supply): Move it to reg_buffer_rw.
5809         * regcache.h (regcache_raw_set_cached_value): Remove.
5810         (reg_buffer_rw): New class.
5811
5812 2018-02-21  Yao Qi  <yao.qi@linaro.org>
5813
5814         * dummy-frame.c (dummy_frame_cache) <prev_regcache>: Use
5815         readonly_detached_regcache.
5816         (dummy_frame_prev_register): Use regcache->cooked_read.
5817         * frame.c (frame_save_as_regcache): Change return type.
5818         (frame_pop): Update.
5819         * frame.h (frame_save_as_regcache): Update declaration.
5820         * inferior.h (get_infcall_suspend_state_regcache): Update
5821         declaration.
5822         * infrun.c (infcall_suspend_state) <registers>: use
5823         readonly_detached_regcache.
5824         (save_infcall_suspend_state): Don't use regcache_dup.
5825         (get_infcall_suspend_state_regcache): Change return type.
5826         * linux-fork.c (struct fork_info) <savedregs>: Change to
5827         readonly_detached_regcache.
5828         <pc>: New field.
5829         (fork_save_infrun_state): Don't use regcache_dup.
5830         (info_checkpoints_command): Adjust.
5831         * mi/mi-main.c (register_changed_p): Update declaration.
5832         (mi_cmd_data_list_changed_registers): Use
5833         readonly_detached_regcache.
5834         (register_changed_p): Change parameter type to
5835         readonly_detached_regcache.
5836         * ppc-linux-tdep.c (ppu2spu_cache) <regcache>: Use
5837         readonly_detached_regcache.
5838         (ppu2spu_sniffer): Construct a new readonly_detached_regcache.
5839         * regcache.c (readonly_detached_regcache::readonly_detached_regcache):
5840         New.
5841         (regcache::save): Move it to reg_buffer.
5842         (regcache::restore): Change parameter type.
5843         (regcache_dup): Remove.
5844         * regcache.h (reg_buffer) <save>: New method.
5845         (readonly_detached_regcache): New class.
5846         * spu-tdep.c (spu2ppu_cache) <regcache>: Use
5847         readonly_detached_regcache.
5848         (spu2ppu_sniffer): Construct a new readonly_detached_regcache.
5849
5850 2018-02-21  Yao Qi  <yao.qi@linaro.org>
5851
5852         * frame.c (frame_save_as_regcache): Use regcache method save.
5853         (frame_pop): Use regcache method restore.
5854         * infrun.c (restore_infcall_suspend_state): Likewise.
5855         * linux-fork.c (fork_load_infrun_state): Likewise.
5856         * ppc-linux-tdep.c (ppu2spu_sniffer): User regcache method
5857         save.
5858         * regcache.c (regcache_save): Remove.
5859         (regcache::restore): More asserts.
5860         (regcache_cpy): Remove.
5861         * regcache.h (regcache_save): Remove the declaration.
5862         (regcache::restore): Move from private to public.
5863         Remove the friend declaration of regcache_cpy.
5864         (regcache_cpy): Remove declaration.
5865
5866 2018-02-21  Yao Qi  <yao.qi@linaro.org>
5867
5868         * aarch64-tdep.c (aarch64_pseudo_register_read_value): Change
5869         parameter type to 'readable_regcache *'.
5870         * amd64-tdep.c (amd64_pseudo_register_read_value): Likewise.
5871         * arm-tdep.c (arm_neon_quad_read): Likewise.
5872         (arm_pseudo_read): Likewise.
5873         * avr-tdep.c (avr_pseudo_register_read): Likewise.
5874         * bfin-tdep.c (bfin_pseudo_register_read): Likewise.
5875         * frv-tdep.c (frv_pseudo_register_read): Likewise.
5876         * gdbarch.c: Re-generated.
5877         * gdbarch.h: Re-generated.
5878         * gdbarch.sh (pseudo_register_read): Change parameter type to
5879         'readable_regcache *'.
5880         (pseudo_register_read_value): Likewise.
5881         * h8300-tdep.c (pseudo_from_raw_register): Likewise.
5882         (h8300_pseudo_register_read): Likewise.
5883         * hppa-tdep.c (hppa_pseudo_register_read): Likewise.
5884         * i386-tdep.c (i386_mmx_regnum_to_fp_regnum): Likewise.
5885         (i386_pseudo_register_read_into_value): Likewise.
5886         (i386_pseudo_register_read_value): Likewise.
5887         * i386-tdep.h (i386_pseudo_register_read_into_value): Update
5888         declaration.
5889         * ia64-tdep.c (ia64_pseudo_register_read): Likewise.
5890         * m32c-tdep.c (m32c_raw_read): Likewise.
5891         (m32c_read_flg): Likewise.
5892         (m32c_banked_register): Likewise.
5893         (m32c_banked_read): Likewise.
5894         (m32c_sb_read): Likewise.
5895         (m32c_part_read): Likewise.
5896         (m32c_cat_read): Likewise.
5897         (m32c_r3r2r1r0_read): Likewise.
5898         (m32c_pseudo_register_read): Likewise.
5899         * m68hc11-tdep.c (m68hc11_pseudo_register_read): Likewise.
5900         * mep-tdep.c (mep_pseudo_cr32_read): Likewise.
5901         (mep_pseudo_cr64_read): Likewise.
5902         (mep_pseudo_register_read): Likewise.
5903         * mips-tdep.c (mips_pseudo_register_read): Likewise.
5904         * msp430-tdep.c (msp430_pseudo_register_read): Likewise.
5905         * nds32-tdep.c (nds32_pseudo_register_read): Likewise.
5906         * regcache.c (regcache::raw_read): Move it to readable_regcache.
5907         (regcache::cooked_read): Likewise.
5908         (regcache::cooked_read_value): Likewise.
5909         (regcache_cooked_read_signed):
5910         (regcache::cooked_read): Likewise.
5911         * regcache.h (readable_regcache): New class.
5912         (regcache): Inherit readable_regcache.  Move some methods to
5913         readable_regcache.
5914         * rl78-tdep.c (rl78_pseudo_register_read): Change
5915         parameter type to 'readable_regcache *'.
5916         * rs6000-tdep.c (do_regcache_raw_read): Remove.
5917         (e500_pseudo_register_read): Change parameter type to
5918         'readable_regcache *'.
5919         (dfp_pseudo_register_read): Likewise.
5920         (vsx_pseudo_register_read): Likewise.
5921         (efpr_pseudo_register_read): Likewise.
5922         * s390-tdep.c (s390_pseudo_register_read): Likewise.
5923         * sh-tdep.c (sh_pseudo_register_read): Likewise.
5924         * sh64-tdep.c (pseudo_register_read_portions): Likewise.
5925         (sh64_pseudo_register_read): Likewise.
5926         * sparc-tdep.c (sparc32_pseudo_register_read): Likewise.
5927         * sparc64-tdep.c (sparc64_pseudo_register_read): Likewise.
5928         * spu-tdep.c (spu_pseudo_register_read_spu): Likewise.
5929         (spu_pseudo_register_read): Likewise.
5930         * xtensa-tdep.c (xtensa_register_read_masked): Likewise.
5931         (xtensa_pseudo_register_read): Likewise.
5932
5933 2018-02-21  Yao Qi  <yao.qi@linaro.org>
5934
5935         * regcache.c (regcache::regcache): Call reg_buffer ctor.
5936         (regcache::arch): Move it to reg_buffer::arch.
5937         (regcache::register_buffer): Likewise.
5938         (regcache::assert_regnum): Likewise.
5939         (regcache::num_raw_registers): Likewise.
5940         * regcache.h (reg_buffer): New class.
5941         (regcache): Inherit reg_buffer.
5942
5943 2018-02-20  Simon Marchi  <simon.marchi@ericsson.com>
5944
5945         * remote-sim.c (gdb_os_printf_filtered, gdb_os_vprintf_filtered,
5946         gdb_os_evprintf_filtered, gdb_os_error): Add ATTRIBUTE_PRINTF.
5947
5948 2018-02-20  Markus Metzger  <markus.t.metzger@intel.com>
5949
5950         * gnulib/update-gnulib.sh (IMPORTED_GNULIB_MODULES): Add mkstemp.
5951
5952 2018-02-19  Alan Hayward  <alan.hayward@arm.com>
5953
5954         * Makefile.in: (COMMON_SFILES): Add common/*.c files.
5955         (SFILES): Remove common/*.c files.
5956         (COMMON_OBS): Remove some *.o files built from common/*.c files.
5957         * common/common.host: Add common reference.
5958         * configure.ac: Likewise.
5959         * configure: Regenerate.
5960
5961 2018-02-16  Yao Qi  <yao.qi@linaro.org>
5962
5963         * block.c (block_namespace_info): Inherit allocate_on_obstack.
5964         (block_initialize_namespace): Use new.
5965         * dwarf2read.c (dwarf2_per_objfile): Inherit allocate_on_obstack.
5966         (dwarf2_free_objfile): Use delete.
5967         * gdbtypes.c (type_pair): Inherit allocate_on_obstack.
5968         (copy_type_recursive): Use new.
5969         * gdb_obstack.h (allocate_on_obstack): New.
5970
5971 2018-02-15  Yao Qi  <yao.qi@linaro.org>
5972
5973         PR gdb/22849
5974         * inferior.c (exit_inferior_1): Reset inf->control.
5975
5976 2018-02-15  Joel Brobecker  <brobecker@adacore.com>
5977
5978         * ada-lang.c (ada_to_fixed_value_create): Delete advance
5979         declaration.
5980
5981 2018-02-14  Pedro Alves  <palves@redhat.com>
5982
5983         * frame-unwind.c (frame_unwind_try_unwinder): Always call
5984         frame_cleanup_after_sniffer on exception.
5985
5986 2018-02-14  Tom Tromey  <tom@tromey.com>
5987
5988         * solist.h (struct target_so_ops) <bfd_open>: Make pathname
5989         const.
5990         (solib_bfd_open): Make pathname const.
5991         * solib.c (solib_bfd_open): Make pathname const.
5992         * solib-spu.c (spu_bfd_fopen): Make name const.
5993         (spu_bfd_open): Make pathname const.
5994         * solib-darwin.c (darwin_bfd_open): Make pathname const.
5995         * solib-aix.c (solib_aix_bfd_open): Make pathname const.
5996
5997 2018-02-14  Tom Tromey  <tom@tromey.com>
5998
5999         * symfile.c (symfile_bfd_open): Update.
6000         * source.h (openp, source_full_path_of, find_and_open_source):
6001         Change argument type to unique_xmalloc_ptr.
6002         * source.c (openp): Take a unique_xmalloc_ptr.
6003         (source_full_path_of, find_and_open_source): Likewise.
6004         (open_source_file, symtab_to_fullname): Update.
6005         * solist.h (struct target_so_ops) <find_and_open_solib>: Take a
6006         unique_xmalloc_ptr.
6007         * solib.c (solib_find_1): Use unique_xmalloc_ptr.
6008         (exec_file_find): Update.
6009         * psymtab.c (psymtab_to_fullname): Update.
6010         * nto-tdep.h (nto_find_and_open_solib): Update.
6011         * nto-tdep.c (nto_find_and_open_solib): Change temp_path to a
6012         unique_xmalloc_ptr.
6013         * exec.c (exec_file_attach): Update.
6014         * dwarf2read.c (try_open_dwop_file): Use unique_xmalloc_ptr.
6015         * cli/cli-cmds.c (find_and_open_script): Use unique_xmalloc_ptr.
6016
6017 2018-02-14  Tom Tromey  <tom@tromey.com>
6018
6019         * solib.c: Include source.h.
6020         * nto-tdep.c: Include source.h.
6021         * mi/mi-cmd-env.c: Include source.h.
6022         * infcmd.c: Include source.h.
6023         * exec.c: Include source.h.
6024         * defs.h (enum openp_flag, openp, source_full_path_of, mod_path)
6025         (add_path, directory_switch, source_path, init_source_path): Move
6026         declarations...
6027         * source.h (enum openp_flag, openp, source_full_path_of, mod_path)
6028         (add_path, directory_switch, source_path, init_source_path):
6029         ...here.
6030
6031 2018-02-14  Tom Tromey  <tom@tromey.com>
6032
6033         * solist.h (exec_file_find, solib_find): Return
6034         unique_xmalloc_ptr.
6035         (solib_bfd_fopen): Take a const char *.
6036         * solib.c (solib_find_1): Return unique_xmalloc_ptr.
6037         (exec_file_find, solib_find): Likewise.
6038         (solib_bfd_fopen): Do not take ownership of "pathname".
6039         (solib_bfd_open): Use unique_xmalloc_ptr.
6040         * solib-darwin.c (darwin_bfd_open): Use unique_xmalloc_ptr.
6041         * solib-aix.c (solib_aix_bfd_open): Use unique_xmalloc_ptr.
6042         * infrun.c (follow_exec): Use unique_xmalloc_ptr.
6043         * exec.c (exec_file_locate_attach): Use unique_xmalloc_ptr.
6044
6045 2018-02-14  Joel Brobecker  <brobecker@adacore.com>
6046
6047         * ada-lang.c (name_match_type_from_name): Remove reference to
6048         ada_name_for_lookup in function's documentation.
6049         * ada-lang.h (ada_name_for_lookup): Delete declaration.
6050
6051 2018-02-13  Simon Marchi  <simon.marchi@polymtl.ca>
6052
6053         * defs.h (enum openp_flags): New enum.
6054         (OPF_TRY_CWD_FIRST, OPF_SEARCH_IN_PATH, OPF_RETURN_REALPATH):
6055         Move to enum openp_flags.
6056         (openp_flags): New enum flags.
6057         (openp): Change parameter type to openp_flags.
6058         * source.c (openp): Change parameter type to openp_flags.
6059         * cli/cli-cmds.c (find_and_open_script): Use openp_flags.
6060         * dwarf2read.c (try_open_dwop_file): Use openp_flags.
6061
6062 2018-02-13  Simon Marchi  <simon.marchi@polymtl.ca>
6063
6064         * maint.c (_initialize_maint_cmds): Fix prefix of maint set/show
6065         per-command.
6066
6067 2018-02-12  Andrew Burgess  <andrew.burgess@embecosm.com>
6068
6069         * dwarf2read.c (dwarf2_release_queue): Delete function, move body
6070         into...
6071         (class dwarf2_queue_guard): ...the destructor of this new class.
6072         (dw2_do_instantiate_symtab): Create instance of the new class
6073         dwarf2_queue_guard, remove cleanup.
6074
6075 2018-02-09  Tom Tromey  <tom@tromey.com>
6076
6077         * source.c (find_source_lines): Don't reference past the end of
6078         the vector.
6079
6080 2018-02-09  Markus Metzger  <markus.t.metzger@intel.com>
6081
6082         * remote.c (remote_btrace_maybe_reopen): Change error message.
6083         * btrace.c (btrace_enable): Likewise.
6084         (parse_xml_btrace): Likewise.
6085         (parse_xml_btrace_conf): Likewise.
6086
6087 2018-02-09  Markus Metzger  <markus.t.metzger@intel.com>
6088
6089         * nat/linux-btrace.c (diagnose_perf_event_open_fail): New.
6090         (linux_enable_pt, linux_enable_bts): Call
6091         diagnose_perf_event_open_fail.
6092
6093 2018-02-09  Markus Metzger  <markus.t.metzger@intel.com>
6094
6095         * nat/linux-btrace.c (perf_event_pt_event_type): Improve error message.
6096         Remove parameter and change return type.  Update callers.  Move it.
6097         (linux_enable_bts, linux_enable_pt): Improve error message.
6098         (linux_enable_pt): Remove zero buffer size check.
6099         (linux_enable_btrace): Improve error messages.  Remove NULL return
6100         check.
6101
6102 2018-02-09  Markus Metzger  <markus.t.metzger@intel.com>
6103
6104         * btrace.c (btrace_enable): Remove target_supports_btrace call.
6105         * nat/linux-btrace.c (perf_event_pt_event_type): Move.
6106         (kernel_supports_bts, kernel_supports_pt, linux_supports_bts)
6107         (linux_supports_pt, linux_supports_btrace): Remove.
6108         (linux_enable_bts): Call cpu_supports_bts.
6109         * nat/linux-btrace.h (linux_supports_btrace): Remove.
6110         * remote.c (remote_supports_btrace): Remove.
6111         (init_remote_ops): Remove remote_supports_btrace.
6112         * target-delegates.c: Regenerated.
6113         * target.c (target_supports_btrace): Remove.
6114         * target.h (target_ops) <to_supports_btrace>: Remove
6115         (target_supports_btrace): Remove.
6116         * x86-linux-nat.c (x86_linux_create_target): Remove
6117         linux_supports_btrace.
6118
6119 2018-02-09  Markus Metzger  <markus.t.metzger@intel.com>
6120
6121         * nat/linux-btrace.c (linux_enable_btrace): Throw exception if enabling
6122         btrace failed.
6123         * x86-linux-nat.c (x86_linux_enable_btrace): Catch btrace enabling
6124         exception and use message in own exception.
6125
6126 2018-02-09  Markus Metzger  <markus.t.metzger@intel.com>
6127
6128         * nat/linux-btrace.c: Include scoped_fd.h and scoped_mmap.h.
6129         (perf_event_pt_event_type): Use gdb_file_up.
6130         (linux_enable_bts, linux_enable_pt): Use gdb::unique_xmalloc_ptr,
6131         scoped_fd, and scoped_mmap.
6132
6133 2018-02-09  Markus Metzger  <markus.t.metzger@intel.com>
6134
6135         * common/scoped_mmap.h: New.
6136         * unittests/scoped_mmap-selftest.c: New.
6137         * Makefile.in (SUBDIR_UNITTESTS_SRCS): Add
6138         unittests/scoped_mmap-selftest.c.
6139
6140 2018-02-09  Markus Metzger  <markus.t.metzger@intel.com>
6141
6142         * common/scoped_fd.h: New.
6143         * unittests/scoped_fd-selftest.c: New.
6144         * Makefile.in (SUBDIR_UNITTESTS_SRCS): Add
6145         unittests/scoped_fd-selftest.c.
6146
6147 2018-02-09  Tom Tromey  <tom@tromey.com>
6148
6149         * auto-load.c (auto_load_section_scripts): Use
6150         gdb::unique_xmalloc_ptr.
6151
6152 2018-02-09  Tom Tromey  <tom@tromey.com>
6153
6154         * auto-load.c (execute_script_contents): Use std::string.
6155
6156 2018-02-09  Joel Brobecker  <brobecker@adacore.com>
6157
6158         * NEWS <Changes in GDB 8.1>: Clarify that "rbreak" is a new
6159         Python function, rather than a new command.
6160
6161 2018-02-08  Tom Tromey  <tom@tromey.com>
6162
6163         * solib.c (solib_find_1): Use std::string.
6164         (solib_bfd_fopen): Use unique_xmalloc_ptr.
6165
6166 2018-02-08  Tom Tromey  <tom@tromey.com>
6167
6168         * build-id.c (build_id_to_debug_bfd): Use unique_xmalloc_ptr.
6169
6170 2018-02-08  Tom Tromey  <tom@tromey.com>
6171
6172         * source.c (find_source_lines): Use gdb::def_vector.
6173
6174 2018-02-08  Tom Tromey  <tom@tromey.com>
6175
6176         * macrocmd.c (struct temporary_macro_definition): New.
6177         (macro_define_command): Use temporary_macro_definition.  Remove
6178         cleanups.
6179         (free_macro_definition_ptr): Remove.
6180
6181 2018-02-08  Tom Tromey  <tom@tromey.com>
6182
6183         * macroexp.c (maybe_expand): Use std::string.
6184
6185 2018-02-08  Tom Tromey  <tom@tromey.com>
6186
6187         * macroexp.c (struct macro_buffer): Add initializers for some
6188         members.
6189         (init_buffer, init_shared_buffer, free_buffer)
6190         (free_buffer_return_text): Remove.
6191         (macro_buffer): New constructors.
6192         (~macro_buffer): New destructor.
6193         (macro_buffer::set_shared): New method.
6194         (macro_buffer::resize_buffer, macro_buffer::appendc)
6195         (macro_buffer::appendmem): Now methods, not free functions.
6196         (set_token, append_tokens_without_splicing, stringify)
6197         (macro_stringify): Update.
6198         (gather_arguments): Change return type.  Remove argc_p argument,
6199         add args_ptr argument.  Use std::vector.
6200         (substitute_args): Remove argc argument.  Accept std::vector.
6201         (expand): Update.  Use std::vector.
6202         (scan, macro_expand, macro_expand_next): Update.
6203
6204 2018-02-08  Tom Tromey  <tom@tromey.com>
6205
6206         * symtab.c (default_collect_symbol_completion_matches_break_on):
6207         Use unique_xmalloc_ptr.
6208         * macroscope.h: (sal_macro_scope, user_macro_scope)
6209         (default_macro_scope): Return unique_xmalloc_ptr.
6210         * macroscope.c (sal_macro_scope, user_macro_scope)
6211         (default_macro_scope): Return unique_xmalloc_ptr.
6212         * macroexp.h (macro_expand, macro_expand_once): Return
6213         unique_xmalloc_ptr.
6214         * macroexp.c (macro_expand, macro_expand_once): Return
6215         unique_xmalloc_ptr.
6216         * macrocmd.c (macro_expand_command, macro_expand_once_command)
6217         (info_macro_command, info_macros_command): Use
6218         unique_xmalloc_ptr.
6219         * compile/compile-c-support.c (write_macro_definitions): Use
6220         unique_xmalloc_ptr.
6221         * c-exp.y (c_parse): Use unique_xmalloc_ptr.
6222
6223 2018-02-07  Simon Marchi  <simon.marchi@ericsson.com>
6224
6225         * value.c (value_static_field): Assign field type instead of
6226         containing type when returning an optimized out value.
6227
6228 2018-02-06  Yao Qi  <yao.qi@linaro.org>
6229
6230         * ft32-tdep.c (ft32_read_pc): Remove.
6231         (ft32_write_pc): Remove.
6232         (ft32_gdbarch_init): Update.
6233         * m32r-tdep.c (m32r_read_pc): Remove.
6234         (m32r_gdbarch_init): Update.
6235         * mep-tdep.c (mep_read_pc): Remove.
6236         (mep_gdbarch_init): Update.
6237         * microblaze-tdep.c (microblaze_write_pc): Remove.
6238         (microblaze_gdbarch_init): Update.
6239         * mn10300-tdep.c (mn10300_read_pc): Remove.
6240         (mn10300_write_pc): Remove.
6241         (mn10300_gdbarch_init): Update.
6242         * moxie-tdep.c (moxie_read_pc): Remove.
6243         (moxie_write_pc): Remove.
6244         (moxie_gdbarch_init): Update.
6245
6246 2018-02-06  Yao Qi  <yao.qi@linaro.org>
6247
6248         * expprint.c (print_subexp_standard): Handle
6249         OP_F77_UNDETERMINED_ARGLIST.
6250         (dump_subexp_body_standard): Likewise.
6251
6252 2018-02-05  Alan Hayward  <alan.hayward@arm.com>
6253
6254         * target-descriptions.c (tdesc_element_visitor) Add empty
6255         implementations.
6256         (tdesc_type): Move make_gdb_type from here.
6257         (tdesc_type_builtin): Likewise.
6258         (tdesc_type_vector): Likewise.
6259         (tdesc_type_with_fields): Move make_gdb_type_ functions from here.
6260         (make_gdb_type_struct): Move from tdesc_type_with_fields.
6261         (make_gdb_type_union): Likewise.
6262         (make_gdb_type_flags): Likewise.
6263         (make_gdb_type_enum): Likewise.
6264         (make_gdb_type): New function.
6265         (tdesc_register_type): Use static make_gdb_type.
6266
6267 2018-02-05  Ruslan Kabatsayev <b7.10110111@gmail.com>
6268
6269         * infcmd.c (default_print_one_register_info): Align natural-format
6270         column values consistently one under another.
6271         (pad_to_column): New function.
6272
6273 2018-02-05  Joel Brobecker  <brobecker@adacore.com>
6274
6275         * dwarf2read.c (dwarf2_physname): Move commment.
6276
6277 2018-02-01  Leszek Swirski  <leszeks@google.com>
6278
6279         * varobj.c (varobj_formatted_print_options): Allow recursive
6280         pretty printing if pretty printing is enabled.
6281
6282 2018-02-01  Leszek Swirski  <leszeks@google.com>
6283
6284         * c-exp.y (lex_one_token, classify_name, yylex): Don't classify
6285         names after a structop as a filename.
6286
6287 2018-02-01  Yao Qi  <yao.qi@linaro.org>
6288
6289         * arm-tdep.c (arm_record_data_proc_misc_ld_str): Rewrite it.
6290         (arm_record_coproc_data_proc): Likewise.
6291
6292 2018-02-01  Yao Qi  <yao.qi@linaro.org>
6293
6294         * arm-tdep.c (arm_record_extension_space): Change ret to signed.
6295
6296 2018-01-31  Nikola Prica  <nikola.prica@rt-rk.com>
6297
6298         * rs6000-tdep.c (skip_prologue): Remove shifting for lr_reg and
6299         assign shifted lr_reg to fdata->lr_register when lr_reg is set.
6300
6301 2018-01-31  Pedro Alves  <palves@redhat.com>
6302
6303         * darwin-nat.c (darwin_interrupt): Remove ptid_t parameter.
6304         * inflow.c (child_terminal_save_inferior): Wrap reference to
6305         tcgetpgrp in HAVE_TERMIOS_H.
6306         (child_interrupt, child_pass_ctrlc): Wrap references to signal in
6307         _WIN32.
6308         * remote-sim.c (gdbsim_interrupt): Remove ptid_t parameter and
6309         always iterate over all inferiors.
6310         (gdbsim_cntrl_c): Adjust.
6311         * windows-nat.c (windows_interrupt): Remove 'ptid_t' parameter.
6312
6313 2018-01-31  Joel Brobecker  <brobecker@adacore.com>
6314
6315         * gdbtypes.c (lookup_array_range_type): Make sure the array's
6316         index type is objfile-owned if the element type is as well.
6317
6318 2018-01-31  Joel Brobecker  <brobecker@adacore.com>
6319
6320         GDB 8.1 released.
6321
6322 2018-01-30  Philipp Rudo  <prudo@linux.vnet.ibm.com>
6323
6324         * s390-linux-tdep.c: Remove includes "features/s390-linux32.c" and
6325         "features/s390x-linux64.c".
6326         (_initialize_s390_linux_tdep): Remove initialization of tdescs
6327         s390_linux32 and s390x_linux64.
6328         (s390_linux_init_abi_31, s390_linux_init_abi_64): Don't set
6329         default tdesc.
6330         * s390-tdep.c: Include "features/s390-linux32.c" and
6331         "features/s390x-linux64.c".
6332         (s390_tdesc_valid): Add check for tdesc_has_registers.
6333         (s390_gdbarch_init): Make sure there is always a valid tdesc.
6334         (_initialize_s390_tdep): Initialize tdesc_s390_linux32 and
6335         tdesc_s390x_linux64.
6336         * s390-linux-tdep.h: Move export of tdesc_s390_linux32 and
6337         tdesc_s390x_linux64 to...
6338         * s390-tdep.h: ...here.
6339
6340 2018-01-30  Pedro Alves  <palves@redhat.com>
6341
6342         PR gdb/13211
6343         * config.in, configure: Regenerate.
6344         * configure.ac: Check for getpgid.
6345         * go32-nat.c (go32_pass_ctrlc): New.
6346         (go32_target): Install it.
6347         * inf-child.c (inf_child_target): Install
6348         child_terminal_save_inferior, child_pass_ctrlc and
6349         child_interrupt.
6350         * inf-ptrace.c (inf_ptrace_interrupt): Delete.
6351         (inf_ptrace_target): No longer install it.
6352         * infcmd.c (interrupt_target_1): Adjust.
6353         * inferior.h (child_terminal_save_inferior, child_pass_ctrlc)
6354         (child_interrupt): Declare.
6355         (inferior::terminal_state): New.
6356         * inflow.c (struct terminal_info): Update comments.
6357         (inferior_process_group): Delete.
6358         (terminal_is_ours): Delete.
6359         (gdb_tty_state): New.
6360         (child_terminal_init): Adjust.
6361         (is_gdb_terminal, sharing_input_terminal_1)
6362         (sharing_input_terminal): New functions.
6363         (child_terminal_inferior): Adjust.  Use sharing_input_terminal.
6364         Set the process's actual process group in the foreground if
6365         possible.  Handle is_ours_for_output/is_ours distinction.  Don't
6366         mark terminal as the inferior's if not sharing GDB's terminal.
6367         Don't check attach_flag.
6368         (child_terminal_ours_for_output, child_terminal_ours): Adjust to
6369         pass down a target_terminal_state.
6370         (child_terminal_save_inferior): New, factored out from ...
6371         (child_terminal_ours_1): ... this.  Handle
6372         target_terminal_state::is_ours_for_output.
6373         (child_interrupt, child_pass_ctrlc): New.
6374         (inflow_inferior_exit): Clear the inferior's terminal_state.
6375         (copy_terminal_info): Copy the inferior's terminal state.
6376         (_initialize_inflow): Remove reference to terminal_is_ours.
6377         * inflow.h (inferior_process_group): Delete.
6378         * nto-procfs.c (nto_handle_sigint, procfs_interrupt): Adjust.
6379         * procfs.c (procfs_target): Don't install procfs_interrupt.
6380         (procfs_interrupt): Delete.
6381         * remote.c (remote_serial_quit_handler): Adjust.
6382         (remote_interrupt): Remove ptid parameter.  Adjust.
6383         * target-delegates.c: Regenerate.
6384         * target.c: Include "terminal.h".
6385         (target_terminal::terminal_state): Rename to ...
6386         (target_terminal::m_terminal_state): ... this.
6387         (target_terminal::init): Adjust.
6388         (target_terminal::inferior): Adjust to per-inferior
6389         terminal_state.
6390         (target_terminal::restore_inferior, target_terminal_is_ours_kind): New.
6391         (target_terminal::ours, target_terminal::ours_for_output): Use
6392         target_terminal_is_ours_kind.
6393         (target_interrupt): Remove ptid parameter.  Adjust.
6394         (default_target_pass_ctrlc): Adjust.
6395         * target.h (target_ops::to_terminal_save_inferior): New field.
6396         (target_ops::to_interrupt): Remove ptid_t parameter.
6397         (target_interrupt): Remove ptid_t parameter.  Update comment.
6398         (target_pass_ctrlc): Update comment.
6399         * target/target.h (target_terminal_state): New scoped enum,
6400         factored out of ...
6401         (target_terminal::terminal_state): ... here.
6402         (target_terminal::inferior): Update comments.
6403         (target_terminal::restore_inferior): New.
6404         (target_terminal::is_inferior, target_terminal::is_ours)
6405         (target_terminal::is_ours_for_output): Adjust.
6406         (target_terminal::scoped_restore_terminal_state): Adjust to
6407         rename, and call restore_inferior() instead of inferior().
6408         (target_terminal::scoped_restore_terminal_state::m_state): Change
6409         type.
6410         (target_terminal::terminal_state): Rename to ...
6411         (target_terminal::m_terminal_state): ... this and change type.
6412
6413 2018-01-30  Pedro Alves  <palves@redhat.com>
6414
6415         * linux-nat.c (wait_for_signal): New function.
6416         (wait_lwp, linux_nat_wait_1): Use it instead of calling sigsuspend
6417         directly.
6418         (async_terminal_is_ours)
6419         (linux_nat_terminal_inferior, linux_nat_terminal_ours): Delete.
6420         (linux_nat_add_target): Don't override
6421         to_terminal_inferior/to_terminal_ours.
6422
6423 2018-01-29  Sergio Durigan Junior  <sergiodj@redhat.com>
6424
6425         * remote.c (remote_follow_fork): Don't call "detach_inferior".
6426
6427 2018-01-28  Simon Marchi  <simon.marchi@ericsson.com>
6428
6429         * dwarf2read.c (free_dwo_files): Add forward-declaration.
6430         (dwarf2_per_objfile::~dwarf2_per_objfile): Move content from
6431         dwarf2_per_objfile_free here.
6432         (dwarf2_per_objfile_free): Remove.
6433         (_initialize_dwarf2_read): Don't register
6434         dwarf2_per_objfile_free as a registry cleanup.
6435
6436 2018-01-27  Eli Zaretskii  <eliz@gnu.org>
6437
6438         Avoid compilation errors in MinGW native builds
6439
6440         The error is triggered by including python-internal.h, and the
6441         error message is:
6442
6443              In file included from d:\usr\lib\gcc\mingw32\6.3.0\include\c++\math.h:36:0,
6444                       from build-gnulib/import/math.h:27,
6445                       from d:/usr/Python26/include/pyport.h:235,
6446                       from d:/usr/Python26/include/Python.h:58,
6447                       from python/python-internal.h:94,
6448                       from python/py-arch.c:24:
6449              d:\usr\lib\gcc\mingw32\6.3.0\include\c++\cmath:1157:11: error: '::hypot' has not been declared
6450         using ::hypot;
6451                 ^~~~~
6452
6453         This happens because Python headers define 'hypot' to expand t
6454         '_hypot' in the Windows builds.
6455         * python/python-internal.h (_hypot) [__MINGW32__]: Define back to
6456         'hypoth'.  This avoids a compilation error.
6457
6458 2018-01-26  Alan Hayward  <alan.hayward@arm.com>
6459
6460         * MAINTAINERS (Write After Approval): Fix ordering.
6461
6462 2018-01-26  Alan Hayward  <alan.hayward@arm.com>
6463
6464         * MAINTAINERS (Write After Approval): Add Alan Hayward.
6465
6466 2018-01-26  Alan Modra  <amodra@gmail.com>
6467
6468         * ppc-linux-tdep.c (powerpc32_plt_stub): Make const.
6469         (powerpc32_plt_stub_so_1): Rename from powerpc32_plt_stub_so.
6470         Remove nop.  Make const.  Comment.
6471         (powerpc32_plt_stub_so_2): New.
6472         (POWERPC32_PLT_CHECK_LEN): Rename from POWERPC32_PLT_STUB_LEN.
6473         Correct count.  Update uses.
6474         (ppc_skip_trampoline_code): Match powerpc32_plt_stub_so_2 too.
6475         Move common code reading PLT entry word.  Correct
6476         powerpc32_plt_stub PLT address calculation.
6477         * ppc64-tdep.c (ppc64_standard_linkage1): Make const.
6478         (ppc64_standard_linkage2, ppc64_standard_linkage3): Likewise.
6479         (ppc64_standard_linkage4, ppc64_standard_linkage5): Likewise.
6480         (ppc64_standard_linkage6, ppc64_standard_linkage7): Likewise.
6481         (ppc64_standard_linkage8): Likewise.
6482         * rs6000-tdep.c (ppc_insns_match_pattern): Make pattern const.
6483         Correct insns description.
6484         * ppc-tdep.h (ppc_insns_match_pattern): Update prototype.
6485
6486 2018-01-24  Pedro Alves  <palves@redhat.com>
6487
6488         GCC PR libstdc++/83906
6489         * gdbtypes.c (operator==(const dynamic_prop &,
6490         const dynamic_prop &)): New.
6491         (operator==(const range_bounds &, const range_bounds &)): New.
6492         (check_types_equal): Use them instead of memcmp.
6493         * gdbtypes.h (operator==(const dynamic_prop &,
6494         const dynamic_prop &)): Declare.
6495         (operator!=(const dynamic_prop &, const dynamic_prop &)): Declare.
6496         (operator==(const range_bounds &, const range_bounds &)): Declare.
6497         (operator!=(const range_bounds &, const range_bounds &)): Declare.
6498
6499 2018-01-23  Philipp Rudo  <prudo@linux.vnet.ibm.com>
6500
6501         * s390-linux-tdep.c (s390_record_address_mask)
6502         (s390_record_calc_disp_common, s390_record_calc_disp)
6503         (s390_record_calc_disp_vsce, s390_record_calc_rl, s390_popcnt)
6504         (s390_record_gpr_g, s390_record_gpr_h, s390_record_vr)
6505         (s390_process_record): Move to s390-tdep.c.
6506         (s390_linux_init_abi_any): Adjust.
6507         * s390-tdep.c (s390_record_address_mask)
6508         (s390_record_calc_disp_common, s390_record_calc_disp)
6509         (s390_record_calc_disp_vsce, s390_record_calc_rl, s390_popcnt)
6510         (s390_record_gpr_g, s390_record_gpr_h, s390_record_vr)
6511         (s390_process_record): Moved from s390-linux-tdep.c
6512         (s390_gdbarch_init): Adjust.
6513
6514 2018-01-23  Philipp Rudo  <prudo@linux.vnet.ibm.com>
6515
6516         * s390-linux-nat.c (s390-tdep.h): New include.
6517         * Makefile.in (ALL_TARGET_OBS): Add s390-tdep.o.
6518         (HFILES_NO_SRCDIR): Add s390-tdep.h.
6519         (ALLDEPFILES): Add s390-tdep.c.
6520         * configure.tgt (s390*-*-linux*): Add s390-tdep.o.
6521         * s390-linux-tdep.h (HWCAP_S390_*, S390_*_REGNUM): Move to...
6522         * s390-tdep.h: ...this.  New file.
6523         * s390-linux-tdep.c (s390-tdep.h): New include.
6524         (_initialize_s390_tdep): Rename to...
6525         (_initialize_s390_linux_tdep): ...this and adjust.
6526         (s390_abi_kind, s390_vector_abi_kind, gdbarch_tdep)
6527         (enum named opcodes, S390_NUM_GPRS, S390_NUM_FPRS): Move to
6528         s390-tdep.h.
6529         (s390_break_insn, s390_breakpoint, s390_readinstruction, is_ri)
6530         (is_ril, is_rr, is_rre, is_rs, is_rsy, is_rx, is_rxy)
6531         (s390_is_partial_instruction, s390_software_single_step)
6532         (is_non_branch_ril, s390_displaced_step_copy_insn)
6533         (s390_displaced_step_fixup, s390_displaced_step_hw_singlestep)
6534         (s390_prologue_data, s390_addr, s390_store, s390_load)
6535         (s390_check_for_saved, s390_analyze_prologue, s390_skip_prologue)
6536         (s390_register_call_saved, s390_guess_tracepoint_registers)
6537         (s390_register_name, s390_dwarf_regmap, s390_dwarf_reg_to_regnum)
6538         (regnum_is_gpr_full, regnum_is_vxr_full, s390_value_from_register)
6539         (s390_pseudo_register_name, s390_pseudo_register_type)
6540         (s390_pseudo_register_read, s390_pseudo_register_write)
6541         (s390_pseudo_register_reggroup_p, s390_ax_pseudo_register_collect)
6542         (s390_ax_pseudo_register_push_stack, s390_gen_return_address)
6543         (s390_addr_bits_remove, s390_address_class_type_flags)
6544         (s390_address_class_type_flags_to_name)
6545         (s390_address_class_name_to_type_flags, s390_effective_inner_type)
6546         (s390_function_arg_float, s390_function_arg_vector)
6547         (is_power_of_two, s390_function_arg_integer, s390_arg_state)
6548         (s390_handle_arg, s390_push_dummy_call, s390_dummy_id)
6549         (s390_frame_align, s390_register_return_value, s390_return_value)
6550         (s390_stack_frame_destroyed_p, s390_unwind_pc, s390_unwind_sp)
6551         (s390_unwind_pseudo_register, s390_adjust_frame_regnum)
6552         (s390_dwarf2_prev_register, s390_dwarf2_frame_init_reg)
6553         (s390_trad_frame_prev_register, s390_unwind_cache)
6554         (s390_prologue_frame_unwind_cache)
6555         (s390_backchain_frame_unwind_cache, s390_frame_unwind_cache)
6556         (s390_frame_this_id, s390_frame_prev_register, s390_frame_unwind)
6557         (s390_stub_unwind_cache, s390_stub_frame_unwind_cache)
6558         (s390_stub_frame_this_id, s390_stub_frame_prev_register)
6559         (s390_stub_frame_sniffer, s390_stub_frame_unwind)
6560         (s390_frame_base_address, s390_local_base_address)
6561         (s390_frame_base, s390_gcc_target_options)
6562         (s390_gnu_triplet_regexp, s390_stap_is_single_operand)
6563         (s390_validate_reg_range, s390_tdesc_valid)
6564         (s390_gdbarch_tdep_alloc, s390_gdbarch_init): Move to...
6565         * s390-tdep.c: ...this.  New file.
6566
6567 2018-01-23  Philipp Rudo  <prudo@linux.vnet.ibm.com>
6568
6569         * s390-linux-tdep.c (gdbarch_tdep.s390_syscall_record): New hook.
6570         (s390_process_record, s390_gdbarch_tdep_alloc)
6571         (s390_linux_init_abi_any): Use/set new hook.
6572
6573 2018-01-23  Philipp Rudo  <prudo@linux.vnet.ibm.com>
6574
6575         * s390-linux-tdep.c (osabi.h): New include.
6576         (s390_linux_init_abi_31, s390_linux_init_abi_64)
6577         (s390_linux_init_abi_any): New functions.
6578         (s390_gdbarch_init, _initialize_s390_tdep): Adjust.
6579
6580 2018-01-23  Philipp Rudo  <prudo@linux.vnet.ibm.com>
6581
6582         * s390-linux-tdep.c (s390_gdbarch_init): Use gdb_assert for
6583         tdesc_has_registers check
6584
6585 2018-01-23  Philipp Rudo  <prudo@linux.vnet.ibm.com>
6586
6587         * s390-linux-tdep.c (s390_tdesc_valid): New function.
6588         (s390_validate_reg_range): New macro.
6589         (s390_gdbarch_init): Adjust.
6590
6591 2018-01-23  Philipp Rudo  <prudo@linux.vnet.ibm.com>
6592
6593         * s390-linux-tdep.c (gdbarch_tdep) <tdesc>: New field.
6594         (s390_gdbarch_tdep_alloc): Adjust.
6595         (s390_gdbarch_init): Adjust.
6596
6597 2018-01-23  Philipp Rudo  <prudo@linux.vnet.ibm.com>
6598
6599         * s390-linux-tdep.c (gdbarch_tdep) <have_linux_v1, have_linux_v2>
6600         <have_tdb>: Change type to bool.
6601         (s390_gdbarch_tdep_alloc): Adjust.
6602         (s390_gdbarch_init): Adjust.
6603
6604 2018-01-23  Philipp Rudo  <prudo@linux.vnet.ibm.com>
6605
6606         * s390-linux-tdep (s390_abi_kind) <ABI_NONE>: New default field.
6607         (gdbarch_tdep) <have_upper, have_vx>: New fields.
6608         (s390_gdbarch_tdep_alloc): New function.
6609         (s390_gdbarch_init): Allocate tdep at start and use its fields
6610         instead of separate variables.
6611
6612 2018-01-23  Philipp Rudo  <prudo@linux.vnet.ibm.com>
6613
6614         * s390-linux-tdep.c (s390_gdbarch_init): Remove duplicate checks
6615         when looking for cached gdbarch and add comment for remaining.
6616
6617 2018-01-22  Pedro Alves  <palves@redhat.com>
6618             Sergio Durigan Junior  <sergiodj@redhat.com>
6619
6620         * typeprint.c (whatis_exp): Initialize "val" in the "whatis type"
6621         case.
6622
6623 2018-01-22  Maciej W. Rozycki  <macro@mips.com>
6624
6625         * MAINTAINERS: Update my company e-mail address.
6626
6627 2018-01-22  Yao Qi  <yao.qi@linaro.org>
6628
6629         * regcache.c (cooked_write_test): New function.
6630         (_initialize_regcache): Register the test.
6631
6632 2018-01-22  Yao Qi  <yao.qi@linaro.org>
6633
6634         * ia64-tdep.c (ia64_pseudo_register_read): Call
6635         regcache->cooked_read instead of regcache_cooked_read_unsigned.
6636         * m32c-tdep.c (m32c_cat_read): Likewise.
6637         (m32c_r3r2r1r0_read): Likewise.
6638         * m68hc11-tdep.c (m68hc11_pseudo_register_read): Likewise.
6639         * xtensa-tdep.c (xtensa_register_read_masked): Likewise.
6640
6641 2018-01-22  Yao Qi  <yao.qi@linaro.org>
6642
6643         * aarch64-tdep.c (aarch64_pseudo_read_value): Call regcache
6644         method raw_read instead of regcache_raw_read.
6645         * amd64-tdep.c (amd64_pseudo_register_read_value): Likewise.
6646         * arm-tdep.c (arm_neon_quad_read): Likewise.
6647         * avr-tdep.c (avr_pseudo_register_read): Likewise.
6648         * bfin-tdep.c (bfin_pseudo_register_read): Likewise.
6649         * frv-tdep.c (frv_pseudo_register_read): Likewise.
6650         * h8300-tdep.c (h8300_pseudo_register_read): Likewise.
6651         * i386-tdep.c (i386_mmx_regnum_to_fp_regnum): Likewise.
6652         (i386_pseudo_register_read_into_value): Likewise.
6653         * mep-tdep.c (mep_pseudo_cr32_read): Likewise.
6654         * msp430-tdep.c (msp430_pseudo_register_read): Likewise.
6655         * nds32-tdep.c (nds32_pseudo_register_read): Likewise.
6656         * rl78-tdep.c (rl78_pseudo_register_read): Likewise.
6657         * s390-linux-tdep.c (s390_pseudo_register_read): Likewise.
6658         * sparc-tdep.c (sparc32_pseudo_register_read):  Likewise.
6659         * sparc64-tdep.c (sparc64_pseudo_register_read): Likewise.
6660         * spu-tdep.c (spu_pseudo_register_read_spu):  Likewise.
6661         * xtensa-tdep.c (xtensa_pseudo_register_read): Likewise.
6662
6663 2018-01-22  Yao Qi  <yao.qi@linaro.org>
6664
6665         * Makefile.in (ALL_TARGET_OBS): Remove mt-tdep.o.
6666         * configure.tgt: Remove target mt.
6667         * mt-tdep.c: Remove.
6668         * regcache.c (cooked_read_test): Remove the check for mt.
6669
6670 2018-01-22  Yao Qi  <yao.qi@linaro.org>
6671
6672         * jit.c (jit_frame_prev_register): Call regcache::cooked_read
6673         instead of gdbarch_pseudo_register_read_value.
6674
6675 2018-01-22  Joel Brobecker  <brobecker@adacore.com>
6676
6677         * dwarf2read.c (need_gnat_info): Return nonzero if the cu's
6678         language is Ada.
6679
6680 2018-01-22  Joel Brobecker  <brobecker@adacore.com>
6681
6682         * linespec.c (create_sals_line_offset): Remove code that preserved
6683         the symtab_and_line's line number.
6684
6685 2018-01-21  Andrew Burgess  <andrew.burgess@embecosm.com>
6686
6687         * varobj.c (varobj_create): Don't set valid_block when creating a
6688         floating varobj.
6689
6690 2018-01-21  Andrew Burgess  <andrew.burgess@embecosm.com>
6691
6692         * varobj.c (varobj_create): Remove out of date comment.
6693
6694 2018-01-21  Andrew Burgess  <andrew.burgess@embecosm.com>
6695
6696         PR mi/20395
6697         * ada-exp.y (write_var_from_sym): Pass extra parameter when
6698         updating innermost block.
6699         * parse.c (innermost_block_tracker::update): Take extra type
6700         parameter, and check types match before updating innermost block.
6701         (write_dollar_variable): Update innermost block for registers.
6702         * parser-defs.h (enum innermost_block_tracker_type): New enum.
6703         (innermost_block_tracker::innermost_block_tracker): Initialise
6704         m_types member.
6705         (innermost_block_tracker::reset): Take type parameter.
6706         (innermost_block_tracker::update): Take type parameter, and pass
6707         type through as needed.
6708         (innermost_block_tracker::m_types): New member.
6709         * varobj.c (varobj_create): Pass type when reseting innermost
6710         block.
6711
6712 2018-01-21  Andrew Burgess  <andrew.burgess@embecosm.com>
6713
6714         * ada-exp.y (write_var_from_sym): Switch to innermost_block API.
6715         * ada-lang.c (resolve_subexp): Likewise.
6716         * breakpoint.c (set_breakpoint_condition) Likewise.
6717         (watch_command_1) Likewise.
6718         * c-exp.y (variable): Likewise.
6719         * d-exp.y (PrimaryExpression): Likewise.
6720         * f-exp.y (variable): Likewise.
6721         * go-exp.y (variable): Likewise.
6722         * m2-exp.y (variable): Likewise.
6723         * objfiles.c (objfile::~objfile): Likewise.
6724         * p-exp.y (variable): Likewise.
6725         * parse.c (innermost_block): Change type.
6726         * parser-defs.h (class innermost_block_tracker): New.
6727         (innermost_block): Change to innermost_block_tracker.
6728         * printcmd.c (display_command): Switch to innermost_block API.
6729         (do_one_display): Likewise.
6730         * rust-exp.y (do_one_display): Likewise.
6731         * symfile.c (clear_symtab_users): Likewise.
6732         * varobj.c (varobj_create): Switch to innermost_block API, replace
6733         use of innermost_block with block stored on varobj object.
6734
6735 2018-01-21  Andrew Burgess  <andrew.burgess@embecosm.com>
6736
6737         * expression.h (innermost_block): Remove declaration.
6738         * varobj.c: Add 'parser-defs.h' include.
6739
6740 2018-01-19  Tom Tromey  <tom@tromey.com>
6741
6742         * rust-lang.c (rust_lookup_symbol_nonlocal): Look up qualified
6743         symbols in the static and global blocks.
6744
6745 2018-01-19  James Clarke  <jrtc27@jrtc27.com>
6746
6747         * nat/linux-ptrace.c: Remove unnecessary reinclusion of
6748         gdb_ptrace.h, and move including gdb_wait.h ...
6749         * nat/linux-ptrace.h: ... to here.
6750
6751 2018-01-19  Simon Marchi  <simon.marchi@ericsson.com>
6752
6753         * inf-ptrace.c (inf_ptrace_detach): Adjust call to
6754         inf_ptrace_detach_success.
6755         (inf_ptrace_detach_success): Add inferior parameter, use it
6756         instead of inferior_ptid, pass it to detach_inferior.
6757         * inf-ptrace.h (inf_ptrace_detach_success): Add inferior
6758         parameter.
6759         * inferior.c (detach_inferior): Add overload that takes an
6760         inferior object.
6761         * inferior.h (detach_inferior): Likewise.
6762         * linux-nat.c (linux_nat_detach): Use the inf parameter, don't
6763         use inferior_ptid, adjust call to inf_ptrace_detach_success.
6764         * linux-thread-db.c (thread_db_detach): Use inf parameter.
6765
6766 2018-01-19  Simon Marchi  <simon.marchi@ericsson.com>
6767
6768         * target.h (struct target_ops) <to_detach>: Add inferior
6769         parameter.
6770         (target_detach): Likewise.
6771         * target.c (dispose_inferior): Pass inferior down.
6772         (target_detach): Pass inferior down.  Assert that it is equal to
6773         the current inferior.
6774         * aix-thread.c (aix_thread_detach): Pass inferior down.
6775         * corefile.c (core_file_command): Pass current_inferior() down.
6776         * corelow.c (core_detach): Add inferior parameter.
6777         * darwin-nat.c (darwin_detach): Likewise.
6778         * gnu-nat.c (gnu_detach): Likewise.
6779         * inf-ptrace.c (inf_ptrace_detach): Likewise.
6780         * infcmd.c (detach_command): Pass current_inferior() down to
6781         target_detach.
6782         * infrun.c (follow_fork_inferior): Pass parent_inf to
6783         target_detach.
6784         (handle_vfork_child_exec_or_exit): Pass inf->vfork_parent to
6785         target_detach.
6786         * linux-nat.c (linux_nat_detach): Add inferior parameter.
6787         * linux-thread-db.c (thread_db_detach): Likewise.
6788         * nto-procfs.c (procfs_detach): Likewise.
6789         * procfs.c (procfs_detach): Likewise.
6790         * record.c (record_detach): Likewise.
6791         * record.h (struct inferior): Forward-declare.
6792         (record_detach): Add inferior parameter.
6793         * remote-sim.c (gdbsim_detach): Likewise.
6794         * remote.c (remote_detach_1): Likewise.
6795         (remote_detach): Likewise.
6796         (extended_remote_detach): Likewise.
6797         * sol-thread.c (sol_thread_detach): Likewise.
6798         * target-debug.h (target_debug_print_inferior_p): New macro.
6799         * target-delegates.c: Re-generate.
6800         * top.c (kill_or_detach): Pass inferior down to target_detach.
6801         * windows-nat.c (windows_detach): Add inferior parameter.
6802
6803 2018-01-19  Simon Marchi  <simon.marchi@ericsson.com>
6804
6805         * target.h (struct target_ops) <to_detach>: Remove args
6806         parameter.
6807         (target_detach): Likewise.
6808         * target.c (dispose_inferior): Adjust.
6809         (target_detach): Remove args parameter, adjust.
6810         * aix-thread.c (aix_thread_detach): Adjust.
6811         * corefile.c (core_file_command): Adjust.
6812         * corelow.c (core_detach): Adjust.
6813         * darwin-nat.c (darwin_detach): Adjust.
6814         * gnu-nat.c (gnu_detach): Adjust.
6815         * inf-ptrace.c (inf_ptrace_detach): Adjust.
6816         * infcmd.c (detach_command): Adjust
6817         * infrun.c (follow_fork_inferior): Adjust.
6818         (handle_vfork_child_exec_or_exit): Adjust.
6819         * linux-fork.c (linux_fork_detach): Remove args parameter.
6820         * linux-fork.h (linux_fork_detach): Likewise.
6821         * linux-nat.c (linux_nat_detach): Likewise, and adjust.
6822         * linux-thread-db.c (thread_db_detach): Likewise.
6823         * nto-procfs.c (procfs_detach): Likewise.
6824         * procfs.c (procfs_detach): Likewise.
6825         (do_detach): Remove signo parameter.
6826         * record.c (record_detach): Remove args parameter.
6827         * record.h (record_detach): Likewise.
6828         * remote-sim.c (gdbsim_detach): Likewise.
6829         * remote.c (remote_detach_1): Likewise.
6830         (remote_detach): Likewise.
6831         (extended_remote_detach): Likewise.
6832         * sol-thread.c (sol_thread_detach): Likewise.
6833         * target-delegates.c: Re-generate.
6834         * top.c (struct qt_args) <args>: Remove field.
6835         (kill_or_detach): Don't pass args.
6836         (quit_force): Don't set args.
6837         * windows-nat.c (windows_detach): Remove args parameter.
6838
6839 2018-01-19  Yao Qi  <yao.qi@linaro.org>
6840
6841         * arm-linux-tdep.c (arm_linux_gcc_target_options): New function.
6842         (arm_linux_init_abi): Install it.
6843
6844 2018-01-19  Yao Qi  <yao.qi@linaro.org>
6845
6846         * osabi.c (gdb_osabi_names): Extend the regexp for
6847         arm-linux-gnueabihf.
6848
6849 2018-01-18  Yao Qi  <yao.qi@linaro.org>
6850
6851         * dwarf2read.c (abbrev_table) <abbrevs>: Rename it to
6852         m_abbrevs.
6853         (abbrev_table::add_abbrev): Update.
6854         (abbrev_table::lookup_abbrev): Update.
6855
6856 2018-01-18  Yao Qi  <yao.qi@linaro.org>
6857
6858         * ppc-linux-tdep.c (ppu2spu_prev_register): Call cooked_read.
6859
6860 2018-01-17  Sergio Durigan Junior  <sergiodj@redhat.com>
6861
6862         * compile/compile.c (compile_to_object): Convert "triplet_rx"
6863         to "std::string".
6864
6865 2018-01-17  Tom Tromey  <tom@tromey.com>
6866
6867         * dwarf2read.c (symbolp): Remove typedef.  Don't instantiate VEC.
6868
6869 2018-01-17  Tom Tromey  <tom@tromey.com>
6870
6871         * gdbtypes.h (add_dyn_prop): Remove objfile parameter.
6872         * gdbtypes.c (add_dyn_prop): Remove objfile parameter.
6873         (create_array_type_with_stride): Update.
6874         * dwarf2read.c (set_die_type): Update.
6875
6876 2018-01-17  Tom Tromey  <tom@tromey.com>
6877
6878         * dwarf2read.c (delayed_method_info): Remove typedef.
6879         (dwarf2_cu::method_info): Now a std::vector.
6880         (add_to_method_list): Update.
6881         (free_delayed_list): Remove.
6882         (compute_delayed_physnames): Update.
6883         (process_full_comp_unit, process_full_type_unit): Clear the method
6884         list.  Remove cleanups.
6885         (psymtab_include_file_name): Add name_holder parameter.  Use
6886         unique_xmalloc_ptr.
6887         (dwarf_decode_lines): Update.
6888
6889 2018-01-17  Tom Tromey  <tom@tromey.com>
6890             Simon Marchi  <simon.marchi@ericsson.com>
6891
6892         * dwarf2read.c (struct dwarf2_cu): Add constructor, destructor.
6893         (dwarf2_per_objfile::free_cached_comp_units)
6894         (init_tu_and_read_dwo_dies, init_cutu_and_read_dies)
6895         (init_cutu_and_read_dies_no_follow): Update.
6896         (dwarf2_cu::dwarf2_cu): Rename from init_one_comp_unit.
6897         (dwarf2_cu::~dwarf2_cu): New.
6898         (free_heap_comp_unit, free_stack_comp_unit): Remove.
6899         (age_cached_comp_units, free_one_cached_comp_unit): Update.
6900
6901 2018-01-17  Tom Tromey  <tom@tromey.com>
6902             Simon Marchi  <simon.marchi@ericsson.com>
6903
6904         * dwarf2read.c (struct dwarf2_cu) <abbrev_table>: Remove.
6905         (struct die_reader_specs) <abbrev_table>: New member.
6906         (struct abbrev_table): Add constructor.
6907         <alloc_abbrev, add_abbrev, lookup_abbrev>: Declare.
6908         <abbrev_obstack>: Now an auto_obstack.
6909         (abbrev_table_up): New typedef.
6910         (init_cu_die_reader): Add abbrev_table parameter.
6911         (read_cutu_die_from_dwo): Remove abbrev_table_provided parameter.
6912         Add result_dwo_abbrev_table.
6913         (init_tu_and_read_dwo_dies, init_cutu_and_read_dies)
6914         (init_cutu_and_read_dies_no_follow, build_type_psymtabs_1):
6915         Update.
6916         (peek_die_abbrev): Take die_reader_specs, not dwarf_cu as
6917         parameter.
6918         (skip_children): Update.
6919         (abbrev_table::alloc_abbrev): Rename from
6920         abbrev_table_alloc_abbrev.
6921         (abbrev_table::add_abbrev): Rename from abbrev_table_add_abbrev.
6922         (abbrev_table::lookup_abbrev): Rename from
6923         abbrev_table_lookup_abbrev.
6924         (abbrev_table_read_table): Return abbrev_table_up.
6925         (abbrev_table_free, abbrev_table_free_cleanup)
6926         (dwarf2_read_abbrevs, dwarf2_free_abbrev_table): Remove.
6927         (load_partial_dies): Update.
6928
6929 2018-01-17  Tom Tromey  <tom@tromey.com>
6930
6931         * dwarf2read.c (dwarf2_compute_name): Update comment.
6932         (read_func_scope, read_variable): Update.
6933         (new_symbol): Remove.
6934         (new_symbol_full): Rename to new_symbol.
6935
6936 2018-01-17  Mike Gulick  <mgulick@mathworks.com>
6937
6938         PR gdb/16577
6939         * gdb_bfd.c (gdb_bfd_map_section): If unable to read object file, issue
6940         a warning instead of throwing an error, set section size to 0 and return
6941         NULL.
6942         * gdb_bfd.h (gdb_bfd_map_section): Update description.
6943
6944 2018-01-17  Simon Marchi  <simon.marchi@ericsson.com>
6945
6946         * nat/linux-ptrace.h (linux_ptrace_attach_fail_reason): Return
6947         std::string.
6948         (linux_ptrace_attach_fail_reason_string): Likewise.
6949         * nat/linux-ptrace.c (linux_ptrace_attach_fail_reason):
6950         Likewise.
6951         (linux_ptrace_attach_fail_reason_string): Likewise.
6952         * linux-nat.c (attach_proc_task_lwp_callback): Adjust.
6953
6954 2018-01-17  Simon Marchi  <simon.marchi@ericsson.com>
6955
6956         * linux-nat.c (linux_nat_attach): Remove xstrdup.
6957
6958 2018-01-17  Eldar Abusalimov  <eldar.abusalimov@jetbrains.com>
6959
6960         PR gdb/21559
6961         * configure.ac: Include <sys/types.h> prior to <sys/user.h> when
6962         checking for fs_base/gs_base fields in struct user_regs_struct.
6963         * configure: Regenerate.
6964
6965 2018-01-17  Yao Qi  <yao.qi@linaro.org>
6966
6967         * aarch64-linux-tdep.c (aarch64_linux_gcc_target_options): New
6968         function.
6969         (aarch64_linux_init_abi): Install it to gdbarch hook
6970         gcc_target_options.
6971
6972 2018-01-15  Pedro Alves  <palves@redhat.com>
6973
6974         * common/signals-state-save-restore.c
6975         (save_original_signals_state): Fix typos.
6976
6977 2017-01-12  Tom Tromey  <tom@tromey.com>
6978             Sergio Durigan Junior  <sergiodj@redhat.com>
6979
6980         * Makefile.in (install-only): Install gdb-add-index.
6981
6982 2018-01-12  John Baldwin  <jhb@FreeBSD.org>
6983
6984         * fbsd-tdep.c (KVE_PROTECTION): Correct value.
6985
6986 2018-01-12  Andreas Arnez  <arnez@linux.vnet.ibm.com>
6987
6988         * infrun.c (keep_going_pass_signal): Clear step-over info when
6989         insert_breakpoints fails.
6990
6991 2018-01-11  Pedro Alves  <palves@redhat.com>
6992
6993         PR gdb/22583
6994         * infrun.c (resume): Rename to ...
6995         (resume_1): ... this.
6996         (resume): Reimplement as wrapper around resume_1.
6997
6998 2018-01-11  Pedro Alves  <palves@redhat.com>
6999
7000         PR remote/22597
7001         * remote.c (remote_parse_stop_reply): Default to the last-set
7002         general thread instead of to 'magic_null_ptid'.
7003
7004 2018-01-10  Pedro Alves  <palves@redhat.com>
7005
7006         * language.h (language_get_symbol_name_matcher): Rename ...
7007         (get_symbol_name_matcher): ... this.
7008         * language.c (language_get_symbol_name_matcher): Ditto.
7009         * dictionary.c, linespec.c, minsyms.c, psymtab.c, symtab.c: All
7010         callers adjusted.
7011
7012 2018-01-10  Pedro Alves  <palves@redhat.com>
7013
7014         PR gdb/22670
7015         * dwarf2read.c
7016         (gdb_index_symbol_name_matcher::gdb_index_symbol_name_matcher):
7017         Adjust to use language_get_symbol_name_matcher instead of
7018         language_defn::la_get_symbol_name_matcher.
7019         * language.c (language_get_symbol_name_matcher): If in Ada mode
7020         and the lookup name is a verbatim match, return Ada's matcher.
7021         * language.h (language_get_symbol_name_matcher): Adjust comment.
7022         (ada_lookup_name_info::verbatim_p):: New method.
7023
7024 2018-01-10  Pedro Alves  <palves@redhat.com>
7025
7026         PR gdb/22670
7027         * ada-lang.c (ada_collect_symbol_completion_matches): If the
7028         minsym's language is language_auto or language_cplus, pass down
7029         language_ada instead.
7030         * symtab.c (compare_symbol_name): Don't frob symbol language here.
7031
7032 2018-01-10  Pedro Alves  <palves@redhat.com>
7033
7034         PR gdb/22670
7035         * minsyms.c (linkage_name_str): New function.
7036         (iterate_over_minimal_symbols): Use it.
7037
7038 2018-01-09  John Baldwin  <jhb@FreeBSD.org>
7039
7040         * NEWS: Document that 'info proc' now works on FreeBSD.
7041
7042 2018-01-09  John Baldwin  <jhb@FreeBSD.org>
7043
7044         * configure.ac: Check for kinfo_getfile in libutil.
7045         * configure: Regenerate.
7046         * config.in: Regenerate.
7047         * fbsd-nat.c: Include "fbsd-tdep.h".
7048         (fbsd_fetch_cmdline): New.
7049         (fbsd_fetch_kinfo_proc): Move earlier and change to return a bool
7050         rather than calling error.
7051         (fbsd_info_proc): New.
7052         (fbsd_thread_name): Report error if fbsd_fetch_kinfo_proc fails.
7053         (fbsd_wait): Report warning if fbsd_fetch_kinfo_proc fails.
7054         (fbsd_nat_add_target): Set "to_info_proc" to "fbsd_info_proc".
7055
7056 2018-01-09  John Baldwin  <jhb@FreeBSD.org>
7057
7058         * fbsd-nat.c (struct free_deleter): Remove.
7059         (fbsd_find_memory_regions): Use gdb::unique_xmalloc_ptr<>.
7060
7061 2018-01-09  John Baldwin  <jhb@FreeBSD.org>
7062
7063         * fbsd-nat.c (fbsd_pid_to_exec_file) [KERN_PROC_PATHNAME]: Return
7064         NULL for an empty pathname.
7065
7066 2018-01-09  John Baldwin  <jhb@FreeBSD.org>
7067
7068         * fbsd-tdep.c (KVE_STRUCTSIZE, KVE_START, KVE_END, KVE_OFFSET)
7069         (KVE_FLAGS, KVE_PROTECTION, KVE_PATH, KINFO_VME_PROT_READ)
7070         (KINFO_VME_PROT_WRITE, KINFO_VME_PROT_EXEC, KINFO_VME_FLAG_COW)
7071         (KINFO_VME_FLAG_NEEDS_COPY, KINFO_VME_FLAG_NOCOREDUMP)
7072         (KINFO_VME_FLAG_SUPER, KINFO_VME_FLAG_GROWS_UP)
7073         (KINFO_VME_FLAG_GROWS_DOWN, KF_STRUCTSIZE, KF_TYPE, KF_FD)
7074         (KF_PATH, KINFO_FILE_TYPE_VNODE, KINFO_FILE_FD_TYPE_CWD)
7075         (KINFO_FILE_FD_TYPE_TEXT, SIG_WORDS, struct kinfo_proc_layout)
7076         (kinfo_proc_layout_32, kinfo_proc_layout_i386)
7077         (kinfo_proc_layout_64, fbsd_vm_map_entry_flags)
7078         (fbsd_core_info_proc_mappings, fbsd_core_vnode_path)
7079         (fbsd_core_fetch_timeval, fbsd_print_sigset)
7080         (fbsd_core_info_proc_status, fbsd_core_info_proc): New.
7081         (fbsd_init_abi):  Install gdbarch "core_info_proc" method.
7082         * fbsd-tdep.h (fbsd_vm_map_entry_flags): New.
7083
7084 2018-01-08  Samuel Thibault  <samuel.thibault@ens-lyon.org>
7085
7086         * gdb/gnu-nat.c: Include <elf.h> and <link.h>.
7087         (gnu_xfer_auxv): New function.
7088         (gnu_xfer_partial): Call gnu_xfer_auxv when `object' is
7089         TARGET_OBJECT_AUXV.
7090
7091 2018-01-08  Yao Qi  <yao.qi@linaro.org>
7092             Simon Marchi  <simon.marchi@ericsson.com>
7093
7094         * Makefile.in (COMMON_SFILES): Remove selftest-arch.c and
7095         common/selftest.c.
7096         (COMMON_OBS): Remove selftest.o.
7097         * configure.ac: Append selftest-arch.c and common/selftest.c to
7098         CONFIG_SRCS.  Append selftest-arch.o and selftest.o to COMMON_OBS.
7099         * configure: Re-generated.
7100         * maint.c (maintenance_selftest): Wrap selftests::run_tests with
7101         GDB_SELF_TEST.
7102         (maintenance_info_selftests): Likewise.
7103
7104 2018-01-08  Xavier Roirand  <roirand@adacore.com>
7105
7106         * ada-valprint.c (val_print_packed_array_elements): Use
7107         proper number of elements when printing an array indexed
7108         by an enumeration type.
7109
7110 2018-01-07  Simon Marchi  <simon.marchi@polymtl.ca>
7111
7112         * dwarf2read.c (struct dwarf2_cu) <dwarf2_per_objfile>: Remove.
7113         (dw2_get_file_names_reader): Adjust.
7114         (lookup_dwo_signatured_type): Adjust.
7115         (lookup_dwp_signatured_type): Adjust.
7116         (lookup_signatured_type): Adjust.
7117         (create_type_unit_group): Adjust.
7118         (get_type_unit_group): Adjust.
7119         (process_psymtab_comp_unit_reader): Adjust.
7120         (build_type_psymtabs_reader): Adjust.
7121         (scan_partial_symbols): Adjust.
7122         (add_partial_symbol): Adjust.
7123         (add_partial_subprogram): Adjust.
7124         (peek_die_abbrev): Adjust.
7125         (fixup_go_packaging): Adjust.
7126         (process_imported_unit_die): Adjust.
7127         (dwarf2_compute_name): Adjust.
7128         (dwarf2_physname): Adjust.
7129         (read_import_statement): Adjust.
7130         (handle_DW_AT_stmt_list): Adjust.
7131         (read_file_scope): Adjust.
7132         (read_func_scope): Adjust.
7133         (read_lexical_block_scope): Adjust.
7134         (read_call_site_scope): Adjust.
7135         (read_variable): Adjust.
7136         (dwarf2_rnglists_process): Adjust.
7137         (dwarf2_ranges_process): Adjust.
7138         (dwarf2_ranges_read): Adjust.
7139         (dwarf2_get_pc_bounds): Adjust.
7140         (dwarf2_record_block_ranges): Adjust.
7141         (dwarf2_add_field): Adjust.
7142         (dwarf2_add_member_fn): Adjust.
7143         (read_structure_type): Adjust.
7144         (process_structure_scope): Adjust.
7145         (read_enumeration_type): Adjust.
7146         (read_array_type): Adjust.
7147         (mark_common_block_symbol_computed): Adjust.
7148         (read_common_block): Adjust.
7149         (read_namespace_type): Adjust.
7150         (read_namespace): Adjust.
7151         (read_module_type): Adjust.
7152         (read_tag_pointer_type): Adjust.
7153         (read_tag_ptr_to_member_type): Adjust.
7154         (read_tag_string_type): Adjust.
7155         (read_subroutine_type): Adjust.
7156         (read_typedef): Adjust.
7157         (read_base_type): Adjust.
7158         (attr_to_dynamic_prop): Adjust.
7159         (read_subrange_type): Adjust.
7160         (read_unspecified_type): Adjust.
7161         (dwarf2_read_abbrevs): Adjust.
7162         (load_partial_dies): Adjust.
7163         (read_partial_die): Adjust.
7164         (find_partial_die): Adjust.
7165         (guess_partial_die_structure_name): Adjust.
7166         (fixup_partial_die): Adjust.
7167         (read_attribute_value): Adjust.
7168         (read_addr_index): Adjust.
7169         (read_addr_index_from_leb128): Adjust.
7170         (read_str_index): Adjust.
7171         (dwarf2_string_attr): Adjust.
7172         (get_debug_line_section): Adjust.
7173         (dwarf_decode_line_header): Adjust.
7174         (lnp_state_machine::check_line_address): Adjust.
7175         (dwarf_decode_lines_1): Adjust.
7176         (dwarf_decode_lines): Adjust.
7177         (dwarf2_start_symtab): Adjust.
7178         (var_decode_location): Adjust.
7179         (new_symbol_full): Adjust.
7180         (dwarf2_const_value_data): Adjust.
7181         (dwarf2_const_value_attr): Adjust.
7182         (dwarf2_const_value): Adjust.
7183         (die_type): Adjust.
7184         (die_containing_type): Adjust.
7185         (build_error_marker_type): Adjust.
7186         (lookup_die_type): Adjust.
7187         (guess_full_die_structure_name): Adjust.
7188         (anonymous_struct_prefix): Adjust.
7189         (determine_prefix): Adjust.
7190         (dwarf2_name): Adjust.
7191         (follow_die_ref_or_sig): Adjust.
7192         (follow_die_offset): Adjust.
7193         (follow_die_ref): Adjust.
7194         (follow_die_sig_1): Adjust.
7195         (follow_die_sig): Adjust.
7196         (get_signatured_type): Adjust.
7197         (get_DW_AT_signature_type): Adjust.
7198         (decode_locdesc): Adjust.
7199         (dwarf_decode_macros): Adjust.
7200         (cu_debug_loc_section): Adjust.
7201         (fill_in_loclist_baton): Adjust.
7202         (dwarf2_symbol_mark_computed): Adjust.
7203         (init_one_comp_unit): Don't assign
7204         dwarf2_cu::dwarf2_per_objfile.
7205         (set_die_type): Adjust.
7206
7207 2018-01-07  Simon Marchi  <simon.marchi@ericsson.com>
7208
7209         * dwarf2read.c (struct mapped_debug_names): Add constructor.
7210         <dwarf2_per_objfile>: New field.
7211         (dwarf2_per_objfile): Remove global.
7212         (get_dwarf2_per_objfile): New function.
7213         (set_dwarf2_per_objfile): New function.
7214         (dwarf2_build_psymtabs_hard): Change objfile parameter to
7215         dwarf2_per_objfile.
7216         (abbrev_table_read_table): Add dwarf2_per_objfile parameter.
7217         (read_abbrev_offset): Likewise.
7218         (read_indirect_string): Likewise.
7219         (read_indirect_line_string): Likewise.
7220         (read_indirect_string_at_offset): Likewise.
7221         (read_indirect_string_from_dwz): Likewise.
7222         (dwarf2_find_containing_comp_unit): Change objfile parameter to
7223         dwarf2_per_objfile.
7224         (age_cached_comp_units): Add dwarf2_per_objfile parameter.
7225         (create_all_comp_units): Change objfile parameter to
7226         dwarf2_per_objfile.
7227         (create_all_type_units): Likewise.
7228         (process_queue): Add dwarf2_per_objfile parameter.
7229         (read_and_check_comp_unit_head): Likewise.
7230         (lookup_dwo_unit_in_dwp): Likewise.
7231         (get_dwp_file): Likewise.
7232         (process_cu_includes): Likewise.
7233         (struct free_dwo_file_cleanup_data): New struct.
7234         (dwarf2_has_info): Use get_dwarf2_per_objfile and
7235         set_dwarf2_per_objfile.
7236         (dwarf2_get_dwz_file): Add dwarf2_per_objfile parameter.
7237         (dw2_do_instantiate_symtab): Get dwarf2_per_objfile from
7238         context, adjust calls.
7239         (dw2_instantiate_symtab): Likewise.
7240         (dw2_get_cutu): Add dwarf2_per_objfile parameter.
7241         (dw2_get_cu): Likewise.
7242         (create_cu_from_index_list): Change objfile parameter to
7243         dwarf2_per_objfile.
7244         (create_cus_from_index_list): Get dwarf2_per_objfile from
7245         context, adjust calls.
7246         (create_cus_from_index): Likewise.
7247         (create_signatured_type_table_from_index): Change objfile
7248         parameter to dwarf2_per_objfile.
7249         (create_signatured_type_table_from_debug_names): Change objfile
7250         parameter to dwarf2_per_objfile.
7251         (create_addrmap_from_index): Likewise.
7252         (create_addrmap_from_aranges): Likewise.
7253         (dwarf2_read_index): Use get_dwarf2_per_objfile, adjust calls.
7254         (dw2_setup): Remove.
7255         (dw2_get_file_names_reader): Get dwarf2_per_objfile from
7256         context.
7257         (dw2_find_last_source_symtab): Get dwarf2_per_objfile using
7258         get_dwarf2_per_objfile.
7259         (dw2_forget_cached_source_info): Likewise.
7260         (dw2_map_symtabs_matching_filename): Likewise.
7261         (struct dw2_symtab_iterator) <index>: Remove.
7262         <dwarf2_per_objfile>: New field.
7263         (dw2_symtab_iter_init): Replace index parameter with
7264         dwarf2_per_objfile.
7265         (dw2_symtab_iter_next): Use dwarf2_per_objfile from iter.
7266         (dw2_lookup_symbol): Use get_dwarf2_per_objfile and adjust.
7267         (dw2_print_stats): Likewise.
7268         (dw2_dump): Likewise.
7269         (dw2_expand_symtabs_for_function): Likewise.
7270         (dw2_expand_all_symtabs): Likewise.
7271         (dw2_expand_symtabs_with_fullname): Likewise.
7272         (dw2_expand_marked_cus): Replace index and objfile parameters
7273         with dwarf2_per_objfile.
7274         (dw_expand_symtabs_matching_file_matcher): Add
7275         dwarf2_per_objfile parameter and adjust calls.
7276         (dw2_expand_symtabs_matching): Use get_dwarf2_per_objfile and
7277         adjust calls.
7278         (dw2_find_pc_sect_compunit_symtab): Don't call dw2_setup.
7279         (dw2_map_symbol_filenames): Use get_dwarf2_per_objfile and
7280         adjust calls.
7281         (create_cus_from_debug_names_list): Replace objfile parameter
7282         with dwarf2_per_objfile and adjust calls.
7283         (create_cus_from_debug_names): Likewise.
7284         (dwarf2_read_debug_names): Likewise.
7285         (mapped_debug_names::namei_to_name): Adjust call.
7286         (dw2_debug_names_iterator::next): Likewise.
7287         (dw2_debug_names_iterator::find_vec_in_debug_names): Likewise.
7288         (dw2_debug_names_lookup_symbol): Use get_dwarf2_per_objfile.
7289         (dw2_debug_names_dump): Likewise.
7290         (dw2_debug_names_expand_symtabs_for_function): Likewise.
7291         (dw2_debug_names_expand_symtabs_matching): Likewise.
7292         (dwarf2_initialize_objfile): Likewise.
7293         (dwarf2_build_psymtabs): Likewise.
7294         (get_abbrev_section_for_cu): Get dwarf2_per_objfile from
7295         this_cu.
7296         (error_check_comp_unit_head): Add dwarf2_per_objfile parameter.
7297         (read_and_check_comp_unit_head): Likewise.
7298         (read_abbrev_offset): Likewise.
7299         (create_debug_type_hash_table): Likewise.
7300         (create_debug_types_hash_table): Likewise.
7301         (create_all_type_units): Replace objfile parameter with
7302         dwarf2_per_objfile.
7303         (add_type_unit): Add dwarf2_per_objfile parameter.
7304         (fill_in_sig_entry_from_dwo_entry): Replace objfile parameter
7305         with dwarf2_per_objfile.
7306         (lookup_dwo_signatured_type): Get dwarf2_per_objfile from cu.
7307         (lookup_dwp_signatured_type): Likewise.
7308         (lookup_signatured_type): Likewise.
7309         (read_cutu_die_from_dwo): Likewise.
7310         (init_tu_and_read_dwo_dies): Likewise.
7311         (init_cutu_and_read_dies): Likewise.
7312         (init_cutu_and_read_dies_no_follow): Likewise.
7313         (allocate_type_unit_groups_table): Add objfile parameter.
7314         (create_type_unit_group): Use dwarf2_per_objfile from cu.
7315         (get_type_unit_group): Likewise.
7316         (process_psymtab_comp_unit): Update call.
7317         (build_type_psymtabs_reader): Use dwarf2_per_objfile from cu.
7318         (build_type_psymtabs_1): Add dwarf2_per_objfile parameter.
7319         (print_tu_stats): Likewise.
7320         (build_type_psymtab_dependencies): Use dwarf2_per_objfile passed
7321         in void* parameter.
7322         (build_type_psymtabs): Change objfile parameter to
7323         dwarf2_per_objfile.
7324         (process_skeletonless_type_unit): Use dwarf2_per_objfile
7325         passed in void* parameter.
7326         (process_skeletonless_type_units): Change objfile parameter to
7327         dwarf2_per_objfile.
7328         (set_partial_user): Likewise.
7329         (dwarf2_build_psymtabs_hard): Likewise.
7330         (read_comp_units_from_section): Likewise.
7331         (create_all_comp_units): Likewise.
7332         (scan_partial_symbols): Update calls.
7333         (add_partial_symbol): Likewise.
7334         (dwarf2_read_symtab): Use get_dwarf2_per_objfile.
7335         (maybe_queue_comp_unit): Use dwarf2_read_symtab from cu.
7336         (process_queue): Add dwarf2_per_objfile parameter.
7337         (get_compunit_symtab): Use dwarf2_per_objfile from cu.
7338         (compute_compunit_symtab_includes): Likewise.
7339         (process_cu_includes): Add dwarf2_per_objfile parameter.
7340         (process_full_comp_unit): Use dwarf2_per_objfile from cu.
7341         (process_full_type_unit): Likewise.
7342         (process_imported_unit_die): Update call.
7343         (handle_DW_AT_stmt_list): Use dwarf2_per_objfile from cu.
7344         (read_file_scope): Likewise.
7345         (allocate_dwo_file_hash_table): Add objfile parameter.
7346         (lookup_dwo_file_slot): Add dwarf2_per_objfile parameter.
7347         (create_cus_hash_table): Likewise.
7348         (create_dwp_hash_table): Likewise.
7349         (create_dwo_unit_in_dwp_v1): Likewise.
7350         (create_dwp_v2_section): Likewise.
7351         (create_dwo_unit_in_dwp_v2): Likewise.
7352         (lookup_dwo_unit_in_dwp): Likewise.
7353         (try_open_dwop_file): Likewise.
7354         (open_dwo_file): Likewise. Use dwarf2_per_objfile from cu.
7355         (open_and_init_dwo_file): Use dwarf2_per_objfile from cu, update
7356         cleanup to include a reference to dwarf2_per_objfile.
7357         (open_dwp_file): Add dwarf2_per_objfile parameter.
7358         (open_and_init_dwp_file): Likewise.
7359         (get_dwp_file): Likewise.
7360         (lookup_dwo_cutu): Use dwarf2_per_objfile from cu.
7361         (queue_and_load_all_dwo_tus): Update call.
7362         (free_dwo_file_cleanup): Use dwarf2_per_objfile from cleanup
7363         data.
7364         (dwarf2_rnglists_process): Use dwarf2_per_objfile from cu.
7365         (dwarf2_ranges_process): Likewise.
7366         (dwarf2_get_pc_bounds): Likewise.
7367         (mark_common_block_symbol_computed): Likewise.
7368         (abbrev_table_read_table): Add dwarf2_per_objfile parameter.
7369         (dwarf2_read_abbrevs): Update call.
7370         (read_partial_die): Use dwarf2_per_objfile from cu.
7371         (find_partial_die): Likewise.
7372         (fixup_partial_die): Likewise.
7373         (read_attribute_value): Likewise.
7374         (read_indirect_string_at_offset_from): Add objfile parameter.
7375         (read_indirect_string_at_offset): Add dwarf2_per_objfile
7376         parameter.
7377         (read_indirect_string_from_dwz): Add objfile parameter.
7378         (read_indirect_string): Add objfile parameter.
7379         (read_addr_index_1): Add dwarf2_per_objfile parameter.
7380         (read_addr_index): Use dwarf2_per_objfile from cu.
7381         (dwarf2_read_addr_index): Use dwarf2_per_objfile from cu, don't
7382         call dw2_setup.
7383         (read_str_index): Use dwarf2_per_objfile from cu.
7384         (get_debug_line_section): Likewise.
7385         (read_formatted_entries): Add dwarf2_per_objfile parameter.
7386         (dwarf_decode_line_header): Use dwarf2_per_objfile from cu.
7387         (new_symbol_full): Use dwarf2_per_objfile from cu.
7388         (build_error_marker_type): Likewise.
7389         (lookup_die_type): Likewise.
7390         (determine_prefix): Likewise.
7391         (follow_die_offset): Likewise.
7392         (dwarf2_fetch_die_loc_sect_off): Use get_dwarf2_per_objfile.
7393         (dwarf2_fetch_constant_bytes): Don't call dw2_setup.
7394         (dwarf2_fetch_die_type_sect_off): Likewise.
7395         (dwarf2_get_die_type): Likewise.
7396         (follow_die_sig_1): Use dwarf2_per_objfile from cu.
7397         (get_signatured_type): Likewise.
7398         (get_DW_AT_signature_type): Likewise.
7399         (dwarf_decode_macro_bytes): Add dwarf2_per_objfile parameter.
7400         (dwarf_decode_macros): Use dwarf2_per_objfile from cu.
7401         (cu_debug_loc_section): Likewise.
7402         (fill_in_loclist_baton): Likewise.
7403         (dwarf2_symbol_mark_computed): Likewise.
7404         (dwarf2_find_containing_comp_unit): Change objfile parameter to
7405         dwarf2_per_objfile.
7406         (free_cached_comp_units): Use dwarf2_per_objfile passed in void*
7407         parameter.
7408         (age_cached_comp_units): Add dwarf2_per_objfile parameter.
7409         (free_one_cached_comp_unit): Use dwarf2_per_objfile from cu.
7410         (dwarf2_free_objfile): Use get_dwarf2_per_objfile.
7411         (set_die_type): Use dwarf2_free_objfile from cu.
7412         (get_die_type_at_offset): Likewise.
7413         (dwarf2_per_objfile_free): Don't assign global variable.
7414         (debug_names) <constructor>: Add dwarf2_per_objfile
7415         parameter, update m_debugstrlookup construction.
7416         (debug_names::debug_str_lookup): Add dwarf2_per_objfile
7417         parameter.
7418         <m_dwarf2_per_objfile>: New field.
7419         <lookup>: Use m_dwarf2_per_objfile.
7420         (check_dwarf64_offsets): Add dwarf2_per_objfile parameter.
7421         (psyms_seen_size): Likewise.
7422         (write_gdbindex): Replace objfile parameter with
7423         dwarf2_per_objfile.
7424         (write_debug_names): Likewise.
7425         (write_psymtabs_to_index): Likewise.
7426         (save_gdb_index_command): Use get_dwarf2_per_objfile, update
7427         calls.
7428
7429 2018-01-07  Simon Marchi  <simon.marchi@ericsson.com>
7430
7431         * dwarf2read.c (struct dwarf2_cu) <objfile>: Remove.
7432         <dwarf2_per_objfile>: New field.
7433         (struct dwarf2_per_cu_data) <objfile>: Remove.
7434         <dwarf2_per_objfile>: New field.
7435         (create_cu_from_index_list): Assign dwarf2_per_objfile instead
7436         of objfile.
7437         (create_signatured_type_table_from_index): Likewise.
7438         (create_debug_type_hash_table): Likewise.
7439         (fill_in_sig_entry_from_dwo_entry): Likewise.
7440         (lookup_dwo_unit): Access objfile through dwarf2_per_objfile.
7441         (create_type_unit_group): Assign dwarf2_per_objfile instead of
7442         objfile.
7443         (create_partial_symtab): Access objfile through
7444         dwarf2_per_objfile.
7445         (process_psymtab_comp_unit_reader): Likewise.
7446         (read_comp_units_from_section): Likewise.
7447         (scan_partial_symbols): Likewise.
7448         (add_partial_symbol): Likewise.
7449         (add_partial_subprogram): Likewise.
7450         (peek_die_abbrev): Likewise.
7451         (fixup_go_packaging): Likewise.
7452         (process_full_comp_unit): Likewise.
7453         (process_full_type_unit): Likewise.
7454         (process_imported_unit_die): Likewise.
7455         (dwarf2_compute_name): Likewise.
7456         (dwarf2_physname): Likewise.
7457         (read_import_statement): Likewise.
7458         (create_cus_hash_table): Assign dwarf2_physname instead of
7459         objfile.
7460         (read_func_scope): Access objfile through dwarf2_per_objfile.
7461         (read_lexical_block_scope): Likewise.
7462         (read_call_site_scope): Likewise.
7463         (read_variable): Likewise.
7464         (dwarf2_rnglists_process): Likewise.
7465         (dwarf2_ranges_process): Likewise.
7466         (dwarf2_ranges_read): Likewise.
7467         (dwarf2_record_block_ranges): Likewise.
7468         (dwarf2_add_field): Likewise.
7469         (dwarf2_add_member_fn): Likewise.
7470         (read_structure_type): Likewise.
7471         (process_structure_scope): Likewise.
7472         (read_enumeration_type): Likewise.
7473         (read_array_type): Likewise.
7474         (read_common_block): Likewise.
7475         (read_namespace_type): Likewise.
7476         (read_namespace): Likewise.
7477         (read_module_type): Likewise.
7478         (read_tag_pointer_type): Likewise.
7479         (read_tag_ptr_to_member_type): Likewise.
7480         (read_tag_string_type): Likewise.
7481         (read_subroutine_type): Likewise.
7482         (read_typedef): Likewise.
7483         (read_base_type): Likewise.
7484         (attr_to_dynamic_prop): Likewise.
7485         (read_subrange_type): Likewise.
7486         (read_unspecified_type): Likewise.
7487         (load_partial_dies): Likewise.
7488         (read_partial_die): Likewise.
7489         (find_partial_die): Likewise.
7490         (guess_partial_die_structure_name): Likewise.
7491         (fixup_partial_die): Likewise.
7492         (read_attribute_value): Likewise.
7493         (read_addr_index_from_leb128): Likewise.
7494         (dwarf2_read_addr_index): Likewise.
7495         (dwarf2_string_attr): Likewise.
7496         (lnp_state_machine::check_line_address): Likewise.
7497         (dwarf_decode_lines_1): Likewise.
7498         (dwarf_decode_lines): Likewise.
7499         (dwarf2_start_symtab): Likewise.
7500         (var_decode_location): Likewise.
7501         (new_symbol_full): Likewise.
7502         (dwarf2_const_value_data): Likewise.
7503         (dwarf2_const_value_attr): Likewise.
7504         (dwarf2_const_value): Likewise.
7505         (die_type): Likewise.
7506         (die_containing_type): Likewise.
7507         (lookup_die_type): Likewise.
7508         (guess_full_die_structure_name): Likewise.
7509         (anonymous_struct_prefix): Likewise.
7510         (dwarf2_name): Likewise.
7511         (follow_die_ref_or_sig): Likewise.
7512         (follow_die_offset): Likewise.
7513         (follow_die_ref): Likewise.
7514         (dwarf2_fetch_die_loc_sect_off): Likewise.
7515         (dwarf2_fetch_constant_bytes): Likewise.
7516         (dwarf2_fetch_die_type_sect_off): Likewise.
7517         (dwarf2_get_die_type): Likewise.
7518         (follow_die_sig): Likewise.
7519         (decode_locdesc): Likewise.
7520         (dwarf2_per_cu_objfile): Likewise.
7521         (dwarf2_per_cu_text_offset): Likewise.
7522         (init_one_comp_unit): Assign dwarf2_per_objfile instead of
7523         objfile.
7524         (set_die_type): Access objfile through
7525         dwarf2_per_objfile.
7526
7527 2018-01-07  Simon Marchi  <simon.marchi@ericsson.com>
7528
7529         * valprint.c (converted_character_d): Remove typedef.
7530         (DEF_VEC_O (converted_character_d)): Remove.
7531         (count_next_character): Use std::vector.
7532         (print_converted_chars_to_obstack): Likewise.
7533         (generic_printstr): Likewise.
7534
7535 2018-01-07  Simon Marchi  <simon.marchi@polymtl.ca>
7536
7537         * xml-support.h (struct gdb_xml_value): Add constructor.
7538         <value>: Change type to unique_xmalloc_ptr.
7539         (gdb_xml_value_s): Remove typedef.
7540         (DEF_VEC_O (gdb_xml_value_s)): Remove.
7541         (gdb_xml_element_start_handler): Change parameter type to
7542         std::vector.
7543         (xml_find_attribute): Likewise.
7544         * xml-support.c (xml_find_attribute): Change parameter type to
7545         std::vector and adjust.
7546         (gdb_xml_values_cleanup): Remove.
7547         (gdb_xml_parser::start_element): Adjust to std::vector.
7548         (xinclude_start_include): Change paraeter type to std::vector
7549         and adjust.
7550         * btrace.c (check_xml_btrace_version): Likewise.
7551         (parse_xml_btrace_block): Likewise.
7552         (parse_xml_btrace_pt_config_cpu): Likewise.
7553         (parse_xml_btrace_pt): Likewise.
7554         (parse_xml_btrace_conf_bts): Likewise.
7555         (parse_xml_btrace_conf_pt): Likewise.
7556         * memory-map.c (memory_map_start_memory): Likewise.
7557         (memory_map_start_property): Likewise.
7558         * osdata.c (osdata_start_osdata): Likewise.
7559         (osdata_start_item): Likewise.
7560         (osdata_start_column): Likewise.
7561         * remote.c (start_thread): Likewise.
7562         * solib-aix.c (library_list_start_library): Likewise.
7563         (library_list_start_list): Likewise.
7564         * solib-svr4.c (library_list_start_library): Likewise.
7565         (svr4_library_list_start_list): Likewise.
7566         * solib-target.c (library_list_start_segment): Likewise.
7567         (library_list_start_section): Likewise.
7568         (library_list_start_library): Likewise.
7569         (library_list_start_list): Likewise.
7570         * tracepoint.c (traceframe_info_start_memory): Likewise.
7571         (traceframe_info_start_tvar): Likewise.
7572         * xml-syscall.c (syscall_start_syscall): Likewise.
7573         * xml-tdesc.c (tdesc_start_target): Likewise.
7574         (tdesc_start_feature): Likewise.
7575         (tdesc_start_reg): Likewise.
7576         (tdesc_start_union): Likewise.
7577         (tdesc_start_struct): Likewise.
7578         (tdesc_start_flags): Likewise.
7579         (tdesc_start_enum): Likewise.
7580         (tdesc_start_field): Likewise.
7581         (tdesc_start_enum_value): Likewise.
7582         (tdesc_start_vector): Likewise.
7583
7584 2018-01-07  Simon Marchi  <simon.marchi@polymtl.ca>
7585
7586         * extension.h (struct xmethod_worker) <clone>: Remove.
7587         * python/py-xmethods.c (struct python_xmethod_worker) <clone>:
7588         Remove.
7589         (python_xmethod_worker::clone): Remove.
7590         * valops.c (find_overload_match): Use std::move instead of
7591         clone.
7592
7593 2018-01-07  Simon Marchi  <simon.marchi@polymtl.ca>
7594
7595         * extension-priv.h (enum ext_lang_rc): Remove, move to extension.h.
7596         (struct extension_language_ops) <clone_xmethod_worker_data>: Remove.
7597         <free_xmethod_worker_data>: Remove.
7598         <get_matching_xmethod_workers>: Chance VEC to std::vector.
7599         <get_xmethod_arg_types>: Remove.
7600         <get_xmethod_result_type>: Remove.
7601         <invoke_xmethod>: Remove.
7602         * extension.c (new_xmethod_worker): Remove.
7603         (clone_xmethod_worker): Remove.
7604         (get_matching_xmethod_workers): Return void, pass std::vector by
7605         pointer.
7606         (get_xmethod_arg_types): Rename to...
7607         (xmethod_worker::get_arg_types): ... this, and adjust.
7608         (get_xmethod_result_type): Rename to...
7609         (xmethod_worker::get_result_type): ... this, and adjust.
7610         (invoke_xmethod): Remove.
7611         (free_xmethod_worker): Remove.
7612         (free_xmethod_worker_vec): Remove.
7613         * extension.h (enum ext_lang_rc): Move here from
7614         extension-priv.h.
7615         (struct xmethod_worker): Add constructor and destructor.
7616         <data>: Remove.
7617         <value>: Remove.
7618         <invoke, clone, do_get_result_type, do_get_arg_types>: New
7619         virtual pure methods.
7620         <get_arg_types, get_result_type>: New methods.
7621         (xmethod_worker_ptr): Remove typedef.
7622         (DEF_VEC_P (xmethod_worker_ptr)): Remove.
7623         (xmethod_worker_vec): Remove typedef.
7624         (xmethod_worker_up): New typedef.
7625         (invoke_xmethod): Remove.
7626         (clone_xmethod_worker): Remove.
7627         (free_xmethod_worker): Remove.
7628         (free_xmethod_worker_vec): Remove.
7629         (get_xmethod_arg_types): Remove.
7630         (get_xmethod_result_type): Remove.
7631         * valops.c (find_method_list): Use std::vector, don't use
7632         intermediate vector.
7633         (value_find_oload_method_list): Use std::vector.
7634         (find_overload_match): Use std::vector.
7635         (find_oload_champ): Use std::vector.
7636         * value.c (value_free): Use operator delete.
7637         (value_of_xmethod): Rename to...
7638         (value_from_xmethod): ... this.  Don't assign
7639         xmethod_worker::value, take rvalue-reference.
7640         (result_type_of_xmethod): Adjust.
7641         (call_xmethod): Adjust.
7642         * value.h: Include extension.h.
7643         (struct xmethod_worker): Don't forward-declare.
7644         (value_of_xmethod): Rename to...
7645         (value_from_xmethod): ... this, take rvalue-reference.
7646         * python/py-xmethods.c (struct gdbpy_worker_data): Rename to...
7647         (struct python_xmethod_worker): ... this, add constructor and
7648         destructor.
7649         <invoke, clone, do_get_arg_types, do_get_result_type>: Implement.
7650         (gdbpy_free_xmethod_worker_data): Rename to...
7651         (python_xmethod_worker::~python_xmethod_worker): ... this and
7652         adjust.
7653         (gdbpy_clone_xmethod_worker_data): Rename to...
7654         (python_xmethod_worker::clone): ... this and adjust.
7655         (gdbpy_get_matching_xmethod_workers): Use std::vector, don't use
7656         temporary vector.
7657         (gdbpy_get_xmethod_arg_types): Rename to...
7658         (python_xmethod_worker::do_get_arg_types): ... this and adjust.
7659         (gdbpy_get_xmethod_result_type): Rename to...
7660         (python_xmethod_worker::do_get_result_type): ... this and
7661         adjust.
7662         (gdbpy_invoke_xmethod): Rename to...
7663         (python_xmethod_worker::invoke): ... this and adjust.
7664         (new_python_xmethod_worker): Rename to...
7665         (python_xmethod_worker::python_xmethod_worker): ... this and
7666         adjust.
7667         * python/python-internal.h (gdbpy_clone_xmethod_worker_data):
7668         Remove.
7669         (gdbpy_free_xmethod_worker_data): Remove.
7670         (gdbpy_get_matching_xmethod_workers): Use std::vector.
7671         (gdbpy_get_xmethod_arg_types): Remove.
7672         (gdbpy_get_xmethod_result_type): Remove.
7673         (gdbpy_invoke_xmethod): Remove.
7674         * python/python.c (python_extension_ops): Remove obsolete
7675         callbacks.
7676
7677 2018-01-05  Pedro Alves  <palves@redhat.com>
7678
7679         PR gdb/18653
7680         * common/signals-state-save-restore.c
7681         (save_original_signals_state): New parameter 'quiet'.  Warn if we
7682         find a custom handler preinstalled, instead of internal erroring.
7683         But only warn if !quiet.
7684         * common/signals-state-save-restore.h
7685         (save_original_signals_state): New parameter 'quiet'.
7686         * main.c (captured_main_1): Move save_original_signals_state call
7687         after option handling, and pass QUIET.
7688
7689 2018-01-05  Pedro Alves  <palves@redhat.com>
7690
7691         * spu-tdep.c (spu_catch_start): Pass
7692         symbol_name_match_type::SEARCH_NAME to block_lookup_symbol.
7693
7694 2018-01-05  Pedro Alves  <palves@redhat.com>
7695
7696         PR gdb/22670
7697         * ada-lang.c (literal_symbol_name_matcher): New function.
7698         (ada_get_symbol_name_matcher): Use it for
7699         symbol_name_match_type::SEARCH_NAME.
7700         * block.c (block_lookup_symbol): New parameter 'match_type'.  Pass
7701         it down instead of assuming symbol_name_match_type::FULL.
7702         * block.h (block_lookup_symbol): New parameter 'match_type'.
7703         * c-valprint.c (print_unpacked_pointer): Use
7704         lookup_symbol_search_name instead of lookup_symbol.
7705         * compile/compile-object-load.c (get_out_value_type): Pass down
7706         symbol_name_match_type::SEARCH_NAME.
7707         * cp-namespace.c (cp_basic_lookup_symbol): Pass down
7708         symbol_name_match_type::FULL.
7709         * cp-support.c (cp_get_symbol_name_matcher): Handle
7710         symbol_name_match_type::SEARCH_NAME.
7711         * infrun.c (insert_exception_resume_breakpoint): Use
7712         lookup_symbol_search_name.
7713         * p-valprint.c (pascal_val_print): Use lookup_symbol_search_name.
7714         * psymtab.c (maintenance_check_psymtabs): Use
7715         symbol_name_match_type::SEARCH_NAME and SYMBOL_SEARCH_NAME.
7716         * stack.c (print_frame_args): Use lookup_symbol_search_name and
7717         SYMBOL_SEARCH_NAME.
7718         * symtab.c (lookup_local_symbol): Don't demangle the lookup name
7719         if symbol_name_match_type::SEARCH_NAME.
7720         (lookup_symbol_in_language): Pass down
7721         symbol_name_match_type::FULL.
7722         (lookup_symbol_search_name): New.
7723         (lookup_language_this): Pass down
7724         symbol_name_match_type::SEARCH_NAME.
7725         (lookup_symbol_aux, lookup_local_symbol): New parameter
7726         'match_type'.  Pass it down.
7727         * symtab.h (symbol_name_match_type::SEARCH_NAME): New enumerator.
7728         (lookup_symbol_search_name): New declaration.
7729         (lookup_symbol_in_block): New 'match_type' parameter.
7730
7731 2018-01-05  Pedro Alves  <palves@redhat.com>
7732
7733         PR gdb/22670
7734         * ada-lang.c (ada_lookup_encoded_symbol): Reimplement in terms of
7735         ada_lookup_symbol.
7736         (ada_lookup_symbol): Reimplement in terms of
7737         ada_lookup_symbol_list, bits factored out from
7738         ada_lookup_encoded_symbol.
7739
7740 2018-01-05  Joel Brobecker  <brobecker@adacore.com>
7741
7742         * ada-exp.y (write_object_renaming): When subscripting an array
7743         using a symbol as the index, pass the block in call to
7744         ada_lookup_encoded_symbol when looking that symbol up.
7745
7746 2018-01-05  Jerome Guitton  <guitton@adacore.com>
7747
7748         * ada-lang.c (ada_array_length): Use ada_index_type instead of
7749         TYPE_INDEX_TYPE.
7750
7751 2018-01-05  Joel Brobecker  <brobecker@adacore.com>
7752
7753         * ada-lang.c (ada_to_fixed_value_create): Add handling of
7754         the case where VALUE_LVAL (val0) is not lval_memory.
7755
7756 2018-01-05  Xavier Roirand  <roirand@adacore.com>
7757
7758         * ada-valprint.c (print_optional_low_bound): Handle
7759         character-indexed array printing like boolean-indexed array
7760         printing.
7761
7762 2018-01-05  Joel Brobecker  <brobecker@adacore.com>
7763
7764         * NEWS: Create a new section for the next release branch.
7765         Rename the section of the current branch, now that it has
7766         been cut.
7767
7768 2018-01-05  Joel Brobecker  <brobecker@adacore.com>
7769
7770         GDB 8.1 branch created (5219ac6237c272b938c28517bf371429260c71e7):
7771         * version.in: Bump version to 8.1.50.DATE-git.
7772
7773 2018-01-03  Xavier Roirand  <roirand@adacore.com>
7774
7775         * ada-lang.h (ada_exception_catchpoint_kind) <ada_catch_handlers>:
7776         Add field.
7777         * ada-lang.c (struct exception_support_info) <catch_handlers_sym>:
7778         Add field.
7779         (default_exception_support_info) <catch_handlers_sym>: Add field.
7780         (exception_support_info_fallback) <catch_handlers_sym>: Add field.
7781         (ada_exception_name_addr_1): Add "catch handlers" handling.
7782         (ada_exception_catchpoint_cond_string) <ex>: New parameter.
7783         Update all callers.
7784         (create_excep_cond_exprs) <ex>: Add parameter.
7785         (re_set_exception): Update create_excep_cond_exprs call.
7786         (print_it_exception, print_one_exception, print_mention_exception)
7787         (print_recreate_exception): Add "catch handler" handling.
7788         (allocate_location_catch_handlers, re_set_catch_handlers)
7789         (check_status_catch_handlers, print_it_catch_handlers)
7790         (print_one_catch_handlers, print_mention_catch_handlers)
7791         (print_recreate_catch_handlers): New function.
7792         (catch_handlers_breakpoint_ops): New variable.
7793         (catch_ada_exception_command_split) <is_catch_handlers_cmd>:
7794         Add parameter.  Add "catch handler" handling.
7795         (ada_exception_sym_name, ada_exception_breakpoint_ops):
7796         Add "catch handler" handling.
7797         (ada_exception_catchpoint_cond_string): Add "catch handler"
7798         handling.
7799         (create_ada_exception_catchpoint): Update create_excep_cond_exprs
7800         call.
7801         (catch_ada_handlers_command): New function.
7802         (initialize_ada_catchpoint_ops): Initialize "catch handlers"
7803         operations structure.
7804         (_initialize_ada_language): Add "catch handlers" command entry.
7805         * NEWS: Document "catch handlers" feature.
7806
7807 2018-01-02  Joel Brobecker  <brobecker@adacore.com>
7808
7809         * ada-lang.c (ada_value_slice_from_ptr): Take array stride into
7810         account when creating the array type of the slice.
7811         (ada_value_slice): Likewise.
7812
7813 2018-01-02  Joel Brobecker  <brobecker@adacore.com>
7814
7815         * gdbtypes.h (enum dynamic_prop_node_kind) <DYN_PROP_BYTE_STRIDE>:
7816         New enum value.
7817         (create_array_type_with_stride): Add byte_stride_prop parameter.
7818         * gdbtypes.c (create_array_type_with_stride) <byte_stride_prop>:
7819         New parameter.  Update all callers in this file.
7820         (array_type_has_dynamic_stride): New function.
7821         (is_dynamic_type_internal, resolve_dynamic_array): Add handling
7822         of arrays with dynamic byte strides.
7823         * dwarf2read.c (read_array_type): Add support for dynamic
7824         DW_AT_byte_stride attributes.
7825
7826 2018-01-02  Joel Brobecker  <brobecker@adacore.com>
7827
7828         * dwarf2read.c (read_unspecified_type): Treat
7829         DW_TAG_enumeration_type DIEs from Ada units as stubs.
7830
7831 2018-01-01  Joel Brobecker  <brobecker@adacore.com>
7832
7833         Update copyright year range in all GDB files.
7834
7835 2018-01-01  Joel Brobecker  <brobecker@adacore.com>
7836
7837         * copyright.py (BY_HAND): Remove gdb/testsuite/gdb.base/step-line.inp
7838         and gdb/testsuite/gdb.base/step-line.c.
7839
7840 2018-01-01  Joel Brobecker  <brobecker@adacore.com>
7841
7842         * copyright.py (main): Dump the contents of
7843         MULTIPLE_COPYRIGHT_HEADERS (separately) from BY_HAND,
7844         even if BY_HAND is empty.
7845
7846 2018-01-01  Joel Brobecker  <brobecker@adacore.com>
7847
7848         * top.c (print_gdb_version): Update Copyright year in version
7849         message.
7850
7851 2018-01-01  Joel Brobecker  <brobecker@adacore.com>
7852
7853         * config/djgpp/fnchange.lst: Add entry for gdb/ChangeLog-2017.
7854
7855 For older changes see ChangeLog-2017.
7856 \f
7857 Local Variables:
7858 mode: change-log
7859 left-margin: 8
7860 fill-column: 74
7861 version-control: never
7862 coding: utf-8
7863 End: