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