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