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