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