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