Defer breakpoint reset when cloning progspace for fork child
[external/binutils.git] / gdb / ChangeLog
1 2018-04-07  Simon Marchi  <simon.marchi@polymtl.ca>
2
3         * progspace.c (clone_program_space): Pass SYMFILE_DEFER_BP_RESET
4         to symbol_file_add_main.
5
6 2018-04-07  Simon Marchi  <simon.marchi@polymtl.ca>
7
8         PR mi/22299
9         * mi/mi-console.c (do_fputc_async_safe): New.
10         (mi_console_file::write_async_safe): New.
11         (mi_console_file::flush): Adjust calls to fputstrn_unfiltered.
12         * mi/mi-console.h (class mi_console_file) <write_async_safe>:
13         New.
14         * ui-file.c (ui_file::putstrn): Adjust call to
15         fputstrn_unfiltered.
16         * utils.c (printchar): Replace do_fputs and do_fprintf
17         parameters by do_fputc.
18         (fputstr_filtered): Adjust call to printchar.
19         (fputstr_unfiltered): Likewise.
20         (fputstrn_filtered): Likewise.
21         (fputstrn_unfiltered): Add do_fputc parameter, pass to
22         printchar.
23         * utils.h (do_fputc_ftype): New typedef.
24         (fputstrn_unfiltered): Add do_fputc parameter.
25
26 2018-04-07  Simon Marchi  <simon.marchi@polymtl.ca>
27
28         * regformats/i386/i386-avx.dat: Remove.
29
30 2018-04-07  Simon Marchi  <simon.marchi@ericsson.com>
31
32         PR gdb/22979
33         * amd64-tdep.c (amd64_none_init_abi): New function.
34         (amd64_x32_none_init_abi): New function.
35         (_initialize_amd64_tdep): Register handlers for x86-64 and
36         x64_32 with GDB_OSABI_NONE.
37         * osabi.c (gdbarch_init_osabi): Allow running handlers for the
38         GDB_OSABI_NONE osabi.
39
40 2018-04-07  Simon Marchi  <simon.marchi@ericsson.com>
41
42         PR gdb/22980
43         * defs.h (enum gdb_osabi): Remove GDB_OSABI_UNINITIALIZED, add
44         GDB_OSABI_NONE.
45         * arch-utils.c (gdbarch_info_init): Don't set info->osabi.
46         * osabi.c (gdb_osabi_names): Add "unknown" entry.
47
48 2018-04-07  Simon Marchi  <simon.marchi@ericsson.com>
49
50         * common/byte-vector.h (char_vector): New type.
51         * target.h (target_read_alloc): Return
52         gdb::optional<byte_vector>.
53         (target_read_stralloc): Return gdb::optional<char_vector>.
54         (target_get_osdata): Return gdb::optional<char_vector>.
55         * target.c (target_read_alloc_1): Templatize.  Replacement
56         manual memory management with vector.
57         (target_read_alloc): Change return type, adjust.
58         (target_read_stralloc): Change return type, adjust.
59         (target_get_osdata): Change return type, adjust.
60         * auxv.c (struct auxv_info) <length>: Remove.
61         <data>: Change type to gdb::optional<byte_vector>.
62         (auxv_inferior_data_cleanup): Free auxv_info with delete.
63         (get_auxv_inferior_data): Allocate auxv_info with new, adjust.
64         (target_auxv_search): Adjust.
65         (fprint_target_auxv): Adjust.
66         * avr-tdep.c (avr_io_reg_read_command): Adjust.
67         * linux-tdep.c (linux_spu_make_corefile_notes): Adjust.
68         (linux_make_corefile_notes): Adjust.
69         * osdata.c (get_osdata): Adjust.
70         * remote.c (remote_get_threads_with_qxfer): Adjust.
71         (remote_memory_map): Adjust.
72         (remote_traceframe_info): Adjust.
73         (btrace_read_config): Adjust.
74         (remote_read_btrace): Adjust.
75         (remote_pid_to_exec_file): Adjust.
76         * solib-aix.c (solib_aix_get_library_list): Adjust.
77         * solib-dsbt.c (decode_loadmap): Don't free buf.
78         (dsbt_get_initial_loadmaps): Adjust.
79         * solib-svr4.c (svr4_current_sos_via_xfer_libraries): Adjust.
80         * solib-target.c (solib_target_current_sos): Adjust.
81         * tracepoint.c (sdata_make_value): Adjust.
82         * xml-support.c (xinclude_start_include): Adjust.
83         (xml_fetch_content_from_file): Adjust.
84         * xml-support.h (xml_fetch_another): Change return type.
85         (xml_fetch_content_from_file): Change return type.
86         * xml-syscall.c (xml_init_syscalls_info): Adjust.
87         * xml-tdesc.c (file_read_description_xml): Adjust.
88         (fetch_available_features_from_target): Change return type.
89         (target_fetch_description_xml): Adjust.
90         (target_read_description_xml): Adjust.
91
92 2018-04-06  Tom Tromey  <tom@tromey.com>
93
94         * value.c (~value): Update.
95         (struct value) <contents>: Now unique_xmalloc_ptr.
96         (value_contents_bits_eq, allocate_value_contents)
97         (value_contents_raw, value_contents_all_raw)
98         (value_contents_for_printing, value_contents_for_printing_const)
99         (set_value_enclosing_type): Update.
100
101 2018-04-06  Tom Tromey  <tom@tromey.com>
102
103         * value.c (range_s): Remove typedef, VEC.
104         (struct range): Add operator<.
105         (range_lessthan): Remove.
106         (ranges_contain): Change type.
107         (~value): Update.
108         (struct value) <unavailable, optimized_out>: Now std::vector.
109         (value_entirely_available)
110         (value_entirely_covered_by_range_vector)
111         (value_entirely_unavailable, value_entirely_optimized_out):
112         Update.
113         (insert_into_bit_range_vector): Change argument type.
114         (find_first_range_overlap): Likewise.
115         (struct ranges_and_idx, value_contents_bits_eq)
116         (require_not_optimized_out, require_available): Update.
117         (ranges_copy_adjusted): Change argument types.
118         (value_optimized_out, value_copy, value_fetch_lazy): Update.
119
120 2018-04-06  Tom Tromey  <tom@tromey.com>
121
122         * value.c (~value): Update.
123         (struct value) <parent>: Now a value_ref_ptr.
124         (value_parent, set_value_parent, value_address, value_copy):
125         Update.
126
127 2018-04-06  Tom Tromey  <tom@tromey.com>
128
129         * value.c (struct value): Add constructor, destructor, and member
130         initializers.
131         (allocate_value_lazy, value_decref): Update.
132
133 2018-04-06  Tom Tromey  <tom@tromey.com>
134
135         * value.c (struct value) <released, next>: Remove.
136         (all_values): Now a std::vector.
137         (allocate_value_lazy): Update.
138         (value_next): Remove.
139         (value_mark, value_free_to_mark, release_value)
140         (value_release_to_mark): Update.
141
142 2018-04-06  Tom Tromey  <tom@tromey.com>
143
144         * value.h (fetch_subexp_value, value_release_to_mark): Update.
145         (free_value_chain): Remove.
146         * value.c (free_value_chain): Remove.
147         (value_release_to_mark): Return a std::vector.
148         * ppc-linux-nat.c (num_memory_accesses): Change "chain" to a
149         std::vector.
150         (check_condition): Update.
151         * eval.c (fetch_subexp_value): Change "val_chain" to a
152         std::vector.
153         * breakpoint.c (update_watchpoint): Update.
154         (can_use_hardware_watchpoint): Change "vals" to a std::vector.
155
156 2018-04-06  Tom Tromey  <tom@tromey.com>
157
158         * value.h (free_all_values): Remove.
159         * value.c (free_all_values): Remove.
160
161 2018-04-06  Tom Tromey  <tom@tromey.com>
162
163         * value.c (VALUE_HISTORY_CHUNK, struct value_history_chunk)
164         (value_history_chain, value_history_count): Remove.
165         (value_history): New global.
166         (record_latest_value, access_value_history, show_values)
167         (preserve_values): Update.
168
169 2018-04-06  Tom Tromey  <tom@tromey.com>
170
171         * varobj.h (struct varobj) <value>: Now a value_ref_ptr.
172         * varobj.c (varobj_set_display_format, varobj_set_value)
173         (install_default_visualizer, construct_visualizer)
174         (install_new_value, ~varobj, varobj_get_value_type)
175         (my_value_of_variable, varobj_editable_p): Update.
176         * c-varobj.c (c_describe_child, c_value_of_variable)
177         (cplus_number_of_children, cplus_describe_child): Update.
178         * ada-varobj.c (ada_number_of_children, ada_name_of_child)
179         (ada_path_expr_of_child, ada_value_of_child, ada_type_of_child)
180         (ada_value_of_variable, ada_value_is_changeable_p): Update.
181
182 2018-04-06  Tom Tromey  <tom@tromey.com>
183
184         * printcmd.c (last_examine_address): Change type to
185         value_ref_ptr.
186         (do_examine, x_command): Update.
187
188 2018-04-06  Tom Tromey  <tom@tromey.com>
189
190         * value.c (release_value): Update.
191         * breakpoint.h (struct watchpoint) <val>: Now a value_ref_ptr.
192         (struct bpstats) <val>: Now a value_ref_ptr.
193         * breakpoint.c (update_watchpoint, breakpoint_init_inferior)
194         (~bpstats, bpstats, bpstat_clear_actions, watchpoint_check)
195         (~watchpoint, print_it_watchpoint, watch_command_1)
196         (invalidate_bp_value_on_memory_change): Update.
197
198 2018-04-06  Tom Tromey  <tom@tromey.com>
199
200         * varobj.c (varobj_clear_saved_item)
201         (update_dynamic_varobj_children, install_new_value, ~varobj):
202         Update.
203         * value.h (value_incref): Move declaration earlier.
204         (value_decref): Rename from value_free.
205         (struct value_ref_policy): New.
206         (value_ref_ptr): New typedef.
207         (struct value_deleter): Remove.
208         (gdb_value_up): Remove typedef.
209         (release_value): Change return type.
210         (release_value_or_incref): Remove.
211         * value.c (set_value_parent): Update.
212         (value_incref): Change return type.
213         (value_decref): Rename from value_free.
214         (value_free_to_mark, free_all_values, free_value_chain): Update.
215         (release_value): Return value_ref_ptr.
216         (release_value_or_incref): Remove.
217         (record_latest_value, set_internalvar, clear_internalvar):
218         Update.
219         * stack.c (info_frame_command): Don't call value_free.
220         * python/py-value.c (valpy_dealloc, valpy_new)
221         (value_to_value_object): Update.
222         * printcmd.c (do_examine): Update.
223         * opencl-lang.c (lval_func_free_closure): Update.
224         * mi/mi-main.c (register_changed_p): Don't call value_free.
225         * mep-tdep.c (mep_frame_prev_register): Don't call value_free.
226         * m88k-tdep.c (m88k_frame_prev_register): Don't call value_free.
227         * m68hc11-tdep.c (m68hc11_frame_prev_register): Don't call
228         value_free.
229         * guile/scm-value.c (vlscm_free_value_smob)
230         (vlscm_scm_from_value): Update.
231         * frame.c (frame_register_unwind, frame_unwind_register_signed)
232         (frame_unwind_register_unsigned, get_frame_register_bytes)
233         (put_frame_register_bytes): Don't call value_free.
234         * findvar.c (address_from_register): Don't call value_free.
235         * dwarf2read.c (dwarf2_compute_name): Don't call value_free.
236         * dwarf2loc.c (entry_data_value_free_closure)
237         (value_of_dwarf_reg_entry, free_pieced_value_closure)
238         (dwarf2_evaluate_loc_desc_full): Update.
239         * breakpoint.c (update_watchpoint, breakpoint_init_inferior)
240         (~bpstats, bpstats, bpstat_clear_actions, watchpoint_check)
241         (~watchpoint, watch_command_1)
242         (invalidate_bp_value_on_memory_change): Update.
243         * alpha-tdep.c (alpha_register_to_value): Don't call value_free.
244
245 2018-04-06  Simon Marchi  <simon.marchi@polymtl.ca>
246
247         PR gdb/23022
248         * warning.m4: Add -Wno-error=deprecated-register.
249         * configure: Re-generate.
250
251 2018-04-05  Tom Tromey  <tom@tromey.com>
252
253         * linespec.h: Remove include of "vec.h".
254
255 2018-04-05  Tom Tromey  <tom@tromey.com>
256
257         * linespec.c (typep): Remove typedef.
258         (find_methods, find_superclass_methods): Take a std::vector.
259         (find_method): Use std::vector.
260
261 2018-04-05  Tom Tromey  <tom@tromey.com>
262
263         * utils.c (compare_strings): Remove.
264         * utils.h (compare_strings): Remove.
265         * objc-lang.h (find_imps): Update.
266         * objc-lang.c (find_methods): Take a std::vector.
267         (uniquify_strings, find_imps): Likewise.
268         * linespec.c (find_methods): Take a std::vector.
269         (decode_objc): Use std::vector.
270         (add_all_symbol_names_from_pspace, find_superclass_methods): Take
271         a std::vector.
272         (find_method, find_function_symbols): Use std::vector.
273
274 2018-04-05  Tom Tromey  <tom@tromey.com>
275
276         * completer.c (completion_tracker::completion_tracker): Remove
277         cast.
278         (completion_tracker::discard_completions): Likewise.
279         * breakpoint.c (ambiguous_names_p): Remove cast.
280         * ada-lang.c (_initialize_ada_language): Remove cast.
281         * utils.h (streq): Update.
282         (streq_hash): Add new declaration.
283         * utils.c (streq): Return bool.
284         (streq_hash): New function.
285
286 2018-04-05  Tom Tromey  <tom@tromey.com>
287
288         * linespec.c (event_location_to_sals) <case ADDRESS_LOCATION>:
289         Remove a string copy.
290
291 2018-04-05  Tom Tromey  <tom@tromey.com>
292
293         * linespec.c (filter_results): Use std::vector.
294         (decode_line_2, decode_line_full): Update.
295
296 2018-04-05  Tom Tromey  <tom@tromey.com>
297
298         * linespec.c (canonical_to_fullform): Return std::string.
299         (filter_results): Update.
300         (struct decode_line_2_item): Add constructor.
301         <fullform, displayform>: Now std::string.
302         (decode_line_2_compare_items): Now a std::sort comparator.
303         (decode_line_2): Update.
304
305 2018-04-05  Tom Tromey  <tom@tromey.com>
306
307         * linespec.c (copy_token_string): Return a unique_xmalloc_ptr.
308         (unexpected_linespec_error): Update.
309         (linespec_parse_basic, parse_linespec): Update.
310
311 2018-04-05  Tom Tromey  <tom@tromey.com>
312
313         * linespec.c (linespec_parse_basic): Reindent.
314
315 2018-04-05  Tom Tromey  <tom@tromey.com>
316
317         * minsyms.h (iterate_over_minimal_symbols): Update.
318         * minsyms.c (iterate_over_minimal_symbols): Take a
319         gdb::function_view.
320         * linespec.c (struct collect_minsyms): Remove.
321         (compare_msyms): Now a std::sort comparator.
322         (add_minsym): Add parameters.
323         (search_minsyms_for_name): Update.  Use std::vector.
324
325 2018-04-03  Tom Tromey  <tom@tromey.com>
326
327         * mipsread.c (read_alphacoff_dynamic_symtab): Use
328         gdb::byte_vector.
329
330 2018-04-02  Weimin Pan  <weimin.pan@oracle.com>
331
332         * MAINTAINERS (Write After Approval): Add Weimin Pan.
333
334 2018-04-02  Weimin Pan  <weimin.pan@oracle.com>
335
336         PR gdb/16959
337         * cp-valprint.c: (cp_print_static_field) Fix infinite recursion when 
338         printing static type.
339
340 2018-04-01  Tom Tromey  <tom@tromey.com>
341
342         * rs6000-nat.c (rs6000_ptrace_ldinfo): Return a byte_vector.
343         (rs6000_xfer_shared_libraries): Update.
344
345 2018-04-01  Simon Marchi  <simon.marchi@polymtl.ca>
346
347         * common/gdb_vecs.h (char_ptr): Remove.
348         * tracepoint.c (encode_actions_1): Remove usage of char_ptr.
349
350 2018-03-30  Simon Marchi  <simon.marchi@polymtl.ca>
351
352         * guile/scm-utils.c (gdbscm_parse_function_args): Replace VEC
353         with std::vector.
354         * common/gdb_vecs.h (DEF_VEC_P (char_ptr)): Remove.
355
356 2018-03-30  Simon Marchi  <simon.marchi@polymtl.ca>
357
358         * tracepoint.h (struct uploaded_tp): Initialize fields.
359         <actions, step_actions, cmd_strings>: Change type to
360         std::vector<char *>.
361         * tracepoint.c (get_uploaded_tp): Allocate with new.
362         (free_uploaded_tps): Free with delete.
363         (parse_tracepoint_definition): Adjust to std::vector change.
364         * breakpoint.c (read_uploaded_action): Likewise.
365         (create_tracepoint_from_upload): Likewise.
366         * ctf.c (ctf_write_uploaded_tp): Likewise.
367         (SET_ARRAY_FIELD): Likewise.
368         * tracefile-tfile.c (tfile_write_uploaded_tp): Likewise.
369
370 2018-03-30  Tom Tromey  <tom@tromey.com>
371
372         * solib-svr4.c (lm_info_read): Use gdb::byte_vector.  Return
373         std::unique_ptr.
374         (svr4_keep_data_in_core): Update.
375         (svr4_read_so_list): Update.
376
377 2018-03-30  Tom Tromey  <tom@tromey.com>
378
379         * windows-nat.c (handle_output_debug_string, handle_exception):
380         Update.
381         * target.h (target_read_string): Update.
382         * target.c (target_read_string): Change "string" to
383         unique_xmalloc_ptr.
384         * solib-svr4.c (open_symbol_file_object, svr4_read_so_list):
385         Update.
386         * solib-frv.c (frv_current_sos): Update.
387         * solib-dsbt.c (dsbt_current_sos): Update.
388         * solib-darwin.c (darwin_current_sos): Update.
389         * linux-thread-db.c (inferior_has_bug): Update.
390         * expprint.c (print_subexp_standard) <case OP_OBJC_MSGCALL>:
391         Update.  Remove alloca.
392         * ada-lang.c (ada_main_name): Update.
393
394 2018-03-30  Tom Tromey  <tom@tromey.com>
395
396         * dwarf2read.c (struct free_dwo_file_cleanup_data): Remove.
397         (struct dwo_file_deleter): New.
398         (dwo_file_up): New typedef.
399         (open_and_init_dwo_file): Use dwo_file_up.
400         (free_dwo_file_cleanup): Remove.
401
402 2018-03-30  Tom Tromey  <tom@tromey.com>
403
404         * dwarf2read.c (free_dwo_file): Remove "objfile" parameter.
405         (free_dwo_file_cleanup, free_dwo_file_from_slot): Update.
406
407 2018-03-30  Tom Tromey  <tom@tromey.com>
408
409         * dwarf2read.c (class free_cached_comp_units): New class.
410         (dw2_instantiate_symtab, dwarf2_build_psymtabs_hard): Use it.
411         (free_cached_comp_units): Remove function.
412
413 2018-03-30  Tom Tromey  <tom@tromey.com>
414
415         * utils.h (make_cleanup_unpush_target): Remove.
416         * inf-ptrace.c (struct target_unpusher): New.
417         (target_unpush_up) New typedef.
418         (inf_ptrace_create_inferior, inf_ptrace_attach): Use
419         target_unpush_up.
420         * utils.c (do_unpush_target, make_cleanup_unpush_target): Remove.
421
422 2018-03-27  Tom Tromey  <tom@tromey.com>
423
424         * utils.c (prompt_for_continue): Use unique_xmalloc_ptr.
425
426 2018-03-27  Pedro Alves  <palves@redhat.com>
427             Tom Tromey  <tom@tromey.com>
428
429         * top.c (class gdb_readline_wrapper_cleanup): Add constructor,
430         destructor.  Now a class.
431         (gdb_readline_wrapper_cleanup): Remove function.
432         (gdb_readline_wrapper): Remove cleanups.
433
434 2018-03-27  Tom Tromey  <tom@tromey.com>
435
436         * typeprint.h (struct type_print_options) <local_typedefs,
437         global_typedefs>: Remove "struct" keyword.
438         (class typedef_hash_table): New class.
439         (recursively_update_typedef_hash, add_template_parameters)
440         (create_typedef_hash, free_typedef_hash, copy_typedef_hash)
441         (find_typedef_in_hash): Don't declare.
442         * typeprint.c (struct typedef_hash_table): Move to typeprint.h.
443         (typedef_hash_table::recursively_update): Rename from
444         recursively_update_typedef_hash.  Now a member.
445         (typedef_hash_table::add_template_parameters): Rename from
446         add_template_parameters.  Now a member.
447         (typedef_hash_table::typedef_hash_table): Now a constructor;
448         rename from create_typedef_hash.
449         (typedef_hash_table::~typedef_hash_table): Now a destructor;
450         rename from free_typedef_hash.
451         (do_free_typedef_hash, make_cleanup_free_typedef_hash)
452         (do_free_global_table): Remove.
453         (typedef_hash_table::typedef_hash_table): New constructor; renamed
454         from copy_type_recursive.
455         (create_global_typedef_table): Remove.
456         (typedef_hash_table::find_global_typedef): Now a member of
457         typedef_hash_table.
458         (typedef_hash_table::find_typedef): Rename from
459         find_typedef_in_hash; now a member.
460         (whatis_exp): Update.
461         * extension.h (struct ext_lang_type_printers): Add constructor and
462         destructor.
463         (start_ext_lang_type_printers, free_ext_lang_type_printers): Don't
464         declare.
465         * extension.c (ext_lang_type_printers::ext_lang_type_printers):
466         Now a constructor; rename from start_ext_lang_type_printers.
467         (ext_lang_type_printers): Now a destructor; rename from
468         free_ext_lang_type_printers.
469         * c-typeprint.c (find_typedef_for_canonicalize, c_print_type_1):
470         Update.
471         (c_type_print_base_struct_union): Update.  Remove cleanups.
472
473 2018-03-27  Tom Tromey  <tom@tromey.com>
474
475         * dwarf-index-write.c: Include <cmath>.
476
477 2018-03-27  Joel Brobecker  <brobecker@adacore.com>
478
479         * NEWS: Add entry describing new "set|show varsize-limit" command.
480         * ada-lang.c (_initialize_ada_language): Add "set/show varsize-limit"
481         command.
482         * printcmd.c (_initialize_printcmd): Add "set var" alias of
483         "set variable".
484
485 2018-03-27  Simon Marchi  <simon.marchi@ericsson.com>
486
487         * Makefile.in (COMMON_SFILES): Add dwarf-index-common.c and
488         dwarf-index-write.c
489         (HFILES_NO_SRCDIR): Add dwarf-index-common.h and dwarf2read.h.
490         * dwarf-index-common.c: New file.
491         * dwarf-index-common.h: New file.
492         * dwarf-index-write.c: New file.
493         * dwarf2read.c: Include dwarf2read.h and dwarf-index-common.h.
494         (struct dwarf2_section_info): Move from here.
495         (dwarf2_section_info_def): Likewise.
496         (DEF_VEC_O (dwarf2_section_info_def)): Likewise.
497         (offset_type): Likewise.
498         (DW2_GDB_INDEX_SYMBOL_STATIC_SET_VALUE): Likewise.
499         (DW2_GDB_INDEX_SYMBOL_KIND_SET_VALUE): Likewise.
500         (DW2_GDB_INDEX_CU_SET_VALUE): Likewise.
501         (byte_swap): Likewise.
502         (MAYBE_SWAP): Likewise.
503         (dwarf2_per_cu_ptr): Likewise.
504         (DEF_VEC_P (dwarf2_per_cu_ptr)): Likewise.
505         (struct tu_stats): Likewise.
506         (struct dwarf2_per_objfile): Likewise.
507         (struct dwarf2_per_cu_data): Likewise.
508         (struct signatured_type): Likewise.
509         (sig_type_ptr): Likewise.
510         (DEF_VEC_P (sig_type_ptr)): Likewise.
511         (INDEX4_SUFFIX): Likewise.
512         (INDEX5_SUFFIX): Likewise.
513         (DEBUG_STR_SUFFIX): Likewise.
514         (dwarf2_read_section): Make non-static.
515         (mapped_index_string_hash): Move from here.
516         (dwarf5_djb_hash): Likewise.
517         (file_write): Likewise.
518         (class data_buf): Likewise.
519         (struct symtab_index_entry): Likewise.
520         (struct mapped_symtab): Likewise.
521         (find_slot): Likewise.
522         (hash_expand): Likewise.
523         (add_index_entry): Likewise.
524         (uniquify_cu_indices): Likewise.
525         (class c_str_view): Likewise.
526         (class c_str_view_hasher): Likewise.
527         (class vector_hasher): Likewise.
528         (write_hash_table): Likewise.
529         (psym_index_map): Likewise.
530         (struct addrmap_index_data): Likewise.
531         (add_address_entry): Likewise.
532         (add_address_entry_worker): Likewise.
533         (write_address_map): Likewise.
534         (symbol_kind): Likewise.
535         (write_psymbols): Likewise.
536         (struct signatured_type_index_data): Likewise.
537         (write_one_signatured_type): Likewise.
538         (recursively_count_psymbols): Likewise.
539         (recursively_write_psymbols): Likewise.
540         (class debug_names): Likewise.
541         (check_dwarf64_offsets): Likewise.
542         (psyms_seen_size): Likewise.
543         (write_gdbindex): Likewise.
544         (write_debug_names): Likewise.
545         (assert_file_size): Likewise.
546         (write_psymtabs_to_index): Likewise.
547         (save_gdb_index_command): Likewise.
548         (_initialize_dwarf2_read): Don't register the "save gdb-index"
549         command.
550         * dwarf2read.h: New file.
551
552 2018-03-27  Joel Brobecker  <brobecker@adacore.com>
553
554         PR gdb/22670
555         * dwarf2read.c (dwarf2_physname): Do not return the demangled
556         symbol name if the CU's language stores symbol names in linkage
557         format.
558         * language.h (struct language_defn)
559         <la_store_sym_names_in_linkage_form_p>: New field.  Adjust
560         all instances of this struct.
561
562 2018-03-26  Tom Tromey  <tom@tromey.com>
563
564         * stack.c (backtrace_command_1): Remove verbose code.
565
566 2018-03-26  Tom Tromey  <tom@tromey.com>
567
568         * python/py-framefilter.c (py_print_type): Don't catch
569         exceptions.  Return void.
570         (py_print_value): Likewise.
571         (py_print_single_arg): Likewise.
572         (enumerate_args): Don't catch exceptions.
573         (py_print_args): Likewise.
574         (py_print_frame): Likewise.
575         (gdbpy_apply_frame_filter): Catch exceptions here.
576
577 2018-03-26  Tom Tromey  <tom@tromey.com>
578
579         * stack.c (_initialize_stack): Remove trailing newlines from help
580         text.  Add "Usage" line to "backtrace" help.
581
582 2018-03-26  Tom Tromey  <tom@tromey.com>
583
584         PR python/16486:
585         * python/py-framefilter.c (py_print_args): Call wrap_hint.
586
587 2018-03-26  Tom Tromey  <tom@tromey.com>
588
589         * python/py-framefilter.c (py_print_single_arg): Return
590         EXT_LANG_BT_ERROR from catch.
591
592 2018-03-26  Tom Tromey  <tom@tromey.com>
593
594         PR backtrace/15584:
595         * stack.c (backtrace_command_1): Move some code into no-filters
596         "if".
597
598 2018-03-26  Tom Tromey  <tom@tromey.com>
599
600         * python/py-framefilter.c (throw_quit_or_print_exception): New
601         function.
602         (gdbpy_apply_frame_filter): Use it.
603
604 2018-03-26  Tom Tromey  <tom@tromey.com>
605
606         PR cli/17716:
607         * python/py-framefilter.c (py_print_type, py_print_value)
608         (enumerate_args, py_print_args, gdbpy_apply_frame_filter): Use
609         RETURN_MASK_ERROR.
610
611 2018-03-26  Tom Tromey  <tom@tromey.com>
612
613         * python/py-framefilter.c (enumerate_args): Use
614         gdb::unique_xmalloc_ptr.
615
616 2018-03-26  Tom Tromey  <tom@tromey.com>
617
618         * python/py-framefilter.c (py_print_frame): Return
619         EXT_LANG_BT_OK.
620         (gdbpy_apply_frame_filter): Update comment.
621         * extension.h (enum ext_lang_bt_status) <EXT_LANG_BT_COMPLETED>:
622         Remove.
623         <EXT_LANG_BT_NO_FILTERS>: Change value.
624
625 2018-03-26  Tom Tromey  <tom@tromey.com>
626
627         PR backtrace/15582:
628         * stack.c (backtrace_command): Parse "hide" argument.
629         * python/py-framefilter.c (py_print_frame): Handle PRINT_HIDE.
630         * extension.h (enum frame_filter_flags) <PRINT_HIDE>: New
631         constant.
632
633 2018-03-26  Tom Tromey  <tom@tromey.com>
634
635         * stack.c (backtrace_command_1): Remove "show_locals" parameter,
636         add "flags".
637         (backtrace_command): Remove "fulltrace", add "flags".
638
639 2018-03-26  Tom Tromey  <tom@tromey.com>
640
641         * stack.c (backtrace_command): Rewrite command line parsing.
642
643 2018-03-26  Simon Marchi  <simon.marchi@ericsson.com>
644
645         * dwarf2read.c (DEF_VEC_I(offset_type)): Remove.
646
647 2018-03-26  Simon Marchi  <simon.marchi@ericsson.com>
648
649         * filename-seen-cache.h: Add include guard.
650
651 2018-03-26  Keith Seitz  <keiths@redhat.com>
652
653         * symfile.c (place_section): Remove "struct" from section_addr_info
654         in comment.
655         * windows-nat.c (struct safe_symbol_file_add_args) <addrs>: Remove
656         "struct" keyword from section_addr_info.
657
658 2018-03-26  Alan Hayward  <alan.hayward@arm.com>
659
660         * regformats/regdef.h (reg): Add constructors.
661
662 2018-03-25  Pedro Alves  <palves@redhat.com>
663
664         * eval.c (evaluate_funcall): Swap OP_VAR_MSYM_VALUE/OP_VAR_VALUE
665         if then/else bodies in var_func_name extraction.
666
667 2018-03-23  Weimin Pan  <weimin.pan@oracle.com>
668
669         * minsyms.c (lookup_minimal_symbol_and_objfile): Use
670         lookup_minimal_symbol() to find symbol entry.
671         * minsyms.h (lookup_minimal_symbol_and_objfile): Update comment.
672
673 2018-03-23  Keith Seitz  <keiths@redhat.com>
674
675         PR c++/22968
676         * dwarf2read.c (scan_partial_symbols): Scan structs/classes for
677         nested type definitions for C++, too.
678
679 2018-03-23  Tom Tromey  <tom@tromey.com>
680
681         * machoread.c (struct oso_el): Add a constructor.  Don't define as
682         a typedef.
683         (macho_register_oso): Remove.
684         (macho_symtab_read): Take a std::vector.
685         (oso_el_compare_name): Now a std::sort comparator.
686         (macho_symfile_read_all_oso): Take a std::vector.
687         (macho_symfile_read): Use std::vector.  Remove cleanups.
688
689 2018-03-22  Tom Tromey  <tom@tromey.com>
690
691         * record-full.c (record_full_exec_insn): Use gdb::byte_vector.
692         (record_full_goto_bookmark): Use std::string.
693
694 2018-03-22  Pedro Franco de Carvalho  <pedromfc@linux.vnet.ibm.com>
695
696         PR tdep/18295
697         * rs6000-tdep.c (skip_prologue): Match both stwux and stdux
698         a single mask.
699
700 2018-03-22  Pedro Franco de Carvalho  <pedromfc@linux.vnet.ibm.com>
701
702         * rs6000-tdep.c (store_insn_p): New function.
703         (skip_prologue): New variable alloca_reg_offset. Set lr_reg
704         and cr_reg to their unshifted values. Use store_insn_p to
705         match LR saves using either R1 or fdata->alloca_reg. Use
706         store_insn_p to match CR saves. Set alloca_reg_offset
707         when alloca_reg and framep are set. Remove lr_reg shift
708         when assigning to fdata->lr_register.
709
710 2018-03-22  Andreas Arnez  <arnez@linux.vnet.ibm.com>
711
712         * linux-tdep.c (linux_info_proc): For "info proc cmdline", print
713         command line args instead of emitting a warning.
714
715 2018-03-22  Simon Marchi  <simon.marchi@polymtl.ca>
716
717         * tracepoint.h (struct static_tracepoint_marker): Initialize
718         fields, define default constructor, move constructor and move
719         assignment, disable the rest.
720         <str_id, extra>: Make std::string.
721         (release_static_tracepoint_marker): Remove.
722         (free_current_marker): Remove.
723         * tracepoint.c (free_current_marker): Remove.
724         (parse_static_tracepoint_marker_definition): Adjust to
725         std::string, use new hex2str overload.
726         (release_static_tracepoint_marker): Remove.
727         (print_one_static_tracepoint_marker): Get marker by reference
728         and adjust to std::string.
729         (info_static_tracepoint_markers_command): Adjust to std::vector
730         changes
731         * target.h (static_tracepoint_marker_p): Remove typedef.
732         (DEF_VEC_P(static_tracepoint_marker_p)): Remove.
733         (struct target_ops) <to_static_tracepoint_marker_at>: Return
734         bool.
735         <to_static_tracepoint_markers_by_strid>: Return std::vector.
736         * target-debug.h
737         (target_debug_print_VEC_static_tracepoint_marker_p_p): Remove.
738         (target_debug_print_std_vector_static_tracepoint_marker): New.
739         (target_debug_print_struct_static_tracepoint_marker_p): Rename
740         to...
741         (target_debug_print_static_tracepoint_marker_p): ... this.
742         * target-delegates.c: Re-generate.
743         * breakpoint.h (struct tracepoint) <static_trace_marker_id>:
744         Make std::string.
745         * breakpoint.c (init_breakpoint_sal): Adjust to std::string.
746         (decode_static_tracepoint_spec): Adjust to std::vector.
747         (tracepoint_print_one_detail): Adjust to std::string.
748         (strace_marker_decode_location): Adjust to std::string.
749         (update_static_tracepoint): Adjust to std::string, remove call
750         to release_static_tracepoint_marker.
751         * linux-nat.c (linux_child_static_tracepoint_markers_by_strid):
752         Adjust to std::vector.
753         * remote.c (remote_static_tracepoint_marker_at): Return bool.
754         (remote_static_tracepoint_markers_by_strid): Adjust to
755         std::vector.
756         * common/rsp-low.h (hex2str): New overload with explicit count
757         of bytes.
758         * common/rsp-low.c (hex2str): New overload with explicit count
759         of bytes.
760         * unittests/rsp-low-selftests.c (test_hex2str): New function.
761         (_initialize_rsp_low_selftests): Add test_hex2str test.
762         * unittests/tracepoint-selftests.c
763         (test_parse_static_tracepoint_marker_definition): Adjust to
764         std::string.
765
766 2018-03-22  Simon Marchi  <simon.marchi@polymtl.ca>
767
768         * tracepoint.c (parse_static_tracepoint_marker_definition):
769         Consider case where the definition is followed by more
770         definitions.
771         * Makefile.in (SUBDIR_UNITTESTS_SRCS): Add
772         tracepoint-selftests.c.
773         * unittests/tracepoint-selftests.c: New.
774
775 2018-03-21  Pedro Franco de Carvalho  <pedromfc@linux.vnet.ibm.com>
776
777         * MAINTAINERS (Write After Approval): Add Pedro Franco de
778         Carvalho.
779
780 2018-03-20  Stephen Roberts  <stephen.roberts@arm.com>
781
782         * symtab.c (find_pc_sect_line): fixed indentation.
783
784 2018-03-20  Stephen Roberts  <stephen.roberts@arm.com>
785
786         * symtab.c (find_pc_sect_line): now uses binary search.
787
788 2018-03-19  Tom Tromey  <tom@tromey.com>
789
790         * rust-exp.y (struct_expr_tail, struct_expr_list): Add plain
791         "IDENT" production.
792
793 2018-03-19  Pedro Alves  <palves@redhat.com>
794             Tom Tromey  <tom@tromey.com>
795
796         * unittests/observable-selftests.c: New file.
797         * common/observable.h: New file.
798         * observable.h: New file.
799         * ada-lang.c, ada-tasks.c, agent.c, aix-thread.c, annotate.c,
800         arm-tdep.c, auto-load.c, auxv.c, break-catch-syscall.c,
801         breakpoint.c, bsd-uthread.c, cli/cli-interp.c, cli/cli-setshow.c,
802         corefile.c, dummy-frame.c, event-loop.c, event-top.c, exec.c,
803         extension.c, frame.c, gdbarch.c, guile/scm-breakpoint.c,
804         infcall.c, infcmd.c, inferior.c, inflow.c, infrun.c, jit.c,
805         linux-tdep.c, linux-thread-db.c, m68klinux-tdep.c,
806         mi/mi-cmd-break.c, mi/mi-interp.c, mi/mi-main.c, objfiles.c,
807         ppc-linux-nat.c, ppc-linux-tdep.c, printcmd.c, procfs.c,
808         python/py-breakpoint.c, python/py-finishbreakpoint.c,
809         python/py-inferior.c, python/py-unwind.c, ravenscar-thread.c,
810         record-btrace.c, record-full.c, record.c, regcache.c, remote.c,
811         riscv-tdep.c, sol-thread.c, solib-aix.c, solib-spu.c, solib.c,
812         spu-multiarch.c, spu-tdep.c, stack.c, symfile-mem.c, symfile.c,
813         symtab.c, thread.c, top.c, tracepoint.c, tui/tui-hooks.c,
814         tui/tui-interp.c, valops.c: Update all users.
815         * tui/tui-hooks.c (tui_bp_created_observer)
816         (tui_bp_deleted_observer, tui_bp_modified_observer)
817         (tui_inferior_exit_observer, tui_before_prompt_observer)
818         (tui_normal_stop_observer, tui_register_changed_observer):
819         Remove.
820         (tui_observers_token): New global.
821         (attach_or_detach, tui_attach_detach_observers): New functions.
822         (tui_install_hooks, tui_remove_hooks): Use
823         tui_attach_detach_observers.
824         * record-btrace.c (record_btrace_thread_observer): Remove.
825         (record_btrace_thread_observer_token): New global.
826         * observer.sh: Remove.
827         * observer.c: Rename to observable.c.
828         * observable.c (namespace gdb_observers): Define new objects.
829         (observer_debug): Move into gdb_observers namespace.
830         (struct observer, struct observer_list, xalloc_observer_list_node)
831         (xfree_observer_list_node, generic_observer_attach)
832         (generic_observer_detach, generic_observer_notify): Remove.
833         (_initialize_observer): Update.
834         Don't include observer.inc.
835         * Makefile.in (generated_files): Remove observer.h, observer.inc.
836         (clean mostlyclean): Likewise.
837         (observer.h, observer.inc): Remove targets.
838         (SUBDIR_UNITTESTS_SRCS): Add observable-selftests.c.
839         (COMMON_SFILES): Use observable.c, not observer.c.
840         * .gitignore: Remove observer.h.
841
842 2018-03-18  Tom Tromey  <tom@tromey.com>
843
844         * solib.c (gdb_bfd_lookup_symbol_from_symtab): Use
845         gdb::def_vector.
846         (bfd_lookup_symbol_from_dyn_symtab): Likewise.
847
848 2018-03-17  Tom Tromey  <tom@tromey.com>
849
850         * auto-load.c (auto_load_objfile_script_1): Use std::string.
851
852 2018-03-17  Tom Tromey  <tom@tromey.com>
853
854         * target.c (class scoped_target_fd): New.
855         (target_fileio_close_cleanup): Remove.
856         (target_fileio_read_alloc_1): Use scoped_target_fd.
857
858 2018-03-16  Simon Marchi  <simon.marchi@polymtl.ca>
859
860         * silent-rules.mk: New.
861         * Makefile.in: Include silent-rules.mk
862         (srcdir, VPATH, top_srcdir): Move up.
863         (COMPILE): Add ECHO_CXX.
864         (test-cp-name-parser$(EXEEXT)): Add ECHO_CXXLD.
865         (init.c): Add ECHO_INIT_C.
866         (gdb$(EXEEXT)): Add SILENCE and ECHO_CXXLD.
867         (version.c): Add ECHO_GEN.
868         (printcmd.o): Add ECHO_CXX.
869         (target-float.o): Add ECHO_CXX.
870         (ada-exp.o): Add ECHO_CXX.
871         (stamp-xml): Add SILENCE and ECHO_GEN_XML_BUILTIN.
872         (insight$(EXEEXT)): Add ECHO_CXXLD.
873         * gnulib/configure.ac: Add AM_SILENT_RULES.
874         * gnulib/aclocal.m4: Re-generate.
875         * gnulib/configure: Re-generate.
876         * gnulib/import/Makefile.in: Re-generate.
877
878 2018-03-16  Tom Tromey  <tom@tromey.com>
879
880         * xcoffread.c (xcoff_symfile_offsets): Change type of "addrs".
881         * utils.h (make_cleanup_free_section_addr_info): Don't declare.
882         * utils.c (do_free_section_addr_info)
883         (make_cleanup_free_section_addr_info): Remove.
884         * symfile.h (struct other_sections): Add constructor.
885         (struct section_addr_info): Remove.
886         (section_addr_info): New typedef.
887         (struct sym_fns) <sym_offsets>: Change type of parameter.
888         (build_section_addr_info_from_objfile)
889         (relative_addr_info_to_section_offsets, addr_info_make_relative)
890         (default_symfile_offsets, symbol_file_add)
891         (symbol_file_add_from_bfd)
892         (build_section_addr_info_from_section_table): Update.
893         (alloc_section_addr_info, free_section_addr_info): Don't declare.
894         * symfile.c (alloc_section_addr_info): Remove.
895         (build_section_addr_info_from_section_table): Change return type.
896         Update.
897         (build_section_addr_info_from_bfd)
898         (build_section_addr_info_from_objfile): Likewise.
899         (free_section_addr_info): Remove.
900         (relative_addr_info_to_section_offsets): Change type of "addrs".
901         (addrs_section_compar): Now a std::sort comparator.
902         (addrs_section_sort): Change return type.
903         (addr_info_make_relative): Change type of "addrs".  Update.
904         (default_symfile_offsets, syms_from_objfile_1)
905         (syms_from_objfile, symbol_file_add_with_addrs): Likewise.
906         (symbol_file_add_separate): Update.
907         (symbol_file_add): Change type of "addrs".  Update.
908         (add_symbol_file_command): Update.  Remove cleanups.
909         * symfile-mem.c (symbol_file_add_from_memory): Update.  Remove
910         cleanups.
911         * symfile-debug.c (debug_sym_offsets): Change type of "info".
912         * solib.c (solib_read_symbols): Update.
913         * objfiles.c (objfile_relocate): Update.  Remove cleanups.
914         * machoread.c (macho_symfile_offsets): Update.
915         * jit.c (jit_bfd_try_read_symtab): Update.
916
917 2018-03-15  Simon Marchi  <simon.marchi@polymtl.ca>
918
919         * Makefile.in (SUBDIR_UNITTESTS_SRCS): Add
920         unittests/utils-selftests.c.
921         * unittests/utils-selftests.c: New file.
922
923 2018-03-14  Tom Tromey  <tom@tromey.com>
924
925         PR cli/14977:
926         * printcmd.c (printf_c_string, printf_wide_c_string): Special case
927         for NULL.
928
929 2018-03-14  Tom Tromey  <tom@tromey.com>
930
931         PR cli/19918:
932         * printcmd.c (printf_pointer): Allow "-" in format.
933
934 2018-03-14  Tom Tromey  <tom@tromey.com>
935
936         * printcmd.c (_initialize_printcmd): Add usage to printf.
937
938 2018-03-14  Yao Qi  <qiyao@sourceware.org>
939
940         * MAINTAINERS: Update my email address.
941
942 2018-03-13  Tom Tromey  <tom@tromey.com>
943
944         * machoread.c (macho_check_dsym): Change filenamep to a
945         std::string*.
946         (macho_symfile_read): Update.
947         * symfile.c (load_command): Use std::string.
948
949 2018-03-12  Andrew Burgess  <andrew.burgess@embecosm.com>
950
951         * riscv-tdep.c (riscv_sw_breakpoint_from_kind): Add localization
952         to error message string.
953         (riscv_register_name): Use xsnprintf instead of sprintf.
954         (riscv_insn::fetch_instruction): Use gdb_assert instead of
955         internal_error.
956         (riscv_print_arg_location): Use gdb_assert_not_reached instead of
957         error.
958         (riscv_push_dummy_call): Likewise.
959
960 2018-03-12  Tom Tromey  <tom@tromey.com>
961
962         * rs6000-aix-tdep.c (rs6000_aix_core_xfer_shared_libraries_aix):
963         Use gdb::byte_vector.
964         * arm-tdep.c (arm_exidx_new_objfile): Use gdb::byte_vector.
965
966 2018-03-12  Yao Qi  <yao.qi@linaro.org>
967
968         * ia64-libunwind-tdep.c (libunwind_get_reg_special): Change
969         parameter type to readable_regcache.
970         * ia64-libunwind-tdep.h (libunwind_get_reg_special): Update
971         the declaration.
972
973 2018-03-11  Tom Tromey  <tom@tromey.com>
974
975         * dwarf2read.c (struct nextfield): Add initializers.
976         (struct nextfnfield): Remove.
977         (struct fnfieldlist): Add initializers.  Remove "length" and
978         "head", use std::vector.
979         (struct decl_field_list): Remove.
980         (struct field_info): Add initializers.
981         <fields, baseclasses>: Now std::vector.
982         <nbaseclasses, nfnfields, typedef_field_list_count,
983         nested_types_list_count>: Remove.
984         (dwarf2_add_field, dwarf2_add_type_defn)
985         (dwarf2_attach_fields_to_type, dwarf2_add_member_fn)
986         (dwarf2_attach_fn_fields_to_type, handle_struct_member_die)
987         (process_structure_scope): Update.
988
989 2018-03-11  Tom Tromey  <tom@tromey.com>
990
991         * dwarf2read.c (sort_tu_by_abbrev_offset): Change to be suitable
992         for use by std::sort.
993         (build_type_psymtabs_1): Use std::vector.
994
995 2018-03-09  Eli Zaretskii  <eliz@gnu.org>
996
997         * top.c (print_gdb_configuration): Reflect LIBIPT, LIBMEMCHECK,
998         and LIBMPFR in the printed configuration.
999
1000 2018-03-08  Tom Tromey  <tom@tromey.com>
1001
1002         * source.c (get_filename_and_charpos): Use scoped_fd.
1003         * nto-procfs.c (procfs_open_1): Use scoped_fd.
1004         (procfs_pidlist): Likewise.
1005         * procfs.c (proc_get_LDT_entry): Use scoped_fd.
1006         (iterate_over_mappings): Likewise.
1007
1008 2018-03-08  Tom Tromey  <tom@tromey.com>
1009
1010         * infcall.c (struct call_return_meta_info)
1011         <stack_temporaries_enabled>: Remove.
1012         (get_call_return_value, call_function_by_hand_dummy): Update.
1013         * thread.c (disable_thread_stack_temporaries): Remove.
1014         (enable_thread_stack_temporaries): Remove.
1015         (thread_stack_temporaries_enabled_p): Return bool.
1016         (push_thread_stack_temporary, value_in_thread_stack_temporaries)
1017         (get_last_thread_stack_temporary): Update.
1018         * eval.c (evaluate_subexp): Update.
1019         * gdbthread.h (class enable_thread_stack_temporaries): Now a
1020         class, not a function.
1021         (value_ptr, value_vec): Remove typedefs.
1022         (class thread_info) <stack_temporaries_enabled>: Now bool.
1023         <stack_temporaries>: Now a std::vector.
1024         (thread_stack_temporaries_enabled_p)
1025         (value_in_thread_stack_temporaries): Return bool.
1026
1027 2018-03-08  Simon Marchi  <simon.marchi@ericsson.com>
1028
1029         * remote.c (putpkt_binary): Fix omitted bytes reporting.
1030         (getpkt_or_notif_sane_1): Likewise.
1031
1032 2018-03-08  Simon Marchi  <simon.marchi@polymtl.ca>
1033
1034         * build-id.c (build_id_to_debug_bfd): Use std::string.
1035
1036 2018-03-08  Simon Marchi  <simon.marchi@polymtl.ca>
1037
1038         * build-id.c (find_separate_debug_file_by_buildid): Return
1039         std::string.
1040         * build-id.h (find_separate_debug_file_by_buildid): Return
1041         std::string.
1042         * coffread.c (coff_symfile_read): Adjust to std::string.
1043         * elfread.c (elf_symfile_read): Adjust to std::string.
1044         * symfile.c (separate_debug_file_exists): Change parameter to
1045         std::string.
1046         (find_separate_debug_file): Return std::string.
1047         (find_separate_debug_file_by_debuglink): Return std::string.
1048         * symfile.h (find_separate_debug_file_by_debuglink): Return
1049         std::string.
1050
1051 2018-03-08  Simon Marchi  <simon.marchi@polymtl.ca>
1052
1053         * common/xml-utils.c (xml_escape_text): Move code to...
1054         (xml_escape_text_append): ... this new function.
1055         * common/xml-utils.h (xml_escape_text_append): New declaration.
1056         * unittests/xml-utils-selftests.c (test_xml_escape_text_append):
1057         New function.
1058         (_initialize_xml_utils): register test_xml_escape_text_append as
1059         a selftest.
1060
1061 2018-03-07  Alan Hayward  <alan.hayward@arm.com>
1062
1063         * defs.h: Remove MAX_REGISTER_SIZE.
1064         * regcache.c (init_regcache_descr): Remove MAX_REGISTER_SIZE
1065         asserts.
1066         * python/py-unwind.c (pyuw_sniffer): Likewise.
1067
1068 2018-03-07  Tom Tromey  <tom@tromey.com>
1069
1070         * linux-tdep.c (linux_info_proc): Update.
1071         * target.h (struct target_ops) <to_fileio_readlink>: Return
1072         optional<string>.
1073         (target_fileio_readlink): Return optional<string>.
1074         * remote.c (remote_hostio_readlink): Return optional<string>.
1075         * inf-child.c (inf_child_fileio_readlink): Return
1076         optional<string>.
1077         * target.c (target_fileio_readlink): Return optional<string>.
1078
1079 2018-03-07  Andrew Burgess  <andrew.burgess@embecosm.com>
1080
1081         * regcache.c (cooked_read_test): Add riscv to the list of
1082         architectures that have a save_reggroup.
1083
1084 2018-03-07  Andreas Arnez  <arnez@linux.vnet.ibm.com>
1085
1086         * gnu-v3-abi.c (gnuv3_rtti_type): Add early exit if the given
1087         value is not a dynamic class object.
1088
1089 2018-03-06  Tom Tromey  <tom@tromey.com>
1090
1091         * rust-exp.y: Formatting fixes.
1092
1093 2018-03-06  Andrew Burgess  <andrew.burgess@embecosm.com>
1094
1095         * riscv-tdep.c (riscv_register_name): Remove target description
1096         support.
1097         (riscv_gdbarch_init): Remove target description check.
1098
1099 2018-03-06  Andrew Burgess  <andrew.burgess@embecosm.com>
1100
1101         * riscv-tdep.c: Remove 'Contributed by ...' lines from header
1102         comment.
1103         * riscv-tdep.h: Likewise.
1104
1105 2018-03-06  Andrew Burgess  <andrew.burgess@embecosm.com>
1106
1107         * riscv-tdep.c (riscv_pseudo_register_read): Delete.
1108         (riscv_pseudo_register_write): Delete.
1109         (riscv_gdbarch_init): Remove all use of pseudo registers.
1110
1111 2018-03-06  Simon Marchi  <simon.marchi@polymtl.ca>
1112
1113         * record-btrace.c (btrace_print_lines): Replace cleanup
1114         parameter with RAII equivalents.
1115         (btrace_insn_history): Replace cleanup with RAII equivalents.
1116         * ui-out.h (make_cleanup_ui_out_list_begin_end,
1117         make_cleanup_ui_out_tuple_begin_end): Remove.
1118         * ui-out.c (struct ui_out_end_cleanup_data, do_cleanup_end,
1119         make_cleanup_ui_out_end, make_cleanup_ui_out_tuple_begin_end,
1120         make_cleanup_ui_out_list_begin_end): Remove.
1121
1122 2018-03-06  Simon Marchi  <simon.marchi@polymtl.ca>
1123
1124         * record-btrace.c (record_btrace_maybe_mark_async_event): Change
1125         parameter types to std::vector.  Use bool.
1126         (record_btrace_wait): Replace VEC(tp_t) with
1127         std::vector<thread_info *>.
1128         * common/gdb_vecs.h (unordered_remove, ordered_remove): New.
1129
1130 2018-03-06  Simon Marchi  <simon.marchi@polymtl.ca>
1131
1132         * record-btrace.c (record_btrace_disable_callback): Remove.
1133         (struct scoped_btrace_disable): New.
1134         (record_btrace_open): Use scoped_btrace_disable.
1135
1136 2018-03-06  Andrew Burgess  <andrew.burgess@embecosm.com>
1137
1138         * riscv-tdep.c (riscv_return_value): Change type to ULONGEST for
1139         reading values from registers.
1140
1141 2018-03-06  Andrew Burgess  <andrew.burgess@embecosm.com>
1142
1143         * riscv-tdep.c (riscv_push_dummy_call): Use core_addr_to_string_nz
1144         where appropriate.
1145
1146 2018-03-06  Andrew Burgess  <andrew.burgess@embecosm.com>
1147
1148         * riscv-tdep.c (riscv_print_arg_location): Add header comment,
1149         change parameter type.  Use GDB's print functions, and use
1150         core_addr_to_string where appropriate.
1151         (riscv_push_dummy_call): Use core_addr_to_string where
1152         appropriate, update call to riscv_print_arg_location, and reindent
1153         a few lines.
1154         (riscv_return_value): Update call to riscv_print_arg_location.
1155
1156 2018-03-06  Andrew Burgess  <andrew.burgess@embecosm.com>
1157             Tim Newsome <tim@sifive.com>
1158             Albert Ou <a0u@eecs.berkeley.edu>
1159             Darius Rad <darius@bluespec.com>
1160
1161         * Makefile.in (ALL_TARGET_OBS): Add riscv-tdep.o
1162         (HFILES_NO_SRCDIR): Add riscv-tdep.h.
1163         (ALLDEPFILES): Add riscv-tdep.c
1164         * configure.tgt: Add riscv support.
1165         * riscv-tdep.c: New file.
1166         * riscv-tdep.h: New file.
1167         * NEWS: Mention new target.
1168         * MAINTAINERS: Add entry for riscv.
1169
1170 2018-03-06  Andrew Burgess  <andrew.burgess@embecosm.com>
1171
1172         * amd64-tdep.c (amd64_classify_aggregate): Ignore zero sized
1173         fields within aggregates.
1174
1175 2018-03-04  Simon Marchi  <simon.marchi@polymtl.ca>
1176
1177         * record-btrace.c (btrace_print_lines): Change type of flags to
1178         gdb_disassembly_flags.
1179
1180 2018-03-04  John Baldwin  <jhb@FreeBSD.org>
1181
1182         * fbsd-nat.c: Include "inf-ptrace.h".
1183         (USE_SIGTRAP_SIGINFO): Conditionally define.
1184         [USE_SIGTRAP_SIGINFO] (fbsd_handle_debug_trap): New function.
1185         (fbsd_wait) [USE_SIGTRAP_SIGINFO]: Call "fbsd_handle_debug_trap".
1186         [USE_SIGTRAP_SIGINFO] (fbsd_stopped_by_sw_breakpoint): New
1187         function.
1188         [USE_SIGTRAP_SIGINFO] (fbsd_supports_stopped_by_sw_breakpoint):
1189         Likewise.
1190         [USE_SIGTRAP_SIGINFO] (fbsd_supports_stopped_by_hw_breakpoint):
1191         Likewise.
1192         (fbsd_nat_add_target) [USE_SIGTRAP_SIGINFO]: Set
1193         "stopped_by_sw_breakpoint", "supports_stopped_by_sw_breakpoint",
1194         "supports_stopped_by_hw_breakpoint" target methods.
1195
1196 2018-03-04  John Baldwin  <jhb@FreeBSD.org>
1197
1198         * NEWS (Changes since GDB 8.1): Add "set/show debug fbsd-nat".
1199         * fbsd-nat.c (debug_fbsd_nat): New variable.
1200         (show_fbsd_nat_debug): New function.
1201         (fbsd_wait): Log LWP info if "debug_fbsd_nat" is enabled.
1202         (_initialize_fbsd_nat): Add "fbsd-nat" debug boolean command.
1203
1204 2018-03-04  John Baldwin  <jhb@FreeBSD.org>
1205
1206         * nat/x86-dregs.c (x86_dr_stopped_by_hw_breakpoint): New function.
1207         * nat/x86-dregs.h (x86_dr_stopped_by_hw_breakpoint): New
1208         prototype.
1209         * x86-nat.c (x86_stopped_by_hw_breakpoint): New function.
1210         (x86_use_watchpoints): Set "stopped_by_hw_breakpoint" target
1211         method.
1212
1213 2018-03-02  Simon Marchi  <simon.marchi@polymtl.ca>
1214
1215         * common/gdb_vecs.c (free_char_ptr_vec): Remove.
1216         * common/gdb_vecs.h (free_char_ptr_vec): Remove.
1217
1218 2018-03-02  Simon Marchi  <simon.marchi@polymtl.ca>
1219
1220         * charset.c (struct charset_vector): New.
1221         (charsets): Change type to charset_vector.
1222         (find_charset_names): Adjust.
1223         (add_one): Adjust.
1224         (_initialize_charset): Adjust.
1225
1226 2018-03-02  Simon Marchi  <simon.marchi@polymtl.ca>
1227
1228         * progspace.h (struct program_space) <deleted_solibs>: Change
1229         type to std::vector<std::string>.
1230         * progspace.c (clear_program_space_solib_cache): Adjust.
1231         * breakpoint.c (print_solib_event): Adjust.
1232         (check_status_catch_solib): Adjust.
1233         * solib.c (update_solib_list): Adjust.
1234         * ui-out.h (class ui_out) <field_string>: New overload.
1235         * ui-out.c (ui_out::field_string): New overload.
1236
1237 2018-03-02  Simon Marchi  <simon.marchi@polymtl.ca>
1238
1239         * progspace.h (struct program_space): Add constructor and
1240         destructor, initialize fields.
1241         (add_program_space): Remove.
1242         * progspace.c (add_program_space): Rename to...
1243         (program_space::program_space): ... this.
1244         (release_program_space): Rename to...
1245         (program_space::~program_space): ... this.
1246         (delete_program_space): Use delete to delete program_space.
1247         (initialize_progspace): Use new to allocate program_space.
1248         * inferior.c (add_inferior_with_spaces): Likewise.
1249         (clone_inferior_command): Likewise.
1250         * infrun.c (follow_fork_inferior): Likewise.
1251         (handle_vfork_child_exec_or_exit): Likewise.
1252
1253 2018-03-02  Simon Marchi  <simon.marchi@polymtl.ca>
1254
1255         * common/gdb_vecs.h (make_cleanup_free_char_ptr_vec): Remove.
1256         (delim_string_to_char_ptr_vec): Return std::vector of
1257         gdb::unique_xmalloc_ptr.
1258         (dirnames_to_char_ptr_vec_append): Take std::vector of
1259         gdb::unique_xmalloc_ptr.
1260         (dirnames_to_char_ptr_vec): Return std::vector of
1261         gdb::unique_xmalloc_ptr.
1262         * common/gdb_vecs.c (delim_string_to_char_ptr_vec_append):
1263         Take std::vector of gdb::unique_xmalloc_ptr, adjust the code.
1264         (delim_string_to_char_ptr_vec): Return an std::vector of
1265         gdb::unique_xmalloc_ptr, adjust the code.
1266         (dirnames_to_char_ptr_vec_append): Take an std::vector of
1267         gdb::unique_xmalloc_ptr, adjust the code.
1268         (dirnames_to_char_ptr_vec): Return an std::vector of
1269         gdb::unique_xmalloc_ptr, adjust the code.
1270         * auto-load.c (auto_load_safe_path_vec): Change type to
1271         std::vector of gdb::unique_xmalloc_ptr.
1272         (auto_load_expand_dir_vars): Return an std::vector of
1273         gdb::unique_xmalloc_ptr, adjust the code.
1274         (auto_load_safe_path_vec_update): Adjust.
1275         (filename_is_in_auto_load_safe_path_vec): Adjust.
1276         (auto_load_objfile_script_1): Adjust.
1277         * build-id.c (build_id_to_debug_bfd): Adjust.
1278         * linux-thread-db.c (thread_db_load_search): Adjust.
1279         * source.c (add_path): Adjust.
1280         (openp): Adjust.
1281         * symfile.c (find_separate_debug_file): Adjust.
1282         * utils.c (do_free_char_ptr_vec): Remove.
1283         (make_cleanup_free_char_ptr_vec): Remove.
1284
1285 2018-03-01  Sergio Durigan Junior  <sergiodj@redhat.com>
1286
1287         PR gdb/22907
1288         * common/pathstuff.c: Conditionally include "<windows.h>".
1289
1290 2018-03-01  Georg Sauthoff  <mail@georg.so>
1291
1292         PR gdb/22888
1293         * gcore.in: Quote variables and switch interpreter to bash.
1294
1295 2018-03-01  Tom Tromey  <tom@tromey.com>
1296
1297         * dwarf2read.c (alloc_discriminant_info): Fix default_index
1298         assertion.  Add assertion for discriminant_index.
1299         (quirk_rust_enum): Use correct base type name in univariant case.
1300
1301 2018-03-01  Simon Marchi  <simon.marchi@ericsson.com>
1302
1303         * record.c (get_call_history_modifiers): Return a
1304         record_print_flags.
1305         (cmd_record_call_history): Adjust.
1306         * record-btrace.c (record_btrace_call_history): Adjust.
1307         (record_btrace_call_history_range): Adjust.
1308         (record_btrace_call_history_from): Adjust.
1309         * target-debug.h (target_debug_print_record_print_flags): New.
1310         * target-delegates.c: Re-generate.
1311         * target.c (target_call_history): Change flags type.
1312         (target_call_history_from): Likewise.
1313         (target_call_history_range): Likewise.
1314         * target.h (struct target_ops) <target_call_history>: Likewise.
1315         (target_call_history_from): Likewise.
1316         (target_call_history_range): Likewise.
1317
1318 2018-02-28  Sergio Durigan Junior  <sergiodj@redhat.com>
1319             Simon Marchi  <simon.marchi@polymtl.ca>
1320
1321         * common/common-utils.c: Include "sys/stat.h".
1322         (is_regular_file): Move here from "source.c"; change return
1323         type to "bool".
1324         * common/common-utils.h (is_regular_file): New prototype.
1325         * common/pathstuff.c (contains_dir_separator): New function.
1326         * common/pathstuff.h (contains_dir_separator): New prototype.
1327         * source.c: Don't include "sys/stat.h".
1328         (is_regular_file): Move to "common/common-utils.c".
1329
1330 2018-02-28  Sergio Durigan Junior  <sergiodj@redhat.com>
1331
1332         * Makefile.in (COMMON_SFILES): Add "common/pathstuff.c".
1333         (HFILES_NO_SRCDIR): Add "common/pathstuff.h".
1334         * auto-load.c: Include "common/pathstuff.h".
1335         * common/common-def.h (current_directory): Move here.
1336         * common/gdb_tilde_expand.c (gdb_tilde_expand_up): New
1337         function.
1338         * common/gdb_tilde_expand.h (gdb_tilde_expand_up): New
1339         prototype.
1340         * common/pathstuff.c: New file.
1341         * common/pathstuff.h: New file.
1342         * compile/compile.c: Include "common/pathstuff.h".
1343         * defs.h (current_directory): Move to "common/common-defs.h".
1344         * dwarf2read.c: Include "common/pathstuff.h".
1345         * exec.c: Likewise.
1346         * guile/scm-safe-call.c: Likewise.
1347         * linux-thread-db.c: Likewise.
1348         * main.c: Likewise.
1349         * nto-tdep.c: Likewise.
1350         * objfiles.c: Likewise.
1351         * source.c: Likewise.
1352         * symtab.c: Likewise.
1353         * utils.c: Include "common/pathstuff.h".
1354         (gdb_realpath): Move to "common/pathstuff.c".
1355         (gdb_realpath_keepfile): Likewise.
1356         (gdb_abspath): Likewise.
1357         * utils.h (gdb_realpath): Move to "common/pathstuff.h".
1358         (gdb_realpath_keepfile): Likewise.
1359         (gdb_abspath): Likewise.
1360
1361 2018-02-28  John Baldwin  <jhb@FreeBSD.org>
1362
1363         * fbsd-nat.c (fbsd_resume): Use PT_SETSTEP for stepping and a
1364         wildcard process pid for super_resume for kernels with a
1365         specific bug.
1366
1367 2018-02-27  Phil Muldoon  <pmuldoon@redhat.com>
1368
1369         * compile/compile.c (get_args): Add additional comments
1370         explaining function.
1371
1372 2018-02-27  Simon Marchi  <simon.marchi@polymtl.ca>
1373             Tom Tromey  <tom@tromey.com>
1374
1375         * target.h (memory_write_request_s): Remove typedef.  Don't define
1376         VEC.
1377         (target_write_memory_blocks): Change argument to std::vector.
1378         (struct memory_write_request): Add constructor.
1379         * target-memory.c (compare_block_starting_address): Return bool.
1380         Change argument types.
1381         (claim_memory): Change arguments to use std::vector.
1382         (split_regular_and_flash_blocks, blocks_to_erase)
1383         (compute_garbled_blocks): Likewise.
1384         (cleanup_request_data, cleanup_write_requests_vector): Remove.
1385         (target_write_memory_blocks): Change argument to std::vector.
1386         * symfile.c (struct load_section_data): Add constructor and
1387         destructor.  Use std::vector for "requests".
1388         (struct load_progress_data): Add initializers.
1389         (load_section_callback): Update.  Use "new".
1390         (clear_memory_write_data): Remove.
1391         (generic_load): Update.
1392
1393 2018-02-27  Alan Hayward  <alan.hayward@arm.com>
1394
1395         * arch/aarch64.h: Use common/tdesc.h.
1396
1397 2018-02-26  Maciej W. Rozycki  <macro@mips.com>
1398
1399         * mips-tdep.c (mips_gdbarch_init): Don't use a 32-bit BFD
1400         architecture with a 64-bit ABI.
1401
1402 2018-02-26  Maciej W. Rozycki  <macro@mips.com>
1403
1404         * gdb/mips-tdep.c (mips_gdbarch_init): Reorder ABI determination
1405         ahead of target description loading.
1406
1407 2018-02-26  Tom Tromey  <tom@tromey.com>
1408
1409         * stack.c (backtrace_command_1): Update.
1410         * python/python-internal.h (gdbpy_apply_frame_filter): Change type
1411         of "flags".
1412         * python/py-framefilter.c (py_print_frame)
1413         (gdbpy_apply_frame_filter): Change type of "flags".
1414         * mi/mi-cmd-stack.c (mi_apply_ext_lang_frame_filter): Change type
1415         of "flags".
1416         (mi_cmd_stack_list_frames, mi_cmd_stack_list_locals)
1417         (mi_cmd_stack_list_args, mi_cmd_stack_list_variables): Update.
1418         * extension.h (enum frame_filter_flag): Rename from
1419         frame_filter_flags.
1420         (frame_filter_flags): Define using DEF_ENUM_FLAGS_TYPE.
1421         (apply_ext_lang_frame_filter): Change type of "flags".
1422         * extension.c (apply_ext_lang_frame_filter): Change type of
1423         "flags".
1424         * extension-priv.h (struct extension_language_ops)
1425         <apply_frame_filter>: Change type of "flags".
1426
1427 2018-02-26  Tom Tromey  <tom@tromey.com>
1428
1429         PR python/16497:
1430         * stack.c (backtrace_command_1): Set PRINT_MORE_FRAMES flag.  Fix
1431         off-by-one in py_end computation.
1432         * python/py-framefilter.c (gdbpy_apply_frame_filter): Handle
1433         PRINT_MORE_FRAMES.
1434         * extension.h (enum frame_filter_flags) <PRINT_MORE_FRAMES>: New
1435         constant.
1436
1437 2018-02-26  Tom Tromey  <tom@tromey.com>
1438
1439         * dwarf2read.c (struct variant_field): New.
1440         (struct nextfield) <variant>: New field.
1441         (dwarf2_add_field): Handle DW_TAG_variant_part.
1442         (dwarf2_attach_fields_to_type): Attach a discriminant_info to a
1443         discriminated union.
1444         (read_structure_type): Handle DW_TAG_variant_part.
1445         (handle_struct_member_die): New function, extracted from
1446         process_structure_scope.  Handle DW_TAG_variant.
1447         (process_structure_scope): Handle discriminated unions.  Call
1448         handle_struct_member_die.
1449
1450 2018-02-26  Tom Tromey  <tom@tromey.com>
1451
1452         * rust-lang.h (rust_last_path_segment): Declare.
1453         * rust-lang.c (rust_last_path_segment): Now public.  Change
1454         contract.
1455         (struct disr_info): Remove.
1456         (RUST_ENUM_PREFIX, RUST_ENCODED_ENUM_REAL)
1457         (RUST_ENCODED_ENUM_HIDDEN, rust_union_is_untagged)
1458         (rust_get_disr_info, rust_tuple_variant_type_p): Remove.
1459         (rust_enum_p, rust_enum_variant): New function.
1460         (rust_underscore_fields): Remove "offset" parameter.
1461         (rust_print_enum): New function.
1462         (rust_val_print) <TYPE_CODE_UNION>: Remove enum code.
1463         <TYPE_CODE_STRUCT>: Call rust_print_enum when appropriate.
1464         (rust_print_struct_def): Add "for_rust_enum" parameter.  Handle
1465         enums.
1466         (rust_internal_print_type): New function, from rust_print_type.
1467         Remove enum code.
1468         (rust_print_type): Call rust_internal_print_type.
1469         (rust_evaluate_subexp) <STRUCTOP_ANONYMOUS, STRUCTOP_STRUCT>:
1470         Update enum handling.
1471         * dwarf2read.c (struct dwarf2_cu) <rust_unions>: New field.
1472         (rust_fully_qualify, alloc_discriminant_info, quirk_rust_enum)
1473         (rust_union_quirks): New functions.
1474         (process_full_comp_unit, process_full_type_unit): Call
1475         rust_union_quirks.
1476         (process_structure_scope): Update rust_unions if necessary.
1477
1478 2018-02-26  Tom Tromey  <tom@tromey.com>
1479
1480         * value.h (value_union_variant): Declare.
1481         * valops.c (value_union_variant): New function.
1482         * gdbtypes.h (TYPE_FLAG_DISCRIMINATED_UNION): New macro.
1483         (struct discriminant_info): New.
1484         (enum dynamic_prop_node_kind) <DYN_PROP_DISCRIMINATED>: New
1485         enumerator.
1486         (struct main_type) <flag_discriminated_union>: New field.
1487
1488 2018-02-26  Tom Tromey  <tom@tromey.com>
1489
1490         * Makefile.in (SUBDIR_UNITTESTS_SRCS): Add
1491         unittests/unpack-selftests.c.
1492         * unittests/unpack-selftests.c: New file.
1493         * value.c (unpack_bits_as_long): Fix bugs in non-bitfield cases.
1494
1495 2018-02-26  Yao Qi  <yao.qi@linaro.org>
1496
1497         * dwarf2read.c (struct partial_die_info) <read>: New method.
1498         (read_partial_die): Remove the declaration.
1499         (load_partial_dies): Update.
1500         (partial_die_info::partial_die_info):
1501         (read_partial_die): Change it to partial_die_info::read.
1502
1503 2018-02-26  Yao Qi  <yao.qi@linaro.org>
1504
1505         * dwarf2read.c (struct partial_die_info) <fixup>: New method.
1506         (fixup_partial_die): Remove declaration.
1507         (scan_partial_symbols): Update.
1508         (partial_die_parent_scope): Likewise.
1509         (partial_die_full_name): Likewise.
1510         (fixup_partial_die): Change it to partial_die_info::fixup.
1511
1512 2018-02-26  Yao Qi  <yao.qi@linaro.org>
1513
1514         * dwarf2read.c (read_partial_die): Update the declaration.
1515         (load_partial_dies): Caller update.
1516         (read_partial_die): Remove one argument abbrev_len.
1517
1518 2018-02-26  Yao Qi  <yao.qi@linaro.org>
1519
1520         * dwarf2read.c (struct partial_die_info): Add ctor, delete
1521         assignment operator.
1522         (load_partial_dies): Use ctor and copy ctor.
1523         (read_partial_die): Update.
1524         (dwarf2_cu::find_partial_die): Use ctor.
1525
1526 2018-02-26  Yao Qi  <yao.qi@linaro.org>
1527
1528         * dwarf2read.c (struct dwarf2_cu) <find_partial_die>: New method.
1529         (find_partial_die_in_comp_unit): Change it to
1530         dwarf2_cu::find_partial_die.
1531         (find_partial_die): Update.
1532
1533 2018-02-26  Yao Qi  <yao.qi@linaro.org>
1534
1535         * dwarf2read.c (read_partial_die): Remove the code checking abbrev
1536         is NULL.
1537
1538 2018-02-26  Yao Qi  <yao.qi@linaro.org>
1539
1540         * dwarf2read.c (load_partial_dies): Move the location of XOBNEW.
1541
1542 2018-02-26  Alan Hayward  <alan.hayward@arm.com>
1543
1544         * arch/amd64.h: Use common/tdesc.h.
1545         * arch/i386.c: Likewise.
1546         * arch/i386.h: Likewise.
1547         * arch/tic6x.c: Likewise.
1548         * arch/tdesc.h: Move file from here...
1549         * common/tdesc.h: ...to here.
1550         * features/aarch64-core.c: Regenerate.
1551         * features/aarch64-fpu.c: Regenerate.
1552         * features/i386/32bit-avx.c: Regenerate.
1553         * features/i386/32bit-avx512.c: Regenerate.
1554         * features/i386/32bit-core.c: Regenerate.
1555         * features/i386/32bit-linux.c: Regenerate.
1556         * features/i386/32bit-mpx.c: Regenerate.
1557         * features/i386/32bit-pkeys.c: Regenerate.
1558         * features/i386/32bit-sse.c: Regenerate.
1559         * features/i386/64bit-avx.c: Regenerate.
1560         * features/i386/64bit-avx512.c: Regenerate.
1561         * features/i386/64bit-core.c: Regenerate.
1562         * features/i386/64bit-linux.c: Regenerate.
1563         * features/i386/64bit-mpx.c: Regenerate.
1564         * features/i386/64bit-pkeys.c: Regenerate.
1565         * features/i386/64bit-segments.c: Regenerate.
1566         * features/i386/64bit-sse.c: Regenerate.
1567         * features/i386/x32-core.c: Regenerate.
1568         * features/tic6x-c6xp.c: Regenerate.
1569         * features/tic6x-core.c: Regenerate.
1570         * features/tic6x-gp.c: Regenerate.
1571         * target-descriptions.c: Use common/tdesc.h.
1572         * target-descriptions.h: Likewise.
1573
1574 2018-02-24  Tom Tromey  <tom@tromey.com>
1575
1576         * linux-thread-db.c (try_thread_db_load_from_pdir_1)
1577         (try_thread_db_load_from_dir, thread_db_load_search): Use
1578         std::string.
1579         (info_auto_load_libthread_db_compare): Return bool.  Change
1580         argument types.
1581         (info_auto_load_libthread_db): Use std::vector, std::string.
1582         Remove cleanups.
1583
1584 2018-02-24  Tom Tromey  <tom@tromey.com>
1585
1586         * i386-tdep.c (i386_fast_tracepoint_valid_at): "msg" now a
1587         std::string.
1588         * gdbarch.sh (fast_tracepoint_valid_at): Change "msg" to a
1589         std::string*.
1590         * gdbarch.c: Rebuild.
1591         * gdbarch.h: Rebuild.
1592         * breakpoint.c (check_fast_tracepoint_sals): Use std::string.
1593         * arch-utils.h (default_fast_tracepoint_valid_at): Update.
1594         * arch-utils.c (default_fast_tracepoint_valid_at): "msg" now a
1595         std::string*.
1596
1597 2018-02-23  Simon Marchi  <simon.marchi@polymtl.ca>
1598
1599         * gdbtypes.h (sect_offset): Change type to uint64_t.
1600         (sect_offset_str): New function.
1601         * dwarf2read.c (create_addrmap_from_aranges): Use
1602         sect_offset_str.
1603         (error_check_comp_unit_head): Likewise.
1604         (create_debug_type_hash_table): Likewise.
1605         (read_cutu_die_from_dwo): Likewise.
1606         (init_cutu_and_read_dies): Likewise.
1607         (init_cutu_and_read_dies_no_follow): Likewise.
1608         (process_psymtab_comp_unit_reader): Likewise.
1609         (partial_die_parent_scope): Likewise.
1610         (peek_die_abbrev): Likewise.
1611         (process_queue): Likewise.
1612         (dwarf2_physname): Likewise.
1613         (read_namespace_alias): Likewise.
1614         (read_import_statement): Likewise.
1615         (create_dwo_cu_reader): Likewise.
1616         (create_cus_hash_table): Likewise.
1617         (lookup_dwo_cutu): Likewise.
1618         (inherit_abstract_dies): Likewise.
1619         (read_func_scope): Likewise.
1620         (read_call_site_scope): Likewise.
1621         (dwarf2_add_member_fn): Likewise.
1622         (read_common_block): Likewise.
1623         (read_module_type): Likewise.
1624         (read_typedef): Likewise.
1625         (read_subrange_type): Likewise.
1626         (load_partial_dies): Likewise.
1627         (read_partial_die): Likewise.
1628         (find_partial_die): Likewise.
1629         (read_str_index): Likewise.
1630         (dwarf2_string_attr): Likewise.
1631         (build_error_marker_type): Likewise.
1632         (lookup_die_type): Likewise.
1633         (dump_die_shallow): Likewise.
1634         (follow_die_ref): Likewise.
1635         (dwarf2_fetch_die_loc_sect_off): Likewise.
1636         (dwarf2_fetch_constant_bytes): Likewise.
1637         (follow_die_sig): Likewise.
1638         (get_signatured_type): Likewise.
1639         (get_DW_AT_signature_type): Likewise.
1640         (dwarf2_find_containing_comp_unit): Likewise.
1641         (set_die_type): Likewise.
1642
1643 2018-02-21  John Baldwin  <jhb@FreeBSD.org>
1644
1645         * arch/aarch64.c: Include "common-defs.h".
1646         * arch/amd64.c: Likewise.
1647         * arch/i386.c: Likewise.
1648
1649 2018-02-21  Tom Tromey  <tom@tromey.com>
1650
1651         * value.h: (extract_field_op): Update.
1652         * eval.c (extract_field_op): Return a const char *.
1653         * expression.h (parse_expression_for_completion): Update.
1654         * completer.c (complete_expression): Update.
1655         (add_struct_fields): Make fieldname const.
1656         * parse.c (expout_completion_name): Now a unique_xmalloc_ptr.
1657         (mark_completion_tag, parse_exp_in_context_1): Update.
1658         (parse_expression_for_completion): Change "name" to
1659         unique_xmalloc_ptr*.
1660
1661 2018-02-21  Tom Tromey  <tom@tromey.com>
1662
1663         * infcall.c (call_function_by_hand_dummy): Use std::vector.
1664
1665 2018-02-21  Yao Qi  <yao.qi@linaro.org>
1666
1667         * avr-tdep.c (avr_read_pc): Change parameter type to
1668         readable_regcache.
1669         * gdbarch.sh (read_pc): Likewise.
1670         * gdbarch.c: Re-generated.
1671         * gdbarch.h: Re-generated.
1672         * hppa-tdep.c (hppa_read_pc): Change parameter type to
1673         readable_regcache.
1674         * ia64-tdep.c (ia64_read_pc): Likewise.
1675         * mips-tdep.c (mips_read_pc): Likewise.
1676         * spu-tdep.c (spu_read_pc): Likewise.
1677
1678 2018-02-21  Yao Qi  <yao.qi@linaro.org>
1679
1680         * Makefile.in (COMMON_SFILES): Add regcache-dump.c
1681         * regcache-dump.c: New file.
1682         * regcache.c: Move register_dump to regcache-dump.c.
1683         (maintenance_print_registers): Likewise.
1684         (maintenance_print_raw_registers): Likewise.
1685         (maintenance_print_cooked_registers): Likewise.
1686         (maintenance_print_register_groups): Likewise.
1687         (maintenance_print_remote_registers): Likewise.
1688         (_initialize_regcache): Likewise.
1689         * regcache.h (register_dump): Moved from regcache.c.
1690
1691 2018-02-21  Yao Qi  <yao.qi@linaro.org>
1692
1693         * regcache.c (regcache::regcache): Update.
1694         (regcache::invalidate): Move it to detached_regcache::invalidate.
1695         (get_thread_arch_aspace_regcache): Update.
1696         (regcache::raw_update): Update.
1697         (regcache::cooked_read): Remove some code.
1698         (regcache::cooked_read_value): Likewise.
1699         (regcache::raw_write): Remove assert on m_readonly_p.
1700         (regcache::raw_supply_integer): Move it to
1701         detached_regcache::raw_supply_integer.
1702         (regcache::raw_supply_zeroed): Likewise.
1703         * regcache.h (detached_regcache) <raw_supply_integer>: New
1704         declaration.
1705         <raw_supply_zeroed, invalidate>: Likewise.
1706         (regcache) <raw_supply_integer, raw_supply_zeroed>: Removed.
1707         <invalidate>: Likewise.
1708         <m_readonly_p>: Removed.
1709
1710 2018-02-21  Yao Qi  <yao.qi@linaro.org>
1711
1712         * infcmd.c (get_return_value): Let stop_regs point to
1713         get_current_regcache.
1714         * regcache.c (regcache::regcache): Remove.
1715         (register_dump_reg_buffer): New class.
1716         (regcache_print): Adjust.
1717         * regcache.h (regcache): Remove constructors.
1718
1719 2018-02-21  Yao Qi  <yao.qi@linaro.org>
1720
1721         * regcache.c (class register_dump): New class.
1722         (register_dump_regcache, register_dump_none): New class.
1723         (register_dump_remote, register_dump_groups): New class.
1724         (regcache_print): Update.
1725         * regcache.h (regcache_dump_what): Move it to regcache.c.
1726         (regcache) <dump>: Remove.
1727
1728 2018-02-21  Yao Qi  <yao.qi@linaro.org>
1729
1730         * jit.c (struct jit_unwind_private) <regcache>: Change its type to
1731          reg_buffer_rw *.
1732         (jit_unwind_reg_set_impl): Call raw_supply.
1733         (jit_frame_sniffer): Use reg_buffer_rw.
1734         * record-full.c (record_full_core_regbuf): Change its type.
1735         (record_full_core_open_1): Use reg_buffer_rw.
1736         (record_full_close): Likewise.
1737         (record_full_core_fetch_registers): Use regcache->raw_supply.
1738         (record_full_core_store_registers): Likewise.
1739         * regcache.c (regcache::get_register_status): Move it to
1740         reg_buffer.
1741         (regcache_raw_set_cached_value): Remove.
1742         (regcache::raw_set_cached_value): Remove.
1743         (regcache::raw_write): Call raw_supply.
1744         (regcache::raw_supply): Move it to reg_buffer_rw.
1745         * regcache.h (regcache_raw_set_cached_value): Remove.
1746         (reg_buffer_rw): New class.
1747
1748 2018-02-21  Yao Qi  <yao.qi@linaro.org>
1749
1750         * dummy-frame.c (dummy_frame_cache) <prev_regcache>: Use
1751         readonly_detached_regcache.
1752         (dummy_frame_prev_register): Use regcache->cooked_read.
1753         * frame.c (frame_save_as_regcache): Change return type.
1754         (frame_pop): Update.
1755         * frame.h (frame_save_as_regcache): Update declaration.
1756         * inferior.h (get_infcall_suspend_state_regcache): Update
1757         declaration.
1758         * infrun.c (infcall_suspend_state) <registers>: use
1759         readonly_detached_regcache.
1760         (save_infcall_suspend_state): Don't use regcache_dup.
1761         (get_infcall_suspend_state_regcache): Change return type.
1762         * linux-fork.c (struct fork_info) <savedregs>: Change to
1763         readonly_detached_regcache.
1764         <pc>: New field.
1765         (fork_save_infrun_state): Don't use regcache_dup.
1766         (info_checkpoints_command): Adjust.
1767         * mi/mi-main.c (register_changed_p): Update declaration.
1768         (mi_cmd_data_list_changed_registers): Use
1769         readonly_detached_regcache.
1770         (register_changed_p): Change parameter type to
1771         readonly_detached_regcache.
1772         * ppc-linux-tdep.c (ppu2spu_cache) <regcache>: Use
1773         readonly_detached_regcache.
1774         (ppu2spu_sniffer): Construct a new readonly_detached_regcache.
1775         * regcache.c (readonly_detached_regcache::readonly_detached_regcache):
1776         New.
1777         (regcache::save): Move it to reg_buffer.
1778         (regcache::restore): Change parameter type.
1779         (regcache_dup): Remove.
1780         * regcache.h (reg_buffer) <save>: New method.
1781         (readonly_detached_regcache): New class.
1782         * spu-tdep.c (spu2ppu_cache) <regcache>: Use
1783         readonly_detached_regcache.
1784         (spu2ppu_sniffer): Construct a new readonly_detached_regcache.
1785
1786 2018-02-21  Yao Qi  <yao.qi@linaro.org>
1787
1788         * frame.c (frame_save_as_regcache): Use regcache method save.
1789         (frame_pop): Use regcache method restore.
1790         * infrun.c (restore_infcall_suspend_state): Likewise.
1791         * linux-fork.c (fork_load_infrun_state): Likewise.
1792         * ppc-linux-tdep.c (ppu2spu_sniffer): User regcache method
1793         save.
1794         * regcache.c (regcache_save): Remove.
1795         (regcache::restore): More asserts.
1796         (regcache_cpy): Remove.
1797         * regcache.h (regcache_save): Remove the declaration.
1798         (regcache::restore): Move from private to public.
1799         Remove the friend declaration of regcache_cpy.
1800         (regcache_cpy): Remove declaration.
1801
1802 2018-02-21  Yao Qi  <yao.qi@linaro.org>
1803
1804         * aarch64-tdep.c (aarch64_pseudo_register_read_value): Change
1805         parameter type to 'readable_regcache *'.
1806         * amd64-tdep.c (amd64_pseudo_register_read_value): Likewise.
1807         * arm-tdep.c (arm_neon_quad_read): Likewise.
1808         (arm_pseudo_read): Likewise.
1809         * avr-tdep.c (avr_pseudo_register_read): Likewise.
1810         * bfin-tdep.c (bfin_pseudo_register_read): Likewise.
1811         * frv-tdep.c (frv_pseudo_register_read): Likewise.
1812         * gdbarch.c: Re-generated.
1813         * gdbarch.h: Re-generated.
1814         * gdbarch.sh (pseudo_register_read): Change parameter type to
1815         'readable_regcache *'.
1816         (pseudo_register_read_value): Likewise.
1817         * h8300-tdep.c (pseudo_from_raw_register): Likewise.
1818         (h8300_pseudo_register_read): Likewise.
1819         * hppa-tdep.c (hppa_pseudo_register_read): Likewise.
1820         * i386-tdep.c (i386_mmx_regnum_to_fp_regnum): Likewise.
1821         (i386_pseudo_register_read_into_value): Likewise.
1822         (i386_pseudo_register_read_value): Likewise.
1823         * i386-tdep.h (i386_pseudo_register_read_into_value): Update
1824         declaration.
1825         * ia64-tdep.c (ia64_pseudo_register_read): Likewise.
1826         * m32c-tdep.c (m32c_raw_read): Likewise.
1827         (m32c_read_flg): Likewise.
1828         (m32c_banked_register): Likewise.
1829         (m32c_banked_read): Likewise.
1830         (m32c_sb_read): Likewise.
1831         (m32c_part_read): Likewise.
1832         (m32c_cat_read): Likewise.
1833         (m32c_r3r2r1r0_read): Likewise.
1834         (m32c_pseudo_register_read): Likewise.
1835         * m68hc11-tdep.c (m68hc11_pseudo_register_read): Likewise.
1836         * mep-tdep.c (mep_pseudo_cr32_read): Likewise.
1837         (mep_pseudo_cr64_read): Likewise.
1838         (mep_pseudo_register_read): Likewise.
1839         * mips-tdep.c (mips_pseudo_register_read): Likewise.
1840         * msp430-tdep.c (msp430_pseudo_register_read): Likewise.
1841         * nds32-tdep.c (nds32_pseudo_register_read): Likewise.
1842         * regcache.c (regcache::raw_read): Move it to readable_regcache.
1843         (regcache::cooked_read): Likewise.
1844         (regcache::cooked_read_value): Likewise.
1845         (regcache_cooked_read_signed):
1846         (regcache::cooked_read): Likewise.
1847         * regcache.h (readable_regcache): New class.
1848         (regcache): Inherit readable_regcache.  Move some methods to
1849         readable_regcache.
1850         * rl78-tdep.c (rl78_pseudo_register_read): Change
1851         parameter type to 'readable_regcache *'.
1852         * rs6000-tdep.c (do_regcache_raw_read): Remove.
1853         (e500_pseudo_register_read): Change parameter type to
1854         'readable_regcache *'.
1855         (dfp_pseudo_register_read): Likewise.
1856         (vsx_pseudo_register_read): Likewise.
1857         (efpr_pseudo_register_read): Likewise.
1858         * s390-tdep.c (s390_pseudo_register_read): Likewise.
1859         * sh-tdep.c (sh_pseudo_register_read): Likewise.
1860         * sh64-tdep.c (pseudo_register_read_portions): Likewise.
1861         (sh64_pseudo_register_read): Likewise.
1862         * sparc-tdep.c (sparc32_pseudo_register_read): Likewise.
1863         * sparc64-tdep.c (sparc64_pseudo_register_read): Likewise.
1864         * spu-tdep.c (spu_pseudo_register_read_spu): Likewise.
1865         (spu_pseudo_register_read): Likewise.
1866         * xtensa-tdep.c (xtensa_register_read_masked): Likewise.
1867         (xtensa_pseudo_register_read): Likewise.
1868
1869 2018-02-21  Yao Qi  <yao.qi@linaro.org>
1870
1871         * regcache.c (regcache::regcache): Call reg_buffer ctor.
1872         (regcache::arch): Move it to reg_buffer::arch.
1873         (regcache::register_buffer): Likewise.
1874         (regcache::assert_regnum): Likewise.
1875         (regcache::num_raw_registers): Likewise.
1876         * regcache.h (reg_buffer): New class.
1877         (regcache): Inherit reg_buffer.
1878
1879 2018-02-20  Simon Marchi  <simon.marchi@ericsson.com>
1880
1881         * remote-sim.c (gdb_os_printf_filtered, gdb_os_vprintf_filtered,
1882         gdb_os_evprintf_filtered, gdb_os_error): Add ATTRIBUTE_PRINTF.
1883
1884 2018-02-20  Markus Metzger  <markus.t.metzger@intel.com>
1885
1886         * gnulib/update-gnulib.sh (IMPORTED_GNULIB_MODULES): Add mkstemp.
1887
1888 2018-02-19  Alan Hayward  <alan.hayward@arm.com>
1889
1890         * Makefile.in: (COMMON_SFILES): Add common/*.c files.
1891         (SFILES): Remove common/*.c files.
1892         (COMMON_OBS): Remove some *.o files built from common/*.c files.
1893         * common/common.host: Add common reference.
1894         * configure.ac: Likewise.
1895         * configure: Regenerate.
1896
1897 2018-02-16  Yao Qi  <yao.qi@linaro.org>
1898
1899         * block.c (block_namespace_info): Inherit allocate_on_obstack.
1900         (block_initialize_namespace): Use new.
1901         * dwarf2read.c (dwarf2_per_objfile): Inherit allocate_on_obstack.
1902         (dwarf2_free_objfile): Use delete.
1903         * gdbtypes.c (type_pair): Inherit allocate_on_obstack.
1904         (copy_type_recursive): Use new.
1905         * gdb_obstack.h (allocate_on_obstack): New.
1906
1907 2018-02-15  Yao Qi  <yao.qi@linaro.org>
1908
1909         PR gdb/22849
1910         * inferior.c (exit_inferior_1): Reset inf->control.
1911
1912 2018-02-15  Joel Brobecker  <brobecker@adacore.com>
1913
1914         * ada-lang.c (ada_to_fixed_value_create): Delete advance
1915         declaration.
1916
1917 2018-02-14  Pedro Alves  <palves@redhat.com>
1918
1919         * frame-unwind.c (frame_unwind_try_unwinder): Always call
1920         frame_cleanup_after_sniffer on exception.
1921
1922 2018-02-14  Tom Tromey  <tom@tromey.com>
1923
1924         * solist.h (struct target_so_ops) <bfd_open>: Make pathname
1925         const.
1926         (solib_bfd_open): Make pathname const.
1927         * solib.c (solib_bfd_open): Make pathname const.
1928         * solib-spu.c (spu_bfd_fopen): Make name const.
1929         (spu_bfd_open): Make pathname const.
1930         * solib-darwin.c (darwin_bfd_open): Make pathname const.
1931         * solib-aix.c (solib_aix_bfd_open): Make pathname const.
1932
1933 2018-02-14  Tom Tromey  <tom@tromey.com>
1934
1935         * symfile.c (symfile_bfd_open): Update.
1936         * source.h (openp, source_full_path_of, find_and_open_source):
1937         Change argument type to unique_xmalloc_ptr.
1938         * source.c (openp): Take a unique_xmalloc_ptr.
1939         (source_full_path_of, find_and_open_source): Likewise.
1940         (open_source_file, symtab_to_fullname): Update.
1941         * solist.h (struct target_so_ops) <find_and_open_solib>: Take a
1942         unique_xmalloc_ptr.
1943         * solib.c (solib_find_1): Use unique_xmalloc_ptr.
1944         (exec_file_find): Update.
1945         * psymtab.c (psymtab_to_fullname): Update.
1946         * nto-tdep.h (nto_find_and_open_solib): Update.
1947         * nto-tdep.c (nto_find_and_open_solib): Change temp_path to a
1948         unique_xmalloc_ptr.
1949         * exec.c (exec_file_attach): Update.
1950         * dwarf2read.c (try_open_dwop_file): Use unique_xmalloc_ptr.
1951         * cli/cli-cmds.c (find_and_open_script): Use unique_xmalloc_ptr.
1952
1953 2018-02-14  Tom Tromey  <tom@tromey.com>
1954
1955         * solib.c: Include source.h.
1956         * nto-tdep.c: Include source.h.
1957         * mi/mi-cmd-env.c: Include source.h.
1958         * infcmd.c: Include source.h.
1959         * exec.c: Include source.h.
1960         * defs.h (enum openp_flag, openp, source_full_path_of, mod_path)
1961         (add_path, directory_switch, source_path, init_source_path): Move
1962         declarations...
1963         * source.h (enum openp_flag, openp, source_full_path_of, mod_path)
1964         (add_path, directory_switch, source_path, init_source_path):
1965         ...here.
1966
1967 2018-02-14  Tom Tromey  <tom@tromey.com>
1968
1969         * solist.h (exec_file_find, solib_find): Return
1970         unique_xmalloc_ptr.
1971         (solib_bfd_fopen): Take a const char *.
1972         * solib.c (solib_find_1): Return unique_xmalloc_ptr.
1973         (exec_file_find, solib_find): Likewise.
1974         (solib_bfd_fopen): Do not take ownership of "pathname".
1975         (solib_bfd_open): Use unique_xmalloc_ptr.
1976         * solib-darwin.c (darwin_bfd_open): Use unique_xmalloc_ptr.
1977         * solib-aix.c (solib_aix_bfd_open): Use unique_xmalloc_ptr.
1978         * infrun.c (follow_exec): Use unique_xmalloc_ptr.
1979         * exec.c (exec_file_locate_attach): Use unique_xmalloc_ptr.
1980
1981 2018-02-14  Joel Brobecker  <brobecker@adacore.com>
1982
1983         * ada-lang.c (name_match_type_from_name): Remove reference to
1984         ada_name_for_lookup in function's documentation.
1985         * ada-lang.h (ada_name_for_lookup): Delete declaration.
1986
1987 2018-02-13  Simon Marchi  <simon.marchi@polymtl.ca>
1988
1989         * defs.h (enum openp_flags): New enum.
1990         (OPF_TRY_CWD_FIRST, OPF_SEARCH_IN_PATH, OPF_RETURN_REALPATH):
1991         Move to enum openp_flags.
1992         (openp_flags): New enum flags.
1993         (openp): Change parameter type to openp_flags.
1994         * source.c (openp): Change parameter type to openp_flags.
1995         * cli/cli-cmds.c (find_and_open_script): Use openp_flags.
1996         * dwarf2read.c (try_open_dwop_file): Use openp_flags.
1997
1998 2018-02-13  Simon Marchi  <simon.marchi@polymtl.ca>
1999
2000         * maint.c (_initialize_maint_cmds): Fix prefix of maint set/show
2001         per-command.
2002
2003 2018-02-12  Andrew Burgess  <andrew.burgess@embecosm.com>
2004
2005         * dwarf2read.c (dwarf2_release_queue): Delete function, move body
2006         into...
2007         (class dwarf2_queue_guard): ...the destructor of this new class.
2008         (dw2_do_instantiate_symtab): Create instance of the new class
2009         dwarf2_queue_guard, remove cleanup.
2010
2011 2018-02-09  Tom Tromey  <tom@tromey.com>
2012
2013         * source.c (find_source_lines): Don't reference past the end of
2014         the vector.
2015
2016 2018-02-09  Markus Metzger  <markus.t.metzger@intel.com>
2017
2018         * remote.c (remote_btrace_maybe_reopen): Change error message.
2019         * btrace.c (btrace_enable): Likewise.
2020         (parse_xml_btrace): Likewise.
2021         (parse_xml_btrace_conf): Likewise.
2022
2023 2018-02-09  Markus Metzger  <markus.t.metzger@intel.com>
2024
2025         * nat/linux-btrace.c (diagnose_perf_event_open_fail): New.
2026         (linux_enable_pt, linux_enable_bts): Call
2027         diagnose_perf_event_open_fail.
2028
2029 2018-02-09  Markus Metzger  <markus.t.metzger@intel.com>
2030
2031         * nat/linux-btrace.c (perf_event_pt_event_type): Improve error message.
2032         Remove parameter and change return type.  Update callers.  Move it.
2033         (linux_enable_bts, linux_enable_pt): Improve error message.
2034         (linux_enable_pt): Remove zero buffer size check.
2035         (linux_enable_btrace): Improve error messages.  Remove NULL return
2036         check.
2037
2038 2018-02-09  Markus Metzger  <markus.t.metzger@intel.com>
2039
2040         * btrace.c (btrace_enable): Remove target_supports_btrace call.
2041         * nat/linux-btrace.c (perf_event_pt_event_type): Move.
2042         (kernel_supports_bts, kernel_supports_pt, linux_supports_bts)
2043         (linux_supports_pt, linux_supports_btrace): Remove.
2044         (linux_enable_bts): Call cpu_supports_bts.
2045         * nat/linux-btrace.h (linux_supports_btrace): Remove.
2046         * remote.c (remote_supports_btrace): Remove.
2047         (init_remote_ops): Remove remote_supports_btrace.
2048         * target-delegates.c: Regenerated.
2049         * target.c (target_supports_btrace): Remove.
2050         * target.h (target_ops) <to_supports_btrace>: Remove
2051         (target_supports_btrace): Remove.
2052         * x86-linux-nat.c (x86_linux_create_target): Remove
2053         linux_supports_btrace.
2054
2055 2018-02-09  Markus Metzger  <markus.t.metzger@intel.com>
2056
2057         * nat/linux-btrace.c (linux_enable_btrace): Throw exception if enabling
2058         btrace failed.
2059         * x86-linux-nat.c (x86_linux_enable_btrace): Catch btrace enabling
2060         exception and use message in own exception.
2061
2062 2018-02-09  Markus Metzger  <markus.t.metzger@intel.com>
2063
2064         * nat/linux-btrace.c: Include scoped_fd.h and scoped_mmap.h.
2065         (perf_event_pt_event_type): Use gdb_file_up.
2066         (linux_enable_bts, linux_enable_pt): Use gdb::unique_xmalloc_ptr,
2067         scoped_fd, and scoped_mmap.
2068
2069 2018-02-09  Markus Metzger  <markus.t.metzger@intel.com>
2070
2071         * common/scoped_mmap.h: New.
2072         * unittests/scoped_mmap-selftest.c: New.
2073         * Makefile.in (SUBDIR_UNITTESTS_SRCS): Add
2074         unittests/scoped_mmap-selftest.c.
2075
2076 2018-02-09  Markus Metzger  <markus.t.metzger@intel.com>
2077
2078         * common/scoped_fd.h: New.
2079         * unittests/scoped_fd-selftest.c: New.
2080         * Makefile.in (SUBDIR_UNITTESTS_SRCS): Add
2081         unittests/scoped_fd-selftest.c.
2082
2083 2018-02-09  Tom Tromey  <tom@tromey.com>
2084
2085         * auto-load.c (auto_load_section_scripts): Use
2086         gdb::unique_xmalloc_ptr.
2087
2088 2018-02-09  Tom Tromey  <tom@tromey.com>
2089
2090         * auto-load.c (execute_script_contents): Use std::string.
2091
2092 2018-02-09  Joel Brobecker  <brobecker@adacore.com>
2093
2094         * NEWS <Changes in GDB 8.1>: Clarify that "rbreak" is a new
2095         Python function, rather than a new command.
2096
2097 2018-02-08  Tom Tromey  <tom@tromey.com>
2098
2099         * solib.c (solib_find_1): Use std::string.
2100         (solib_bfd_fopen): Use unique_xmalloc_ptr.
2101
2102 2018-02-08  Tom Tromey  <tom@tromey.com>
2103
2104         * build-id.c (build_id_to_debug_bfd): Use unique_xmalloc_ptr.
2105
2106 2018-02-08  Tom Tromey  <tom@tromey.com>
2107
2108         * source.c (find_source_lines): Use gdb::def_vector.
2109
2110 2018-02-08  Tom Tromey  <tom@tromey.com>
2111
2112         * macrocmd.c (struct temporary_macro_definition): New.
2113         (macro_define_command): Use temporary_macro_definition.  Remove
2114         cleanups.
2115         (free_macro_definition_ptr): Remove.
2116
2117 2018-02-08  Tom Tromey  <tom@tromey.com>
2118
2119         * macroexp.c (maybe_expand): Use std::string.
2120
2121 2018-02-08  Tom Tromey  <tom@tromey.com>
2122
2123         * macroexp.c (struct macro_buffer): Add initializers for some
2124         members.
2125         (init_buffer, init_shared_buffer, free_buffer)
2126         (free_buffer_return_text): Remove.
2127         (macro_buffer): New constructors.
2128         (~macro_buffer): New destructor.
2129         (macro_buffer::set_shared): New method.
2130         (macro_buffer::resize_buffer, macro_buffer::appendc)
2131         (macro_buffer::appendmem): Now methods, not free functions.
2132         (set_token, append_tokens_without_splicing, stringify)
2133         (macro_stringify): Update.
2134         (gather_arguments): Change return type.  Remove argc_p argument,
2135         add args_ptr argument.  Use std::vector.
2136         (substitute_args): Remove argc argument.  Accept std::vector.
2137         (expand): Update.  Use std::vector.
2138         (scan, macro_expand, macro_expand_next): Update.
2139
2140 2018-02-08  Tom Tromey  <tom@tromey.com>
2141
2142         * symtab.c (default_collect_symbol_completion_matches_break_on):
2143         Use unique_xmalloc_ptr.
2144         * macroscope.h: (sal_macro_scope, user_macro_scope)
2145         (default_macro_scope): Return unique_xmalloc_ptr.
2146         * macroscope.c (sal_macro_scope, user_macro_scope)
2147         (default_macro_scope): Return unique_xmalloc_ptr.
2148         * macroexp.h (macro_expand, macro_expand_once): Return
2149         unique_xmalloc_ptr.
2150         * macroexp.c (macro_expand, macro_expand_once): Return
2151         unique_xmalloc_ptr.
2152         * macrocmd.c (macro_expand_command, macro_expand_once_command)
2153         (info_macro_command, info_macros_command): Use
2154         unique_xmalloc_ptr.
2155         * compile/compile-c-support.c (write_macro_definitions): Use
2156         unique_xmalloc_ptr.
2157         * c-exp.y (c_parse): Use unique_xmalloc_ptr.
2158
2159 2018-02-07  Simon Marchi  <simon.marchi@ericsson.com>
2160
2161         * value.c (value_static_field): Assign field type instead of
2162         containing type when returning an optimized out value.
2163
2164 2018-02-06  Yao Qi  <yao.qi@linaro.org>
2165
2166         * ft32-tdep.c (ft32_read_pc): Remove.
2167         (ft32_write_pc): Remove.
2168         (ft32_gdbarch_init): Update.
2169         * m32r-tdep.c (m32r_read_pc): Remove.
2170         (m32r_gdbarch_init): Update.
2171         * mep-tdep.c (mep_read_pc): Remove.
2172         (mep_gdbarch_init): Update.
2173         * microblaze-tdep.c (microblaze_write_pc): Remove.
2174         (microblaze_gdbarch_init): Update.
2175         * mn10300-tdep.c (mn10300_read_pc): Remove.
2176         (mn10300_write_pc): Remove.
2177         (mn10300_gdbarch_init): Update.
2178         * moxie-tdep.c (moxie_read_pc): Remove.
2179         (moxie_write_pc): Remove.
2180         (moxie_gdbarch_init): Update.
2181
2182 2018-02-06  Yao Qi  <yao.qi@linaro.org>
2183
2184         * expprint.c (print_subexp_standard): Handle
2185         OP_F77_UNDETERMINED_ARGLIST.
2186         (dump_subexp_body_standard): Likewise.
2187
2188 2018-02-05  Alan Hayward  <alan.hayward@arm.com>
2189
2190         * target-descriptions.c (tdesc_element_visitor) Add empty
2191         implementations.
2192         (tdesc_type): Move make_gdb_type from here.
2193         (tdesc_type_builtin): Likewise.
2194         (tdesc_type_vector): Likewise.
2195         (tdesc_type_with_fields): Move make_gdb_type_ functions from here.
2196         (make_gdb_type_struct): Move from tdesc_type_with_fields.
2197         (make_gdb_type_union): Likewise.
2198         (make_gdb_type_flags): Likewise.
2199         (make_gdb_type_enum): Likewise.
2200         (make_gdb_type): New function.
2201         (tdesc_register_type): Use static make_gdb_type.
2202
2203 2018-02-05  Ruslan Kabatsayev <b7.10110111@gmail.com>
2204
2205         * infcmd.c (default_print_one_register_info): Align natural-format
2206         column values consistently one under another.
2207         (pad_to_column): New function.
2208
2209 2018-02-05  Joel Brobecker  <brobecker@adacore.com>
2210
2211         * dwarf2read.c (dwarf2_physname): Move commment.
2212
2213 2018-02-01  Leszek Swirski  <leszeks@google.com>
2214
2215         * varobj.c (varobj_formatted_print_options): Allow recursive
2216         pretty printing if pretty printing is enabled.
2217
2218 2018-02-01  Leszek Swirski  <leszeks@google.com>
2219
2220         * c-exp.y (lex_one_token, classify_name, yylex): Don't classify
2221         names after a structop as a filename.
2222
2223 2018-02-01  Yao Qi  <yao.qi@linaro.org>
2224
2225         * arm-tdep.c (arm_record_data_proc_misc_ld_str): Rewrite it.
2226         (arm_record_coproc_data_proc): Likewise.
2227
2228 2018-02-01  Yao Qi  <yao.qi@linaro.org>
2229
2230         * arm-tdep.c (arm_record_extension_space): Change ret to signed.
2231
2232 2018-01-31  Nikola Prica  <nikola.prica@rt-rk.com>
2233
2234         * rs6000-tdep.c (skip_prologue): Remove shifting for lr_reg and
2235         assign shifted lr_reg to fdata->lr_register when lr_reg is set.
2236
2237 2018-01-31  Pedro Alves  <palves@redhat.com>
2238
2239         * darwin-nat.c (darwin_interrupt): Remove ptid_t parameter.
2240         * inflow.c (child_terminal_save_inferior): Wrap reference to
2241         tcgetpgrp in HAVE_TERMIOS_H.
2242         (child_interrupt, child_pass_ctrlc): Wrap references to signal in
2243         _WIN32.
2244         * remote-sim.c (gdbsim_interrupt): Remove ptid_t parameter and
2245         always iterate over all inferiors.
2246         (gdbsim_cntrl_c): Adjust.
2247         * windows-nat.c (windows_interrupt): Remove 'ptid_t' parameter.
2248
2249 2018-01-31  Joel Brobecker  <brobecker@adacore.com>
2250
2251         * gdbtypes.c (lookup_array_range_type): Make sure the array's
2252         index type is objfile-owned if the element type is as well.
2253
2254 2018-01-31  Joel Brobecker  <brobecker@adacore.com>
2255
2256         GDB 8.1 released.
2257
2258 2018-01-30  Philipp Rudo  <prudo@linux.vnet.ibm.com>
2259
2260         * s390-linux-tdep.c: Remove includes "features/s390-linux32.c" and
2261         "features/s390x-linux64.c".
2262         (_initialize_s390_linux_tdep): Remove initialization of tdescs
2263         s390_linux32 and s390x_linux64.
2264         (s390_linux_init_abi_31, s390_linux_init_abi_64): Don't set
2265         default tdesc.
2266         * s390-tdep.c: Include "features/s390-linux32.c" and
2267         "features/s390x-linux64.c".
2268         (s390_tdesc_valid): Add check for tdesc_has_registers.
2269         (s390_gdbarch_init): Make sure there is always a valid tdesc.
2270         (_initialize_s390_tdep): Initialize tdesc_s390_linux32 and
2271         tdesc_s390x_linux64.
2272         * s390-linux-tdep.h: Move export of tdesc_s390_linux32 and
2273         tdesc_s390x_linux64 to...
2274         * s390-tdep.h: ...here.
2275
2276 2018-01-30  Pedro Alves  <palves@redhat.com>
2277
2278         PR gdb/13211
2279         * config.in, configure: Regenerate.
2280         * configure.ac: Check for getpgid.
2281         * go32-nat.c (go32_pass_ctrlc): New.
2282         (go32_target): Install it.
2283         * inf-child.c (inf_child_target): Install
2284         child_terminal_save_inferior, child_pass_ctrlc and
2285         child_interrupt.
2286         * inf-ptrace.c (inf_ptrace_interrupt): Delete.
2287         (inf_ptrace_target): No longer install it.
2288         * infcmd.c (interrupt_target_1): Adjust.
2289         * inferior.h (child_terminal_save_inferior, child_pass_ctrlc)
2290         (child_interrupt): Declare.
2291         (inferior::terminal_state): New.
2292         * inflow.c (struct terminal_info): Update comments.
2293         (inferior_process_group): Delete.
2294         (terminal_is_ours): Delete.
2295         (gdb_tty_state): New.
2296         (child_terminal_init): Adjust.
2297         (is_gdb_terminal, sharing_input_terminal_1)
2298         (sharing_input_terminal): New functions.
2299         (child_terminal_inferior): Adjust.  Use sharing_input_terminal.
2300         Set the process's actual process group in the foreground if
2301         possible.  Handle is_ours_for_output/is_ours distinction.  Don't
2302         mark terminal as the inferior's if not sharing GDB's terminal.
2303         Don't check attach_flag.
2304         (child_terminal_ours_for_output, child_terminal_ours): Adjust to
2305         pass down a target_terminal_state.
2306         (child_terminal_save_inferior): New, factored out from ...
2307         (child_terminal_ours_1): ... this.  Handle
2308         target_terminal_state::is_ours_for_output.
2309         (child_interrupt, child_pass_ctrlc): New.
2310         (inflow_inferior_exit): Clear the inferior's terminal_state.
2311         (copy_terminal_info): Copy the inferior's terminal state.
2312         (_initialize_inflow): Remove reference to terminal_is_ours.
2313         * inflow.h (inferior_process_group): Delete.
2314         * nto-procfs.c (nto_handle_sigint, procfs_interrupt): Adjust.
2315         * procfs.c (procfs_target): Don't install procfs_interrupt.
2316         (procfs_interrupt): Delete.
2317         * remote.c (remote_serial_quit_handler): Adjust.
2318         (remote_interrupt): Remove ptid parameter.  Adjust.
2319         * target-delegates.c: Regenerate.
2320         * target.c: Include "terminal.h".
2321         (target_terminal::terminal_state): Rename to ...
2322         (target_terminal::m_terminal_state): ... this.
2323         (target_terminal::init): Adjust.
2324         (target_terminal::inferior): Adjust to per-inferior
2325         terminal_state.
2326         (target_terminal::restore_inferior, target_terminal_is_ours_kind): New.
2327         (target_terminal::ours, target_terminal::ours_for_output): Use
2328         target_terminal_is_ours_kind.
2329         (target_interrupt): Remove ptid parameter.  Adjust.
2330         (default_target_pass_ctrlc): Adjust.
2331         * target.h (target_ops::to_terminal_save_inferior): New field.
2332         (target_ops::to_interrupt): Remove ptid_t parameter.
2333         (target_interrupt): Remove ptid_t parameter.  Update comment.
2334         (target_pass_ctrlc): Update comment.
2335         * target/target.h (target_terminal_state): New scoped enum,
2336         factored out of ...
2337         (target_terminal::terminal_state): ... here.
2338         (target_terminal::inferior): Update comments.
2339         (target_terminal::restore_inferior): New.
2340         (target_terminal::is_inferior, target_terminal::is_ours)
2341         (target_terminal::is_ours_for_output): Adjust.
2342         (target_terminal::scoped_restore_terminal_state): Adjust to
2343         rename, and call restore_inferior() instead of inferior().
2344         (target_terminal::scoped_restore_terminal_state::m_state): Change
2345         type.
2346         (target_terminal::terminal_state): Rename to ...
2347         (target_terminal::m_terminal_state): ... this and change type.
2348
2349 2018-01-30  Pedro Alves  <palves@redhat.com>
2350
2351         * linux-nat.c (wait_for_signal): New function.
2352         (wait_lwp, linux_nat_wait_1): Use it instead of calling sigsuspend
2353         directly.
2354         (async_terminal_is_ours)
2355         (linux_nat_terminal_inferior, linux_nat_terminal_ours): Delete.
2356         (linux_nat_add_target): Don't override
2357         to_terminal_inferior/to_terminal_ours.
2358
2359 2018-01-29  Sergio Durigan Junior  <sergiodj@redhat.com>
2360
2361         * remote.c (remote_follow_fork): Don't call "detach_inferior".
2362
2363 2018-01-28  Simon Marchi  <simon.marchi@ericsson.com>
2364
2365         * dwarf2read.c (free_dwo_files): Add forward-declaration.
2366         (dwarf2_per_objfile::~dwarf2_per_objfile): Move content from
2367         dwarf2_per_objfile_free here.
2368         (dwarf2_per_objfile_free): Remove.
2369         (_initialize_dwarf2_read): Don't register
2370         dwarf2_per_objfile_free as a registry cleanup.
2371
2372 2018-01-27  Eli Zaretskii  <eliz@gnu.org>
2373
2374         Avoid compilation errors in MinGW native builds
2375
2376         The error is triggered by including python-internal.h, and the
2377         error message is:
2378
2379              In file included from d:\usr\lib\gcc\mingw32\6.3.0\include\c++\math.h:36:0,
2380                       from build-gnulib/import/math.h:27,
2381                       from d:/usr/Python26/include/pyport.h:235,
2382                       from d:/usr/Python26/include/Python.h:58,
2383                       from python/python-internal.h:94,
2384                       from python/py-arch.c:24:
2385              d:\usr\lib\gcc\mingw32\6.3.0\include\c++\cmath:1157:11: error: '::hypot' has not been declared
2386         using ::hypot;
2387                 ^~~~~
2388
2389         This happens because Python headers define 'hypot' to expand t
2390         '_hypot' in the Windows builds.
2391         * python/python-internal.h (_hypot) [__MINGW32__]: Define back to
2392         'hypoth'.  This avoids a compilation error.
2393
2394 2018-01-26  Alan Hayward  <alan.hayward@arm.com>
2395
2396         * MAINTAINERS (Write After Approval): Fix ordering.
2397
2398 2018-01-26  Alan Hayward  <alan.hayward@arm.com>
2399
2400         * MAINTAINERS (Write After Approval): Add Alan Hayward.
2401
2402 2018-01-26  Alan Modra  <amodra@gmail.com>
2403
2404         * ppc-linux-tdep.c (powerpc32_plt_stub): Make const.
2405         (powerpc32_plt_stub_so_1): Rename from powerpc32_plt_stub_so.
2406         Remove nop.  Make const.  Comment.
2407         (powerpc32_plt_stub_so_2): New.
2408         (POWERPC32_PLT_CHECK_LEN): Rename from POWERPC32_PLT_STUB_LEN.
2409         Correct count.  Update uses.
2410         (ppc_skip_trampoline_code): Match powerpc32_plt_stub_so_2 too.
2411         Move common code reading PLT entry word.  Correct
2412         powerpc32_plt_stub PLT address calculation.
2413         * ppc64-tdep.c (ppc64_standard_linkage1): Make const.
2414         (ppc64_standard_linkage2, ppc64_standard_linkage3): Likewise.
2415         (ppc64_standard_linkage4, ppc64_standard_linkage5): Likewise.
2416         (ppc64_standard_linkage6, ppc64_standard_linkage7): Likewise.
2417         (ppc64_standard_linkage8): Likewise.
2418         * rs6000-tdep.c (ppc_insns_match_pattern): Make pattern const.
2419         Correct insns description.
2420         * ppc-tdep.h (ppc_insns_match_pattern): Update prototype.
2421
2422 2018-01-24  Pedro Alves  <palves@redhat.com>
2423
2424         GCC PR libstdc++/83906
2425         * gdbtypes.c (operator==(const dynamic_prop &,
2426         const dynamic_prop &)): New.
2427         (operator==(const range_bounds &, const range_bounds &)): New.
2428         (check_types_equal): Use them instead of memcmp.
2429         * gdbtypes.h (operator==(const dynamic_prop &,
2430         const dynamic_prop &)): Declare.
2431         (operator!=(const dynamic_prop &, const dynamic_prop &)): Declare.
2432         (operator==(const range_bounds &, const range_bounds &)): Declare.
2433         (operator!=(const range_bounds &, const range_bounds &)): Declare.
2434
2435 2018-01-23  Philipp Rudo  <prudo@linux.vnet.ibm.com>
2436
2437         * s390-linux-tdep.c (s390_record_address_mask)
2438         (s390_record_calc_disp_common, s390_record_calc_disp)
2439         (s390_record_calc_disp_vsce, s390_record_calc_rl, s390_popcnt)
2440         (s390_record_gpr_g, s390_record_gpr_h, s390_record_vr)
2441         (s390_process_record): Move to s390-tdep.c.
2442         (s390_linux_init_abi_any): Adjust.
2443         * s390-tdep.c (s390_record_address_mask)
2444         (s390_record_calc_disp_common, s390_record_calc_disp)
2445         (s390_record_calc_disp_vsce, s390_record_calc_rl, s390_popcnt)
2446         (s390_record_gpr_g, s390_record_gpr_h, s390_record_vr)
2447         (s390_process_record): Moved from s390-linux-tdep.c
2448         (s390_gdbarch_init): Adjust.
2449
2450 2018-01-23  Philipp Rudo  <prudo@linux.vnet.ibm.com>
2451
2452         * s390-linux-nat.c (s390-tdep.h): New include.
2453         * Makefile.in (ALL_TARGET_OBS): Add s390-tdep.o.
2454         (HFILES_NO_SRCDIR): Add s390-tdep.h.
2455         (ALLDEPFILES): Add s390-tdep.c.
2456         * configure.tgt (s390*-*-linux*): Add s390-tdep.o.
2457         * s390-linux-tdep.h (HWCAP_S390_*, S390_*_REGNUM): Move to...
2458         * s390-tdep.h: ...this.  New file.
2459         * s390-linux-tdep.c (s390-tdep.h): New include.
2460         (_initialize_s390_tdep): Rename to...
2461         (_initialize_s390_linux_tdep): ...this and adjust.
2462         (s390_abi_kind, s390_vector_abi_kind, gdbarch_tdep)
2463         (enum named opcodes, S390_NUM_GPRS, S390_NUM_FPRS): Move to
2464         s390-tdep.h.
2465         (s390_break_insn, s390_breakpoint, s390_readinstruction, is_ri)
2466         (is_ril, is_rr, is_rre, is_rs, is_rsy, is_rx, is_rxy)
2467         (s390_is_partial_instruction, s390_software_single_step)
2468         (is_non_branch_ril, s390_displaced_step_copy_insn)
2469         (s390_displaced_step_fixup, s390_displaced_step_hw_singlestep)
2470         (s390_prologue_data, s390_addr, s390_store, s390_load)
2471         (s390_check_for_saved, s390_analyze_prologue, s390_skip_prologue)
2472         (s390_register_call_saved, s390_guess_tracepoint_registers)
2473         (s390_register_name, s390_dwarf_regmap, s390_dwarf_reg_to_regnum)
2474         (regnum_is_gpr_full, regnum_is_vxr_full, s390_value_from_register)
2475         (s390_pseudo_register_name, s390_pseudo_register_type)
2476         (s390_pseudo_register_read, s390_pseudo_register_write)
2477         (s390_pseudo_register_reggroup_p, s390_ax_pseudo_register_collect)
2478         (s390_ax_pseudo_register_push_stack, s390_gen_return_address)
2479         (s390_addr_bits_remove, s390_address_class_type_flags)
2480         (s390_address_class_type_flags_to_name)
2481         (s390_address_class_name_to_type_flags, s390_effective_inner_type)
2482         (s390_function_arg_float, s390_function_arg_vector)
2483         (is_power_of_two, s390_function_arg_integer, s390_arg_state)
2484         (s390_handle_arg, s390_push_dummy_call, s390_dummy_id)
2485         (s390_frame_align, s390_register_return_value, s390_return_value)
2486         (s390_stack_frame_destroyed_p, s390_unwind_pc, s390_unwind_sp)
2487         (s390_unwind_pseudo_register, s390_adjust_frame_regnum)
2488         (s390_dwarf2_prev_register, s390_dwarf2_frame_init_reg)
2489         (s390_trad_frame_prev_register, s390_unwind_cache)
2490         (s390_prologue_frame_unwind_cache)
2491         (s390_backchain_frame_unwind_cache, s390_frame_unwind_cache)
2492         (s390_frame_this_id, s390_frame_prev_register, s390_frame_unwind)
2493         (s390_stub_unwind_cache, s390_stub_frame_unwind_cache)
2494         (s390_stub_frame_this_id, s390_stub_frame_prev_register)
2495         (s390_stub_frame_sniffer, s390_stub_frame_unwind)
2496         (s390_frame_base_address, s390_local_base_address)
2497         (s390_frame_base, s390_gcc_target_options)
2498         (s390_gnu_triplet_regexp, s390_stap_is_single_operand)
2499         (s390_validate_reg_range, s390_tdesc_valid)
2500         (s390_gdbarch_tdep_alloc, s390_gdbarch_init): Move to...
2501         * s390-tdep.c: ...this.  New file.
2502
2503 2018-01-23  Philipp Rudo  <prudo@linux.vnet.ibm.com>
2504
2505         * s390-linux-tdep.c (gdbarch_tdep.s390_syscall_record): New hook.
2506         (s390_process_record, s390_gdbarch_tdep_alloc)
2507         (s390_linux_init_abi_any): Use/set new hook.
2508
2509 2018-01-23  Philipp Rudo  <prudo@linux.vnet.ibm.com>
2510
2511         * s390-linux-tdep.c (osabi.h): New include.
2512         (s390_linux_init_abi_31, s390_linux_init_abi_64)
2513         (s390_linux_init_abi_any): New functions.
2514         (s390_gdbarch_init, _initialize_s390_tdep): Adjust.
2515
2516 2018-01-23  Philipp Rudo  <prudo@linux.vnet.ibm.com>
2517
2518         * s390-linux-tdep.c (s390_gdbarch_init): Use gdb_assert for
2519         tdesc_has_registers check
2520
2521 2018-01-23  Philipp Rudo  <prudo@linux.vnet.ibm.com>
2522
2523         * s390-linux-tdep.c (s390_tdesc_valid): New function.
2524         (s390_validate_reg_range): New macro.
2525         (s390_gdbarch_init): Adjust.
2526
2527 2018-01-23  Philipp Rudo  <prudo@linux.vnet.ibm.com>
2528
2529         * s390-linux-tdep.c (gdbarch_tdep) <tdesc>: New field.
2530         (s390_gdbarch_tdep_alloc): Adjust.
2531         (s390_gdbarch_init): Adjust.
2532
2533 2018-01-23  Philipp Rudo  <prudo@linux.vnet.ibm.com>
2534
2535         * s390-linux-tdep.c (gdbarch_tdep) <have_linux_v1, have_linux_v2>
2536         <have_tdb>: Change type to bool.
2537         (s390_gdbarch_tdep_alloc): Adjust.
2538         (s390_gdbarch_init): Adjust.
2539
2540 2018-01-23  Philipp Rudo  <prudo@linux.vnet.ibm.com>
2541
2542         * s390-linux-tdep (s390_abi_kind) <ABI_NONE>: New default field.
2543         (gdbarch_tdep) <have_upper, have_vx>: New fields.
2544         (s390_gdbarch_tdep_alloc): New function.
2545         (s390_gdbarch_init): Allocate tdep at start and use its fields
2546         instead of separate variables.
2547
2548 2018-01-23  Philipp Rudo  <prudo@linux.vnet.ibm.com>
2549
2550         * s390-linux-tdep.c (s390_gdbarch_init): Remove duplicate checks
2551         when looking for cached gdbarch and add comment for remaining.
2552
2553 2018-01-22  Pedro Alves  <palves@redhat.com>
2554             Sergio Durigan Junior  <sergiodj@redhat.com>
2555
2556         * typeprint.c (whatis_exp): Initialize "val" in the "whatis type"
2557         case.
2558
2559 2018-01-22  Maciej W. Rozycki  <macro@mips.com>
2560
2561         * MAINTAINERS: Update my company e-mail address.
2562
2563 2018-01-22  Yao Qi  <yao.qi@linaro.org>
2564
2565         * regcache.c (cooked_write_test): New function.
2566         (_initialize_regcache): Register the test.
2567
2568 2018-01-22  Yao Qi  <yao.qi@linaro.org>
2569
2570         * ia64-tdep.c (ia64_pseudo_register_read): Call
2571         regcache->cooked_read instead of regcache_cooked_read_unsigned.
2572         * m32c-tdep.c (m32c_cat_read): Likewise.
2573         (m32c_r3r2r1r0_read): Likewise.
2574         * m68hc11-tdep.c (m68hc11_pseudo_register_read): Likewise.
2575         * xtensa-tdep.c (xtensa_register_read_masked): Likewise.
2576
2577 2018-01-22  Yao Qi  <yao.qi@linaro.org>
2578
2579         * aarch64-tdep.c (aarch64_pseudo_read_value): Call regcache
2580         method raw_read instead of regcache_raw_read.
2581         * amd64-tdep.c (amd64_pseudo_register_read_value): Likewise.
2582         * arm-tdep.c (arm_neon_quad_read): Likewise.
2583         * avr-tdep.c (avr_pseudo_register_read): Likewise.
2584         * bfin-tdep.c (bfin_pseudo_register_read): Likewise.
2585         * frv-tdep.c (frv_pseudo_register_read): Likewise.
2586         * h8300-tdep.c (h8300_pseudo_register_read): Likewise.
2587         * i386-tdep.c (i386_mmx_regnum_to_fp_regnum): Likewise.
2588         (i386_pseudo_register_read_into_value): Likewise.
2589         * mep-tdep.c (mep_pseudo_cr32_read): Likewise.
2590         * msp430-tdep.c (msp430_pseudo_register_read): Likewise.
2591         * nds32-tdep.c (nds32_pseudo_register_read): Likewise.
2592         * rl78-tdep.c (rl78_pseudo_register_read): Likewise.
2593         * s390-linux-tdep.c (s390_pseudo_register_read): Likewise.
2594         * sparc-tdep.c (sparc32_pseudo_register_read):  Likewise.
2595         * sparc64-tdep.c (sparc64_pseudo_register_read): Likewise.
2596         * spu-tdep.c (spu_pseudo_register_read_spu):  Likewise.
2597         * xtensa-tdep.c (xtensa_pseudo_register_read): Likewise.
2598
2599 2018-01-22  Yao Qi  <yao.qi@linaro.org>
2600
2601         * Makefile.in (ALL_TARGET_OBS): Remove mt-tdep.o.
2602         * configure.tgt: Remove target mt.
2603         * mt-tdep.c: Remove.
2604         * regcache.c (cooked_read_test): Remove the check for mt.
2605
2606 2018-01-22  Yao Qi  <yao.qi@linaro.org>
2607
2608         * jit.c (jit_frame_prev_register): Call regcache::cooked_read
2609         instead of gdbarch_pseudo_register_read_value.
2610
2611 2018-01-22  Joel Brobecker  <brobecker@adacore.com>
2612
2613         * dwarf2read.c (need_gnat_info): Return nonzero if the cu's
2614         language is Ada.
2615
2616 2018-01-22  Joel Brobecker  <brobecker@adacore.com>
2617
2618         * linespec.c (create_sals_line_offset): Remove code that preserved
2619         the symtab_and_line's line number.
2620
2621 2018-01-21  Andrew Burgess  <andrew.burgess@embecosm.com>
2622
2623         * varobj.c (varobj_create): Don't set valid_block when creating a
2624         floating varobj.
2625
2626 2018-01-21  Andrew Burgess  <andrew.burgess@embecosm.com>
2627
2628         * varobj.c (varobj_create): Remove out of date comment.
2629
2630 2018-01-21  Andrew Burgess  <andrew.burgess@embecosm.com>
2631
2632         PR mi/20395
2633         * ada-exp.y (write_var_from_sym): Pass extra parameter when
2634         updating innermost block.
2635         * parse.c (innermost_block_tracker::update): Take extra type
2636         parameter, and check types match before updating innermost block.
2637         (write_dollar_variable): Update innermost block for registers.
2638         * parser-defs.h (enum innermost_block_tracker_type): New enum.
2639         (innermost_block_tracker::innermost_block_tracker): Initialise
2640         m_types member.
2641         (innermost_block_tracker::reset): Take type parameter.
2642         (innermost_block_tracker::update): Take type parameter, and pass
2643         type through as needed.
2644         (innermost_block_tracker::m_types): New member.
2645         * varobj.c (varobj_create): Pass type when reseting innermost
2646         block.
2647
2648 2018-01-21  Andrew Burgess  <andrew.burgess@embecosm.com>
2649
2650         * ada-exp.y (write_var_from_sym): Switch to innermost_block API.
2651         * ada-lang.c (resolve_subexp): Likewise.
2652         * breakpoint.c (set_breakpoint_condition) Likewise.
2653         (watch_command_1) Likewise.
2654         * c-exp.y (variable): Likewise.
2655         * d-exp.y (PrimaryExpression): Likewise.
2656         * f-exp.y (variable): Likewise.
2657         * go-exp.y (variable): Likewise.
2658         * m2-exp.y (variable): Likewise.
2659         * objfiles.c (objfile::~objfile): Likewise.
2660         * p-exp.y (variable): Likewise.
2661         * parse.c (innermost_block): Change type.
2662         * parser-defs.h (class innermost_block_tracker): New.
2663         (innermost_block): Change to innermost_block_tracker.
2664         * printcmd.c (display_command): Switch to innermost_block API.
2665         (do_one_display): Likewise.
2666         * rust-exp.y (do_one_display): Likewise.
2667         * symfile.c (clear_symtab_users): Likewise.
2668         * varobj.c (varobj_create): Switch to innermost_block API, replace
2669         use of innermost_block with block stored on varobj object.
2670
2671 2018-01-21  Andrew Burgess  <andrew.burgess@embecosm.com>
2672
2673         * expression.h (innermost_block): Remove declaration.
2674         * varobj.c: Add 'parser-defs.h' include.
2675
2676 2018-01-19  Tom Tromey  <tom@tromey.com>
2677
2678         * rust-lang.c (rust_lookup_symbol_nonlocal): Look up qualified
2679         symbols in the static and global blocks.
2680
2681 2018-01-19  James Clarke  <jrtc27@jrtc27.com>
2682
2683         * nat/linux-ptrace.c: Remove unnecessary reinclusion of
2684         gdb_ptrace.h, and move including gdb_wait.h ...
2685         * nat/linux-ptrace.h: ... to here.
2686
2687 2018-01-19  Simon Marchi  <simon.marchi@ericsson.com>
2688
2689         * inf-ptrace.c (inf_ptrace_detach): Adjust call to
2690         inf_ptrace_detach_success.
2691         (inf_ptrace_detach_success): Add inferior parameter, use it
2692         instead of inferior_ptid, pass it to detach_inferior.
2693         * inf-ptrace.h (inf_ptrace_detach_success): Add inferior
2694         parameter.
2695         * inferior.c (detach_inferior): Add overload that takes an
2696         inferior object.
2697         * inferior.h (detach_inferior): Likewise.
2698         * linux-nat.c (linux_nat_detach): Use the inf parameter, don't
2699         use inferior_ptid, adjust call to inf_ptrace_detach_success.
2700         * linux-thread-db.c (thread_db_detach): Use inf parameter.
2701
2702 2018-01-19  Simon Marchi  <simon.marchi@ericsson.com>
2703
2704         * target.h (struct target_ops) <to_detach>: Add inferior
2705         parameter.
2706         (target_detach): Likewise.
2707         * target.c (dispose_inferior): Pass inferior down.
2708         (target_detach): Pass inferior down.  Assert that it is equal to
2709         the current inferior.
2710         * aix-thread.c (aix_thread_detach): Pass inferior down.
2711         * corefile.c (core_file_command): Pass current_inferior() down.
2712         * corelow.c (core_detach): Add inferior parameter.
2713         * darwin-nat.c (darwin_detach): Likewise.
2714         * gnu-nat.c (gnu_detach): Likewise.
2715         * inf-ptrace.c (inf_ptrace_detach): Likewise.
2716         * infcmd.c (detach_command): Pass current_inferior() down to
2717         target_detach.
2718         * infrun.c (follow_fork_inferior): Pass parent_inf to
2719         target_detach.
2720         (handle_vfork_child_exec_or_exit): Pass inf->vfork_parent to
2721         target_detach.
2722         * linux-nat.c (linux_nat_detach): Add inferior parameter.
2723         * linux-thread-db.c (thread_db_detach): Likewise.
2724         * nto-procfs.c (procfs_detach): Likewise.
2725         * procfs.c (procfs_detach): Likewise.
2726         * record.c (record_detach): Likewise.
2727         * record.h (struct inferior): Forward-declare.
2728         (record_detach): Add inferior parameter.
2729         * remote-sim.c (gdbsim_detach): Likewise.
2730         * remote.c (remote_detach_1): Likewise.
2731         (remote_detach): Likewise.
2732         (extended_remote_detach): Likewise.
2733         * sol-thread.c (sol_thread_detach): Likewise.
2734         * target-debug.h (target_debug_print_inferior_p): New macro.
2735         * target-delegates.c: Re-generate.
2736         * top.c (kill_or_detach): Pass inferior down to target_detach.
2737         * windows-nat.c (windows_detach): Add inferior parameter.
2738
2739 2018-01-19  Simon Marchi  <simon.marchi@ericsson.com>
2740
2741         * target.h (struct target_ops) <to_detach>: Remove args
2742         parameter.
2743         (target_detach): Likewise.
2744         * target.c (dispose_inferior): Adjust.
2745         (target_detach): Remove args parameter, adjust.
2746         * aix-thread.c (aix_thread_detach): Adjust.
2747         * corefile.c (core_file_command): Adjust.
2748         * corelow.c (core_detach): Adjust.
2749         * darwin-nat.c (darwin_detach): Adjust.
2750         * gnu-nat.c (gnu_detach): Adjust.
2751         * inf-ptrace.c (inf_ptrace_detach): Adjust.
2752         * infcmd.c (detach_command): Adjust
2753         * infrun.c (follow_fork_inferior): Adjust.
2754         (handle_vfork_child_exec_or_exit): Adjust.
2755         * linux-fork.c (linux_fork_detach): Remove args parameter.
2756         * linux-fork.h (linux_fork_detach): Likewise.
2757         * linux-nat.c (linux_nat_detach): Likewise, and adjust.
2758         * linux-thread-db.c (thread_db_detach): Likewise.
2759         * nto-procfs.c (procfs_detach): Likewise.
2760         * procfs.c (procfs_detach): Likewise.
2761         (do_detach): Remove signo parameter.
2762         * record.c (record_detach): Remove args parameter.
2763         * record.h (record_detach): Likewise.
2764         * remote-sim.c (gdbsim_detach): Likewise.
2765         * remote.c (remote_detach_1): Likewise.
2766         (remote_detach): Likewise.
2767         (extended_remote_detach): Likewise.
2768         * sol-thread.c (sol_thread_detach): Likewise.
2769         * target-delegates.c: Re-generate.
2770         * top.c (struct qt_args) <args>: Remove field.
2771         (kill_or_detach): Don't pass args.
2772         (quit_force): Don't set args.
2773         * windows-nat.c (windows_detach): Remove args parameter.
2774
2775 2018-01-19  Yao Qi  <yao.qi@linaro.org>
2776
2777         * arm-linux-tdep.c (arm_linux_gcc_target_options): New function.
2778         (arm_linux_init_abi): Install it.
2779
2780 2018-01-19  Yao Qi  <yao.qi@linaro.org>
2781
2782         * osabi.c (gdb_osabi_names): Extend the regexp for
2783         arm-linux-gnueabihf.
2784
2785 2018-01-18  Yao Qi  <yao.qi@linaro.org>
2786
2787         * dwarf2read.c (abbrev_table) <abbrevs>: Rename it to
2788         m_abbrevs.
2789         (abbrev_table::add_abbrev): Update.
2790         (abbrev_table::lookup_abbrev): Update.
2791
2792 2018-01-18  Yao Qi  <yao.qi@linaro.org>
2793
2794         * ppc-linux-tdep.c (ppu2spu_prev_register): Call cooked_read.
2795
2796 2018-01-17  Sergio Durigan Junior  <sergiodj@redhat.com>
2797
2798         * compile/compile.c (compile_to_object): Convert "triplet_rx"
2799         to "std::string".
2800
2801 2018-01-17  Tom Tromey  <tom@tromey.com>
2802
2803         * dwarf2read.c (symbolp): Remove typedef.  Don't instantiate VEC.
2804
2805 2018-01-17  Tom Tromey  <tom@tromey.com>
2806
2807         * gdbtypes.h (add_dyn_prop): Remove objfile parameter.
2808         * gdbtypes.c (add_dyn_prop): Remove objfile parameter.
2809         (create_array_type_with_stride): Update.
2810         * dwarf2read.c (set_die_type): Update.
2811
2812 2018-01-17  Tom Tromey  <tom@tromey.com>
2813
2814         * dwarf2read.c (delayed_method_info): Remove typedef.
2815         (dwarf2_cu::method_info): Now a std::vector.
2816         (add_to_method_list): Update.
2817         (free_delayed_list): Remove.
2818         (compute_delayed_physnames): Update.
2819         (process_full_comp_unit, process_full_type_unit): Clear the method
2820         list.  Remove cleanups.
2821         (psymtab_include_file_name): Add name_holder parameter.  Use
2822         unique_xmalloc_ptr.
2823         (dwarf_decode_lines): Update.
2824
2825 2018-01-17  Tom Tromey  <tom@tromey.com>
2826             Simon Marchi  <simon.marchi@ericsson.com>
2827
2828         * dwarf2read.c (struct dwarf2_cu): Add constructor, destructor.
2829         (dwarf2_per_objfile::free_cached_comp_units)
2830         (init_tu_and_read_dwo_dies, init_cutu_and_read_dies)
2831         (init_cutu_and_read_dies_no_follow): Update.
2832         (dwarf2_cu::dwarf2_cu): Rename from init_one_comp_unit.
2833         (dwarf2_cu::~dwarf2_cu): New.
2834         (free_heap_comp_unit, free_stack_comp_unit): Remove.
2835         (age_cached_comp_units, free_one_cached_comp_unit): Update.
2836
2837 2018-01-17  Tom Tromey  <tom@tromey.com>
2838             Simon Marchi  <simon.marchi@ericsson.com>
2839
2840         * dwarf2read.c (struct dwarf2_cu) <abbrev_table>: Remove.
2841         (struct die_reader_specs) <abbrev_table>: New member.
2842         (struct abbrev_table): Add constructor.
2843         <alloc_abbrev, add_abbrev, lookup_abbrev>: Declare.
2844         <abbrev_obstack>: Now an auto_obstack.
2845         (abbrev_table_up): New typedef.
2846         (init_cu_die_reader): Add abbrev_table parameter.
2847         (read_cutu_die_from_dwo): Remove abbrev_table_provided parameter.
2848         Add result_dwo_abbrev_table.
2849         (init_tu_and_read_dwo_dies, init_cutu_and_read_dies)
2850         (init_cutu_and_read_dies_no_follow, build_type_psymtabs_1):
2851         Update.
2852         (peek_die_abbrev): Take die_reader_specs, not dwarf_cu as
2853         parameter.
2854         (skip_children): Update.
2855         (abbrev_table::alloc_abbrev): Rename from
2856         abbrev_table_alloc_abbrev.
2857         (abbrev_table::add_abbrev): Rename from abbrev_table_add_abbrev.
2858         (abbrev_table::lookup_abbrev): Rename from
2859         abbrev_table_lookup_abbrev.
2860         (abbrev_table_read_table): Return abbrev_table_up.
2861         (abbrev_table_free, abbrev_table_free_cleanup)
2862         (dwarf2_read_abbrevs, dwarf2_free_abbrev_table): Remove.
2863         (load_partial_dies): Update.
2864
2865 2018-01-17  Tom Tromey  <tom@tromey.com>
2866
2867         * dwarf2read.c (dwarf2_compute_name): Update comment.
2868         (read_func_scope, read_variable): Update.
2869         (new_symbol): Remove.
2870         (new_symbol_full): Rename to new_symbol.
2871
2872 2018-01-17  Mike Gulick  <mgulick@mathworks.com>
2873
2874         PR gdb/16577
2875         * gdb_bfd.c (gdb_bfd_map_section): If unable to read object file, issue
2876         a warning instead of throwing an error, set section size to 0 and return
2877         NULL.
2878         * gdb_bfd.h (gdb_bfd_map_section): Update description.
2879
2880 2018-01-17  Simon Marchi  <simon.marchi@ericsson.com>
2881
2882         * nat/linux-ptrace.h (linux_ptrace_attach_fail_reason): Return
2883         std::string.
2884         (linux_ptrace_attach_fail_reason_string): Likewise.
2885         * nat/linux-ptrace.c (linux_ptrace_attach_fail_reason):
2886         Likewise.
2887         (linux_ptrace_attach_fail_reason_string): Likewise.
2888         * linux-nat.c (attach_proc_task_lwp_callback): Adjust.
2889
2890 2018-01-17  Simon Marchi  <simon.marchi@ericsson.com>
2891
2892         * linux-nat.c (linux_nat_attach): Remove xstrdup.
2893
2894 2018-01-17  Eldar Abusalimov  <eldar.abusalimov@jetbrains.com>
2895
2896         PR gdb/21559
2897         * configure.ac: Include <sys/types.h> prior to <sys/user.h> when
2898         checking for fs_base/gs_base fields in struct user_regs_struct.
2899         * configure: Regenerate.
2900
2901 2018-01-17  Yao Qi  <yao.qi@linaro.org>
2902
2903         * aarch64-linux-tdep.c (aarch64_linux_gcc_target_options): New
2904         function.
2905         (aarch64_linux_init_abi): Install it to gdbarch hook
2906         gcc_target_options.
2907
2908 2018-01-15  Pedro Alves  <palves@redhat.com>
2909
2910         * common/signals-state-save-restore.c
2911         (save_original_signals_state): Fix typos.
2912
2913 2017-01-12  Tom Tromey  <tom@tromey.com>
2914             Sergio Durigan Junior  <sergiodj@redhat.com>
2915
2916         * Makefile.in (install-only): Install gdb-add-index.
2917
2918 2018-01-12  John Baldwin  <jhb@FreeBSD.org>
2919
2920         * fbsd-tdep.c (KVE_PROTECTION): Correct value.
2921
2922 2018-01-12  Andreas Arnez  <arnez@linux.vnet.ibm.com>
2923
2924         * infrun.c (keep_going_pass_signal): Clear step-over info when
2925         insert_breakpoints fails.
2926
2927 2018-01-11  Pedro Alves  <palves@redhat.com>
2928
2929         PR gdb/22583
2930         * infrun.c (resume): Rename to ...
2931         (resume_1): ... this.
2932         (resume): Reimplement as wrapper around resume_1.
2933
2934 2018-01-11  Pedro Alves  <palves@redhat.com>
2935
2936         PR remote/22597
2937         * remote.c (remote_parse_stop_reply): Default to the last-set
2938         general thread instead of to 'magic_null_ptid'.
2939
2940 2018-01-10  Pedro Alves  <palves@redhat.com>
2941
2942         * language.h (language_get_symbol_name_matcher): Rename ...
2943         (get_symbol_name_matcher): ... this.
2944         * language.c (language_get_symbol_name_matcher): Ditto.
2945         * dictionary.c, linespec.c, minsyms.c, psymtab.c, symtab.c: All
2946         callers adjusted.
2947
2948 2018-01-10  Pedro Alves  <palves@redhat.com>
2949
2950         PR gdb/22670
2951         * dwarf2read.c
2952         (gdb_index_symbol_name_matcher::gdb_index_symbol_name_matcher):
2953         Adjust to use language_get_symbol_name_matcher instead of
2954         language_defn::la_get_symbol_name_matcher.
2955         * language.c (language_get_symbol_name_matcher): If in Ada mode
2956         and the lookup name is a verbatim match, return Ada's matcher.
2957         * language.h (language_get_symbol_name_matcher): Adjust comment.
2958         (ada_lookup_name_info::verbatim_p):: New method.
2959
2960 2018-01-10  Pedro Alves  <palves@redhat.com>
2961
2962         PR gdb/22670
2963         * ada-lang.c (ada_collect_symbol_completion_matches): If the
2964         minsym's language is language_auto or language_cplus, pass down
2965         language_ada instead.
2966         * symtab.c (compare_symbol_name): Don't frob symbol language here.
2967
2968 2018-01-10  Pedro Alves  <palves@redhat.com>
2969
2970         PR gdb/22670
2971         * minsyms.c (linkage_name_str): New function.
2972         (iterate_over_minimal_symbols): Use it.
2973
2974 2018-01-09  John Baldwin  <jhb@FreeBSD.org>
2975
2976         * NEWS: Document that 'info proc' now works on FreeBSD.
2977
2978 2018-01-09  John Baldwin  <jhb@FreeBSD.org>
2979
2980         * configure.ac: Check for kinfo_getfile in libutil.
2981         * configure: Regenerate.
2982         * config.in: Regenerate.
2983         * fbsd-nat.c: Include "fbsd-tdep.h".
2984         (fbsd_fetch_cmdline): New.
2985         (fbsd_fetch_kinfo_proc): Move earlier and change to return a bool
2986         rather than calling error.
2987         (fbsd_info_proc): New.
2988         (fbsd_thread_name): Report error if fbsd_fetch_kinfo_proc fails.
2989         (fbsd_wait): Report warning if fbsd_fetch_kinfo_proc fails.
2990         (fbsd_nat_add_target): Set "to_info_proc" to "fbsd_info_proc".
2991
2992 2018-01-09  John Baldwin  <jhb@FreeBSD.org>
2993
2994         * fbsd-nat.c (struct free_deleter): Remove.
2995         (fbsd_find_memory_regions): Use gdb::unique_xmalloc_ptr<>.
2996
2997 2018-01-09  John Baldwin  <jhb@FreeBSD.org>
2998
2999         * fbsd-nat.c (fbsd_pid_to_exec_file) [KERN_PROC_PATHNAME]: Return
3000         NULL for an empty pathname.
3001
3002 2018-01-09  John Baldwin  <jhb@FreeBSD.org>
3003
3004         * fbsd-tdep.c (KVE_STRUCTSIZE, KVE_START, KVE_END, KVE_OFFSET)
3005         (KVE_FLAGS, KVE_PROTECTION, KVE_PATH, KINFO_VME_PROT_READ)
3006         (KINFO_VME_PROT_WRITE, KINFO_VME_PROT_EXEC, KINFO_VME_FLAG_COW)
3007         (KINFO_VME_FLAG_NEEDS_COPY, KINFO_VME_FLAG_NOCOREDUMP)
3008         (KINFO_VME_FLAG_SUPER, KINFO_VME_FLAG_GROWS_UP)
3009         (KINFO_VME_FLAG_GROWS_DOWN, KF_STRUCTSIZE, KF_TYPE, KF_FD)
3010         (KF_PATH, KINFO_FILE_TYPE_VNODE, KINFO_FILE_FD_TYPE_CWD)
3011         (KINFO_FILE_FD_TYPE_TEXT, SIG_WORDS, struct kinfo_proc_layout)
3012         (kinfo_proc_layout_32, kinfo_proc_layout_i386)
3013         (kinfo_proc_layout_64, fbsd_vm_map_entry_flags)
3014         (fbsd_core_info_proc_mappings, fbsd_core_vnode_path)
3015         (fbsd_core_fetch_timeval, fbsd_print_sigset)
3016         (fbsd_core_info_proc_status, fbsd_core_info_proc): New.
3017         (fbsd_init_abi):  Install gdbarch "core_info_proc" method.
3018         * fbsd-tdep.h (fbsd_vm_map_entry_flags): New.
3019
3020 2018-01-08  Samuel Thibault  <samuel.thibault@ens-lyon.org>
3021
3022         * gdb/gnu-nat.c: Include <elf.h> and <link.h>.
3023         (gnu_xfer_auxv): New function.
3024         (gnu_xfer_partial): Call gnu_xfer_auxv when `object' is
3025         TARGET_OBJECT_AUXV.
3026
3027 2018-01-08  Yao Qi  <yao.qi@linaro.org>
3028             Simon Marchi  <simon.marchi@ericsson.com>
3029
3030         * Makefile.in (COMMON_SFILES): Remove selftest-arch.c and
3031         common/selftest.c.
3032         (COMMON_OBS): Remove selftest.o.
3033         * configure.ac: Append selftest-arch.c and common/selftest.c to
3034         CONFIG_SRCS.  Append selftest-arch.o and selftest.o to COMMON_OBS.
3035         * configure: Re-generated.
3036         * maint.c (maintenance_selftest): Wrap selftests::run_tests with
3037         GDB_SELF_TEST.
3038         (maintenance_info_selftests): Likewise.
3039
3040 2018-01-08  Xavier Roirand  <roirand@adacore.com>
3041
3042         * ada-valprint.c (val_print_packed_array_elements): Use
3043         proper number of elements when printing an array indexed
3044         by an enumeration type.
3045
3046 2018-01-07  Simon Marchi  <simon.marchi@polymtl.ca>
3047
3048         * dwarf2read.c (struct dwarf2_cu) <dwarf2_per_objfile>: Remove.
3049         (dw2_get_file_names_reader): Adjust.
3050         (lookup_dwo_signatured_type): Adjust.
3051         (lookup_dwp_signatured_type): Adjust.
3052         (lookup_signatured_type): Adjust.
3053         (create_type_unit_group): Adjust.
3054         (get_type_unit_group): Adjust.
3055         (process_psymtab_comp_unit_reader): Adjust.
3056         (build_type_psymtabs_reader): Adjust.
3057         (scan_partial_symbols): Adjust.
3058         (add_partial_symbol): Adjust.
3059         (add_partial_subprogram): Adjust.
3060         (peek_die_abbrev): Adjust.
3061         (fixup_go_packaging): Adjust.
3062         (process_imported_unit_die): Adjust.
3063         (dwarf2_compute_name): Adjust.
3064         (dwarf2_physname): Adjust.
3065         (read_import_statement): Adjust.
3066         (handle_DW_AT_stmt_list): Adjust.
3067         (read_file_scope): Adjust.
3068         (read_func_scope): Adjust.
3069         (read_lexical_block_scope): Adjust.
3070         (read_call_site_scope): Adjust.
3071         (read_variable): Adjust.
3072         (dwarf2_rnglists_process): Adjust.
3073         (dwarf2_ranges_process): Adjust.
3074         (dwarf2_ranges_read): Adjust.
3075         (dwarf2_get_pc_bounds): Adjust.
3076         (dwarf2_record_block_ranges): Adjust.
3077         (dwarf2_add_field): Adjust.
3078         (dwarf2_add_member_fn): Adjust.
3079         (read_structure_type): Adjust.
3080         (process_structure_scope): Adjust.
3081         (read_enumeration_type): Adjust.
3082         (read_array_type): Adjust.
3083         (mark_common_block_symbol_computed): Adjust.
3084         (read_common_block): Adjust.
3085         (read_namespace_type): Adjust.
3086         (read_namespace): Adjust.
3087         (read_module_type): Adjust.
3088         (read_tag_pointer_type): Adjust.
3089         (read_tag_ptr_to_member_type): Adjust.
3090         (read_tag_string_type): Adjust.
3091         (read_subroutine_type): Adjust.
3092         (read_typedef): Adjust.
3093         (read_base_type): Adjust.
3094         (attr_to_dynamic_prop): Adjust.
3095         (read_subrange_type): Adjust.
3096         (read_unspecified_type): Adjust.
3097         (dwarf2_read_abbrevs): Adjust.
3098         (load_partial_dies): Adjust.
3099         (read_partial_die): Adjust.
3100         (find_partial_die): Adjust.
3101         (guess_partial_die_structure_name): Adjust.
3102         (fixup_partial_die): Adjust.
3103         (read_attribute_value): Adjust.
3104         (read_addr_index): Adjust.
3105         (read_addr_index_from_leb128): Adjust.
3106         (read_str_index): Adjust.
3107         (dwarf2_string_attr): Adjust.
3108         (get_debug_line_section): Adjust.
3109         (dwarf_decode_line_header): Adjust.
3110         (lnp_state_machine::check_line_address): Adjust.
3111         (dwarf_decode_lines_1): Adjust.
3112         (dwarf_decode_lines): Adjust.
3113         (dwarf2_start_symtab): Adjust.
3114         (var_decode_location): Adjust.
3115         (new_symbol_full): Adjust.
3116         (dwarf2_const_value_data): Adjust.
3117         (dwarf2_const_value_attr): Adjust.
3118         (dwarf2_const_value): Adjust.
3119         (die_type): Adjust.
3120         (die_containing_type): Adjust.
3121         (build_error_marker_type): Adjust.
3122         (lookup_die_type): Adjust.
3123         (guess_full_die_structure_name): Adjust.
3124         (anonymous_struct_prefix): Adjust.
3125         (determine_prefix): Adjust.
3126         (dwarf2_name): Adjust.
3127         (follow_die_ref_or_sig): Adjust.
3128         (follow_die_offset): Adjust.
3129         (follow_die_ref): Adjust.
3130         (follow_die_sig_1): Adjust.
3131         (follow_die_sig): Adjust.
3132         (get_signatured_type): Adjust.
3133         (get_DW_AT_signature_type): Adjust.
3134         (decode_locdesc): Adjust.
3135         (dwarf_decode_macros): Adjust.
3136         (cu_debug_loc_section): Adjust.
3137         (fill_in_loclist_baton): Adjust.
3138         (dwarf2_symbol_mark_computed): Adjust.
3139         (init_one_comp_unit): Don't assign
3140         dwarf2_cu::dwarf2_per_objfile.
3141         (set_die_type): Adjust.
3142
3143 2018-01-07  Simon Marchi  <simon.marchi@ericsson.com>
3144
3145         * dwarf2read.c (struct mapped_debug_names): Add constructor.
3146         <dwarf2_per_objfile>: New field.
3147         (dwarf2_per_objfile): Remove global.
3148         (get_dwarf2_per_objfile): New function.
3149         (set_dwarf2_per_objfile): New function.
3150         (dwarf2_build_psymtabs_hard): Change objfile parameter to
3151         dwarf2_per_objfile.
3152         (abbrev_table_read_table): Add dwarf2_per_objfile parameter.
3153         (read_abbrev_offset): Likewise.
3154         (read_indirect_string): Likewise.
3155         (read_indirect_line_string): Likewise.
3156         (read_indirect_string_at_offset): Likewise.
3157         (read_indirect_string_from_dwz): Likewise.
3158         (dwarf2_find_containing_comp_unit): Change objfile parameter to
3159         dwarf2_per_objfile.
3160         (age_cached_comp_units): Add dwarf2_per_objfile parameter.
3161         (create_all_comp_units): Change objfile parameter to
3162         dwarf2_per_objfile.
3163         (create_all_type_units): Likewise.
3164         (process_queue): Add dwarf2_per_objfile parameter.
3165         (read_and_check_comp_unit_head): Likewise.
3166         (lookup_dwo_unit_in_dwp): Likewise.
3167         (get_dwp_file): Likewise.
3168         (process_cu_includes): Likewise.
3169         (struct free_dwo_file_cleanup_data): New struct.
3170         (dwarf2_has_info): Use get_dwarf2_per_objfile and
3171         set_dwarf2_per_objfile.
3172         (dwarf2_get_dwz_file): Add dwarf2_per_objfile parameter.
3173         (dw2_do_instantiate_symtab): Get dwarf2_per_objfile from
3174         context, adjust calls.
3175         (dw2_instantiate_symtab): Likewise.
3176         (dw2_get_cutu): Add dwarf2_per_objfile parameter.
3177         (dw2_get_cu): Likewise.
3178         (create_cu_from_index_list): Change objfile parameter to
3179         dwarf2_per_objfile.
3180         (create_cus_from_index_list): Get dwarf2_per_objfile from
3181         context, adjust calls.
3182         (create_cus_from_index): Likewise.
3183         (create_signatured_type_table_from_index): Change objfile
3184         parameter to dwarf2_per_objfile.
3185         (create_signatured_type_table_from_debug_names): Change objfile
3186         parameter to dwarf2_per_objfile.
3187         (create_addrmap_from_index): Likewise.
3188         (create_addrmap_from_aranges): Likewise.
3189         (dwarf2_read_index): Use get_dwarf2_per_objfile, adjust calls.
3190         (dw2_setup): Remove.
3191         (dw2_get_file_names_reader): Get dwarf2_per_objfile from
3192         context.
3193         (dw2_find_last_source_symtab): Get dwarf2_per_objfile using
3194         get_dwarf2_per_objfile.
3195         (dw2_forget_cached_source_info): Likewise.
3196         (dw2_map_symtabs_matching_filename): Likewise.
3197         (struct dw2_symtab_iterator) <index>: Remove.
3198         <dwarf2_per_objfile>: New field.
3199         (dw2_symtab_iter_init): Replace index parameter with
3200         dwarf2_per_objfile.
3201         (dw2_symtab_iter_next): Use dwarf2_per_objfile from iter.
3202         (dw2_lookup_symbol): Use get_dwarf2_per_objfile and adjust.
3203         (dw2_print_stats): Likewise.
3204         (dw2_dump): Likewise.
3205         (dw2_expand_symtabs_for_function): Likewise.
3206         (dw2_expand_all_symtabs): Likewise.
3207         (dw2_expand_symtabs_with_fullname): Likewise.
3208         (dw2_expand_marked_cus): Replace index and objfile parameters
3209         with dwarf2_per_objfile.
3210         (dw_expand_symtabs_matching_file_matcher): Add
3211         dwarf2_per_objfile parameter and adjust calls.
3212         (dw2_expand_symtabs_matching): Use get_dwarf2_per_objfile and
3213         adjust calls.
3214         (dw2_find_pc_sect_compunit_symtab): Don't call dw2_setup.
3215         (dw2_map_symbol_filenames): Use get_dwarf2_per_objfile and
3216         adjust calls.
3217         (create_cus_from_debug_names_list): Replace objfile parameter
3218         with dwarf2_per_objfile and adjust calls.
3219         (create_cus_from_debug_names): Likewise.
3220         (dwarf2_read_debug_names): Likewise.
3221         (mapped_debug_names::namei_to_name): Adjust call.
3222         (dw2_debug_names_iterator::next): Likewise.
3223         (dw2_debug_names_iterator::find_vec_in_debug_names): Likewise.
3224         (dw2_debug_names_lookup_symbol): Use get_dwarf2_per_objfile.
3225         (dw2_debug_names_dump): Likewise.
3226         (dw2_debug_names_expand_symtabs_for_function): Likewise.
3227         (dw2_debug_names_expand_symtabs_matching): Likewise.
3228         (dwarf2_initialize_objfile): Likewise.
3229         (dwarf2_build_psymtabs): Likewise.
3230         (get_abbrev_section_for_cu): Get dwarf2_per_objfile from
3231         this_cu.
3232         (error_check_comp_unit_head): Add dwarf2_per_objfile parameter.
3233         (read_and_check_comp_unit_head): Likewise.
3234         (read_abbrev_offset): Likewise.
3235         (create_debug_type_hash_table): Likewise.
3236         (create_debug_types_hash_table): Likewise.
3237         (create_all_type_units): Replace objfile parameter with
3238         dwarf2_per_objfile.
3239         (add_type_unit): Add dwarf2_per_objfile parameter.
3240         (fill_in_sig_entry_from_dwo_entry): Replace objfile parameter
3241         with dwarf2_per_objfile.
3242         (lookup_dwo_signatured_type): Get dwarf2_per_objfile from cu.
3243         (lookup_dwp_signatured_type): Likewise.
3244         (lookup_signatured_type): Likewise.
3245         (read_cutu_die_from_dwo): Likewise.
3246         (init_tu_and_read_dwo_dies): Likewise.
3247         (init_cutu_and_read_dies): Likewise.
3248         (init_cutu_and_read_dies_no_follow): Likewise.
3249         (allocate_type_unit_groups_table): Add objfile parameter.
3250         (create_type_unit_group): Use dwarf2_per_objfile from cu.
3251         (get_type_unit_group): Likewise.
3252         (process_psymtab_comp_unit): Update call.
3253         (build_type_psymtabs_reader): Use dwarf2_per_objfile from cu.
3254         (build_type_psymtabs_1): Add dwarf2_per_objfile parameter.
3255         (print_tu_stats): Likewise.
3256         (build_type_psymtab_dependencies): Use dwarf2_per_objfile passed
3257         in void* parameter.
3258         (build_type_psymtabs): Change objfile parameter to
3259         dwarf2_per_objfile.
3260         (process_skeletonless_type_unit): Use dwarf2_per_objfile
3261         passed in void* parameter.
3262         (process_skeletonless_type_units): Change objfile parameter to
3263         dwarf2_per_objfile.
3264         (set_partial_user): Likewise.
3265         (dwarf2_build_psymtabs_hard): Likewise.
3266         (read_comp_units_from_section): Likewise.
3267         (create_all_comp_units): Likewise.
3268         (scan_partial_symbols): Update calls.
3269         (add_partial_symbol): Likewise.
3270         (dwarf2_read_symtab): Use get_dwarf2_per_objfile.
3271         (maybe_queue_comp_unit): Use dwarf2_read_symtab from cu.
3272         (process_queue): Add dwarf2_per_objfile parameter.
3273         (get_compunit_symtab): Use dwarf2_per_objfile from cu.
3274         (compute_compunit_symtab_includes): Likewise.
3275         (process_cu_includes): Add dwarf2_per_objfile parameter.
3276         (process_full_comp_unit): Use dwarf2_per_objfile from cu.
3277         (process_full_type_unit): Likewise.
3278         (process_imported_unit_die): Update call.
3279         (handle_DW_AT_stmt_list): Use dwarf2_per_objfile from cu.
3280         (read_file_scope): Likewise.
3281         (allocate_dwo_file_hash_table): Add objfile parameter.
3282         (lookup_dwo_file_slot): Add dwarf2_per_objfile parameter.
3283         (create_cus_hash_table): Likewise.
3284         (create_dwp_hash_table): Likewise.
3285         (create_dwo_unit_in_dwp_v1): Likewise.
3286         (create_dwp_v2_section): Likewise.
3287         (create_dwo_unit_in_dwp_v2): Likewise.
3288         (lookup_dwo_unit_in_dwp): Likewise.
3289         (try_open_dwop_file): Likewise.
3290         (open_dwo_file): Likewise. Use dwarf2_per_objfile from cu.
3291         (open_and_init_dwo_file): Use dwarf2_per_objfile from cu, update
3292         cleanup to include a reference to dwarf2_per_objfile.
3293         (open_dwp_file): Add dwarf2_per_objfile parameter.
3294         (open_and_init_dwp_file): Likewise.
3295         (get_dwp_file): Likewise.
3296         (lookup_dwo_cutu): Use dwarf2_per_objfile from cu.
3297         (queue_and_load_all_dwo_tus): Update call.
3298         (free_dwo_file_cleanup): Use dwarf2_per_objfile from cleanup
3299         data.
3300         (dwarf2_rnglists_process): Use dwarf2_per_objfile from cu.
3301         (dwarf2_ranges_process): Likewise.
3302         (dwarf2_get_pc_bounds): Likewise.
3303         (mark_common_block_symbol_computed): Likewise.
3304         (abbrev_table_read_table): Add dwarf2_per_objfile parameter.
3305         (dwarf2_read_abbrevs): Update call.
3306         (read_partial_die): Use dwarf2_per_objfile from cu.
3307         (find_partial_die): Likewise.
3308         (fixup_partial_die): Likewise.
3309         (read_attribute_value): Likewise.
3310         (read_indirect_string_at_offset_from): Add objfile parameter.
3311         (read_indirect_string_at_offset): Add dwarf2_per_objfile
3312         parameter.
3313         (read_indirect_string_from_dwz): Add objfile parameter.
3314         (read_indirect_string): Add objfile parameter.
3315         (read_addr_index_1): Add dwarf2_per_objfile parameter.
3316         (read_addr_index): Use dwarf2_per_objfile from cu.
3317         (dwarf2_read_addr_index): Use dwarf2_per_objfile from cu, don't
3318         call dw2_setup.
3319         (read_str_index): Use dwarf2_per_objfile from cu.
3320         (get_debug_line_section): Likewise.
3321         (read_formatted_entries): Add dwarf2_per_objfile parameter.
3322         (dwarf_decode_line_header): Use dwarf2_per_objfile from cu.
3323         (new_symbol_full): Use dwarf2_per_objfile from cu.
3324         (build_error_marker_type): Likewise.
3325         (lookup_die_type): Likewise.
3326         (determine_prefix): Likewise.
3327         (follow_die_offset): Likewise.
3328         (dwarf2_fetch_die_loc_sect_off): Use get_dwarf2_per_objfile.
3329         (dwarf2_fetch_constant_bytes): Don't call dw2_setup.
3330         (dwarf2_fetch_die_type_sect_off): Likewise.
3331         (dwarf2_get_die_type): Likewise.
3332         (follow_die_sig_1): Use dwarf2_per_objfile from cu.
3333         (get_signatured_type): Likewise.
3334         (get_DW_AT_signature_type): Likewise.
3335         (dwarf_decode_macro_bytes): Add dwarf2_per_objfile parameter.
3336         (dwarf_decode_macros): Use dwarf2_per_objfile from cu.
3337         (cu_debug_loc_section): Likewise.
3338         (fill_in_loclist_baton): Likewise.
3339         (dwarf2_symbol_mark_computed): Likewise.
3340         (dwarf2_find_containing_comp_unit): Change objfile parameter to
3341         dwarf2_per_objfile.
3342         (free_cached_comp_units): Use dwarf2_per_objfile passed in void*
3343         parameter.
3344         (age_cached_comp_units): Add dwarf2_per_objfile parameter.
3345         (free_one_cached_comp_unit): Use dwarf2_per_objfile from cu.
3346         (dwarf2_free_objfile): Use get_dwarf2_per_objfile.
3347         (set_die_type): Use dwarf2_free_objfile from cu.
3348         (get_die_type_at_offset): Likewise.
3349         (dwarf2_per_objfile_free): Don't assign global variable.
3350         (debug_names) <constructor>: Add dwarf2_per_objfile
3351         parameter, update m_debugstrlookup construction.
3352         (debug_names::debug_str_lookup): Add dwarf2_per_objfile
3353         parameter.
3354         <m_dwarf2_per_objfile>: New field.
3355         <lookup>: Use m_dwarf2_per_objfile.
3356         (check_dwarf64_offsets): Add dwarf2_per_objfile parameter.
3357         (psyms_seen_size): Likewise.
3358         (write_gdbindex): Replace objfile parameter with
3359         dwarf2_per_objfile.
3360         (write_debug_names): Likewise.
3361         (write_psymtabs_to_index): Likewise.
3362         (save_gdb_index_command): Use get_dwarf2_per_objfile, update
3363         calls.
3364
3365 2018-01-07  Simon Marchi  <simon.marchi@ericsson.com>
3366
3367         * dwarf2read.c (struct dwarf2_cu) <objfile>: Remove.
3368         <dwarf2_per_objfile>: New field.
3369         (struct dwarf2_per_cu_data) <objfile>: Remove.
3370         <dwarf2_per_objfile>: New field.
3371         (create_cu_from_index_list): Assign dwarf2_per_objfile instead
3372         of objfile.
3373         (create_signatured_type_table_from_index): Likewise.
3374         (create_debug_type_hash_table): Likewise.
3375         (fill_in_sig_entry_from_dwo_entry): Likewise.
3376         (lookup_dwo_unit): Access objfile through dwarf2_per_objfile.
3377         (create_type_unit_group): Assign dwarf2_per_objfile instead of
3378         objfile.
3379         (create_partial_symtab): Access objfile through
3380         dwarf2_per_objfile.
3381         (process_psymtab_comp_unit_reader): Likewise.
3382         (read_comp_units_from_section): Likewise.
3383         (scan_partial_symbols): Likewise.
3384         (add_partial_symbol): Likewise.
3385         (add_partial_subprogram): Likewise.
3386         (peek_die_abbrev): Likewise.
3387         (fixup_go_packaging): Likewise.
3388         (process_full_comp_unit): Likewise.
3389         (process_full_type_unit): Likewise.
3390         (process_imported_unit_die): Likewise.
3391         (dwarf2_compute_name): Likewise.
3392         (dwarf2_physname): Likewise.
3393         (read_import_statement): Likewise.
3394         (create_cus_hash_table): Assign dwarf2_physname instead of
3395         objfile.
3396         (read_func_scope): Access objfile through dwarf2_per_objfile.
3397         (read_lexical_block_scope): Likewise.
3398         (read_call_site_scope): Likewise.
3399         (read_variable): Likewise.
3400         (dwarf2_rnglists_process): Likewise.
3401         (dwarf2_ranges_process): Likewise.
3402         (dwarf2_ranges_read): Likewise.
3403         (dwarf2_record_block_ranges): Likewise.
3404         (dwarf2_add_field): Likewise.
3405         (dwarf2_add_member_fn): Likewise.
3406         (read_structure_type): Likewise.
3407         (process_structure_scope): Likewise.
3408         (read_enumeration_type): Likewise.
3409         (read_array_type): Likewise.
3410         (read_common_block): Likewise.
3411         (read_namespace_type): Likewise.
3412         (read_namespace): Likewise.
3413         (read_module_type): Likewise.
3414         (read_tag_pointer_type): Likewise.
3415         (read_tag_ptr_to_member_type): Likewise.
3416         (read_tag_string_type): Likewise.
3417         (read_subroutine_type): Likewise.
3418         (read_typedef): Likewise.
3419         (read_base_type): Likewise.
3420         (attr_to_dynamic_prop): Likewise.
3421         (read_subrange_type): Likewise.
3422         (read_unspecified_type): Likewise.
3423         (load_partial_dies): Likewise.
3424         (read_partial_die): Likewise.
3425         (find_partial_die): Likewise.
3426         (guess_partial_die_structure_name): Likewise.
3427         (fixup_partial_die): Likewise.
3428         (read_attribute_value): Likewise.
3429         (read_addr_index_from_leb128): Likewise.
3430         (dwarf2_read_addr_index): Likewise.
3431         (dwarf2_string_attr): Likewise.
3432         (lnp_state_machine::check_line_address): Likewise.
3433         (dwarf_decode_lines_1): Likewise.
3434         (dwarf_decode_lines): Likewise.
3435         (dwarf2_start_symtab): Likewise.
3436         (var_decode_location): Likewise.
3437         (new_symbol_full): Likewise.
3438         (dwarf2_const_value_data): Likewise.
3439         (dwarf2_const_value_attr): Likewise.
3440         (dwarf2_const_value): Likewise.
3441         (die_type): Likewise.
3442         (die_containing_type): Likewise.
3443         (lookup_die_type): Likewise.
3444         (guess_full_die_structure_name): Likewise.
3445         (anonymous_struct_prefix): Likewise.
3446         (dwarf2_name): Likewise.
3447         (follow_die_ref_or_sig): Likewise.
3448         (follow_die_offset): Likewise.
3449         (follow_die_ref): Likewise.
3450         (dwarf2_fetch_die_loc_sect_off): Likewise.
3451         (dwarf2_fetch_constant_bytes): Likewise.
3452         (dwarf2_fetch_die_type_sect_off): Likewise.
3453         (dwarf2_get_die_type): Likewise.
3454         (follow_die_sig): Likewise.
3455         (decode_locdesc): Likewise.
3456         (dwarf2_per_cu_objfile): Likewise.
3457         (dwarf2_per_cu_text_offset): Likewise.
3458         (init_one_comp_unit): Assign dwarf2_per_objfile instead of
3459         objfile.
3460         (set_die_type): Access objfile through
3461         dwarf2_per_objfile.
3462
3463 2018-01-07  Simon Marchi  <simon.marchi@ericsson.com>
3464
3465         * valprint.c (converted_character_d): Remove typedef.
3466         (DEF_VEC_O (converted_character_d)): Remove.
3467         (count_next_character): Use std::vector.
3468         (print_converted_chars_to_obstack): Likewise.
3469         (generic_printstr): Likewise.
3470
3471 2018-01-07  Simon Marchi  <simon.marchi@polymtl.ca>
3472
3473         * xml-support.h (struct gdb_xml_value): Add constructor.
3474         <value>: Change type to unique_xmalloc_ptr.
3475         (gdb_xml_value_s): Remove typedef.
3476         (DEF_VEC_O (gdb_xml_value_s)): Remove.
3477         (gdb_xml_element_start_handler): Change parameter type to
3478         std::vector.
3479         (xml_find_attribute): Likewise.
3480         * xml-support.c (xml_find_attribute): Change parameter type to
3481         std::vector and adjust.
3482         (gdb_xml_values_cleanup): Remove.
3483         (gdb_xml_parser::start_element): Adjust to std::vector.
3484         (xinclude_start_include): Change paraeter type to std::vector
3485         and adjust.
3486         * btrace.c (check_xml_btrace_version): Likewise.
3487         (parse_xml_btrace_block): Likewise.
3488         (parse_xml_btrace_pt_config_cpu): Likewise.
3489         (parse_xml_btrace_pt): Likewise.
3490         (parse_xml_btrace_conf_bts): Likewise.
3491         (parse_xml_btrace_conf_pt): Likewise.
3492         * memory-map.c (memory_map_start_memory): Likewise.
3493         (memory_map_start_property): Likewise.
3494         * osdata.c (osdata_start_osdata): Likewise.
3495         (osdata_start_item): Likewise.
3496         (osdata_start_column): Likewise.
3497         * remote.c (start_thread): Likewise.
3498         * solib-aix.c (library_list_start_library): Likewise.
3499         (library_list_start_list): Likewise.
3500         * solib-svr4.c (library_list_start_library): Likewise.
3501         (svr4_library_list_start_list): Likewise.
3502         * solib-target.c (library_list_start_segment): Likewise.
3503         (library_list_start_section): Likewise.
3504         (library_list_start_library): Likewise.
3505         (library_list_start_list): Likewise.
3506         * tracepoint.c (traceframe_info_start_memory): Likewise.
3507         (traceframe_info_start_tvar): Likewise.
3508         * xml-syscall.c (syscall_start_syscall): Likewise.
3509         * xml-tdesc.c (tdesc_start_target): Likewise.
3510         (tdesc_start_feature): Likewise.
3511         (tdesc_start_reg): Likewise.
3512         (tdesc_start_union): Likewise.
3513         (tdesc_start_struct): Likewise.
3514         (tdesc_start_flags): Likewise.
3515         (tdesc_start_enum): Likewise.
3516         (tdesc_start_field): Likewise.
3517         (tdesc_start_enum_value): Likewise.
3518         (tdesc_start_vector): Likewise.
3519
3520 2018-01-07  Simon Marchi  <simon.marchi@polymtl.ca>
3521
3522         * extension.h (struct xmethod_worker) <clone>: Remove.
3523         * python/py-xmethods.c (struct python_xmethod_worker) <clone>:
3524         Remove.
3525         (python_xmethod_worker::clone): Remove.
3526         * valops.c (find_overload_match): Use std::move instead of
3527         clone.
3528
3529 2018-01-07  Simon Marchi  <simon.marchi@polymtl.ca>
3530
3531         * extension-priv.h (enum ext_lang_rc): Remove, move to extension.h.
3532         (struct extension_language_ops) <clone_xmethod_worker_data>: Remove.
3533         <free_xmethod_worker_data>: Remove.
3534         <get_matching_xmethod_workers>: Chance VEC to std::vector.
3535         <get_xmethod_arg_types>: Remove.
3536         <get_xmethod_result_type>: Remove.
3537         <invoke_xmethod>: Remove.
3538         * extension.c (new_xmethod_worker): Remove.
3539         (clone_xmethod_worker): Remove.
3540         (get_matching_xmethod_workers): Return void, pass std::vector by
3541         pointer.
3542         (get_xmethod_arg_types): Rename to...
3543         (xmethod_worker::get_arg_types): ... this, and adjust.
3544         (get_xmethod_result_type): Rename to...
3545         (xmethod_worker::get_result_type): ... this, and adjust.
3546         (invoke_xmethod): Remove.
3547         (free_xmethod_worker): Remove.
3548         (free_xmethod_worker_vec): Remove.
3549         * extension.h (enum ext_lang_rc): Move here from
3550         extension-priv.h.
3551         (struct xmethod_worker): Add constructor and destructor.
3552         <data>: Remove.
3553         <value>: Remove.
3554         <invoke, clone, do_get_result_type, do_get_arg_types>: New
3555         virtual pure methods.
3556         <get_arg_types, get_result_type>: New methods.
3557         (xmethod_worker_ptr): Remove typedef.
3558         (DEF_VEC_P (xmethod_worker_ptr)): Remove.
3559         (xmethod_worker_vec): Remove typedef.
3560         (xmethod_worker_up): New typedef.
3561         (invoke_xmethod): Remove.
3562         (clone_xmethod_worker): Remove.
3563         (free_xmethod_worker): Remove.
3564         (free_xmethod_worker_vec): Remove.
3565         (get_xmethod_arg_types): Remove.
3566         (get_xmethod_result_type): Remove.
3567         * valops.c (find_method_list): Use std::vector, don't use
3568         intermediate vector.
3569         (value_find_oload_method_list): Use std::vector.
3570         (find_overload_match): Use std::vector.
3571         (find_oload_champ): Use std::vector.
3572         * value.c (value_free): Use operator delete.
3573         (value_of_xmethod): Rename to...
3574         (value_from_xmethod): ... this.  Don't assign
3575         xmethod_worker::value, take rvalue-reference.
3576         (result_type_of_xmethod): Adjust.
3577         (call_xmethod): Adjust.
3578         * value.h: Include extension.h.
3579         (struct xmethod_worker): Don't forward-declare.
3580         (value_of_xmethod): Rename to...
3581         (value_from_xmethod): ... this, take rvalue-reference.
3582         * python/py-xmethods.c (struct gdbpy_worker_data): Rename to...
3583         (struct python_xmethod_worker): ... this, add constructor and
3584         destructor.
3585         <invoke, clone, do_get_arg_types, do_get_result_type>: Implement.
3586         (gdbpy_free_xmethod_worker_data): Rename to...
3587         (python_xmethod_worker::~python_xmethod_worker): ... this and
3588         adjust.
3589         (gdbpy_clone_xmethod_worker_data): Rename to...
3590         (python_xmethod_worker::clone): ... this and adjust.
3591         (gdbpy_get_matching_xmethod_workers): Use std::vector, don't use
3592         temporary vector.
3593         (gdbpy_get_xmethod_arg_types): Rename to...
3594         (python_xmethod_worker::do_get_arg_types): ... this and adjust.
3595         (gdbpy_get_xmethod_result_type): Rename to...
3596         (python_xmethod_worker::do_get_result_type): ... this and
3597         adjust.
3598         (gdbpy_invoke_xmethod): Rename to...
3599         (python_xmethod_worker::invoke): ... this and adjust.
3600         (new_python_xmethod_worker): Rename to...
3601         (python_xmethod_worker::python_xmethod_worker): ... this and
3602         adjust.
3603         * python/python-internal.h (gdbpy_clone_xmethod_worker_data):
3604         Remove.
3605         (gdbpy_free_xmethod_worker_data): Remove.
3606         (gdbpy_get_matching_xmethod_workers): Use std::vector.
3607         (gdbpy_get_xmethod_arg_types): Remove.
3608         (gdbpy_get_xmethod_result_type): Remove.
3609         (gdbpy_invoke_xmethod): Remove.
3610         * python/python.c (python_extension_ops): Remove obsolete
3611         callbacks.
3612
3613 2018-01-05  Pedro Alves  <palves@redhat.com>
3614
3615         PR gdb/18653
3616         * common/signals-state-save-restore.c
3617         (save_original_signals_state): New parameter 'quiet'.  Warn if we
3618         find a custom handler preinstalled, instead of internal erroring.
3619         But only warn if !quiet.
3620         * common/signals-state-save-restore.h
3621         (save_original_signals_state): New parameter 'quiet'.
3622         * main.c (captured_main_1): Move save_original_signals_state call
3623         after option handling, and pass QUIET.
3624
3625 2018-01-05  Pedro Alves  <palves@redhat.com>
3626
3627         * spu-tdep.c (spu_catch_start): Pass
3628         symbol_name_match_type::SEARCH_NAME to block_lookup_symbol.
3629
3630 2018-01-05  Pedro Alves  <palves@redhat.com>
3631
3632         PR gdb/22670
3633         * ada-lang.c (literal_symbol_name_matcher): New function.
3634         (ada_get_symbol_name_matcher): Use it for
3635         symbol_name_match_type::SEARCH_NAME.
3636         * block.c (block_lookup_symbol): New parameter 'match_type'.  Pass
3637         it down instead of assuming symbol_name_match_type::FULL.
3638         * block.h (block_lookup_symbol): New parameter 'match_type'.
3639         * c-valprint.c (print_unpacked_pointer): Use
3640         lookup_symbol_search_name instead of lookup_symbol.
3641         * compile/compile-object-load.c (get_out_value_type): Pass down
3642         symbol_name_match_type::SEARCH_NAME.
3643         * cp-namespace.c (cp_basic_lookup_symbol): Pass down
3644         symbol_name_match_type::FULL.
3645         * cp-support.c (cp_get_symbol_name_matcher): Handle
3646         symbol_name_match_type::SEARCH_NAME.
3647         * infrun.c (insert_exception_resume_breakpoint): Use
3648         lookup_symbol_search_name.
3649         * p-valprint.c (pascal_val_print): Use lookup_symbol_search_name.
3650         * psymtab.c (maintenance_check_psymtabs): Use
3651         symbol_name_match_type::SEARCH_NAME and SYMBOL_SEARCH_NAME.
3652         * stack.c (print_frame_args): Use lookup_symbol_search_name and
3653         SYMBOL_SEARCH_NAME.
3654         * symtab.c (lookup_local_symbol): Don't demangle the lookup name
3655         if symbol_name_match_type::SEARCH_NAME.
3656         (lookup_symbol_in_language): Pass down
3657         symbol_name_match_type::FULL.
3658         (lookup_symbol_search_name): New.
3659         (lookup_language_this): Pass down
3660         symbol_name_match_type::SEARCH_NAME.
3661         (lookup_symbol_aux, lookup_local_symbol): New parameter
3662         'match_type'.  Pass it down.
3663         * symtab.h (symbol_name_match_type::SEARCH_NAME): New enumerator.
3664         (lookup_symbol_search_name): New declaration.
3665         (lookup_symbol_in_block): New 'match_type' parameter.
3666
3667 2018-01-05  Pedro Alves  <palves@redhat.com>
3668
3669         PR gdb/22670
3670         * ada-lang.c (ada_lookup_encoded_symbol): Reimplement in terms of
3671         ada_lookup_symbol.
3672         (ada_lookup_symbol): Reimplement in terms of
3673         ada_lookup_symbol_list, bits factored out from
3674         ada_lookup_encoded_symbol.
3675
3676 2018-01-05  Joel Brobecker  <brobecker@adacore.com>
3677
3678         * ada-exp.y (write_object_renaming): When subscripting an array
3679         using a symbol as the index, pass the block in call to
3680         ada_lookup_encoded_symbol when looking that symbol up.
3681
3682 2018-01-05  Jerome Guitton  <guitton@adacore.com>
3683
3684         * ada-lang.c (ada_array_length): Use ada_index_type instead of
3685         TYPE_INDEX_TYPE.
3686
3687 2018-01-05  Joel Brobecker  <brobecker@adacore.com>
3688
3689         * ada-lang.c (ada_to_fixed_value_create): Add handling of
3690         the case where VALUE_LVAL (val0) is not lval_memory.
3691
3692 2018-01-05  Xavier Roirand  <roirand@adacore.com>
3693
3694         * ada-valprint.c (print_optional_low_bound): Handle
3695         character-indexed array printing like boolean-indexed array
3696         printing.
3697
3698 2018-01-05  Joel Brobecker  <brobecker@adacore.com>
3699
3700         * NEWS: Create a new section for the next release branch.
3701         Rename the section of the current branch, now that it has
3702         been cut.
3703
3704 2018-01-05  Joel Brobecker  <brobecker@adacore.com>
3705
3706         GDB 8.1 branch created (5219ac6237c272b938c28517bf371429260c71e7):
3707         * version.in: Bump version to 8.1.50.DATE-git.
3708
3709 2018-01-03  Xavier Roirand  <roirand@adacore.com>
3710
3711         * ada-lang.h (ada_exception_catchpoint_kind) <ada_catch_handlers>:
3712         Add field.
3713         * ada-lang.c (struct exception_support_info) <catch_handlers_sym>:
3714         Add field.
3715         (default_exception_support_info) <catch_handlers_sym>: Add field.
3716         (exception_support_info_fallback) <catch_handlers_sym>: Add field.
3717         (ada_exception_name_addr_1): Add "catch handlers" handling.
3718         (ada_exception_catchpoint_cond_string) <ex>: New parameter.
3719         Update all callers.
3720         (create_excep_cond_exprs) <ex>: Add parameter.
3721         (re_set_exception): Update create_excep_cond_exprs call.
3722         (print_it_exception, print_one_exception, print_mention_exception)
3723         (print_recreate_exception): Add "catch handler" handling.
3724         (allocate_location_catch_handlers, re_set_catch_handlers)
3725         (check_status_catch_handlers, print_it_catch_handlers)
3726         (print_one_catch_handlers, print_mention_catch_handlers)
3727         (print_recreate_catch_handlers): New function.
3728         (catch_handlers_breakpoint_ops): New variable.
3729         (catch_ada_exception_command_split) <is_catch_handlers_cmd>:
3730         Add parameter.  Add "catch handler" handling.
3731         (ada_exception_sym_name, ada_exception_breakpoint_ops):
3732         Add "catch handler" handling.
3733         (ada_exception_catchpoint_cond_string): Add "catch handler"
3734         handling.
3735         (create_ada_exception_catchpoint): Update create_excep_cond_exprs
3736         call.
3737         (catch_ada_handlers_command): New function.
3738         (initialize_ada_catchpoint_ops): Initialize "catch handlers"
3739         operations structure.
3740         (_initialize_ada_language): Add "catch handlers" command entry.
3741         * NEWS: Document "catch handlers" feature.
3742
3743 2018-01-02  Joel Brobecker  <brobecker@adacore.com>
3744
3745         * ada-lang.c (ada_value_slice_from_ptr): Take array stride into
3746         account when creating the array type of the slice.
3747         (ada_value_slice): Likewise.
3748
3749 2018-01-02  Joel Brobecker  <brobecker@adacore.com>
3750
3751         * gdbtypes.h (enum dynamic_prop_node_kind) <DYN_PROP_BYTE_STRIDE>:
3752         New enum value.
3753         (create_array_type_with_stride): Add byte_stride_prop parameter.
3754         * gdbtypes.c (create_array_type_with_stride) <byte_stride_prop>:
3755         New parameter.  Update all callers in this file.
3756         (array_type_has_dynamic_stride): New function.
3757         (is_dynamic_type_internal, resolve_dynamic_array): Add handling
3758         of arrays with dynamic byte strides.
3759         * dwarf2read.c (read_array_type): Add support for dynamic
3760         DW_AT_byte_stride attributes.
3761
3762 2018-01-02  Joel Brobecker  <brobecker@adacore.com>
3763
3764         * dwarf2read.c (read_unspecified_type): Treat
3765         DW_TAG_enumeration_type DIEs from Ada units as stubs.
3766
3767 2018-01-01  Joel Brobecker  <brobecker@adacore.com>
3768
3769         Update copyright year range in all GDB files.
3770
3771 2018-01-01  Joel Brobecker  <brobecker@adacore.com>
3772
3773         * copyright.py (BY_HAND): Remove gdb/testsuite/gdb.base/step-line.inp
3774         and gdb/testsuite/gdb.base/step-line.c.
3775
3776 2018-01-01  Joel Brobecker  <brobecker@adacore.com>
3777
3778         * copyright.py (main): Dump the contents of
3779         MULTIPLE_COPYRIGHT_HEADERS (separately) from BY_HAND,
3780         even if BY_HAND is empty.
3781
3782 2018-01-01  Joel Brobecker  <brobecker@adacore.com>
3783
3784         * top.c (print_gdb_version): Update Copyright year in version
3785         message.
3786
3787 2018-01-01  Joel Brobecker  <brobecker@adacore.com>
3788
3789         * config/djgpp/fnchange.lst: Add entry for gdb/ChangeLog-2017.
3790
3791 For older changes see ChangeLog-2017.
3792 \f
3793 Local Variables:
3794 mode: change-log
3795 left-margin: 8
3796 fill-column: 74
3797 version-control: never
3798 coding: utf-8
3799 End: