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