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