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