dwarf2read.c: Clean up out of bounds handling
[external/binutils.git] / gdb / ChangeLog
1 2017-03-27  Pedro Alves  <palves@redhat.com>
2
3         * dwarf2read.c (file_entry) <dir_index>: Add comment.
4         (file_entry::include_dir): New method.
5         (line_header::include_dir_at, line_header::file_name_at): New
6         methods.
7         (setup_type_unit_groups, setup_type_unit_groups)
8         (psymtab_include_file_name): Simplify using the new methods.
9         (lnp_state_machine) <the_line_header>: New field.
10         <file>: Add comment.
11         (lnp_state_machine::current_file): New method.
12         (dwarf_record_line): Simplify using the new methods.
13         (init_lnp_state_machine): Initialize the "the_line_header" field.
14         (dwarf_decode_lines_1, dwarf_decode_lines, file_file_name):
15         Simplify using the new methods.
16
17 2017-03-27  Pedro Alves  <palves@redhat.com>
18
19         * cp-name-parser.y (make_empty): Delete.
20         (demangler_special, nested_name, ptr_operator, array_indicator)
21         (direct_declarator, declarator_1): Use fill_comp instead of
22         make_empty.
23
24 2017-03-27  Pedro Alves  <palves@redhat.com>
25
26         * xml-support.h (gdb_xml_debug): Pass a "first-to-check" argument
27         to ATTRIBUTE_PRINTF.
28         * solib-target.c (library_list_start_list): Print "string" not
29         "version".
30         * xml-tdesc.c (tdesc_start_field): Pass "field_name" to
31         gdb_xml_error call.
32
33 2017-03-27  Pedro Alves  <palves@redhat.com>
34
35         * dwarf2read.c (struct file_and_directory): New.
36         (dwarf2_get_dwz_file): Adjust to use std::string.
37         (dw2_get_file_names_reader): Adjust to use file_and_directory.
38         (find_file_and_directory): Adjust to return a file_and_directory
39         object.
40         (read_file_scope): Adjust to use file_and_directory.  Remove
41         make_cleanup/do_cleanups calls.
42         (open_and_init_dwp_file): Adjust to use std::string.  Remove
43         make_cleanup/do_cleanups calls.
44         * python/python.c (do_start_initialization): Adjust to ldirname
45         returning a std::string.
46         * utils.c (ldirname): Now returns a std::string.
47         * utils.h (ldirname): Change return type to std::string.
48         * xml-syscall.c (xml_init_syscalls_info): Adjust to ldirname
49         returning a std::string.
50         * xml-tdesc.c (file_read_description_xml): Likewise.
51
52 2017-03-24  Alan Hayward  <alan.hayward@arm.com>
53
54         * regcache.c (regcache_debug_print_register): New function.
55         * regcache.h (regcache_debug_print_register): New declaration.
56         * target.c (debug_print_register): Remove.
57         (target_fetch_registers): Call regcache_debug_print_register.
58         (target_store_registers): Likewise.
59
60 2017-03-24  Pádraig Brady  <pbrady@fb.com>
61
62         * dwarf2read.c (setup_type_unit_groups): Ensure dir_index doesn't
63         reference beyond the 'lh->include_dirs' array before accessing to
64         it.
65         (psymtab_include_file_name): Likewise.
66         (dwarf_decode_lines_1): Likewise.
67         (dwarf_decode_lines): Likewise.
68         (file_file_name): Likewise.
69
70 2017-03-23  Simon Marchi  <simon.marchi@ericsson.com>
71
72         * fbsd-tdep.c (fbsd_corefile_thread): Don't set/restore
73         inferior_ptid.
74         * proc-service.c (ps_lgetregs, ps_lsetregs, ps_lgetfpregs,
75         ps_lsetfpregs): Likewise.
76         * regcache.c (regcache_raw_update, regcache_raw_write): Likewise.
77         * sol-thread.c (ps_lgetregs, ps_lsetregs, ps_lgetfpregs,
78         ps_lsetfpregs): Likewise.
79         * target.c (target_fetch_registers, target_store_registers):
80         Remove asserts.
81
82 2017-03-23  Alan Hayward  <alan.hayward@arm.com>
83
84         * sol-thread.c (sol_thread_store_registers): Remove regcache calls.
85
86 2017-03-23  Yao Qi  <yao.qi@linaro.org>
87
88         * aarch64-tdep.c (aarch64_process_record_test): Declare.
89         (_initialize_aarch64_tdep): Register it.
90         (aarch64_record_load_store): Handle PRFM instruction.
91         (aarch64_process_record_test): New function.
92
93 2017-03-23  Yao Qi  <yao.qi@linaro.org>
94
95         * aarch64-tdep.c (aarch64_record_load_store): Fix code
96         indentation.
97
98 2017-03-23  Yao Qi  <yao.qi@linaro.org>
99
100         * aarch64-tdep.c: Remove AARCH64_RECORD_FAILURE.
101
102 2017-03-23  Philipp Rudo  <prudo@linux.vnet.ibm.com>
103
104         python/python.c (do_start_initialization): Fix memory leak.
105
106 2017-03-22  Simon Marchi  <simon.marchi@polymtl.ca>
107
108         * inf-ptrace.c (inf_ptrace_xfer_partial): Get pid from ptid
109         using get_ptrace_pid.
110         * linux-nat.c (linux_nat_xfer_partial): Don't set/restore
111         inferior_ptid.
112         (linux_proc_xfer_partial, linux_proc_xfer_spu): Use lwp of
113         inferior_ptid instead of pid.
114
115 2017-03-22  Yao Qi  <yao.qi@linaro.org>
116
117         * aarch64-tdep.c: Wrap locally used classes in anonymous
118         namespace.
119         * arm-tdep.c: Likewise.
120         * linespec.c: Likewise.
121         * ui-out.c: Likewise.
122
123 2017-03-22  Jonah Graham  <jonah@kichwacoders.com>
124
125         PR gdb/19637
126         * python/lib/gdb/printer/bound_registers.py: Import sys.
127
128 2017-03-21  Simon Marchi  <simon.marchi@ericsson.com>
129
130         * windows-nat.c (do_windows_fetch_inferior_registers): Add
131         windows_thread_info parameter and use it instead of
132         current_thread.
133         (windows_fetch_inferior_registers): Don't set current_thread,
134         pass the thread to do_windows_fetch_inferior_registers.  Use
135         ptid from regcache instead of inferior_ptid.
136         (do_windows_store_inferior_registers): Add windows_thread_info
137         parameter and use it instead of current_thread.
138         (windows_store_inferior_registers): Don't set current_thread,
139         pass the thread to do_windows_store_inferior_registers.  Use
140         ptid from regcache instead of inferior_ptid.
141
142 2017-03-21  Simon Marchi  <simon.marchi@ericsson.com>
143
144         * ser-mingw.c (ser_windows_raw): Remove reference to
145         struct serial::current_timeout.
146
147 2017-03-21  Ivo Raisr  <ivo.raisr@oracle.com>
148
149         PR tdep/20928
150         * gdb/sparc-tdep.h (gdbarch_tdep) <sparc64_ccr_type>: New field.
151         * gdb/sparc64-tdep.c (sparc64_ccr_type): New function.
152         (sparc64_fsr_type): Fix %fsr decoding.
153
154 2017-03-21  Tim Wiederhake  <tim.wiederhake@intel.com>
155
156         * python/py-record-btrace.c (btpy_insn_data): Change return type
157         for Python 2.
158
159 2017-03-20  Simon Marchi  <simon.marchi@polymtl.ca>
160
161         * spu-linux-nat.c (spu_fetch_inferior_registers,
162         spu_store_inferior_registers): Use ptid from regcache, set and
163         restore inferior_ptid.
164         * spu-multiarch.c (spu_fetch_registers, spu_store_registers):
165         Likewise.
166
167 2017-03-20  Simon Marchi  <simon.marchi@polymtl.ca>
168
169         * i386-linux-nat.c (fetch_register, store_register,
170         i386_linux_fetch_inferior_registers,
171         i386_linux_store_inferior_registers): Use ptid from regcache.
172         * ia64-linux-nat.c (ia64_linux_fetch_register,
173         ia64_linux_store_register): Likewise.
174         * inf-ptrace.c (inf_ptrace_fetch_register,
175         inf_ptrace_store_register): Likewise.
176         * m32r-linux-nat.c (m32r_linux_fetch_inferior_registers,
177         m32r_linux_store_inferior_registers): Likewise.
178         * m68k-bsd-nat.c (m68kbsd_fetch_inferior_registers,
179         m68kbsd_store_inferior_registers): Likewise.
180         * m68k-linux-nat.c (fetch_register, store_register,
181         m68k_linux_fetch_inferior_registers,
182         m68k_linux_store_inferior_registers): Likewise.
183         * m88k-bsd-nat.c (m88kbsd_fetch_inferior_registers,
184         m88kbsd_store_inferior_registers): Likewise.
185         * mips-fbsd-nat.c (mips_fbsd_fetch_inferior_registers,
186         mips_fbsd_store_inferior_registers): Likewise.
187         * mips-linux-nat.c (mips64_linux_regsets_fetch_registers,
188         mips64_linux_regsets_store_registers): Likewise.
189         * mips-nbsd-nat.c (mipsnbsd_fetch_inferior_registers,
190         mipsnbsd_store_inferior_registers): Likewise.
191         * mips-obsd-nat.c (mips64obsd_fetch_inferior_registers,
192         mips64obsd_store_inferior_registers): Likewise.
193         * nto-procfs.c (procfs_fetch_registers, procfs_store_registers):
194         Likewise.
195         * ppc-fbsd-nat.c (ppcfbsd_fetch_inferior_registers,
196         ppcfbsd_store_inferior_registers): Likewise.
197         * ppc-linux-nat.c (ppc_linux_fetch_inferior_registers,
198         ppc_linux_store_inferior_registers): Likewise.
199         * ppc-nbsd-nat.c (ppcnbsd_fetch_inferior_registers,
200         ppcnbsd_store_inferior_registers): Likewise.
201         * ppc-obsd-nat.c (ppcobsd_fetch_registers,
202         ppcobsd_store_registers): Likewise.
203         * procfs.c (procfs_fetch_registers, procfs_store_registers):
204         Likewise.
205         * ravenscar-thread.c (ravenscar_fetch_registers,
206         ravenscar_store_registers, ravenscar_prepare_to_store):
207         Likewise.
208         * record-btrace.c (record_btrace_fetch_registers,
209         record_btrace_store_registers, record_btrace_prepare_to_store):
210         Likewise.
211         * remote-sim.c (gdbsim_fetch_register, gdbsim_store_register):
212         Lookup inferior using ptid from regcache, instead of
213         current_inferior.
214         * remote.c (remote_fetch_registers, remote_store_registers): Use
215         ptid from regcache.
216         * rs6000-nat.c (fetch_register, store_register): Likewise.
217         * s390-linux-nat.c (s390_linux_fetch_inferior_registers,
218         s390_linux_store_inferior_registers): Likewise.
219         * sh-nbsd-nat.c (shnbsd_fetch_inferior_registers,
220         shnbsd_store_inferior_registers): Likewise.
221         * sol-thread.c (sol_thread_fetch_registers,
222         sol_thread_store_registers): Likewise.
223         * sparc-nat.c (sparc_fetch_inferior_registers,
224         sparc_store_inferior_registers): Likewise.
225         * tilegx-linux-nat.c (fetch_inferior_registers,
226         store_inferior_registers): Likewise.
227         * vax-bsd-nat.c (vaxbsd_fetch_inferior_registers,
228         vaxbsd_store_inferior_registers): Likewise.
229         * xtensa-linux-nat.c (fetch_gregs, store_gregs, fetch_xtregs,
230         store_xtregs): Likewise.
231
232 2017-03-20  Artemiy Volkov  <artemiyv@acm.org>
233
234         PR gdb/14441
235         * NEWS: Mention support for rvalue references in GDB and python.
236         * doc/gdb.texinfo (C Plus Plus Expressions): Mention that GDB
237         supports both lvalue and rvalue references.
238
239 2017-03-20  Artemiy Volkov  <artemiyv@acm.org>
240
241         PR gdb/14441
242         * gdbtypes.c (rank_one_type): Implement overloading
243         resolution rules regarding rvalue references.
244
245 2017-03-20  Artemiy Volkov  <artemiyv@acm.org>
246
247         PR gdb/14441
248         * aarch64-tdep.c (aarch64_type_align)
249         (aarch64_extract_return_value, aarch64_store_return_value): Change
250         lvalue reference type checks to general reference type checks.
251         * amd64-tdep.c (amd64_classify): Likewise.
252         * amd64-windows-tdep.c (amd64_windows_passed_by_integer_register):
253         Likewise.
254         * arm-tdep.c (arm_type_align, arm_extract_return_value)
255         (arm_store_return_value): Likewise.
256         * ax-gdb.c (gen_fetch, gen_cast): Likewise.
257         * c-typeprint.c (c_print_type): Likewise.
258         * c-varobj.c (adjust_value_for_child_access, c_value_of_variable)
259         (cplus_number_of_children, cplus_describe_child): Likewise.
260         * compile/compile-c-symbols.c (generate_vla_size): Likewise.
261         * completer.c (expression_completer): Likewise.
262         * cp-support.c (make_symbol_overload_list_adl_namespace):
263         Likewise.
264         * darwin-nat-info.c (info_mach_region_command): Likewise.
265         * dwarf2loc.c (entry_data_value_coerce_ref)
266         (value_of_dwarf_reg_entry): Likewise.
267         * eval.c (ptrmath_type_p, evaluate_subexp_standard)
268         (evaluate_subexp_for_address, evaluate_subexp_for_sizeof):
269         Likewise.
270         * findvar.c (extract_typed_address, store_typed_address):
271         Likewise.
272         * gdbtypes.c (rank_one_type): Likewise.
273         * hppa-tdep.c (hppa64_integral_or_pointer_p): Likewise.
274         * infcall.c (value_arg_coerce): Likewise.
275         * language.c (pointer_type): Likewise.
276         * m32c-tdep.c (m32c_reg_arg_type, m32c_m16c_address_to_pointer):
277         Likewise.
278         * m88k-tdep.c (m88k_integral_or_pointer_p): Likewise.
279         * mn10300-tdep.c (mn10300_type_align): Likewise.
280         * msp430-tdep.c (msp430_push_dummy_call): Likewise.
281         * ppc-sysv-tdep.c (do_ppc_sysv_return_value)
282         (ppc64_sysv_abi_push_param, ppc64_sysv_abi_return_value):
283         Likewise.
284         * printcmd.c (print_formatted, x_command): Likewise.
285         * python/py-type.c (typy_get_composite, typy_template_argument):
286         Likewise.
287         * python/py-value.c (valpy_referenced_value)
288         (valpy_get_dynamic_type, value_has_field): Likewise.
289         * s390-linux-tdep.c (s390_function_arg_integer): Likewise.
290         * sparc-tdep.c (sparc_integral_or_pointer_p): Likewise.
291         * sparc64-tdep.c (sparc64_integral_or_pointer_p): Likewise.
292         * spu-tdep.c (spu_scalar_value_p): Likewise.
293         * symtab.c (lookup_symbol_aux): Likewise.
294         * typeprint.c (whatis_exp, print_type_scalar): Likewise.
295         * valarith.c (binop_types_user_defined_p, unop_user_defined_p):
296         Likewise.
297         * valops.c (value_cast_pointers, value_cast)
298         (value_reinterpret_cast, value_dynamic_cast, value_addr, typecmp)
299         (value_struct_elt, value_struct_elt_bitpos)
300         (value_find_oload_method_list, find_overload_match)
301         (value_rtti_indirect_type): Likewise.
302         * valprint.c (val_print_scalar_type_p, generic_val_print):
303         Likewise.
304         * value.c (value_actual_type, value_as_address, unpack_long)
305         (pack_long, pack_unsigned_long, coerce_ref_if_computed)
306         (coerce_ref): Likewise.
307         * varobj.c (varobj_get_value_type): Likewise.
308
309 2017-03-20  Artemiy Volkov  <artemiyv@acm.org>
310
311         PR gdb/14441
312         * doc/python.texi (Types in Python): Add TYPE_CODE_RVALUE_REF to
313         table of constants.
314         * python/lib/gdb/command/explore.py: Support exploring values
315         of rvalue reference types.
316         * python/lib/gdb/types.py: Implement get_basic_type() for
317         rvalue reference types.
318         * python/py-type.c (pyty_codes) <TYPE_CODE_RVALUE_REF>: New
319         constant.
320         * python/py-value.c (valpy_getitem): Add an rvalue reference
321         check.
322         (valpy_reference_value): Add new parameter "refcode".
323         (valpy_lvalue_reference_value, valpy_rvalue_reference_value):
324         New wrappers for valpy_reference_value().
325         * python/py-xmethods.c (gdbpy_get_xmethod_result_type)
326         (gdbpy_invoke_xmethod): Likewise.
327
328 2017-03-20  Artemiy Volkov  <artemiyv@acm.org>
329
330         PR gdb/14441
331         * dwarf2read.c (process_die, read_type_die_1): Handle the
332         DW_TAG_rvalue_reference_type DIE.
333         (read_tag_reference_type): Add new parameter "refcode".
334
335 2017-03-20  Artemiy Volkov  <artemiyv@acm.org>
336
337         PR gdb/14441
338         * c-typeprint.c (c_print_type, c_type_print_varspec_prefix)
339         (c_type_print_modifier, c_type_print_varspec_suffix)
340         (c_type_print_base): Support printing rvalue reference types.
341         * c-valprint.c (c_val_print, c_value_print): Support printing
342         rvalue reference values.
343
344 2017-03-20  Artemiy Volkov  <artemiyv@acm.org>
345
346         PR gdb/14441
347         * cp-name-parser.y (ptr_operator): Handle the '&&' token in
348         typename.
349         * cp-support.c (replace_typedefs): Handle
350         DEMANGLE_COMPONENT_RVALUE_REFERENCE.
351         * python/py-type.c (typy_lookup_type): Likewise.
352
353 2017-03-20  Artemiy Volkov  <artemiyv@acm.org>
354
355         PR gdb/14441
356         * c-exp.y (ptr_operator): Handle the '&&' token in the typename.
357         * parse.c (insert_type): Change assert statement.
358         (follow_types): Handle rvalue reference types.
359         * parser-defs.h (enum type_pieces) <tp_rvalue_reference>: New
360         constant.
361
362 2017-03-20  Artemiy Volkov  <artemiyv@acm.org>
363
364         PR gdb/14441
365         * ada-lang.c (ada_evaluate_subexp): Adhere to the new
366         value_ref() interface.
367         * c-valprint.c (c_value_print): Likewise.
368         * infcall.c (value_arg_coerce): Likewise.
369         * python/py-value.c (valpy_reference_value): Likewise.
370         * valops.c (value_cast, value_reinterpret_cast)
371         (value_dynamic_cast, typecmp): Likewise.
372         (value_ref): Parameterize by kind of return value reference type.
373         * value.h (value_ref): Add new parameter "refcode".
374
375 2017-03-20  Artemiy Volkov  <artemiyv@acm.org>
376
377         PR gdb/14441
378         * dwarf2read.c (read_tag_reference_type): Use
379         lookup_lvalue_reference_type() instead of lookup_reference_type().
380         * eval.c (evaluate_subexp_standard): Likewise.
381         * f-exp.y: Likewise.
382         * gdbtypes.c (make_reference_type, lookup_reference_type):
383         Generalize with rvalue reference types.
384         (lookup_lvalue_reference_type, lookup_rvalue_reference_type): New
385         convenience wrappers for lookup_reference_type().
386         * gdbtypes.h (make_reference_type, lookup_reference_type): Add a
387         reference kind parameter.
388         (lookup_lvalue_reference_type, lookup_rvalue_reference_type): Add
389         wrappers for lookup_reference_type().
390         * guile/scm-type.c (gdbscm_type_reference): Use
391         lookup_lvalue_reference_type() instead of lookup_reference_type().
392         * guile/scm-value.c (gdbscm_value_dynamic_type): Likewise.
393         * parse.c (follow_types): Likewise.
394         * python/py-type.c (typy_reference, typy_lookup_type): Likewise.
395         * python/py-value.c (valpy_get_dynamic_type, valpy_getitem):
396         Likewise.
397         * python/py-xmethods.c (gdbpy_get_xmethod_result_type)
398         (gdbpy_invoke_xmethod): Likewise.
399         * stabsread.c: Provide extra argument to make_reference_type()
400         call.
401         * valops.c (value_ref, value_rtti_indirect_type): Use
402         lookup_lvalue_reference_type() instead of lookup_reference_type().
403
404 2017-03-20  Artemiy Volkov  <artemiyv@acm.org>
405
406         PR gdb/14441
407         * gdbtypes.h (enum type_code) <TYPE_CODE_RVALUE_REF>: New constant.
408         (TYPE_IS_REFERENCE): New macro.
409         (struct type): Add rvalue_reference_type field.
410         (TYPE_RVALUE_REFERENCE_TYPE): New macro.
411
412 2017-03-20  Marc-Andre Laperle  <marc-andre.laperle@ericsson.com>
413
414         * NEWS: Add an entry about new '-file-list-shared-libraries' command.
415         * mi/mi-cmd-file.c (mi_cmd_file_list_shared_libraries):
416         New function definition.
417         * mi/mi-cmds.c (mi_cmds): Add -file-list-shared-libraries command.
418         * mi/mi-cmds.h (mi_cmd_file_list_shared_libraries):
419         New function declaration.
420         * mi/mi-interp.c (mi_output_solib_attribs): New Function.
421         * mi/mi-interp.h: New file.
422         * solib.c (info_sharedlibrary_command): Replace for loop with
423         ALL_SO_LIBS macro
424         * solib.h (update_solib_list): New function declaration.
425         (so_list_head): Move macro.
426         * solist.h (ALL_SO_LIBS): New macro.
427
428 2017-03-20  Marc-Andre Laperle  <marc-andre.laperle@ericsson.com>
429
430         * infcmd.c (post_create_inferior): Remove unused argument in
431         call to solib_add.
432         * remote.c (remote_start_remote): Likewise.
433         * solib-frv.c (frv_fetch_objfile_link_map): Likewise.
434         * solib-svr4.c: (svr4_fetch_objfile_link_map): Likewise.
435         (enable_break): Likewise.
436         * solib.c (update_solib_list): Remove unused target argument
437         and its documentation.
438         (solib_add): Remove unused target argument.  Remove unused
439         argument in call to update_solib_list.
440         (info_sharedlibrary_command): Remove unused argument in call
441         to update_solib_list.
442         (sharedlibrary_command): Remove unused argument in call to
443         solib_add.
444         (handle_solib_event): Likewise.
445         (reload_shared_libraries): Likewise.
446         * solib.h (solib_add): Remove unused target argument.
447
448 2017-03-20  Andreas Arnez  <arnez@linux.vnet.ibm.com>
449
450         * s390-linux-tdep.c (is_rsi, is_rie): Remove functions.
451         (s390_displaced_step_fixup): Cover relative branches with the
452         default fixup handling.  This fixes lack of support for some
453         relative branch instructions.
454
455 2017-03-17  Simon Marchi  <simon.marchi@polymtl.ca>
456
457         * i386-gnu-nat.c (gnu_fetch_registers, gnu_store_registers): Use
458         ptid from regcache.
459
460 2017-03-17  Simon Marchi  <simon.marchi@polymtl.ca>
461
462         * i386-darwin-nat.c (i386_darwin_fetch_inferior_registers,
463         i386_darwin_store_inferior_registers): Use ptid from regcache.
464
465 2017-03-17  Simon Marchi  <simon.marchi@polymtl.ca>
466
467         * i386-bsd-nat.c (i386bsd_fetch_inferior_registers,
468         i386bsd_store_inferior_registers): Use ptid from regcache.
469
470 2017-03-17  Simon Marchi  <simon.marchi@polymtl.ca>
471
472         * hppa-obsd-nat.c (hppaobsd_fetch_registers,
473         hppaobsd_store_registers): Use ptid from regcache.
474
475 2017-03-17  Simon Marchi  <simon.marchi@polymtl.ca>
476
477         * hppa-nbsd-nat.c (hppanbsd_fetch_registers,
478         hppanbsd_store_registers): Use ptid from regcache.
479
480 2017-03-17  Simon Marchi  <simon.marchi@polymtl.ca>
481
482         * hppa-linux-nat.c (fetch_register, store_register): Use ptid
483         from regcache.  Use get_ptrace_pid.
484
485 2017-03-17  Simon Marchi  <simon.marchi@polymtl.ca>
486
487         * corelow.c (get_core_register_section): Use ptid from regcache,
488         update doc.
489
490 2017-03-17  Simon Marchi  <simon.marchi@polymtl.ca>
491
492         * bsd-uthread.c (bsd_uthread_fetch_registers,
493         bsd_uthread_store_registers): Use ptid from regcache, set and
494         restore inferior_ptid.
495
496 2017-03-17  Simon Marchi  <simon.marchi@polymtl.ca>
497
498         * arm-nbsd-nat.c (fetch_register, fetch_regs, fetch_fp_register,
499         fetch_fp_regs, store_register, store_regs, store_fp_register,
500         store_fp_regs): Use ptid from regcache.
501
502 2017-03-17  Simon Marchi  <simon.marchi@polymtl.ca>
503
504         * arm-linux-nat.c (fetch_fpregs, store_fpregs, fetch_regs,
505         store_regs, fetch_wmmx_regs, store_wmmx_regs, fetch_vfp_regs,
506         store_vfp_regs): Use ptid from regcache.
507
508 2017-03-17  Pedro Alves  <palves@redhat.com>
509
510         PR remote/21188
511         * ser-base.c (ser_base_wait_for): Add comment.
512         (do_ser_base_readchar): Improve comment based on the ser-unix.c's
513         version.
514         * ser-unix.c (hardwire_raw): Remove reference to
515         scb->current_timeout.
516         (wait_for, do_hardwire_readchar, hardwire_readchar): Delete.
517         (hardwire_ops): Install ser_base_readchar instead of
518         hardwire_readchar.
519         * serial.h (struct serial) <current_timeout, timeout_remaining>:
520         Remove fields.
521
522 2017-03-17  Jonah Graham  <jonah@kichwacoders.com>
523
524         PR gdb/19637
525         * python/lib/gdb/printer/bound_registers.py: Add support for
526         Python 3.
527
528 2017-03-16  Andreas Arnez  <arnez@linux.vnet.ibm.com>
529
530         * dwarf2loc.c (indirect_synthetic_pointer): Get data type of
531         pointed-to DIE and pass it to dwarf2_evaluate_loc_desc_full.
532         (dwarf2_evaluate_loc_desc_full): New parameter subobj_type; rename
533         byte_offset to subobj_byte_offset.  Fix the handling of
534         DWARF_VALUE_STACK on big-endian targets when coming via an
535         implicit pointer.
536         (dwarf2_evaluate_loc_desc): Adjust call to
537         dwarf2_evaluate_loc_desc_full.
538         * dwarf2loc.h (dwarf2_fetch_die_type_sect_off): New declaration.
539         * dwarf2read.c (dwarf2_fetch_die_type_sect_off): New function.
540
541 2017-03-16  Yao Qi  <yao.qi@linaro.org>
542
543         * arm-tdep.c (thumb_record_misc): Decode CBNZ, CBZ, REV16,
544         and REVSH instructions.
545
546 2017-03-16  Yao Qi  <yao.qi@linaro.org>
547
548         * arm-tdep.c [GDB_SELF_TEST]: include "selftests.h".
549         (arm_record_test): Declare.
550         (_initialize_arm_tdep) [GDB_SELF_TEST]: call register_self_test.
551         (thumb_record_ld_st_reg_offset): Rewrite the opcode matching to
552         align with the manual.
553         (thumb_record_misc): Adjust the code order to align with the
554         manual.
555         (thumb2_record_decode_insn_handler): Fix instruction matching.
556         (instruction_reader_thumb): New class.
557         (arm_record_test): New function.
558
559 2017-03-16  Yao Qi  <yao.qi@linaro.org>
560
561         * arm-tdep.c (abstract_memory_reader): New class.
562         (instruction_reader): New class.
563         (extract_arm_insn): Add argument 'reader'.  Callers updated.
564         (decode_insn): Likewise.
565
566 2017-03-16  Doug Evans  <dje@google.com>
567
568         * guile/scm-lazy-string.c (lazy_string_smob): Clarify use of LENGTH
569         member.  Change type of TYPE member to SCM.  All uses updated.
570         (lsscm_make_lazy_string_smob): Add assert.
571         (lsscm_make_lazy_string): Flag bad length values.
572         (lsscm_elt_type): New function.
573         (gdbscm_lazy_string_to_value): Rewrite to use
574         lsscm_safe_lazy_string_to_value.
575         (lsscm_safe_lazy_string_to_value): Fix handling of TYPE_CODE_PTR.
576         * guile/scm-value.c (gdbscm_value_to_lazy_string): Flag bad length
577         values.  Fix TYPE_CODE_PTR.  Handle TYPE_CODE_ARRAY.  Handle typedefs
578         in incoming type.
579         * guile/guile-internal.h (tyscm_scm_to_type): Declare.
580         * guile/scm-type.c (tyscm_scm_to_type): New function.
581
582 2017-03-15  Doug Evans  <dje@google.com>
583
584         PR python/17728, python/18439, python/18779
585         * python/py-lazy-string.c (lazy_string_object): Clarify use of LENGTH
586         member.  Change type of TYPE member to PyObject *.  All uses updated.
587         (stpy_convert_to_value): Fix handling of TYPE_CODE_PTR.
588         (gdbpy_create_lazy_string_object): Flag bad length values.
589         Handle TYPE_CODE_ARRAY with possibly different user-provided length.
590         Handle typedefs in incoming type.
591         (stpy_lazy_string_elt_type): New function.
592         (gdbpy_extract_lazy_string): Call it.
593         * python/py-value.c (valpy_lazy_string): Flag bad length values.
594         Fix handling of TYPE_CODE_PTR.  Handle TYPE_CODE_ARRAY.  Handle
595         typedefs in incoming type.
596
597 2017-03-16  Doug Evans  <dje@google.com>
598
599         * guile/guile-internal.h (tyscm_scm_to_type): Declare.
600         * guile/scm-type.c (tyscm_scm_to_type): New function.
601
602 2017-03-16  Jiong Wang  <jiong.wang@arm.com>
603
604         * inf-ptrace.c (inf_ptrace_peek_poke): Change the type to
605         "ULONGEST" for "skip".
606
607 2017-03-14  Andreas Arnez  <arnez@linux.vnet.ibm.com>
608
609         PR gdb/21220
610         * inf-ptrace.c (inf_ptrace_xfer_partial): In "case
611         TARGET_OBJECT_MEMORY", extract the logic for ptrace peek/poke...
612         (inf_ptrace_peek_poke): ...here.  New function.  Now also loop
613         over ptrace peek/poke until end of buffer or error.
614
615 2017-03-14  Simon Marchi  <simon.marchi@ericsson.com>
616
617         * parse.c (length_of_subexp): Make static.
618         * parser-defs.h (length_of_subexp): Remove.
619
620 2017-03-14  Andreas Arnez  <arnez@linux.vnet.ibm.com>
621
622         * linux-nat.c (linux_proc_xfer_partial): Handle write operations
623         as well.
624
625 2017-03-14  Pedro Alves  <palves@redhat.com>
626
627         * cp-name-parser.y (cp_demangled_name_to_comp): Update comment.
628         (main): Use std::unique_ptr.  Remove calls to
629         cp_demangled_name_parse_free.
630
631 2017-03-13  Simon Marchi  <simon.marchi@polymtl.ca>
632
633         * alpha-bsd-nat.c (alphabsd_fetch_inferior_registers,
634         alphabsd_store_inferior_registers): Use regcache->ptid instead
635         of inferior_ptid.
636
637 2017-03-13  Simon Marchi  <simon.marchi@polymtl.ca>
638
639         * aix-thread.c (aix_thread_fetch_registers,
640         aix_thread_store_registers): Use regcache->ptid instead of
641         inferior_ptid.
642
643 2017-03-13  Simon Marchi  <simon.marchi@polymtl.ca>
644
645         * aarch64-linux-nat.c (fetch_gregs_from_thread,
646         store_gregs_to_thread, fetch_fpregs_from_thread,
647         store_fpregs_to_thread): Use regcache->ptid instead of
648         inferior_ptid.
649
650 2017-03-13  Simon Marchi  <simon.marchi@polymtl.ca>
651
652         * amd64-linux-nat.c (amd64_linux_fetch_inferior_registers,
653         amd64_linux_fetch_inferior_registers): Use regcache->ptid
654         instead of inferior_ptid.
655
656 2017-03-13  Simon Marchi  <simon.marchi@polymtl.ca>
657
658         * target.c (target_fetch_registers, target_store_registers): Add
659         assert.
660
661 2017-03-13  Simon Marchi  <simon.marchi@polymtl.ca>
662
663         * regcache.h (regcache_get_ptid): New function.
664         * regcache.c (regcache_get_ptid): New function.
665
666 2017-03-13  Mark Wielaard  <mark@klomp.org>
667
668         * cp-name-parser.y (make_empty): Initialize d_printing to zero.
669
670 2017-03-10  Keith Seitz  <keiths@redhat.com>
671
672         PR c++/8218
673         * c-typeprint.c (cp_type_print_method_args): Skip artificial arguments.
674
675 2017-03-08  Pedro Alves  <palves@redhat.com>
676
677         PR gdb/18360
678         * infrun.c (start_step_over, do_target_resume, resume)
679         (restart_threads): Assert we're not resuming a thread that is
680         meant to be stopped.
681         (infrun_thread_stop_requested_callback): Delete.
682         (infrun_thread_stop_requested): If the thread is internally
683         stopped, queue a pending stop event and clear the thread's
684         inline-frame state.
685         (handle_stop_requested): New function.
686         (handle_syscall_event, handle_inferior_event_1): Use
687         handle_stop_requested.
688         (handle_stop_requested): New function.
689         (handle_signal_stop): Set the thread's stop_signal here instead of
690         at caller.
691         (finish_step_over): Clear step over info unconditionally.
692         (handle_signal_stop): If the user had interrupted the event
693         thread, consider the stop a random signal.
694         (handle_signal_stop) <signal arrived while stepping over
695         breakpoint>: Don't restart threads here.
696         (stop_waiting): Don't clear step-over info here.
697
698 2017-03-08  Pedro Alves  <palves@redhat.com>
699
700         PR 21206
701         * common/gdb_unlinker.h (unlinker::unlinker): Attribute nonnull
702         goes to argument 2, not 1.
703
704 2017-03-08  Pedro Alves  <palves@redhat.com>
705
706         PR cli/21218
707         * top.c (gdb_readline_wrapper): Avoid passing NULL to
708         display_gdb_prompt.
709         (command_line_input): Add comment.
710
711 2017-03-08  Pedro Alves  <palves@redhat.com>
712
713         PR tui/21216
714         * tui/tui-file.c (tui_file::write): New.
715         * tui/tui-file.h (tui_file): Override "write".
716         * tui/tui-io.c (do_tui_putc, update_start_line): New functions,
717         factored out from ...
718         (tui_puts): ... here.
719         (tui_putc): Use them.
720         (tui_write): New function.
721         * tui/tui-io.h (tui_write): Declare.
722
723 2017-03-07  Sergio Durigan Junior  <sergiodj@redhat.com>
724
725         * Makefile.in (SFILES): Replace "environ.c" with
726         "common/environ.c".
727         (HFILES_NO_SRCDIR): Likewise, for "environ.h".
728         * environ.c: Include "common-defs.h" instead of "defs.h.  Moved
729         to...
730         * common/environ.c: ... here.
731         * environ.h: Moved to...
732         * common/environ.h: ... here.
733
734 2017-03-07  Peter Bergner  <bergner@vnet.ibm.com>
735
736         * gdbarch.sh (pstring_ptr): New static function.
737         (gdbarch_disassembler_options): Use it.
738         (gdbarch_verify_disassembler_options): Print valid_disassembler_options,
739         not valid_disassembler_option->name.
740         * gdbarch.c: Regenerate.
741
742 2017-03-07  Peter Bergner  <bergner@vnet.ibm.com>
743
744         * config/powerpc/ppc64-linux.mh (MH_CFLAGS): Delete.
745
746 2017-03-07  Pedro Alves  <palves@redhat.com>
747
748         * tui/tui-regs.c (tui_restore_gdbout): Don't delete gdb_stdout.
749
750 2017-03-07  Walfred Tedeschi  <walfred.tedeschi@intel.com>
751
752         * i387-tdep.h (i387_reset_bnd_regs): Add function definition.
753         * i387-tdep.c (i387_reset_bnd_regs): Add function implementation.
754         * i386-tdep.c (i386_push_dummy_call): Call i387_reset_bnd_regs.
755         * amd64-tdep.c (amd64_push_dummy_call): Call i387_reset_bnd_regs.
756
757 2017-03-06  Simon Marchi  <simon.marchi@ericsson.com>
758
759         * xtensa-linux-nat.c (fetch_gregs): Remove const.
760
761 2017-03-03  Simon Marchi  <simon.marchi@ericsson.com>
762
763         * remote.c (remote_add_target_side_commands): Use range-based
764         for loop.
765
766 2017-03-03  Yao Qi  <yao.qi@linaro.org>
767
768         PR gdb/21165
769         * ada-valprint.c (ada_val_print_ref): Call value_fetch_lazy if
770         value is lazy.
771         * valprint.c (common_val_print): Likewise.
772
773 2017-02-28  Peter Bergner  <bergner@vnet.ibm.com>
774
775         * NEWS: Mention new set/show disassembler-options commands.
776         * doc/gdb.texinfo: Document new set/show disassembler-options commands.
777         * disasm.c: Include "arch-utils.h", "gdbcmd.h" and "safe-ctype.h".
778         (prospective_options): New static variable.
779         (gdb_disassembler::gdb_disassembler): Initialize
780         m_di.disassembler_options.
781         (gdb_buffered_insn_length_init_dis): Initilize di->disassembler_options.
782         (get_disassembler_options): New function.
783         (set_disassembler_options): Likewise.
784         (set_disassembler_options_sfunc): Likewise.
785         (show_disassembler_options_sfunc): Likewise.
786         (disassembler_options_completer): Likewise.
787         (_initialize_disasm): Likewise.
788         * disasm.h (get_disassembler_options): New prototype.
789         (set_disassembler_options): Likewise.
790         * gdbarch.sh (gdbarch_disassembler_options): New variable.
791         (gdbarch_verify_disassembler_options): Likewise.
792         * gdbarch.c: Regenerate.
793         * gdbarch.h: Likewise.
794         * arm-tdep.c (num_disassembly_options): Delete.
795         (set_disassembly_style): Likewise.
796         (arm_disassembler_options): New static variable.
797         (set_disassembly_style_sfunc): Convert short style name into long
798         option name.  Call set_disassembler_options.
799         (show_disassembly_style_sfunc): New function.
800         (arm_gdbarch_init): Call set_gdbarch_disassembler_options and
801         set_gdbarch_verify_disassembler_options.
802         (_initialize_arm_tdep): Delete regnames variable and update callers.
803         (arm_disassembler_options): Initialize.
804         (disasm_options): New variable.
805         (num_disassembly_options): Rename from this...
806         (num_disassembly_styles): ...to this.  Compute by scanning through
807         disasm_options.
808         (valid_disassembly_styles): Initialize using disasm_options.
809         Remove calls to parse_arm_disassembler_option, get_arm_regnames and
810         set_arm_regname_option.
811         Pass show_disassembly_style_sfunc to the "disassembler" setshow command.
812         * rs6000-tdep.c (powerpc_disassembler_options): New static variable.
813         (rs6000_gdbarch_init): Call set_gdbarch_disassembler_options and
814         set_gdbarch_verify_disassembler_options.
815         * s390-tdep.c (s390_disassembler_options): New static variable.
816         (s390_gdbarch_init):all set_gdbarch_disassembler_options and
817         set_gdbarch_verify_disassembler_options.
818
819 2017-02-27  Simon Marchi  <simon.marchi@ericsson.com>
820
821         * remote.c (remote_add_target_side_condition): Remove "struct"
822         keyword from range-based for loop.
823
824 2017-02-27  Simon Marchi  <simon.marchi@ericsson.com>
825
826         * remote.c (remote_add_target_side_condition): Use range-based
827         for loop.  Update comment.
828
829 2017-02-27  Yao Qi  <yao.qi@linaro.org>
830
831         * f-typeprint.c (f_print_type): Check "varstring" is empty first.
832
833 2017-02-26  Alan Hayward  <alan.hayward@arm.com>
834
835         * regcache.c (regcache_raw_update): New function.
836         (regcache_raw_read): Move code to regcache_raw_update.
837         * regcache.h (regcache_raw_update): New declaration.
838         * remote.c (remote_prepare_to_store): Call regcache_raw_update.
839
840 2017-02-26  Jan Kratochvil  <jan.kratochvil@redhat.com>
841
842         * dwarf2read.c (create_debug_type_hash_table): Initialize
843         header.signature and header.type_offset_in_tu.
844
845 2017-02-24  Pedro Alves  <palves@redhat.com>
846
847         * symtab.c (make_file_symbol_completion_list_1): Use
848         add_symtab_completions.
849
850 2017-02-24  Alan Hayward  <alan.hayward@arm.com>
851
852         * stack.c (frame_info): Use frame_unwind_register_value to avoid buf.
853
854 2017-02-24  Alan Hayward  <alan.hayward@arm.com>
855
856         * i386-tdep.c (i386_pseudo_register_read_into_value): Use
857         I386_MAX_REGISTER_SIZE.
858         (i386_pseudo_register_write): Likewise.
859         (i386_process_record): Likewise.
860         * i387-tdep.c (i387_supply_xsave): Likewise.
861         * m68k-linux-nat.c (fetch_register): Use M68K_MAX_REGISTER_SIZE.
862         (store_register): Likewise.
863
864 2017-02-23  Pedro Alves  <palves@redhat.com>
865
866         * ada-lang.c: Include "common/function-view.h".
867         (ada_iterate_over_symbols): Adjust to use function_view as
868         callback type.
869         (struct add_partial_datum, ada_complete_symbol_matcher): Delete.
870         (ada_make_symbol_completion_list): Use a lambda.
871         (ada_exc_search_name_matches): Delete.
872         (name_matches_regex): New.
873         (ada_add_global_exceptions): Use a lambda and name_matches_regex.
874         * compile/compile-c-support.c: Include "common/function-view.h".
875         (print_one_macro): Change prototype to accept a ui_file pointer.
876         (write_macro_definitions): Use a lambda.
877         * dwarf2read.c: Include "common/function-view.h".
878         (dw2_map_expand_apply, dw2_map_symtabs_matching_filename)
879         (dw2_expand_symtabs_matching): Adjust to use function_view as
880         callback type.
881         * language.h: Include "common/function-view.h".
882         (struct language_defn) <la_iterate_over_symbols>: Adjust to use
883         function_view as callback type.
884         (LA_ITERATE_OVER_SYMBOLS): Remove DATA parameter.
885         * linespec.c: Include "common/function-view.h".
886         (collect_info::add_symbol): New method.
887         (struct symbol_and_data_callback, iterate_inline_only, struct
888         symbol_matcher_data, iterate_name_matcher): Delete.
889         (iterate_over_all_matching_symtabs): Adjust to use function_view
890         as callback type and lambdas.
891         (iterate_over_file_blocks): Adjust to use function_view as
892         callback type.
893         (decode_compound_collector): Now a class with private fields.
894         (decode_compound_collector::release_symbols): New method.
895         (collect_one_symbol): Rename to...
896         (decode_compound_collector::operator()): ... this and adjust.
897         (lookup_prefix_sym): decode_compound_collector construction bits
898         move to decode_compound_collector ctor.  Pass the
899         decode_compound_collector object directly as callback.  Remove
900         cleanups and use decode_compound_collector::release_symbols
901         instead.
902         (symtab_collector): Now a class with private fields.
903         (symtab_collector::release_symtabs): New method.
904         (add_symtabs_to_list): Rename to...
905         (symtab_collector::operator()): ... this and adjust.
906         (collect_symtabs_from_filename): symtab_collector construction
907         bits move to symtab_collector ctor.  Pass the symtab_collector
908         object directly as callback.  Remove cleanups and use
909         symtab_collector::release_symtabs instead.
910         (collect_symbols): Delete.
911         (add_matching_symbols_to_info): Use lambdas.
912         * macrocmd.c (print_macro_callback): Delete.
913         (info_macro_command): Use a lambda.
914         (info_macros_command): Pass print_macro_definition as callable
915         directly.
916         (print_one_macro): Remove 'ignore' parameter.
917         (macro_list_command): Adjust.
918         * macrotab.c (macro_for_each_data::fn): Now a function_view.
919         (macro_for_each_data::user_data): Delete field.
920         (foreach_macro): Adjust to call the function_view.
921         (macro_for_each): Adjust to use function_view as callback type.
922         (foreach_macro_in_scope): Adjust to call the function_view.
923         (macro_for_each_in_scope): Adjust to use function_view as callback
924         type.
925         * macrotab.h: Include "common/function-view.h".
926         (macro_callback_fn): Declare a prototype instead of a pointer.
927         Remove "user_data" parameter.
928         (macro_for_each, macro_for_each_in_scope): Adjust to use
929         function_view as callback type.
930         * psymtab.c (partial_map_expand_apply)
931         (psym_map_symtabs_matching_filename, recursively_search_psymtabs):
932         Adjust to use function_view as callback type and to return bool.
933         (psym_expand_symtabs_matching): Adjust to use function_view as
934         callback types.
935         * symfile-debug.c (debug_qf_map_symtabs_matching_filename): Adjust
936         to use function_view as callback type and to return bool.
937         (debug_qf_expand_symtabs_matching): Adjust to use function_view as
938         callback types.
939         * symfile.c (expand_symtabs_matching): Adjust to use function_view
940         as callback types.
941         * symfile.h: Include "common/function-view.h".
942         (expand_symtabs_file_matcher_ftype)
943         (expand_symtabs_symbol_matcher_ftype)
944         (expand_symtabs_exp_notify_ftype): Remove "data" parameter and
945         return bool.
946         (quick_symbol_functions::map_symtabs_matching_filename)
947         (quick_symbol_functions::expand_symtabs_matching): Adjust to use
948         function_view as callback type and return bool.
949         (expand_symtabs_matching): Adjust to use function_view as callback
950         type.
951         (maintenance_expand_name_matcher)
952         (maintenance_expand_file_matcher): Delete.
953         (maintenance_expand_symtabs): Use lambdas.
954         * symtab.c (iterate_over_some_symtabs): Adjust to use
955         function_view as callback types and return bool.
956         (iterate_over_symtabs): Likewise.  Use unique_xmalloc_ptr instead
957         of a cleanup.
958         (lookup_symtab_callback): Delete.
959         (lookup_symtab): Use a lambda.
960         (iterate_over_symbols): Adjust to use function_view as callback
961         type.
962         (struct search_symbols_data, search_symbols_file_matches)
963         (search_symbols_name_matches): Delete.
964         (search_symbols): Use a pair of lambdas.
965         (struct add_name_data, add_macro_name, symbol_completion_matcher)
966         (symtab_expansion_callback): Delete.
967         (default_make_symbol_completion_list_break_on_1): Use lambdas.
968         * symtab.h: Include "common/function-view.h".
969         (iterate_over_some_symtabs): Adjust to use function_view as
970         callback type and return bool.
971         (iterate_over_symtabs): Adjust to use function_view as callback
972         type.
973         (symbol_found_callback_ftype): Remove 'data' parameter and return
974         bool.
975         (iterate_over_symbols): Adjust to use function_view as callback
976         type.
977
978 2017-02-23  Pedro Alves  <palves@redhat.com>
979
980         * Makefile.in (SUBDIR_UNITTESTS_SRCS, SUBDIR_UNITTESTS_OBS): New.
981         (%.o) <unittests/%.c>: New pattern.
982         * configure.ac ($development): Add $(SUBDIR_UNITTESTS_OBS) to
983         CONFIG_OBS, and $(SUBDIR_UNITTESTS_SRCS) to CONFIG_SRCS.
984         * common/function-view.h: New file.
985         * unittests/function-view-selftests.c: New file.
986         * configure: Regenerate.
987
988 2017-02-23  Simon Marchi  <simon.marchi@ericsson.com>
989
990         * bsd-uthread.c (bsd_uthread_thread_alive): Use ptid instead of
991         inferior_ptid.
992         * go32-nat.c (go32_thread_alive): Likewise.
993
994 2017-02-23  Yao Qi  <yao.qi@linaro.org>
995
996         * varobj-iter.h (varobj_iter_delete): Call xfree instead of
997         delete.
998
999 2017-02-23  Yao Qi  <yao.qi@linaro.org>
1000
1001         * varobj.c (varobj_clear_saved_item): Use delete instead of
1002         xfree.
1003         (update_dynamic_varobj_children): Likewise.
1004
1005 2017-02-21  Jan Kratochvil  <jan.kratochvil@redhat.com>
1006
1007         * dwarf2read.c (dwarf2_record_block_ranges): Add forgotten BASEADDR.
1008
1009 2017-02-21  Simon Marchi  <simon.marchi@ericsson.com>
1010
1011         * common/enum-flags.h (enum_flags::enum_flags): Initialize
1012         m_enum_value to 0 in default constructor.
1013
1014 2017-02-21  Edjunior Barbosa Machado  <emachado@linux.vnet.ibm.com>
1015
1016         * rs6000-tdep.c (LOAD_AND_RESERVE_MASK): Rename from LWARX_MASK.
1017         (STORE_CONDITIONAL_MASK): Rename from STWCX_MASK.
1018         (LBARX_INSTRUCTION, LHARX_INSTRUCTION, LQARX_INSTRUCTION,
1019         STBCX_INSTRUCTION, STHCX_INSTRUCTION, STQCX_INSTRUCTION): New defines.
1020         (IS_LOAD_AND_RESERVE_INSN, IS_STORE_CONDITIONAL_INSN): New macros.
1021         (ppc_displaced_step_copy_insn): Use IS_LOAD_AND_RESERVE_INSN.
1022         (ppc_deal_with_atomic_sequence): Use IS_LOAD_AND_RESERVE_INSN and
1023         IS_STORE_CONDITIONAL_INSN.
1024
1025 2017-02-21  Jan Kratochvil  <jan.kratochvil@redhat.com>
1026
1027         * dwarf2_rnglists_process: Initialize range_beginning and range_end.
1028
1029 2017-02-20  Jan Kratochvil  <jan.kratochvil@redhat.com>
1030
1031         * NEWS (Changes since GDB 7.12): Add DWARF-5.
1032
1033 2017-02-20  Jan Kratochvil  <jan.kratochvil@redhat.com>
1034
1035         * dwarf2read.c (skip_one_die, read_attribute_value)
1036         (dwarf2_const_value_attr, dump_die_shallow)
1037         (dwarf2_get_attr_constant_value, dwarf2_fetch_constant_bytes)
1038         (skip_form_bytes, attr_form_is_constant): Handle DW_FORM_data16.
1039
1040 2017-02-20  Jan Kratochvil  <jan.kratochvil@redhat.com>
1041
1042         * dwarf2read.c (read_file_scope): Rename DW_MACRO_GNU_*.
1043         (dwarf_parse_macro_header): Accept DWARF version 5.
1044         (dwarf_decode_macro_bytes, dwarf_decode_macros): Rename DW_MACRO_GNU_*.
1045
1046 2017-02-20  Jan Kratochvil  <jan.kratochvil@redhat.com>
1047
1048         * block.c (call_site_for_pc): Rename DW_OP_GNU_*, DW_TAG_GNU_* and
1049         DW_AT_GNU_*.
1050         * common/common-exceptions.h (enum errors): Likewise.
1051         * dwarf2-frame.c (class dwarf_expr_executor): Likewise.
1052         * dwarf2expr.c (dwarf_block_to_dwarf_reg)
1053         (dwarf_expr_context::execute_stack_op): Likewise.
1054         * dwarf2expr.h (struct dwarf_expr_context, struct dwarf_expr_piece):
1055         Likewise.
1056         * dwarf2loc.c (dwarf_evaluate_loc_desc::get_base_type)
1057         (dwarf_evaluate_loc_desc::push_dwarf_reg_entry_value)
1058         (show_entry_values_debug, call_site_to_target_addr)
1059         (func_addr_to_tail_call_list, func_verify_no_selftailcall)
1060         (dwarf_expr_reg_to_entry_parameter, dwarf_entry_parameter_to_value)
1061         (entry_data_value_free_closure, value_of_dwarf_reg_entry)
1062         (value_of_dwarf_block_entry, indirect_pieced_value)
1063         (symbol_needs_eval_context::push_dwarf_reg_entry_value):
1064         (disassemble_dwarf_expression): Likewise.
1065         * dwarf2read.c (process_die, inherit_abstract_dies)
1066         (read_call_site_scope): Likewise.
1067         * gdbtypes.h (struct func_type, struct call_site_parameter)
1068         (struct call_site): Likewise.
1069         * stack.c (read_frame_arg): Likewise.
1070         * std-operator.def (OP_VAR_ENTRY_VALUE): Likewise.
1071
1072 2017-02-20  Jan Kratochvil  <jan.kratochvil@redhat.com>
1073
1074         * defs.h (read_unsigned_leb128): New declaration.
1075         * dwarf2loc.c (decode_debug_loclists_addresses): New function.
1076         (decode_debug_loc_dwo_addresses): Update DEBUG_LOC_* to DW_LLE_*.
1077         (dwarf2_find_location_expression): Call also
1078         decode_debug_loclists_addresses.  Handle DWARF-5 ULEB128 length.
1079         * dwarf2loc.h (dwarf2_version): New declaration.
1080         * dwarf2read.c (struct dwarf2_per_objfile): Add loclists, line_str,
1081         rnglists.
1082         (dwarf2_elf_names): Add .debug_loclists, .debug_line_str,
1083         .debug_rnglists.
1084         (struct dwop_section_names): Add loclists_dwo.
1085         (dwop_section_names): Add .debug_loclists.dwo.
1086         (struct comp_unit_head): Add unit_type, signature, type_offset_in_tu.
1087         (struct dwarf2_per_cu_data): Add dwarf_version.
1088         (struct dwo_sections): Add loclists.
1089         (struct attr_abbrev): Add implicit_const.
1090         (read_indirect_line_string): New declaration.
1091         (read_unsigned_leb128): Delete declaration.
1092         (rcuh_kind): New definition.
1093         (read_and_check_comp_unit_head): Change parameter
1094         is_debug_types_section to section_kind.
1095         (dwarf2_locate_sections): Handle loclists, line_str and rnglists.
1096         (read_comp_unit_head): Change parameter abfd to section, add parameter
1097         section_kind.  Handle DWARF-5.
1098         (error_check_comp_unit_head): Accept also DWARF version 5.
1099         (read_and_check_comp_unit_head): Change parameter
1100         is_debug_types_section to section_kind.
1101         (read_and_check_type_unit_head): Delete function.
1102         (read_abbrev_offset): Handle DWARF-5.
1103         (create_debug_type_hash_table): Add parameter section_kind.  Process
1104         only DW_UT_type.  Use signature and type_offset_in_tu from struct
1105         comp_unit_head.
1106         (create_debug_types_hash_table): Update create_debug_type_hash_table
1107         caller.
1108         (create_all_type_units): Call create_debug_type_hash_table.
1109         (read_cutu_die_from_dwo, init_cutu_and_read_dies): Change
1110         read_and_check_type_unit_head caller to read_and_check_comp_unit_head
1111         caller.
1112         (skip_one_die): Handle DW_FORM_implicit_const.
1113         (dwarf2_rnglists_process): New function.
1114         (dwarf2_ranges_process): Call dwarf2_rnglists_process for DWARF-5.
1115         (abbrev_table_read_table): Handle DW_FORM_implicit_const.
1116         (read_attribute_value): Handle DW_FORM_implicit_const,
1117         DW_FORM_line_strp.
1118         (read_attribute): Handle DW_FORM_implicit_const.
1119         (read_indirect_string_at_offset_from): New function from
1120         read_indirect_string_at_offset.
1121         (read_indirect_string_at_offset): Call
1122         read_indirect_string_at_offset_from.
1123         (read_indirect_line_string_at_offset): New function.
1124         (read_indirect_string): New function comment.
1125         (read_indirect_line_string): New function.
1126         (read_unsigned_leb128): Make it global.
1127         (dwarf2_string_attr): Handle DWARF-5.
1128         (add_include_dir_stub, read_formatted_entries): New functions.
1129         (dwarf_decode_line_header, dump_die_shallow, cu_debug_loc_section):
1130         Handle DWARF-5.
1131         (per_cu_header_read_in): Update read_comp_unit_head caller.
1132         (dwarf2_version): New function.
1133         * symfile.h (struct dwarf2_debug_sections): Add loclists, line_str and
1134         rnglists.
1135         * xcoffread.c (dwarf2_xcoff_names): Update struct dwarf2_debug_sections
1136         fields.
1137
1138 2017-02-20  Jan Kratochvil  <jan.kratochvil@redhat.com>
1139
1140         * dwarf2read.c (abbrev_table_read_table): Read the data only once.
1141
1142 2017-02-20  Jan Kratochvil  <jan.kratochvil@redhat.com>
1143
1144         * dwarf2read.c (dwarf2_ranges_process): New function from
1145         dwarf2_ranges_read.
1146         (dwarf2_ranges_read, dwarf2_record_block_ranges): Use
1147         dwarf2_ranges_process.
1148
1149 2017-02-20  Jan Kratochvil  <jan.kratochvil@redhat.com>
1150
1151         * dwarf2read.c (create_debug_type_hash_table): New function from
1152         create_debug_types_hash_table.
1153         (create_debug_types_hash_table): Call create_debug_type_hash_table.
1154         (create_all_type_units, open_and_init_dwo_file): Update
1155         create_debug_types_hash_table callers.
1156
1157 2017-02-20  Sergio Durigan Junior  <sergiodj@redhat.com>
1158
1159         PR gdb/16188
1160         * fork-child.c (trace_start_error): Fix thinko.  va_end should
1161         refer to 'ap', not 'args'.
1162
1163 2017-02-20  Sergio Durigan Junior  <sergiodj@redhat.com>
1164             Pedro Alves  <palves@redhat.com>
1165
1166         PR gdb/16188
1167         * darwin-nat.c (darwin_ptrace_me): Check if calls to system
1168         calls succeeded.
1169         * fork-child.c (trace_start_error): New function.
1170         (trace_start_error_with_name): Likewise.
1171         * gnu-nat.c (gnu_ptrace_me): Check if call to PTRACE succeeded.
1172         * inf-ptrace.c (inf_ptrace_me): Likewise.
1173         * inferior.h (trace_start_error): New prototype.
1174         (trace_start_error_with_name): Likewise.
1175
1176 2017-02-15  Sergio Durigan Junior  <sergiodj@redhat.com>
1177
1178         PR gdb/21164
1179         * psymtab.c (maintenance_print_psymbols): Verify if 'argv' is not
1180         NULL before using it.
1181         * symmisc.c (maintenance_print_symbols): Likewise.
1182         (maintenance_print_msymbols): Likewise.
1183
1184 2017-02-14  Tim Wiederhake  <tim.wiederhake@intel.com>
1185
1186         * NEWS: Add record Python bindings entry.
1187
1188 2017-02-14  Tim Wiederhake  <tim.wiederhake@intel.com>
1189
1190         * Makefile.in (SUBDIR_PYTHON_OBS): Add py-record-btrace.o,
1191         py-record-full.o.
1192         (SUBDIR_PYTHON_SRCS): Add py-record-btrace.c, py-record-full.c.
1193         * python/py-record-btrace.c, python/py-record-btrace.h,
1194         python/py-record-full.c, python/py-record-full.h: New file.
1195         * python/py-record.c: Add include for py-record-btrace.h and
1196         py-record-full.h.
1197         (recpy_method, recpy_format, recpy_goto, recpy_replay_position,
1198         recpy_instruction_history, recpy_function_call_history, recpy_begin,
1199         recpy_end): Use functions from py-record-btrace.c and py-record-full.c.
1200         * python/python-internal.h (PyInt_FromSsize_t, PyInt_AsSsize_t):
1201         New definition.
1202         (gdbpy_initialize_btrace): New export.
1203         * python/python.c (_initialize_python): Add gdbpy_initialize_btrace.
1204
1205 2017-02-14  Tim Wiederhake  <tim.wiederhake@intel.com>
1206
1207         * Makefile.in (SUBDIR_PYTHON_OBS): Add python/py-record.o.
1208         (SUBDIR_PYTHON_SRCS): Add python/py-record.c.
1209         * python/py-record.c: New file.
1210         * python/python-internal.h (gdbpy_start_recording,
1211         gdbpy_current_recording, gdpy_stop_recording,
1212         gdbpy_initialize_record): New export.
1213         * python/python.c (_initialize_python): Add gdbpy_initialize_record.
1214         (python_GdbMethods): Add gdbpy_start_recording,
1215         gdbpy_current_recording and gdbpy_stop_recording.
1216
1217 2017-02-14  Tim Wiederhake  <tim.wiederhake@intel.com>
1218
1219         * record-btrace.c (record_btrace_record_method): New function.
1220         (init_record_btrace_ops): Initialize to_record_method.
1221         * record-full.c (record_full_record_method): New function.
1222         (init_record_full_ops, init_record_full_core_ops): Add
1223         record_full_record_method.
1224         * record.h (enum record_method): New enum.
1225         * target-debug.h (target_debug_print_enum_record_method: New define.
1226         * target-delegates.c: Regenerate.
1227         * target.c (target_record_method): New function.
1228         * target.h: Include record.h.
1229         (struct target_ops) <to_record_method>: New field.
1230         (target_record_method): New export.
1231
1232 2017-02-14  Tim Wiederhake  <tim.wiederhake@intel.com>
1233
1234         * record.h (record_start, record_stop): New export.
1235         * record.c (record_start, record_stop): New function.
1236
1237 2017-02-14  Tim Wiederhake  <tim.wiederhake@intel.com>
1238
1239         * btrace.c (btrace_fetch): Copy function call segments pointer
1240         into a vector.
1241         (btrace_clear): Clear the vector.
1242         (btrace_find_insn_by_number): Use binary search to find the correct
1243         function call segment.
1244         * btrace.h (brace_fun_p): New typedef.
1245         (struct btrace_thread_info) <functions>: New field.
1246
1247 2017-02-14  Tim Wiederhake  <tim.wiederhake@intel.com>
1248
1249         * record-btrace.c (btrace_ui_out_decode_error): Move most of it ...
1250         * btrace.c (btrace_decode_error): ... here.  New function.
1251         * btrace.h (btrace_decode_error): New export.
1252
1253 2017-02-14  Tim Wiederhake  <tim.wiederhake@intel.com>
1254
1255         * btrace.c (ftrace_call_num_insn, btrace_insn_get_error): New function.
1256         (ftrace_new_function, btrace_insn_number, btrace_insn_cmp,
1257         btrace_find_insn_by_number): Remove special case for gaps.
1258         * btrace.h (btrace_insn_get_error): New export.
1259         (btrace_insn_number, btrace_find_insn_by_number): Adjust comment.
1260         * record-btrace.c (btrace_insn_history): Print number for gaps.
1261         (record_btrace_info, record_btrace_goto): Handle gaps.
1262
1263 2017-02-14  Tom Tromey  <tom@tromey.com>
1264
1265         PR python/13598:
1266         * python/python.c (gdbpy_before_prompt_hook): Emit before_prompt
1267         event.
1268         * python/py-evts.c (gdbpy_initialize_py_events): Add
1269         before_prompt registry.
1270         * python/py-events.h (events_object) <before_prompt>: New field.
1271
1272 2017-02-14  Markus Metzger  <markus.t.metzger@intel.com>
1273
1274         * btrace.c (ftrace_new_switch): Preserve up link and flags.
1275
1276 2017-02-13  Luis Machado  <lgustavo@codesourcery.com>
1277
1278         * symfile (_initialize_symfile): Add usage text to the load command's
1279         help text.
1280
1281 2017-02-10  Simon Marchi  <simon.marchi@ericsson.com>
1282
1283         * utils.c (defaulted_query): Don't query on secondary UIs.
1284
1285 2017-02-10  Tom Tromey  <tom@tromey.com>
1286
1287         * rust-lang.c (rust_get_disr_info): Remove unused variable.
1288
1289 2017-02-10  Tom Tromey  <tom@tromey.com>
1290
1291         * python/py-value.c (valpy_richcompare_throw): Remove unnecessary
1292         "cleanup" local.
1293         * python/py-type.c (typy_legacy_template_argument): Remove
1294         unnecessary "cleanup" local.
1295
1296 2017-02-10  Tom Tromey  <tom@tromey.com>
1297
1298         * python/python.c (do_start_initialization): New function, from
1299         _initialize_python.
1300         (_initialize_python): Call do_start_initialization.
1301         * python/py-linetable.c (ltpy_iternext): Use explicit returns, not
1302         goto.
1303
1304 2017-02-10  Tom Tromey  <tom@tromey.com>
1305
1306         * python/py-prettyprint.c (pretty_print_one_value): Use
1307         gdbpy_ref.
1308
1309 2017-02-10  Tom Tromey  <tom@tromey.com>
1310
1311         * python/py-cmd.c (cmdpy_destroyer): Use gdbpy_ref.
1312         * python/py-breakpoint.c (gdbpy_breakpoint_deleted): Use
1313         gdbpy_ref.
1314         * python/py-type.c (field_new): Use gdbpy_ref.
1315         * python/py-symtab.c (symtab_and_line_to_sal_object): Use
1316         gdbpy_ref.
1317         * python/py-progspace.c (pspy_new): Use gdbpy_ref.
1318         (py_free_pspace): Likewise.
1319         (pspace_to_pspace_object): Likewise.
1320         * python/py-objfile.c (objfpy_new): Use gdbpy_ref.
1321         (py_free_objfile): Likewise.
1322         (objfile_to_objfile_object): Likewise.
1323         * python/py-inferior.c (delete_thread_object): Use
1324         gdbpy_ref.
1325         (infpy_read_memory): Likewise.
1326         (py_free_inferior): Likewise.
1327         * python/py-evtregistry.c (create_eventregistry_object): Use
1328         gdbpy_ref.
1329         * python/py-event.c (create_event_object): Use gdbpy_ref.
1330
1331 2017-02-10  Tom Tromey  <tom@tromey.com>
1332
1333         * python/py-ref.h (gdbpy_ref_policy): Now a template.
1334         (gdbpy_ref): Now a template; allow subclasses of PyObject to be
1335         used.
1336         * python/py-arch.c, python/py-bpevent.c, python/py-breakpoint.c,
1337         python/py-cmd.c, python/py-continueevent.c, python/py-event.c,
1338         python/py-exitedevent.c, python/py-finishbreakpoint.c,
1339         python/py-framefilter.c, python/py-function.c,
1340         python/py-inferior.c, python/py-infevents.c,
1341         python/py-linetable.c, python/py-newobjfileevent.c,
1342         python/py-param.c, python/py-prettyprint.c, python/py-ref.h,
1343         python/py-signalevent.c, python/py-stopevent.c,
1344         python/py-symbol.c, python/py-threadevent.c, python/py-type.c,
1345         python/py-unwind.c, python/py-utils.c, python/py-value.c,
1346         python/py-varobj.c, python/py-xmethods.c, python/python.c,
1347         varobj.c: Change gdbpy_ref to gdbpy_ref<>.
1348
1349 2017-02-10  Tom Tromey  <tom@tromey.com>
1350
1351         * ui-out.h (ui_out_emit_type): New class.
1352         (ui_out_emit_tuple, ui_out_emit_list): New typedefs.
1353         * python/py-framefilter.c (py_print_single_arg): Use gdb::optional
1354         and ui_out_emit_tuple.
1355         (enumerate_locals): Likewise.
1356         (py_mi_print_variables, py_print_locals, py_print_args): Use
1357         ui_out_emit_list.
1358         (py_print_frame): Use gdb::optional, ui_out_emit_tuple,
1359         ui_out_emit_list.
1360         * common/gdb_optional.h: New file.
1361
1362 2017-02-10  Martin Galvan  <martingalvan@sourceware.org>
1363
1364         * MAINTAINERS (Write After Approval): Update my e-mail address.
1365
1366 2017-02-10  Martin Galvan  <martingalvan@sourceware.org>
1367
1368         PR gdb/21122
1369         * breakpoint.c (_initialize_breakpoint): Update the help description
1370         of the 'commands' command to indicate that it takes a list argument.
1371
1372 2017-02-09  Simon Marchi  <simon.marchi@ericsson.com>
1373
1374         * interps.c (current_interp_set_logging): Remove "return".
1375
1376 2017-02-09  Gary Benson  <gbenson@redhat.com>
1377
1378         * symtab.c (add_symtab_completions): Prevent NULL pointer
1379         dereference.
1380
1381 2017-02-08  Pedro Alves  <palves@redhat.com>
1382
1383         * interps.c (interp::interp): Remove reference to quiet_p.
1384         (interp_set): Make static.  Remove dead "Switching to" output
1385         code.
1386         (interp_quiet_p, interp_set_quiet): Delete.
1387         (interpreter_exec_cmd): Don't set the interpreter quiet.
1388         * interps.h (interp_quiet_p): Make static.
1389         (class interp) <quiet_p>: Remove field
1390
1391 2017-02-08  Jerome Guitton  <guitton@adacore.com>
1392
1393         * cli/cli-decode.c (find_command_name_length): Make it extern.
1394         * cli/cli-decode.h (find_command_name_length): Declare.
1395         * cli/cli-script.c (command_name_equals, line_first_arg):
1396         New functions.
1397         (process_next_line): Use cli-decode to parse command names.
1398         (build_command_line): Make args a constant pointer.
1399
1400 2017-02-08  Jerome Guitton  <guitton@adacore.com>
1401
1402         * cli-decode.c (lookup_cmd_1, lookup_cmd_composition):
1403         Remove case-insensitive search.
1404
1405 2017-02-07  Jose E. Marchesi  <jose.marchesi@oracle.com>
1406
1407         * sparc-tdep.c (sparc32_gdbarch_init): Do not place a + operator
1408         at the end of the line.  Avoids an ARI warning.
1409
1410 2017-02-06  Luis Machado  <lgustavo@codesourcery.com>
1411
1412         * NEWS: Mention support for record/replay of Intel 64 rdrand and
1413         rdseed instructions.
1414         i386-tdep.c (i386_process_record): Handle Intel 64 rdrand and rseed.
1415
1416 2017-02-06  Ivo Raisr  <ivo.raisr@oracle.com>
1417
1418         PR tdep/20936
1419         Provide and use sparc32 and sparc64 target description XML files.
1420         * features/sparc/sparc32-cp0.xml, features/sparc/sparc32-cpu.xml,
1421         features/sparc/sparc32-fpu.xml: New files for sparc 32-bit.
1422         * features/sparc/sparc64-cp0.xml, features/sparc/sparc64-cpu.xml,
1423         features/sparc/sparc64-fpu.xml: New files for sparc 64-bit.
1424         * features/sparc/sparc32-solaris.xml: New file.
1425         * features/sparc/sparc64-solaris.xml: New file.
1426         * features/sparc/sparc32-solaris.c: Generated.
1427         * features/sparc/sparc64-solaris.c: Generated.
1428         * sparc-tdep.h: Account for differences in target descriptions.
1429         * sparc-tdep.c (sparc32_register_name): Use target provided registers.
1430         (sparc32_register_type): Use target provided registers.
1431         (validate_tdesc_registers): New function.
1432         (sparc32_gdbarch_init): Use tdesc_has_registers.
1433         Set pseudoregister functions.
1434         * sparc64-tdep.c (sparc64_register_name): Use target provided registers.
1435         (sparc64_register_type): Use target provided registers.
1436         (sparc64_init_abi): Set pseudoregister functions.
1437
1438 2017-02-03  Tom Tromey  <tom@tromey.com>
1439
1440         PR rust/21097:
1441         * rust-lang.c (rust_print_type) <TYPE_CODE_UNION>: Handle enums
1442         with a single member.
1443
1444 2017-02-03  Pedro Alves  <palves@redhat.com>
1445
1446         * cli/cli-interp.c (cli_interp_base::cli_interp_base)
1447         (cli_interp_base::~cli_interp_base): New.
1448         (cli_interp): New struct.
1449         (as_cli_interp): Cast the interp itself to cli_interp.
1450         (cli_interpreter_pre_command_loop): Rename to ...
1451         (cli_interp_base::pre_command_loop): ... this.  Remove 'self'
1452         parameter.
1453         (cli_interpreter_init): Rename to ...
1454         (cli_interp::init): ... this.  Remove 'self' parameter.  Use
1455         boolean.  Make extern.
1456         (cli_interpreter_resume): Rename to ...
1457         (cli_interp::resume): ... this.  Remove 'data' parameter.  Make
1458         extern.
1459         (cli_interpreter_suspend): Rename to ...
1460         (cli_interp::suspend): ... this.  Remove 'data' parameter.  Make
1461         extern.
1462         (cli_interpreter_exec): Rename to ...
1463         (cli_interp::exec): ... this.  Remove 'data' parameter.  Make
1464         extern.
1465         (cli_interpreter_supports_command_editing): Rename to ...
1466         (cli_interp_base::supports_command_editing): ... this.  Remove
1467         'interp' parameter.  Make extern.
1468         (cli_ui_out): Rename to ...
1469         (cli_interp::interp_ui_out): ... this.  Remove 'interp' parameter.
1470         Make extern.
1471         (cli_set_logging): Rename to ...
1472         (cli_interp_base::set_logging): ... this.  Remove 'interp'
1473         parameter.  Make extern.
1474         (cli_interp_procs): Delete.
1475         (cli_interp_factory): Adjust to use "new".
1476         * cli/cli-interp.h: Include "interps.h".
1477         (struct cli_interp_base): New struct.
1478         * interps.c (struct interp): Delete.  Fields moved to interps.h.
1479         (interp_new): Delete.
1480         (interp::interp, interp::~interp): New.
1481         (interp_set): Use bool, and return void.  Assume the interpreter
1482         has suspend, init and resume methods, and that the all return
1483         void.
1484         (set_top_level_interpreter): interp_set returns void.
1485         (interp_ui_out): Adapt.
1486         (current_interp_set_logging): Adapt.
1487         (interp_data): Delete.
1488         (interp_pre_command_loop, interp_supports_command_editing): Adapt.
1489         (interp_exec): Adapt.
1490         (top_level_interpreter_data): Delete.
1491         * interps.h (interp_init_ftype, interp_resume_ftype)
1492         (interp_suspend_ftype, interp_exec_ftype)
1493         (interp_pre_command_loop_ftype, interp_ui_out_ftype): Delete.
1494         (class interp): New.
1495         (interp_new): Delete.
1496         (interp_set): Now returns void.  Use bool.
1497         (interp_data, top_level_interpreter_data): Delete.
1498         * mi/mi-common.h: Include interps.h.
1499         (class mi_interp): Inherit from interp.  Define a ctor.  Declare
1500         init, resume, suspect, exec, interp_ui_out, set_logging and
1501         pre_command_loop methods.
1502         * mi/mi-interp.c (as_mi_interp): Cast the interp itself.
1503         (mi_interpreter_init): Rename to ...
1504         (mi_interp::init): ... this.  Remove the 'interp' parameter, use
1505         bool, return void and make extern.  Adjust.
1506         (mi_interpreter_resume): ... Rename to ...
1507         (mi_interp::resume): ... this.  Remove the 'data' parameter,
1508         return void and make extern.  Adjust.
1509         (mi_interpreter_suspend): ... Rename to ...
1510         (mi_interp::suspend): ... this.  Remove the 'data' parameter,
1511         return void and make extern.  Adjust.
1512         (mi_interpreter_exec): ... Rename to ...
1513         (mi_interp::exec): ... this.  Remove the 'data' parameter and make
1514         extern.  Adjust.
1515         (mi_interpreter_pre_command_loop): ... Rename to ...
1516         (mi_interp::pre_command_loop): ... this.  Remove the 'self'
1517         parameter and make extern.
1518         (mi_on_normal_stop_1): Adjust.
1519         (mi_ui_out): Rename to ...
1520         (mi_interp::interp_ui_out): ... this.  Remove the 'interp'
1521         parameter and make extern.  Adjust.
1522         (mi_set_logging): Rename to ...
1523         (mi_interp::set_logging): ... this.  Remove the 'interp'
1524         parameter and make extern.  Adjust.
1525         (mi_interp_procs): Delete.
1526         (mi_interp_factory): Adjust to use 'new'.
1527         * mi/mi-main.c (mi_cmd_gdb_exit, captured_mi_execute_command)
1528         (mi_print_exception, mi_execute_command, mi_load_progress):
1529         Adjust.
1530         * tui/tui-interp.c (tui_interp): New class.
1531         (as_tui_interp): Return a tui_interp pointer.
1532         (tui_on_normal_stop, tui_on_signal_received)
1533         (tui_on_end_stepping_range, tui_on_signal_exited, tui_on_exited)
1534         (tui_on_no_history, tui_on_user_selected_context_changed): Adjust
1535         to use interp::interp_ui_out.
1536         (tui_init): Rename to ...
1537         (tui_interp::init): ... this.  Remove the 'self' parameter, use
1538         bool, return void and make extern.  Adjust.
1539         (tui_resume): Rename to ...
1540         (tui_interp::resume): ... this.  Remove the 'data' parameter,
1541         return void and make extern.  Adjust.
1542         (tui_suspend): Rename to ...
1543         (tui_interp::suspend): ... this.  Remove the 'data' parameter,
1544         return void and make extern.  Adjust.
1545         (tui_ui_out): Rename to ...
1546         (tui_interp::interp_ui_out): ... this.  Remove the 'self'
1547         parameter, and make extern.  Adjust.
1548         (tui_exec): Rename to ...
1549         (tui_interp::exec): ... this.  Remove the 'data' parameter and
1550         make extern.
1551         (tui_interp_procs): Delete.
1552         (tui_interp_factory): Use "new".
1553
1554 2017-02-02  Tom Tromey  <tom@tromey.com>
1555
1556         * rust-exp.y (ends_raw_string, space_then_number)
1557         (rust_identifier_start_p): Return bool.
1558         * rust-lang.c (rust_tuple_type_p, rust_underscore_fields)
1559         (rust_tuple_struct_type_p, rust_tuple_variant_type_p)
1560         (rust_slice_type_p, rust_range_type_p, rust_u8_type_p)
1561         (rust_chartype_p): Return bool.
1562         (val_print_struct, rust_print_struct_def, rust_print_type):
1563         Update.
1564         * rust-lang.h (rust_tuple_type_p, rust_tuple_struct_type_p):
1565         Return bool.
1566
1567 2017-02-02  Tom Tromey  <tom@tromey.com>
1568
1569         * rust-lang.c: Reindent.
1570
1571 2017-02-02  Tom Tromey  <tom@tromey.com>
1572
1573         * rust-lang.h (rust_crate_for_block): Update.
1574         * rust-lang.c (rust_crate_for_block): Return std::string.
1575         (rust_get_disr_info): Use std:;string, not
1576         gdb::unique_xmalloc_ptr.
1577         * rust-exp.y (crate_name): Update.
1578
1579 2017-02-02  Pedro Alves  <palves@redhat.com>
1580
1581         * disasm-selftests.c (print_one_insn_test): Move the "verbose"
1582         field out of gdb_disassembler_test and make it static.
1583
1584 2017-02-02  Pedro Alves  <palves@redhat.com>
1585
1586         * mi/mi-common.h (struct mi_interp): Delete the mi2_interp,
1587         mi1_interp and mi_interp fields.
1588
1589 2017-02-02  Pedro Alves  <palves@redhat.com>
1590
1591         * cli/cli-interp.c (struct saved_output_files, saved_output):
1592         Moved from cli/cli-logging.c.
1593         (cli_set_logging): New function.
1594         (cli_interp_procs): Install cli_set_logging.
1595         * cli/cli-interp.h (make_logging_output, cli_set_logging):
1596         Declare.
1597         * cli/cli-logging.c (struct saved_output_files, saved_output):
1598         Moved to cli/cli-interp.c.
1599         (pop_output_files): Don't save outputs here.
1600         (make_logging_output): New function.
1601         (handle_redirections): Don't build tee nor save previous outputs
1602         here.
1603         * interps.c (current_interp_set_logging): Change prototype.
1604         Assume there's always a set_logging_proc method installed.
1605         * interps.h (interp_set_logging_ftype): Change prototype.
1606         (current_interp_set_logging): Change prototype and adjust comment.
1607         * mi/mi-interp.c (mi_set_logging): Change protototype.  Adjust to
1608         use make_logging_output.
1609         * tui/tui-interp.c (tui_interp_procs): Install cli_set_logging.
1610 2017-02-02  Pedro Alves  <palves@redhat.com>
1611
1612         * cli/cli-logging.c (maybe_warn_already_logging): New factored out
1613         from ...
1614         (set_logging_overwrite): ... here.
1615         (logging_no_redirect_file): Delete.
1616         (set_logging_redirect): Don't handle redirection on the fly.
1617         Instead warn that "logging off" / "logging on" is necessary.
1618         (pop_output_files): Delete references to logging_no_redirect_file.
1619         (show_logging_command): Always speak in terms of what will happen
1620         once logging is reenabled.
1621
1622 2017-02-02  Pedro Alves  <palves@redhat.com>
1623
1624         * disasm.h (gdb_pretty_print_disassembler): Tweak intro comment.
1625
1626 2017-02-02  Pedro Alves  <palves@redhat.com>
1627
1628         * disasm.c (gdb_pretty_print_insn): Rename to ...
1629         (gdb_pretty_print_disassembler::pretty_print_insn): ... this.
1630         Remove gdbarch parameter.  Adapt to clear the object's buffers
1631         instead of allocating new buffers, and to print using the object's
1632         gdb_disassembler instead of calling gdb_print_insn.
1633         (dump_insns): Use gdb_pretty_print_disassembler.
1634         * disasm.h (gdb_pretty_print_insn): Delete declaration.
1635         (gdb_pretty_print_disassembler): New class.
1636         * record-btrace.c (btrace_insn_history): Use
1637         gdb_pretty_print_disassembler.
1638
1639 2017-02-02  Pedro Alves  <palves@redhat.com>
1640
1641         * ada-lang.c (type_as_string): Use string_file.
1642         * ada-valprint.c (ada_print_floating): Use string_file.
1643         * ada-varobj.c (ada_varobj_scalar_image)
1644         (ada_varobj_get_value_image): Use string_file.
1645         * aix-thread.c (aix_thread_extra_thread_info): Use string_file.
1646         * arm-tdep.c (_initialize_arm_tdep): Use string_printf.
1647         * breakpoint.c (update_inserted_breakpoint_locations)
1648         (insert_breakpoint_locations, reattach_breakpoints)
1649         (print_breakpoint_location, print_one_detail_ranged_breakpoint)
1650         (print_it_watchpoint): Use string_file.
1651         (save_breakpoints): Use stdio_file.
1652         * c-exp.y (oper): Use string_file.
1653         * cli/cli-logging.c (set_logging_redirect): Use ui_file_up and
1654         tee_file.
1655         (pop_output_files): Use delete.
1656         (handle_redirections): Use stdio_file and tee_file.
1657         * cli/cli-setshow.c (do_show_command): Use string_file.
1658         * compile/compile-c-support.c (c_compute_program): Use
1659         string_file.
1660         * compile/compile-c-symbols.c (generate_vla_size): Take a
1661         'string_file &' instead of a 'ui_file *'.
1662         (generate_c_for_for_one_variable): Take a 'string_file &' instead
1663         of a 'ui_file *'.  Use string_file.
1664         (generate_c_for_variable_locations): Take a 'string_file &'
1665         instead of a 'ui_file *'.
1666         * compile/compile-internal.h (generate_c_for_for_one_variable):
1667         Take a 'string_file &' instead of a 'ui_file *'.
1668         * compile/compile-loc2c.c (push, pushf, unary, binary)
1669         (print_label, pushf_register_address, pushf_register)
1670         (do_compile_dwarf_expr_to_c): Take a 'string_file &' instead of a
1671         'ui_file *'.  Adjust.
1672         * compile/compile.c (compile_to_object): Use string_file.
1673         * compile/compile.h (compile_dwarf_expr_to_c)
1674         (compile_dwarf_bounds_to_c): Take a 'string_file &' instead of a
1675         'ui_file *'.
1676         * cp-support.c (inspect_type): Use string_file and obstack_copy0.
1677         (replace_typedefs_qualified_name): Use string_file and
1678         obstack_copy0.
1679         * disasm.c (gdb_pretty_print_insn): Use string_file.
1680         (gdb_disassembly): Adjust reference the null_stream global.
1681         (do_ui_file_delete): Delete.
1682         (gdb_insn_length): Use null_stream.
1683         * dummy-frame.c (maintenance_print_dummy_frames): Use stdio_file.
1684         * dwarf2loc.c (dwarf2_compile_property_to_c)
1685         (locexpr_generate_c_location, loclist_generate_c_location): Take a
1686         'string_file &' instead of a 'ui_file *'.
1687         * dwarf2loc.h (dwarf2_compile_property_to_c): Likewise.
1688         * dwarf2read.c (do_ui_file_peek_last): Delete.
1689         (dwarf2_compute_name): Use string_file.
1690         * event-top.c (gdb_setup_readline): Use stdio_file.
1691         * gdbarch.sh (verify_gdbarch): Use string_file.
1692         * gdbtypes.c (safe_parse_type): Use null_stream.
1693         * guile/scm-breakpoint.c (gdbscm_breakpoint_commands): Use
1694         string_file.
1695         * guile/scm-disasm.c (gdbscm_print_insn_from_port): Take a
1696         'string_file *' instead of a 'ui_file *'.
1697         (gdbscm_arch_disassemble): Use string_file.
1698         * guile/scm-frame.c (frscm_print_frame_smob): Use string_file.
1699         * guile/scm-ports.c (class ioscm_file_port): Now a class that
1700         inherits from ui_file.
1701         (ioscm_file_port_delete, ioscm_file_port_rewind)
1702         (ioscm_file_port_put): Delete.
1703         (ioscm_file_port_write): Rename to ...
1704         (ioscm_file_port::write): ... this.  Remove file_port_magic
1705         checks.
1706         (ioscm_file_port_new): Delete.
1707         (ioscm_with_output_to_port_worker): Use ioscm_file_port and
1708         ui_file_up.
1709         * guile/scm-type.c (tyscm_type_name): Use string_file.
1710         * guile/scm-value.c (vlscm_print_value_smob, gdbscm_value_print):
1711         Use string_file.
1712         * infcmd.c (print_return_value_1): Use string_file.
1713         * infrun.c (print_target_wait_results): Use string_file.
1714         * language.c (add_language): Use string_file.
1715         * location.c (explicit_to_string_internal): Use string_file.
1716         * main.c (captured_main_1): Use null_file.
1717         * maint.c (maintenance_print_architecture): Use stdio_file.
1718         * mi/mi-cmd-stack.c (list_arg_or_local): Use string_file.
1719         * mi/mi-common.h (struct mi_interp) <out, err, log, targ,
1720         event_channel>: Change type to mi_console_file pointer.
1721         * mi/mi-console.c (mi_console_file_fputs, mi_console_file_flush)
1722         (mi_console_file_delete): Delete.
1723         (struct mi_console_file): Delete.
1724         (mi_console_file_magic): Delete.
1725         (mi_console_file_new): Delete.
1726         (mi_console_file::mi_console_file): New.
1727         (mi_console_file_delete): Delete.
1728         (mi_console_file_fputs): Delete.
1729         (mi_console_file::write): New.
1730         (mi_console_raw_packet): Delete.
1731         (mi_console_file::flush): New.
1732         (mi_console_file_flush): Delete.
1733         (mi_console_set_raw): Rename to ...
1734         (mi_console_file::set_raw): ... this.
1735         * mi/mi-console.h (class mi_console_file): New class.
1736         (mi_console_file_new, mi_console_set_raw): Delete.
1737         * mi/mi-interp.c (mi_interpreter_init): Use mi_console_file.
1738         (mi_set_logging): Use delete and tee_file.  Adjust.
1739         * mi/mi-main.c (output_register): Use string_file.
1740         (mi_cmd_data_evaluate_expression): Use string_file.
1741         (mi_cmd_data_read_memory): Use string_file.
1742         (mi_cmd_execute, print_variable_or_computed): Use string_file.
1743         * mi/mi-out.c (mi_ui_out::main_stream): New.
1744         (mi_ui_out::rewind): Use main_stream and
1745         string_file.
1746         (mi_ui_out::put): Use main_stream and string_file.
1747         (mi_ui_out::mi_ui_out): Remove 'stream' parameter.
1748         Allocate a 'string_file' instead.
1749         (mi_out_new): Don't allocate a mem_fileopen stream here.
1750         * mi/mi-out.h (mi_ui_out::mi_ui_out): Remove 'stream' parameter.
1751         (mi_ui_out::main_stream): Declare method.
1752         * printcmd.c (eval_command): Use string_file.
1753         * psymtab.c (maintenance_print_psymbols): Use stdio_file.
1754         * python/py-arch.c (archpy_disassemble): Use string_file.
1755         * python/py-breakpoint.c (bppy_get_commands): Use string_file.
1756         * python/py-frame.c (frapy_str): Use string_file.
1757         * python/py-framefilter.c (py_print_type, py_print_single_arg):
1758         Use string_file.
1759         * python/py-type.c (typy_str): Use string_file.
1760         * python/py-unwind.c (unwind_infopy_str): Use string_file.
1761         * python/py-value.c (valpy_str): Use string_file.
1762         * record-btrace.c (btrace_insn_history): Use string_file.
1763         * regcache.c (regcache_print): Use stdio_file.
1764         * reggroups.c (maintenance_print_reggroups): Use stdio_file.
1765         * remote.c (escape_buffer): Use string_file.
1766         * rust-lang.c (rust_get_disr_info): Use string_file.
1767         * serial.c (serial_open_ops_1): Use stdio_file.
1768         (do_serial_close): Use delete.
1769         * stack.c (print_frame_arg): Use string_file.
1770         (print_frame_args): Remove local mem_fileopen stream, not used.
1771         (print_frame): Use string_file.
1772         * symmisc.c (maintenance_print_symbols): Use stdio_file.
1773         * symtab.h (struct symbol_computed_ops) <generate_c_location>:
1774         Take a 'string_file *' instead of a 'ui_file *'.
1775         * top.c (new_ui): Use stdio_file and stderr_file.
1776         (free_ui): Use delete.
1777         (execute_command_to_string): Use string_file.
1778         (quit_confirm): Use string_file.
1779         * tracepoint.c (collection_list::append_exp): Use string_file.
1780         * tui/tui-disasm.c (tui_disassemble): Use string_file.
1781         * tui/tui-file.c: Don't include "ui-file.h".
1782         (enum streamtype, struct tui_stream): Delete.
1783         (tui_file_new, tui_file_delete, tui_fileopen, tui_sfileopen)
1784         (tui_file_isatty, tui_file_rewind, tui_file_put): Delete.
1785         (tui_file::tui_file): New method.
1786         (tui_file_fputs): Delete.
1787         (tui_file_get_strbuf): Delete.
1788         (tui_file::puts): New method.
1789         (tui_file_adjust_strbuf): Delete.
1790         (tui_file_flush): Delete.
1791         (tui_file::flush): New method.
1792         * tui/tui-file.h: Tweak intro comment.
1793         Include ui-file.h.
1794         (tui_fileopen, tui_sfileopen, tui_file_get_strbuf)
1795         (tui_file_adjust_strbuf): Delete declarations.
1796         (class tui_file): New class.
1797         * tui/tui-io.c (tui_initialize_io): Use tui_file.
1798         * tui/tui-regs.c (tui_restore_gdbout): Use delete.
1799         (tui_register_format): Use string_stream.
1800         * tui/tui-stack.c (tui_make_status_line): Use string_file.
1801         (tui_get_function_from_frame): Use string_file.
1802         * typeprint.c (type_to_string): Use string_file.
1803         * ui-file.c (struct ui_file, ui_file_magic, ui_file_new): Delete.
1804         (null_stream): New global.
1805         (ui_file_delete): Delete.
1806         (ui_file::ui_file): New.
1807         (null_file_isatty): Delete.
1808         (ui_file::~ui_file): New.
1809         (null_file_rewind): Delete.
1810         (ui_file::printf): New.
1811         (null_file_put): Delete.
1812         (null_file_flush): Delete.
1813         (ui_file::putstr): New.
1814         (null_file_write): Delete.
1815         (ui_file::putstrn): New.
1816         (null_file_read): Delete.
1817         (ui_file::putc): New.
1818         (null_file_fputs): Delete.
1819         (null_file_write_async_safe): Delete.
1820         (ui_file::vprintf): New.
1821         (null_file_delete): Delete.
1822         (null_file::write): New.
1823         (null_file_fseek): Delete.
1824         (null_file::puts): New.
1825         (ui_file_data): Delete.
1826         (null_file::write_async_safe): New.
1827         (gdb_flush, ui_file_isatty): Adjust.
1828         (ui_file_put, ui_file_rewind): Delete.
1829         (ui_file_write): Adjust.
1830         (ui_file_write_for_put): Delete.
1831         (ui_file_write_async_safe, ui_file_read): Adjust.
1832         (ui_file_fseek): Delete.
1833         (fputs_unfiltered): Adjust.
1834         (set_ui_file_flush, set_ui_file_isatty, set_ui_file_rewind)
1835         (set_ui_file_put, set_ui_file_write, set_ui_file_write_async_safe)
1836         (set_ui_file_read, set_ui_file_fputs, set_ui_file_fseek)
1837         (set_ui_file_data): Delete.
1838         (string_file::~string_file, string_file::write)
1839         (struct accumulated_ui_file, do_ui_file_xstrdup, ui_file_xstrdup)
1840         (do_ui_file_as_string, ui_file_as_string): Delete.
1841         (do_ui_file_obsavestring, ui_file_obsavestring): Delete.
1842         (struct mem_file): Delete.
1843         (mem_file_new): Delete.
1844         (stdio_file::stdio_file): New.
1845         (mem_file_delete): Delete.
1846         (stdio_file::stdio_file): New.
1847         (mem_fileopen): Delete.
1848         (stdio_file::~stdio_file): New.
1849         (mem_file_rewind): Delete.
1850         (stdio_file::set_stream): New.
1851         (mem_file_put): Delete.
1852         (stdio_file::open): New.
1853         (mem_file_write): Delete.
1854         (stdio_file_magic, struct stdio_file): Delete.
1855         (stdio_file_new, stdio_file_delete, stdio_file_flush): Delete.
1856         (stdio_file::flush): New.
1857         (stdio_file_read): Rename to ...
1858         (stdio_file::read): ... this.  Adjust.
1859         (stdio_file_write): Rename to ...
1860         (stdio_file::write): ... this.  Adjust.
1861         (stdio_file_write_async_safe): Rename to ...
1862         (stdio_file::write_async_safe) ... this.  Adjust.
1863         (stdio_file_fputs): Rename to ...
1864         (stdio_file::puts) ... this.  Adjust.
1865         (stdio_file_isatty): Delete.
1866         (stdio_file_fseek): Delete.
1867         (stdio_file::isatty): New.
1868         (stderr_file_write): Rename to ...
1869         (stderr_file::write) ... this.  Adjust.
1870         (stderr_file_fputs): Rename to ...
1871         (stderr_file::puts) ... this.  Adjust.
1872         (stderr_fileopen, stdio_fileopen, gdb_fopen): Delete.
1873         (stderr_file::stderr_file): New.
1874         (tee_file_magic): Delete.
1875         (struct tee_file): Delete.
1876         (tee_file::tee_file): New.
1877         (tee_file_new): Delete.
1878         (tee_file::~tee_file): New.
1879         (tee_file_delete): Delete.
1880         (tee_file_flush): Rename to ...
1881         (tee_file::flush): ... this.  Adjust.
1882         (tee_file_write): Rename to ...
1883         (tee_file::write): ... this.  Adjust.
1884         (tee_file::write_async_safe): New.
1885         (tee_file_fputs): Rename to ...
1886         (tee_file::puts): ... this.  Adjust.
1887         (tee_file_isatty): Rename to ...
1888         (tee_file::isatty): ... this.  Adjust.
1889         * ui-file.h (struct obstack, struct ui_file): Don't
1890         forward-declare.
1891         (ui_file_new, ui_file_flush_ftype, set_ui_file_flush)
1892         (ui_file_write_ftype)
1893         (set_ui_file_write, ui_file_fputs_ftype, set_ui_file_fputs)
1894         (ui_file_write_async_safe_ftype, set_ui_file_write_async_safe)
1895         (ui_file_read_ftype, set_ui_file_read, ui_file_isatty_ftype)
1896         (set_ui_file_isatty, ui_file_rewind_ftype, set_ui_file_rewind)
1897         (ui_file_put_method_ftype, ui_file_put_ftype, set_ui_file_put)
1898         (ui_file_delete_ftype, set_ui_file_data, ui_file_fseek_ftype)
1899         (set_ui_file_fseek): Delete.
1900         (ui_file_data, ui_file_delete, ui_file_rewind)
1901         (struct ui_file): New.
1902         (ui_file_up): New.
1903         (class null_file): New.
1904         (null_stream): Declare.
1905         (ui_file_write_for_put, ui_file_put): Delete.
1906         (ui_file_xstrdup, ui_file_as_string, ui_file_obsavestring):
1907         Delete.
1908         (ui_file_fseek, mem_fileopen, stdio_fileopen, stderr_fileopen)
1909         (gdb_fopen, tee_file_new): Delete.
1910         (struct string_file): New.
1911         (struct stdio_file): New.
1912         (stdio_file_up): New.
1913         (struct stderr_file): New.
1914         (class tee_file): New.
1915         * ui-out.c (ui_out::field_stream): Take a 'string_file &' instead
1916         of a 'ui_file *'.  Adjust.
1917         * ui-out.h (class ui_out) <field_stream>: Likewise.
1918         * utils.c (do_ui_file_delete, make_cleanup_ui_file_delete)
1919         (null_stream): Delete.
1920         (error_stream): Take a 'string_file &' instead of a 'ui_file *'.
1921         Adjust.
1922         * utils.h (struct ui_file): Delete forward declaration..
1923         (make_cleanup_ui_file_delete, null_stream): Delete declarations.
1924         (error_stream): Take a 'string_file &' instead of a
1925         'ui_file *'.
1926         * varobj.c (varobj_value_get_print_value): Use string_file.
1927         * xtensa-tdep.c (xtensa_verify_config): Use string_file.
1928         * gdbarch.c: Regenerate.
1929
1930 2017-02-02  Pedro Alves  <palves@redhat.com>
1931
1932         * disasm.c (gdb_disassembler::pretty_print_insn): Rename to...
1933         (gdb_pretty_print_insn): ... this.  Now a free function.  Add back
1934         a 'gdbarch' parameter.  Allocate a mem_fileopen stream here.
1935         Adjust to call gdb_print_insn instead of
1936         gdb_disassembler::print_insn.
1937         (dump_insns, do_mixed_source_and_assembly_deprecated)
1938         (do_mixed_source_and_assembly, do_assembly_only): Add back a
1939         'gdbarch' parameter.  Remove gdb_disassembler parameter.
1940         (gdb_disassembly): Don't allocate a gdb_disassembler here.
1941         * disasm.h (gdb_disassembler::pretty_print_insn): Delete
1942         declaration.
1943         (gdb_pretty_print_insn): Re-add declaration.
1944         * record-btrace.c (btrace_insn_history): Don't allocate a
1945         gdb_disassembler here.  Adjust to call gdb_pretty_print_insn.
1946
1947 2017-02-01  Simon Marchi  <simon.marchi@polymtl.ca>
1948
1949         * disasm.h (gdb_disassembly): Remove file_string parameter.
1950         * disasm.c (gdb_disassembly): Likewise.
1951         * cli/cli-cmds.c (print_disassembly): Adapt.
1952         * mi/mi-cmd-disas.c (mi_cmd_disassemble): Likewise.
1953         * stack.c (do_gdb_disassembly): Likewise.
1954
1955 2017-02-01  Andreas Arnez  <arnez@linux.vnet.ibm.com>
1956
1957         * dwarf2loc.c (dwarf2_evaluate_loc_desc_full): For
1958         DWARF_VALUE_LITERAL, no longer ignore the offset on big-endian
1959         targets.  And if the implicit value is longer than needed, extract
1960         the first bytes instead of the "least significant" ones.
1961
1962 2017-02-01  Markus Metzger  <markus.t.metzger@intel.com>
1963
1964         * btrace.c (btrace_enable): Do not call btrace_add_pc for
1965         BTRACE_FORMAT_PT or if can_access_registers_ptid returns false.
1966         (btrace_fetch): Assert can_access_registers_ptid.
1967         * record-btrace.c (require_btrace_thread, record_btrace_info): Call
1968         validate_registers_access.
1969
1970 2017-02-01  Markus Metzger  <markus.t.metzger@intel.com>
1971
1972         * gdbthread.h (can_access_registers_ptid): New.
1973         * thread.c (can_access_registers_ptid): New.
1974
1975 2017-02-01  Pedro Alves  <palves@redhat.com>
1976
1977         * i386-tdep.c (i386_fast_tracepoint_valid_at): Use gdb_insn_length.
1978
1979 2017-01-31  Pedro Alves  <palves@redhat.com>
1980
1981         * mi/mi-interp.c (mi_breakpoint_created, mi_breakpoint_modified):
1982         Fix typos.
1983
1984 2017-01-31  Pedro Alves  <palves@redhat.com>
1985
1986         * stack.c (print_frame_args): Remove local mem_fileopen stream,
1987         not used.
1988
1989 2017-01-31  Pedro Alves  <palves@redhat.com>
1990
1991         * varobj.c (varobj_value_get_print_value): Remove xstrdup call.
1992
1993 2017-01-31  Pedro Alves  <palves@redhat.com>
1994
1995         * common/scoped_restore.h
1996         (scoped_restore_tmpl::scoped_restore_tmpl): Template on T2, and
1997         change the value's parameter type to T2.
1998         (make_scoped_restore): Likewise.
1999
2000 2017-01-27  Walfred Tedeschi  <walfred.tedeschi@intel.com>
2001             Richard Henderson  <rth@redhat.com>
2002
2003         * amd64-linux-nat.c (PTRACE_ARCH_PRCTL): New define.
2004         (amd64_linux_fetch_inferior_registers): Add case to fetch FS_BASE
2005         GS_BASE for older kernels.
2006         (amd64_linux_store_inferior_registers): Add case to store FS_BASE
2007         GS_BASE for older kernels.
2008         * amd64-linux-tdep.c (amd64_linux_gregset_reg_offset): Add FS_BASE
2009         and GS_BASE to the offset table.
2010         (amd64_linux_register_reggroup_p): Add FS_BASE and GS_BASE to the
2011         system register group.
2012         * amd64-nat.c (amd64_native_gregset_reg_offset): Implements case
2013         for older kernels.
2014         * amd64-tdep.c (amd64_init_abi): Add segment registers for the
2015         amd64 ABI.
2016         * amd64-tdep.h (amd64_regnum): Add AMD64_FSBASE_REGNUM and
2017         AMD64_GSBASE_REGNUM.
2018         (AMD64_NUM_REGS): Set to AMD64_GSBASE_REGNUM + 1.
2019         * features/Makefile (amd64-linux.dat, amd64-avx-linux.dat)
2020         (amd64-mpx-linux.dat, amd64-avx512-linux.dat, x32-linux.dat)
2021         (x32-avx-linux.dat, x32-avx512-linux.dat): Add
2022         i386/64bit-segments.xml in those rules.
2023         * features/i386/64bit-segments.xml: New file.
2024         * features/i386/amd64-avx-mpx-linux.xml: Add 64bit-segments.xml.
2025         * features/i386/amd64-avx-linux.xml: Add 64bit-segments.xml.
2026         * features/i386/amd64-avx512-linux.xml: Add 64bit-segments.xml.
2027         * features/i386/amd64-mpx-linux.xml: Add 64bit-segments.xml.
2028         * features/i386/x32-avx512-linux.xml: Add 64bit-segments.xml.
2029         * features/i386/x32-avx-linux.xml: Add 64bit-segments.xml.
2030         * features/i386/amd64-linux.xml: Add 64bit-segments.xml.
2031         * features/i386/amd64-avx-linux.c: Regenerated.
2032         * features/i386/amd64-avx-mpx-linux.c: Regenerated.
2033         * features/i386/amd64-avx-mpx.c: Regenerated.
2034         * features/i386/amd64-avx512-linux.c: Regenerated.
2035         * features/i386/amd64-linux.c: Regenerated.
2036         * features/i386/amd64-mpx-linux.c: Regenerated.
2037         * features/i386/i386-avx-mpx-linux.c: Regenerated.
2038         * features/i386/i386-avx-mpx.c: Regenerated.
2039         * features/i386/x32-avx-linux.c: Regenerated.
2040         * features/i386/x32-avx512-linux.c: Regenerated.
2041         * regformats/i386/amd64-avx-linux.dat: Regenerated.
2042         * regformats/i386/amd64-avx-mpx-linux.dat: Regenerated.
2043         * regformats/i386/amd64-avx512-linux.dat: Regenerated.
2044         * regformats/i386/amd64-linux.dat: Regenerated.
2045         * regformats/i386/amd64-mpx-linux.dat: Regenerated.
2046         * regformats/i386/x32-avx-linux.dat: Regenerated.
2047         * regformats/i386/x32-avx512-linux.dat: Regenerated.
2048         * regformats/i386/x32-linux.dat: Regenerated.
2049
2050 2017-01-27  Walfred Tedeschi  <walfred.tedeschi@intel.com>
2051
2052         * amd64-linux-tdep.h (AMD64_LINUX_ORIG_RAX_REGNUM):
2053         Set to AMD64_NUM_REGS.
2054
2055 2017-01-27  Walfred Tedeschi  <walfred.tedeschi@intel.com>
2056
2057         * amd64-nat.c (amd64_native_gregset_reg_offset): Simplify logic
2058         that checks validity of a register number.
2059
2060 2017-01-27  Kees Cook  <keescook@google.com>
2061
2062         * gdb/arm-linux-nat.c (arm_linux_fetch_inferior_registers): Call
2063         fetch_fpregs if target has fpa registers.
2064         (arm_linux_store_inferior_registers): Call store_fpregs if target
2065         has fpa registers.
2066
2067 2017-01-26  Andreas Arnez  <arnez@linux.vnet.ibm.com>
2068
2069         * cris-tdep.c (cris_gdbarch_init): Remove check for
2070         info.byte_order and force it to BFD_ENDIAN_LITTLE.
2071
2072 2017-01-26  Antoine Tremblay  <antoine.tremblay@ericsson.com>
2073
2074         * corelow.c (get_core_register_section): Check for regset
2075         existence before checking for REGSET_VARIABLE_SIZE.
2076
2077 2017-01-26  Yao Qi  <yao.qi@linaro.org>
2078             Pedro Alves  <palves@redhat.com>
2079
2080         PR gdb/20939
2081         * disasm.c (gdb_disassembler::dis_asm_memory_error): Don't
2082         call memory_error, save memaddr instead.
2083         (gdb_disassembler::print_insn): If gdbarch_print_insn returns
2084         negative, cal memory_error.
2085         * disasm.h (gdb_disassembler) <m_err_memaddr>: New field.
2086
2087 2017-01-26  Yao Qi  <yao.qi@linaro.org>
2088
2089         * disasm-selftests.c (memory_error_test): New function.
2090         (_initialize_disasm_selftests): Register memory_error_test.
2091
2092 2017-01-26  Yao Qi  <yao.qi@linaro.org>
2093
2094         * Makefile.in (SFILES): Add disasm-selftests.c and
2095         selftest-arch.c.
2096         (COMMON_OBS): Add disasm-selftests.o and selftest-arch.o.
2097         * disasm-selftests.c: New file.
2098         * selftest-arch.c: New file.
2099         * selftest-arch.h: New file.
2100
2101 2017-01-26  Yao Qi  <yao.qi@linaro.org>
2102
2103         * mep-tdep.c (mep_gdb_print_insn): Set info->arch
2104         to bfd_arch_mep.  Don't return 0 if section is not
2105         found.  Call print_insn_mep.
2106
2107 2017-01-26  Pedro Alves  <palves@redhat.com>
2108             Yao Qi  <yao.qi@linaro.org>
2109
2110         * arm-tdep.c: Include "disasm.h".
2111         (gdb_print_insn_arm): Update code to get gdbarch.
2112         * disasm.c (dis_asm_read_memory): Change it to
2113         gdb_disassembler::dis_asm_read_memory.
2114         (dis_asm_memory_error): Likewise.
2115         (dis_asm_print_address): Likewise.
2116         (gdb_pretty_print_insn): Change it to
2117         gdb_disassembler::pretty_print_insn.
2118         (dump_insns): Add one argument gdb_disassemlber.  All
2119         callers updated.
2120         (do_mixed_source_and_assembly_deprecated): Likewise.
2121         (do_mixed_source_and_assembly): Likewise.
2122         (do_assembly_only): Likewise.
2123         (gdb_disassembler::gdb_disassembler): New.
2124         (gdb_disassembler::print_insn): New.
2125         * disasm.h (class gdb_disassembler): New.
2126         (gdb_pretty_print_insn): Remove declaration.
2127         (gdb_disassemble_info): Likewise.
2128         * guile/scm-disasm.c (class gdbscm_disassembler): New.
2129         (gdbscm_disasm_read_memory_worker): Update.
2130         (gdbscm_disasm_read_memory): Update.
2131         (gdbscm_disasm_memory_error): Remove.
2132         (gdbscm_disasm_print_address): Remove.
2133         (gdbscm_disassembler::gdbscm_disassembler): New.
2134         (gdbscm_print_insn_from_port): Update.
2135         * mips-tdep.c: Include disasm.h.
2136         (gdb_print_insn_mips): Update code to get gdbarch.
2137         * record-btrace.c (btrace_insn_history): Update.
2138         * spu-tdep.c: Include disasm.h.
2139         (struct spu_dis_asm_data): Remove.
2140         (struct spu_dis_asm_info): New.
2141         (spu_dis_asm_print_address): Use spu_dis_asm_info to get
2142         SPU id.
2143         (gdb_print_insn_spu): Cast disassemble_info to
2144         spu_dis_asm_info.
2145
2146 2017-01-26  Yao Qi  <yao.qi@linaro.org>
2147
2148         * disasm.c (do_ui_file_delete): Delete.
2149         (gdb_insn_length): Move code creating stream to ...
2150         * utils.c (null_stream): ... here.  New function.
2151         * utils.h (null_stream): Declare.
2152
2153 2017-01-23  Simon Marchi  <simon.marchi@polymtl.ca>
2154
2155         * python/py-inferior.c (find_thread_object): Return directly
2156         from the loop.  Remove "found" variable.
2157
2158 2017-01-21  Joel Brobecker  <brobecker@adacore.com>
2159
2160         GDB 7.12.1 released.
2161
2162 2017-01-20  Simon Marchi  <simon.marchi@ericsson.com>
2163
2164         * python/py-function.c (fnpy_call): Reorder declarations to have
2165         the gdbpy_enter object declared first.
2166         * python/py-xmethods.c (gdbpy_get_xmethod_arg_types): Likewise.
2167
2168 2017-01-20  Simon Marchi  <simon.marchi@ericsson.com>
2169
2170         PR python/21068
2171         * python/python-internal.h (PyMem_RawMalloc): Define for
2172         Python < 3.4.
2173         * python/py-gdb-readline.c (gdbpy_readline_wrapper): Use
2174         PyMem_RawMalloc instead of PyMem_Malloc.
2175
2176 2017-01-20  Mike Wrighton  <mike_wrighton@codesourcery.com>
2177             Luis Machado  <lgustavo@codesourcery.com>
2178
2179         * NEWS (New commands): Mention flash-erase.
2180         (New MI commands): Mention target-flash-erase.
2181         * mi/mi-cmds.c (mi_cmd_target_flash_erase): Add target-flash-erase MI
2182         command.
2183         * mi/mi-cmds.h (mi_cmd_target_flash_erase): New declaration.
2184         * mi/mi-main.c (mi_cmd_target_flash_erase): New function.
2185         * target.c (flash_erase_command): New function.
2186         (initialize_targets): Add new flash-erase command.
2187         * target.h (flash_erase_command): New declaration.
2188
2189 2017-01-20  Joel Brobecker  <brobecker@adacore.com>
2190
2191         * nat/linux-ptrace.c: Only include <sys/procfs.h> if
2192         HAVE_SYS_PROCFS_H is defined.
2193
2194 2017-01-18  Alan Hayward  <alan.hayward@arm.com>
2195
2196         * remote.c (struct cached_reg): Change data into a pointer.
2197         * (stop_reply_dtr): Free data pointers before deleting vector.
2198         (process_stop_reply): Likewise.
2199         (remote_parse_stop_reply): Allocate space for data
2200
2201 2017-01-18  Alan Hayward  <alan.hayward@arm.com>
2202
2203         * amd64-tdep.c (amd64_pseudo_register_read_value): remove
2204         MAX_REGISTER_SIZE.
2205         (amd64_pseudo_register_read_value): Likewise.
2206         * remote.c (fetch_register_using_p): Remove MAX_REGISTER_SIZE.
2207         (store_register_using_P): Likewise.
2208         * regcache.c (regcache_xfer_part): Likewise.
2209
2210 2017-01-16  Ivo Raisr  <ivo.raisr@oracle.com>
2211
2212         Split real and pseudo registers.
2213         * sparc-tdep.h (SPARC_CORE_REGISTERS): New macro.
2214         (sparc32_pseudo_regnum): New enum.
2215         * sparc64-tdep.h (sparc64_pseudo_regnum): New enum.
2216         * sparc-tdep.c (SPARC32_FPU_REGISTERS): New macro.
2217         (SPARC32_CP0_REGISTERS): New macro.
2218         (sparc32_pseudo_register_name): New function.
2219         (sparc32_register_name): Use sparc32_pseudo_register_name.
2220         (sparc32_pseudo_register_type): New function.
2221         (sparc32_register_type): Use sparc32_pseudo_register_type.
2222         (sparc32_pseudo_register_read, sparc32_pseudo_register_write): Handle
2223         pseudo register numbers.
2224         * sparc64-tdep.c SPARC64_FPU_REGISTERS): New macro.
2225         (SPARC64_CP0_REGISTERS): New macro.
2226         (sparc64_pseudo_register_name): New function.
2227         (sparc64_register_name): Use sparc64_pseudo_register_name.
2228         (sparc64_pseudo_register_type): New function.
2229         (sparc64_register_type): Use sparc64_pseudo_register_type.
2230         (sparc64_pseudo_register_read, sparc64_pseudo_register_write): Handle
2231         pseudo register numbers.
2232         (sparc64_store_floating_fields, sparc64_extract_floating_fields,
2233         sparc64_store_arguments): Handle pseudo register numbers.
2234
2235 2017-01-13  Yao Qi  <yao.qi@linaro.org>
2236
2237         * remote.c (REMOTE_DEBUG_MAX_CHAR): New macro.
2238         (putpkt_binary): Print only REMOTE_DEBUG_MAX_CHAR chars in debug
2239         output.
2240         (getpkt_or_notif_sane_1): Likewise.
2241
2242 2017-01-13  Yao Qi  <yao.qi@linaro.org>
2243
2244         * Makefile.in (checker-headers): Use CXX and CXX_DIALET instead
2245         of CC.  Pass "-x c++-header" instead of "-x c".
2246
2247 2017-01-12  Simon Marchi  <simon.marchi@ericsson.com>
2248
2249         * remote.c (remote_can_async_p): Update comment.
2250
2251 2017-01-12  Simon Marchi  <simon.marchi@ericsson.com>
2252
2253         * linux-nat.c (linux_nat_can_async_p): Update comment.
2254
2255 2017-01-12  Simon Marchi  <simon.marchi@ericsson.com>
2256
2257         * serial.c (serial_open): Forget about "pc" and "lpt" serial interface.
2258
2259 2017-01-11  Simon Marchi  <simon.marchi@ericsson.com>
2260
2261         * cli/cli-decode.c (lookup_cmd_1): Fix typo in comment.
2262
2263 2017-01-10  Tom Tromey  <tom@tromey.com>
2264
2265         * python/py-type.c (typy_legacy_template_argument): Update.
2266         * cp-support.h (struct demangle_parse_info) (demangle_parse_info,
2267         ~demangle_parse_info): Declare new members.
2268         (cp_demangled_name_to_comp): Return unique_ptr.
2269         (cp_demangled_name_parse_free)
2270         (make_cleanup_cp_demangled_name_parse_free)
2271         (cp_new_demangle_parse_info): Remove.
2272         * cp-support.c (do_demangled_name_parse_free_cleanup)
2273         (make_cleanup_cp_demangled_name_parse_free): Remove.
2274         (inspect_type, cp_canonicalize_string_full)
2275         (cp_canonicalize_string): Update.
2276         (mangled_name_to_comp): Change return type.
2277         (cp_class_name_from_physname, method_name_from_physname)
2278         (cp_func_name, cp_remove_params): Update.
2279         * cp-name-parser.y (demangle_parse_info): New constructor, from
2280         cp_new_demangle_parse_info.
2281         (~demangle_parse_info): New destructor, from
2282         cp_demangled_name_parse_free.
2283         (cp_merge_demangle_parse_infos): Update.
2284         (cp_demangled_name_to_comp): Change return type.
2285
2286 2017-01-10  Tom Tromey  <tom@tromey.com>
2287
2288         * top.c (prevent_dont_repeat): Change return type.
2289         * python/python.c (execute_gdb_command): Use std::string.
2290         Update.
2291         * guile/guile.c (gdbscm_execute_gdb_command): Update.
2292         * command.h (prevent_dont_repeat): Change return type.
2293         * breakpoint.c (bpstat_do_actions_1): Update.
2294
2295 2017-01-10  Tom Tromey  <tom@tromey.com>
2296
2297         * value.h (scoped_value_mark::~scoped_value_mark): Call
2298         free_to_mark.
2299         (scoped_value_mark::free_to_mark): New method.
2300         * dwarf2loc.c (dwarf2_evaluate_loc_desc_full): Use
2301         scoped_value_mark.
2302
2303 2017-01-10  Tom Tromey  <tom@tromey.com>
2304
2305         * python/py-value.c (valpy_dereference, valpy_referenced_value)
2306         (valpy_reference_value, valpy_const_value, valpy_get_address)
2307         (valpy_get_dynamic_type, valpy_lazy_string, valpy_do_cast)
2308         (valpy_getitem, valpy_call, valpy_binop_throw, valpy_negative)
2309         (valpy_absolute, valpy_richcompare_throw): Use scoped_value_mark.
2310         * dwarf2loc.c (dwarf2_loc_desc_get_symbol_read_needs): Use
2311         scoped_value_mark.
2312         * dwarf2-frame.c (execute_stack_op): Use scoped_value_mark.
2313         * value.h (scoped_value_mark): New class.
2314
2315 2017-01-10  Tom Tromey  <tom@tromey.com>
2316
2317         * dwarf2read.c (dwarf2_build_psymtabs): Use psymtab_discarder.
2318         * psympriv.h (make_cleanup_discard_psymtabs): Don't declare.
2319         * psymtab.c (discard_psymtabs_upto): Remove.
2320         (make_cleanup_discard_psymtabs): Remove.
2321         (struct psymtab_state): Remove.
2322
2323 2017-01-10  Tom Tromey  <tom@tromey.com>
2324
2325         * record-full.c (record_full_save_cleanups): Remove.
2326         (record_full_save): Use gdb::unlinker.
2327         * gcore.c (do_bfd_delete_cleanup): Remove.
2328         (gcore_command): Use gdb::unlinker, unique_xmalloc_ptr.  Remove
2329         cleanups.
2330         * dwarf2read.c (unlink_if_set): Remove.
2331         (write_psymtabs_to_index): Use gdb::unlinker.
2332         * common/gdb_unlinker.h: New file.
2333
2334 2017-01-10  Tom Tromey  <tom@tromey.com>
2335
2336         * windows-tdep.c (windows_xfer_shared_library): Update.
2337         * windows-nat.c (windows_make_so): Update.
2338         * utils.h (make_cleanup_bfd_unref): Remove.
2339         * utils.c (do_bfd_close_cleanup, make_cleanup_bfd_unref): Remove.
2340         * symfile.h (symfile_bfd_open)
2341         (find_separate_debug_file_in_section): Return gdb_bfd_ref_ptr.
2342         * symfile.c (read_symbols, symbol_file_add)
2343         (separate_debug_file_exists): Update.
2344         (symfile_bfd_open): Return gdb_bfd_ref_ptr.
2345         (generic_load, reread_symbols): Update.
2346         * symfile-mem.c (symbol_file_add_from_memory): Update.
2347         * spu-linux-nat.c (spu_bfd_open): Return gdb_bfd_ref_ptr.
2348         (spu_symbol_file_add_from_memory): Update.
2349         * solist.h (struct target_so_ops) <bfd_open>: Return
2350         gdb_bfd_ref_ptr.
2351         (solib_bfd_fopen, solib_bfd_open): Return gdb_bfd_ref_ptr.
2352         * solib.c (solib_bfd_fopen, solib_bfd_open): Return
2353         gdb_bfd_ref_ptr.
2354         (solib_map_sections, reload_shared_libraries_1): Update.
2355         * solib-svr4.c (enable_break): Update.
2356         * solib-spu.c (spu_bfd_fopen): Return gdb_bfd_ref_ptr.
2357         * solib-frv.c (enable_break2): Update.
2358         * solib-dsbt.c (enable_break): Update.
2359         * solib-darwin.c (gdb_bfd_mach_o_fat_extract): Return
2360         gdb_bfd_ref_ptr.
2361         (darwin_solib_get_all_image_info_addr_at_init): Update.
2362         (darwin_bfd_open): Return gdb_bfd_ref_ptr.
2363         * solib-aix.c (solib_aix_bfd_open): Return gdb_bfd_ref_ptr.
2364         * record-full.c (record_full_save): Update.
2365         * python/py-objfile.c (objfpy_add_separate_debug_file): Update.
2366         * procfs.c (insert_dbx_link_bpt_in_file): Update.
2367         * minidebug.c (find_separate_debug_file_in_section): Return
2368         gdb_bfd_ref_ptr.
2369         * machoread.c (macho_add_oso_symfile): Change abfd to
2370         gdb_bfd_ref_ptr.
2371         (macho_symfile_read_all_oso): Update.
2372         (macho_check_dsym): Return gdb_bfd_ref_ptr.
2373         (macho_symfile_read): Update.
2374         * jit.c (bfd_open_from_target_memory): Return gdb_bfd_ref_ptr.
2375         (jit_bfd_try_read_symtab): Update.
2376         * gdb_bfd.h (gdb_bfd_open, gdb_bfd_fopen, gdb_bfd_openr)
2377         (gdb_bfd_openw, gdb_bfd_openr_iovec)
2378         (gdb_bfd_openr_next_archived_file, gdb_bfd_fdopenr): Return
2379         gdb_bfd_ref_ptr.
2380         (gdb_bfd_ref_policy): New struct.
2381         (gdb_bfd_ref_ptr): New typedef.
2382         * gdb_bfd.c (gdb_bfd_open, gdb_bfd_fopen, gdb_bfd_openr)
2383         (gdb_bfd_openw, gdb_bfd_openr_iovec)
2384         (gdb_bfd_openr_next_archived_file, gdb_bfd_fdopenr): Return
2385         gdb_bfd_ref_ptr.
2386         * gcore.h (create_gcore_bfd): Return gdb_bfd_ref_ptr.
2387         * gcore.c (create_gcore_bfd): Return gdb_bfd_ref_ptr.
2388         (gcore_command): Update.
2389         * exec.c (exec_file_attach): Update.
2390         * elfread.c (elf_symfile_read): Update.
2391         * dwarf2read.c (dwarf2_get_dwz_file): Update.
2392         (try_open_dwop_file, open_dwo_file): Return gdb_bfd_ref_ptr.
2393         (open_and_init_dwo_file): Update.
2394         (open_dwp_file): Return gdb_bfd_ref_ptr.
2395         (open_and_init_dwp_file): Update.
2396         * corelow.c (core_open): Update.
2397         * compile/compile-object-load.c (compile_object_load): Update.
2398         * common/gdb_ref_ptr.h (ref_ptr::operator->): New operator.
2399         * coffread.c (coff_symfile_read): Update.
2400         * cli/cli-dump.c (bfd_openr_or_error, bfd_openw_or_error): Return
2401         gdb_bfd_ref_ptr.  Rename.
2402         (dump_bfd_file, restore_command): Update.
2403         * build-id.h (build_id_to_debug_bfd): Return gdb_bfd_ref_ptr.
2404         * build-id.c (build_id_to_debug_bfd): Return gdb_bfd_ref_ptr.
2405         (find_separate_debug_file_by_buildid): Update.
2406
2407 2017-01-10  Tom Tromey  <tom@tromey.com>
2408
2409         * common/gdb_ref_ptr.h: New file.
2410         * python/py-ref.h (struct gdbpy_ref_policy): New.
2411         (gdbpy_ref): Now a typedef.
2412
2413 2017-01-10  Tom Tromey  <tom@tromey.com>
2414
2415         * utils.h (make_cleanup_htab_delete): Don't declare.
2416         * utils.c (do_htab_delete_cleanup, make_cleanup_htab_delete):
2417         Remove.
2418         * linespec.c (decode_compound_collector): Add constructor,
2419         destructor.
2420         (lookup_prefix_sym): Remove cleanup.
2421         (symtab_collector): Add constructor, destructor.
2422         (collect_symtabs_from_filename): Remove cleanup.
2423         * disasm.c (do_mixed_source_and_assembly): Use htab_up.
2424         * compile/compile-c-symbols.c (generate_c_for_variable_locations):
2425         Use htab_up.
2426         * gnu-v3-abi.c (gnuv3_print_vtable): Use htab_up.
2427         * dwarf2read.c (dw2_expand_symtabs_matching)
2428         (dw2_map_symbol_filenames, dwarf_decode_macros)
2429         (write_psymtabs_to_index): Use htab_up.
2430         * dwarf2loc.c (func_verify_no_selftailcall)
2431         (call_site_find_chain_1, func_verify_no_selftailcall)
2432         (chain_candidate, call_site_find_chain_1): Use std::unordered_set,
2433         std::vector, gdb::unique_xmalloc_ptr.
2434         (call_sitep): Remove typedef.
2435         (dwarf2_locexpr_baton_eval): Remove unused variable.
2436
2437 2017-01-10  Tom Tromey  <tom@tromey.com>
2438
2439         * python/python-internal.h (make_cleanup_py_decref)
2440         (make_cleanup_py_xdecref): Don't declare.
2441         * python/py-utils.c (py_decref, make_cleanup_py_decref)
2442         (py_xdecref, make_cleanup_py_xdecref): Remove.
2443
2444 2017-01-10  Tom Tromey  <tom@tromey.com>
2445
2446         * python/py-framefilter.c (py_mi_print_variables): Use gdbpy_ref.
2447         (py_print_locals, enumerate_locals, py_print_args): Use gdbpy_ref.
2448
2449 2017-01-10  Tom Tromey  <tom@tromey.com>
2450
2451         * python/py-framefilter.c (enumerate_args): Use gdbpy_ref.
2452
2453 2017-01-10  Tom Tromey  <tom@tromey.com>
2454
2455         * python/py-utils.c (unicode_to_encoded_string)
2456         (python_string_to_target_string)
2457         (python_string_to_target_python_string)
2458         (python_string_to_host_string, gdbpy_obj_to_string)
2459         (get_addr_from_python): Use gdbpy_ref.
2460
2461 2017-01-10  Tom Tromey  <tom@tromey.com>
2462
2463         * python/py-unwind.c (pyuw_object_attribute_to_pointer): Use
2464         gdbpy_ref.
2465
2466 2017-01-10  Tom Tromey  <tom@tromey.com>
2467
2468         * python/python.c (eval_python_command, gdbpy_decode_line)
2469         (gdbpy_run_events, gdbpy_start_type_printers)
2470         (gdbpy_apply_type_printers): Use gdbpy_ref.
2471
2472 2017-01-10  Tom Tromey  <tom@tromey.com>
2473
2474         * python/py-param.c (get_doc_string, compute_enum_values): Use
2475         gdbpy_ref.
2476
2477 2017-01-10  Tom Tromey  <tom@tromey.com>
2478
2479         * python/py-inferior.c (find_thread_object, build_inferior_list):
2480         Use gdbpy_ref.
2481
2482 2017-01-10  Tom Tromey  <tom@tromey.com>
2483
2484         * python/py-framefilter.c (py_print_frame): Use gdbpy_ref.
2485
2486 2017-01-10  Tom Tromey  <tom@tromey.com>
2487
2488         * python/py-finishbreakpoint.c (bpfinishpy_out_of_scope): Use
2489         gdbpy_ref.
2490
2491 2017-01-10  Tom Tromey  <tom@tromey.com>
2492
2493         * python/py-cmd.c (cmdpy_completer_helper): Use gdbpy_ref.  Remove
2494         extra incref.
2495         (cmdpy_completer_handle_brkchars, cmdpy_completer, cmdpy_init):
2496         Use gdbpy_ref.
2497
2498 2017-01-10  Tom Tromey  <tom@tromey.com>
2499
2500         * python/py-breakpoint.c (gdbpy_breakpoint_cond_says_stop): Use
2501         gdbpy_ref.
2502
2503 2017-01-10  Tom Tromey  <tom@tromey.com>
2504
2505         * python/py-arch.c (archpy_disassemble): Use gdbpy_ref.  Don't
2506         decref results of PyArg_ParseTupleAndKeywords.
2507
2508 2017-01-10  Tom Tromey  <tom@tromey.com>
2509
2510         * python/python.c (python_run_simple_file): Use
2511         unique_xmalloc_ptr, gdbpy_ref.
2512
2513 2017-01-10  Tom Tromey  <tom@tromey.com>
2514
2515         * python/py-prettyprint.c (print_stack_unless_memory_error)
2516         (print_string_repr, print_children): Use gdbpy_ref.
2517         (dummy_python_frame): New class.
2518         (dummy_python_frame::dummy_python_frame): Rename from
2519         push_dummy_python_frame.
2520         (py_restore_tstate): Remove.
2521
2522 2017-01-10  Tom Tromey  <tom@tromey.com>
2523
2524         * python/py-framefilter.c (py_print_frame): Use gdbpy_ref.
2525
2526 2017-01-10  Tom Tromey  <tom@tromey.com>
2527
2528         * python/python.c (ensure_python_env, restore_python_env):
2529         Remove.
2530         * python/python-internal.h (ensure_python_env): Don't declare.
2531         * varobj.h (varobj_ensure_python_env): Don't declare.
2532         * varobj.c (varobj_ensure_python_env): Remove.
2533
2534 2017-01-10  Tom Tromey  <tom@tromey.com>
2535
2536         * varobj.c (varobj_value_get_print_value): Use
2537         gdbpy_enter_varobj.
2538
2539 2017-01-10  Tom Tromey  <tom@tromey.com>
2540
2541         * python/py-prettyprint.c (print_string_repr, print_children):
2542         Update.
2543         * python/py-lazy-string.c (gdbpy_extract_lazy_string): Change type
2544         of "encoding".
2545         * varobj.c (varobj_value_get_print_value): Update.
2546         * python/python-internal.h (gdbpy_extract_lazy_string): Update.
2547
2548 2017-01-10  Tom Tromey  <tom@tromey.com>
2549
2550         * varobj.c (varobj_get_display_hint)
2551         (dynamic_varobj_has_child_method, install_new_value_visualizer)
2552         (varobj_set_visualizer, free_variable): Use
2553         gdbpy_enter_varobj.
2554
2555 2017-01-10  Tom Tromey  <tom@tromey.com>
2556
2557         * python/python.c (python_command): Use gdbpy_enter, gdbpy_ref.
2558         (do_finish_initialization): New function.  Use gdbpy_ref.
2559         (gdbpy_finish_initialization): Use gdbpy_enter.  Call
2560         do_finish_initialization.
2561
2562 2017-01-10  Tom Tromey  <tom@tromey.com>
2563
2564         * python/py-param.c (get_set_value, get_show_value): Use
2565         gdbpy_enter, gdbpy_ref.
2566
2567 2017-01-10  Tom Tromey  <tom@tromey.com>
2568
2569         * python/py-function.c (fnpy_call): Use gdbpy_enter, gdbpy_ref.
2570
2571 2017-01-10  Tom Tromey  <tom@tromey.com>
2572
2573         * python/py-cmd.c (cmdpy_function): Use gdbpy_enter, gdbpy_ref.
2574
2575 2017-01-10  Tom Tromey  <tom@tromey.com>
2576
2577         * python/py-varobj.c (py_varobj_iter_dtor, py_varobj_iter_next):
2578         Use gdbpy_enter_varobj.
2579
2580 2017-01-10  Tom Tromey  <tom@tromey.com>
2581
2582         * varobj.c (gdbpy_enter_varobj): New constructor.
2583         * python/python-internal.h (gdbpy_enter_varobj): New class.
2584         * python/py-varobj.c (py_varobj_get_iterator): Use
2585         gdbpy_enter_varobj.
2586
2587 2017-01-10  Tom Tromey  <tom@tromey.com>
2588
2589         * python/py-xmethods.c (gdbpy_get_xmethod_result_type): Use
2590         gdbpy_enter, gdbpy_ref, unique_xmalloc_ptr.
2591         (gdbpy_invoke_xmethod): Use gdbpy_ref, gdbpy_enter.
2592         (gdbpy_get_xmethod_arg_types): Use gdbpy_ref,
2593         unique_xmalloc_ptr.
2594         (gdbpy_get_xmethod_arg_types): Use gdbpy_ref, gdbpy_enter.
2595
2596 2017-01-10  Tom Tromey  <tom@tromey.com>
2597
2598         * python/py-xmethods.c (invoke_match_method): Use
2599         gdbpy_ref.
2600
2601 2017-01-10  Tom Tromey  <tom@tromey.com>
2602
2603         * python/py-xmethods.c (gdbpy_get_matching_xmethod_workers): use
2604         gdbpy_enter, gdbpy_ref.
2605
2606 2017-01-10  Tom Tromey  <tom@tromey.com>
2607
2608         * python/python.c (python_interactive_command): Use gdbpy_enter.
2609
2610 2017-01-10  Tom Tromey  <tom@tromey.com>
2611
2612         * python/python.c (gdbpy_before_prompt_hook): Use gdbpy_enter,
2613         gdbpy_ref.
2614
2615 2017-01-10  Tom Tromey  <tom@tromey.com>
2616
2617         * python/py-prettyprint.c (gdbpy_apply_val_pretty_printer): Use
2618         gdbpy_enter, gdbpy_ref, unique_xmalloc_ptr.
2619
2620 2017-01-10  Tom Tromey  <tom@tromey.com>
2621
2622         * utils.h (htab_deleter): New struct.
2623         (htab_up): New typedef.
2624         * python/py-framefilter.c (gdbpy_apply_frame_filter): Use
2625         gdbpy_enter, gdbpy_ref, htab_up.
2626
2627 2017-01-10  Tom Tromey  <tom@tromey.com>
2628
2629         * python/py-unwind.c (pending_frame_invalidate): Remove.
2630         (pyuw_sniffer): Use gdbpy_enter and gdbpy_ref.
2631
2632 2017-01-10  Tom Tromey  <tom@tromey.com>
2633
2634         * python/py-xmethods.c (gdbpy_free_xmethod_worker_data)
2635         (gdbpy_clone_xmethod_worker_data): Use gdbpy_enter.
2636
2637 2017-01-10  Tom Tromey  <tom@tromey.com>
2638
2639         * python/py-type.c (save_objfile_types): Use gdbpy_enter.
2640
2641 2017-01-10  Tom Tromey  <tom@tromey.com>
2642
2643         * python/python.c (gdbpy_eval_from_control_command)
2644         (gdbpy_source_script, gdbpy_run_events)
2645         (gdbpy_source_objfile_script, gdbpy_execute_objfile_script)
2646         (gdbpy_free_type_printers, gdbpy_finish_initialization): Use
2647         gdbpy_enter.
2648
2649 2017-01-10  Tom Tromey  <tom@tromey.com>
2650
2651         * python/py-progspace.c (py_free_pspace): Use gdbpy_enter.
2652
2653 2017-01-10  Tom Tromey  <tom@tromey.com>
2654
2655         * python/py-objfile.c (py_free_objfile): Use gdbpy_enter.
2656
2657 2017-01-10  Tom Tromey  <tom@tromey.com>
2658
2659         * python/py-inferior.c (python_on_normal_stop, python_on_resume)
2660         (python_on_inferior_call_pre, python_on_inferior_call_post)
2661         (python_on_memory_change, python_on_register_change)
2662         (python_inferior_exit, python_new_objfile, add_thread_object)
2663         (delete_thread_object, py_free_inferior): Use gdbpy_enter.
2664
2665 2017-01-10  Tom Tromey  <tom@tromey.com>
2666
2667         * python/py-finishbreakpoint.c (bpfinishpy_handle_stop)
2668         (bpfinishpy_handle_exit): Use gdbpy_enter.
2669
2670 2017-01-10  Tom Tromey  <tom@tromey.com>
2671
2672         * python/py-cmd.c (cmdpy_destroyer)
2673         (cmdpy_completer_handle_brkchars, cmdpy_completer): Use
2674         gdbpy_enter.
2675
2676 2017-01-10  Tom Tromey  <tom@tromey.com>
2677
2678         * python/py-breakpoint.c (gdbpy_breakpoint_cond_says_stop): Use
2679         gdbpy_enter.
2680         (gdbpy_breakpoint_has_cond): Likewise.
2681
2682 2017-01-10  Tom Tromey  <tom@tromey.com>
2683
2684         * python/python.c (gdbpy_enter): New constructor.
2685         (~gdbpy_enter): New destructor.
2686         (restore_python_env, ensure_python_env): Rewrite.
2687         * python/python-internal.h (gdbpy_enter): New class.
2688
2689 2017-01-10  Tom Tromey  <tom@tromey.com>
2690
2691         * python/py-symbol.c (gdbpy_lookup_symbol): Use gdbpy_ref.
2692
2693 2017-01-10  Tom Tromey  <tom@tromey.com>
2694
2695         * python/py-value.c (value_has_field, get_field_flag)
2696         (get_field_type, valpy_getitem, convert_value_from_python): Use
2697         gdbpy_ref.
2698
2699 2017-01-10  Tom Tromey  <tom@tromey.com>
2700
2701         * python/python.c (gdbpy_progspaces, gdbpy_objfiles): Use
2702         gdbpy_ref.
2703
2704 2017-01-10  Tom Tromey  <tom@tromey.com>
2705
2706         * python/py-prettyprint.c (search_pp_list)
2707         (find_pretty_printer_from_objfiles)
2708         (find_pretty_printer_from_progspace)
2709         (find_pretty_printer_from_gdb, find_pretty_printer)
2710         (gdbpy_get_display_hint, gdbpy_get_varobj_pretty_printer): Use
2711         gdbpy_ref.
2712
2713 2017-01-10  Tom Tromey  <tom@tromey.com>
2714
2715         * python/py-param.c (call_doc_function): Use gdbpy_ref.
2716
2717 2017-01-10  Tom Tromey  <tom@tromey.com>
2718
2719         * python/py-linetable.c (build_line_table_tuple_from_pcs)
2720         (ltpy_get_all_source_lines): Use gdbpy_ref.
2721
2722 2017-01-10  Tom Tromey  <tom@tromey.com>
2723
2724         * python/py-framefilter.c (extract_sym, extract_value)
2725         (get_py_iter_from_func, bootstrap_python_frame_filters): Use
2726         gdbpy_ref.
2727
2728 2017-01-10  Tom Tromey  <tom@tromey.com>
2729
2730         * python/py-breakpoint.c (gdbpy_breakpoints): Use gdbpy_ref.
2731
2732 2017-01-10  Tom Tromey  <tom@tromey.com>
2733
2734         * python/py-inferior.c (gdbpy_inferiors): Use gdbpy_ref.
2735
2736 2017-01-10  Tom Tromey  <tom@tromey.com>
2737
2738         * python/py-function.c (convert_values_to_python, fnpy_init): Use
2739         gdbpy_ref.
2740
2741 2017-01-10  Tom Tromey  <tom@tromey.com>
2742
2743         * python/py-cmd.c (gdbpy_string_to_argv): Use gdbpy_ref.
2744
2745 2017-01-10  Tom Tromey  <tom@tromey.com>
2746
2747         * python/py-type.c (convert_field, make_fielditem, typy_fields)
2748         (typy_range): Use gdbpy_ref.
2749
2750 2017-01-10  Tom Tromey  <tom@tromey.com>
2751
2752         * python/py-threadevent.c (create_thread_event_object): Use
2753         gdbpy_ref.
2754         * python/py-stopevent.c (create_stop_event_object): Simplify.
2755         (emit_stop_event): Use gdbpy_ref.
2756         * python/py-signalevent.c (create_signal_event_object): Use
2757         gdbpy_ref.
2758         * python/py-newobjfileevent.c (create_new_objfile_event_object)
2759         (emit_new_objfile_event, create_clear_objfiles_event_object)
2760         (emit_clear_objfiles_event): Use gdbpy_ref.
2761         * python/py-infevents.c (create_inferior_call_event_object)
2762         (create_register_changed_event_object)
2763         (create_memory_changed_event_object, emit_inferior_call_event)
2764         (emit_memory_changed_event, emit_register_changed_event): Use
2765         gdbpy_ref.
2766         * python/py-exitedevent.c (create_exited_event_object)
2767         (emit_exited_event): Use gdbpy_ref.
2768         * python/py-event.h (evpy_emit_event): Remove
2769         CPYCHECKER_STEALS_REFERENCE_TO_ARG annotation.
2770         * python/py-event.c (evpy_emit_event): Use gdbpy_ref.
2771         * python/py-continueevent.c (emit_continue_event): Use
2772         gdbpy_ref.
2773         * python/py-breakpoint.c (gdbpy_breakpoint_created)
2774         (gdbpy_breakpoint_deleted, gdbpy_breakpoint_modified): Use
2775         gdbpy_ref.
2776         * python/py-bpevent.c (create_breakpoint_event_object): Use
2777         gdbpy_ref.
2778
2779 2017-01-10  Tom Tromey  <tom@tromey.com>
2780
2781         * python/py-ref.h: New file.
2782
2783 2017-01-10  Simon Marchi  <simon.marchi@ericsson.com>
2784
2785         * cli-out.c (cli_ui_out::do_redirect): Change return type to
2786         void.
2787         * cli-out.h (cli_ui_out::do_redirect): Likewise.
2788         * mi/mi-out.c (mi_ui_out::do_redirect): Likewise.
2789         * mi/mi-out.h (mi_ui_out::do_redirect): Likewise.
2790         * ui-out.c (ui_out::redirect): Likewise.
2791         * ui-out.h (ui_out::redirect, ui_out::do_redirect): Likewise.
2792         * cli/cli-logging.c (set_logging_redirect): Update call site of
2793         ui_out::redirect.
2794         (handle_redirections): Likewise.
2795         * scm-ports.c (ioscm_with_output_to_port_worker): Likewise.
2796         * top.c (execute_command_to_string): Likewise.
2797         * utils.c (do_ui_out_redirect_pop): Likewise.
2798
2799 2017-01-10  Simon Marchi  <simon.marchi@ericsson.com>
2800
2801         * stack.c (_initialize_stack): Update "frame" command help message.
2802
2803 2017-01-08  Iain Buclaw  <ibuclaw@gdcproject.org>
2804
2805         * d-exp.y (CastExpression): Emit UNOP_CAST_TYPE.
2806
2807 2017-01-06  Yao Qi  <yao.qi@linaro.org>
2808
2809         * x86-linux-nat.h: Include gdb_proc_service.h.
2810
2811 2017-01-06  Yao Qi  <yao.qi@linaro.org>
2812
2813         * ser-base.h: Include serial.h.
2814
2815 2017-01-06  Yao Qi  <yao.qi@linaro.org>
2816
2817         * ppc-linux-tdep.h: Include ppc-tdep.h.
2818
2819 2017-01-06  Yao Qi  <yao.qi@linaro.org>
2820
2821         * nat/amd64-linux-siginfo.h: Include signal.h.
2822
2823 2017-01-06  Yao Qi  <yao.qi@linaro.org>
2824
2825         * nat/aarch64-linux-hw-point.h: Include break-common.h.
2826
2827 2017-01-06  Yao Qi  <yao.qi@linaro.org>
2828
2829         * mi/mi-parse.h: Include mi-cmds.h.
2830
2831 2017-01-06  Yao Qi  <yao.qi@linaro.org>
2832
2833         * inf-loop.c: Don't include "target.h".
2834         * inf-loop.h: Include it here.
2835
2836 2017-01-06  Yao Qi  <yao.qi@linaro.org>
2837
2838         * dfp.h: Include "dboulest.h" and "expression.h".
2839
2840 2017-01-06  Yao Qi  <yao.qi@linaro.org>
2841
2842         * ax-gdb.h: Include "ax.h".
2843
2844 2017-01-06  Yao Qi  <yao.qi@linaro.org>
2845
2846         * Makefile.in (HFILES_NO_SRCDIR): Replace gdb_ptrace.h
2847         with nat/gdb_ptrace.h.
2848
2849 2017-01-05  Yao Qi  <yao.qi@linaro.org>
2850
2851         * mips-fbsd-tdep.c (mips_fbsd_sigframe_init): Move && to
2852         new line.
2853         (mips64_fbsd_sigframe_init): Likewise.
2854
2855 2017-01-04  John Baldwin  <jhb@FreeBSD.org>
2856
2857         * mips-fbsd-tdep.c (_initialize_mips_fbsd_tdep): Use
2858         GDB_OSABI_FREEBSD instead of GDB_OSABI_FREEBSD_ELF.
2859
2860 2017-01-04  John Baldwin  <jhb@FreeBSD.org>
2861
2862         * Makefile.in (ALLDEPFILES): Add mips-fbsd-nat.c.
2863         * NEWS: Mention new FreeBSD/mips native configuration.
2864         * config/mips/fbsd.mh: New file.
2865         * configure.host: Add mips*-*-freebsd*.
2866         * mips-fbsd-nat.c: New file.
2867
2868 2017-01-04  John Baldwin  <jhb@FreeBSD.org>
2869
2870         * Makefile.in (ALL_TARGET_OBS): Add mips-fbsd-tdep.o.
2871         (ALLDEPFILES): Add mips-fbsd-tdep.c.
2872         * NEWS: Mention new FreeBSD/mips target.
2873         * configure.tgt: Add mips*-*-freebsd*.
2874         * mips-fbsd-tdep.c: New file.
2875         * mips-fbsd-tdep.h: New file.
2876
2877 2017-01-04  Yao Qi  <yao.qi@linaro.org>
2878
2879         * dwarf2loc.c (write_pieced_value): Don't use VALUE_FRAME_ID (to),
2880         use c->frame_id when the piece location is DWARF_VALUE_REGISTER.
2881
2882 2017-01-01  Joel Brobecker  <brobecker@adacore.com>
2883
2884         Update copyright year range in all GDB files.
2885
2886 2017-01-01  Joel Brobecker  <brobecker@adacore.com>
2887
2888         * config/djgpp/fnchange.lst: Add entry for gdb/ChangeLog-2016.
2889
2890 For older changes see ChangeLog-2016.
2891 \f
2892 Local Variables:
2893 mode: change-log
2894 left-margin: 8
2895 fill-column: 74
2896 version-control: never
2897 coding: utf-8
2898 End: