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