Simplify regcache_dup
[external/binutils.git] / gdb / ChangeLog
1 2017-04-28  Yao Qi  <yao.qi@linaro.org>
2
3         * regcache.c (regcache_dup): Assert !src->m_readonly_p and
4         call method save instead of regcache_cpy.
5         * regcache.h (struct regcache): Make regcache_dup a friend.
6
7 2017-04-28  Yao Qi  <yao.qi@linaro.org>
8
9         * regcache.c (struct regcache): Move to regcache.h
10         (regcache::arch): New method.
11         (regcache_get_ptid): Update.
12         (get_regcache_arch): Call arch method.
13         (get_regcache_aspace): Call method aspace.
14         (register_buffer): Change it to method.
15         (regcache_save): Change it to regcache::save.
16         (regcache_restore): Likewise.
17         (regcache_cpy_no_passthrough): Remove the declaration.
18         (regcache_cpy): Call methods restore and cpy_no_passthrough.
19         (regcache_cpy_no_passthrough): Change it to method
20         cpy_no_passthrough.
21         (regcache_register_status): Change it to method
22         get_register_status.
23         (regcache_invalidate): Change it to method invalidate.
24         (regcache_thread_ptid_changed): Use methods ptid and set_ptid.
25         (regcache_raw_update): Change it to method raw_update.
26         (regcache_raw_read): Likewise.
27         (regcache_raw_read_signed): Likewise.
28         (regcache_raw_read_unsigned): Likewise.
29         (regcache_raw_write_signed): Likewise.
30         (regcache_raw_write_unsigned): Likewise.
31         (regcache_cooked_read): Likewise.
32         (regcache_cooked_read_value): Likewise.
33         (regcache_cooked_read_signed): Likewise.
34         (regcache_cooked_read_unsigned): Likewise.
35         (regcache_cooked_write_signed): Likewise.
36         (regcache_cooked_write_unsigned): Likewise.
37         (regcache_raw_set_cached_value): Likewise.
38         (regcache_raw_write): Likewise.
39         (regcache_cooked_write): Likewise.
40         (regcache_xfer_part): Likewise.
41         (regcache_raw_read_part): Likewise.
42         (regcache_raw_write_part): Likewise.
43         (regcache_cooked_read_part): Likewise.
44         (regcache_cooked_write_part): Likewise.
45         (regcache_raw_supply): Likewise.
46         (regcache_raw_collect): Likewise.
47         (regcache_transfer_regset): Likewise.
48         (regcache_supply_regset): Likewise.
49         (regcache_collect_regset): Likewise.
50         (regcache_debug_print_register): Likewise.
51         (enum regcache_dump_what): Move it to regcache.h.
52         (regcache_dump): Change it to method dump.
53         * regcache.h (enum regcache_dump_what): New.
54         (class regcache): New.
55         * target.c (target_fetch_registers): Call method
56         debug_print_register.
57         (target_store_registers): Likewise.
58
59 2017-04-28  Simon Marchi  <simon.marchi@ericsson.com>
60
61         * windows-nat.c (struct lm_info_windows): Initialize field.
62         (windows_make_so): Allocate lm_info_windows with new.
63         (windows_free_so): Free lm_info_windows with delete.
64
65 2017-04-28  Simon Marchi  <simon.marchi@ericsson.com>
66
67         * solib-darwin.c (struct lm_info_darwin): Initialize field.
68         (darwin_current_sos): Allocate lm_info_darwin with new, remove
69         cleanup.
70         (darwin_free_so): Free lm_info_darwin with delete.
71
72 2017-04-28  Simon Marchi  <simon.marchi@ericsson.com>
73
74         * solib-svr4.h (struct lm_info_svr4): Initialize fields.
75         <l_addr_p>: Change type to bool.
76         * solib-svr4.c (lm_info_read): Allocate lm_info_svr4 with new.
77         (svr4_free_so): Free lm_info_svr4 with delete.
78         (svr4_copy_library_list): Replace memcpy with call to copy
79         constructor.
80         (library_list_start_library, svr4_default_sos): Allocate
81         lm_info_svr4 with new.
82
83 2017-04-28  Simon Marchi  <simon.marchi@ericsson.com>
84
85         * solib-target.c (struct lm_info_target): Add destructor,
86         initialize fields.
87         <name>: Change type to std::string.
88         (library_list_start_library): Allocate lm_info_target with new.
89         (solib_target_free_library_list): Free lm_info_target with
90         delete.
91         (solib_target_current_sos): Adapt to std::string.
92         (solib_target_free_so): Free lm_info_target with delete.
93
94 2017-04-28  Simon Marchi  <simon.marchi@ericsson.com>
95
96         * solib-frv.c (struct lm_info_frv): Add destructor, initialize
97         fields.
98         (frv_current_sos): Allocate lm_info_frv with new.
99         (frv_relocate_main_executable): Free lm_info_frv with delete,
100         allocate with new.
101         (frv_clear_solib, frv_free_so): Free lm_info_frv with delete.
102
103 2017-04-28  Simon Marchi  <simon.marchi@ericsson.com>
104
105         * solib-frv.c (struct lm_info_frv): Fix indentation.
106
107 2017-04-28  Simon Marchi  <simon.marchi@ericsson.com>
108
109         * solib-dsbt.c (struct lm_info_dsbt): Add destructor, initialize
110         map field.
111         (dsbt_current_sos): Allocate lm_info_dsbt with new.
112         (dsbt_relocate_main_executable): Free lm_info_dsbt with delete
113         and allocate with new.
114         (dsbt_clear_solib, dsbt_free_so): Free lm_info_dsbt with delete.
115
116 2017-04-28  Simon Marchi  <simon.marchi@ericsson.com>
117
118         * solib-aix.c (struct lm_info_aix): Initialize fields in-class.
119         <filename, member_name>: Change type to std::string.
120         (solib_aix_new_lm_info, solib_aix_xfree_lm_info): Remove.
121         (library_list_start_library): Allocate lm_info_aix with new.
122         (solib_aix_free_library_list, solib_aix_free_so): Free with delete.
123         (solib_aix_current_sos): Adapt to std::string, copy lm_info_aix
124         with copy constructor.
125
126 2017-04-28  Simon Marchi  <simon.marchi@ericsson.com>
127
128         * solist.h (struct lm_info): Remove.
129         (struct lm_info_base): New class.
130         (struct so_list) <lm_info>: Change type to lm_info_base *.
131         * nto-tdep.c (struct lm_info): Remove.
132         (lm_addr): Adjust.
133         * solib-aix.c (struct lm_info): Rename to ...
134         (struct lm_info_aix): ... this.  Extend lm_info_base.
135         (lm_info_p): Rename to ...
136         (lm_info_aix_p): ... this, and adjust.
137         (solib_aix_new_lm_info, solib_aix_xfree_lm_info,
138         solib_aix_parse_libraries, library_list_start_library,
139         solib_aix_free_library_list, solib_aix_parse_libraries,
140         solib_aix_get_library_list,
141         solib_aix_relocate_section_addresses, solib_aix_free_so,
142         solib_aix_get_section_offsets,
143         solib_aix_solib_create_inferior_hook, solib_aix_current_sos):
144         Adjust.
145         (struct solib_aix_inferior_data) <library_list>: Adjust.
146         * solib-darwin.c (struct lm_info): Rename to ...
147         (struct lm_info_darwin): ... this.  Extend lm_info_base.
148         (darwin_current_sos, darwin_relocate_section_addresses): Adjust.
149         * solib-dsbt.c (struct lm_info): Rename to ...
150         (struct lm_info_dsbt): ... this.  Extend lm_info_base.
151         (struct dsbt_info) <main_executable_lm_info): Adjust.
152         (dsbt_current_sos, dsbt_relocate_main_executable, dsbt_free_so,
153         dsbt_relocate_section_addresses): Adjust.
154         * solib-frv.c (struct lm_info): Rename to ...
155         (struct lm_info_frv): ... this.  Extend lm_info_base.
156         (main_executable_lm_info): Adjust.
157         (frv_current_sos, frv_relocate_main_executable, frv_free_so,
158         frv_relocate_section_addresses, frv_fdpic_find_global_pointer,
159         find_canonical_descriptor_in_load_object,
160         frv_fdpic_find_canonical_descriptor): Adjust.
161         * solib-svr4.c (struct lm_info): Move to solib-svr4.h, renamed
162         to lm_info_svr4.
163         (lm_info_read, lm_addr_check, svr4_keep_data_in_core,
164         svr4_clear_so, svr4_copy_library_list,
165         library_list_start_library, svr4_default_sos, svr4_read_so_list,
166         svr4_current_sos, svr4_fetch_objfile_link_map,
167         solist_update_incremental): Adjust.
168         * solib-svr4.h (struct lm_info_svr4): Move here from
169         solib-svr4.c.
170         * solib-target.c (struct lm_info): Rename to ...
171         (struct lm_info_target): ... this.  Extend lm_info_base.
172         (lm_info_p): Rename to ...
173         (lm_info_target_p): ... this.
174         (solib_target_parse_libraries, library_list_start_segment,
175         library_list_start_section, library_list_start_library,
176         library_list_end_library, solib_target_free_library_list,
177         solib_target_current_sos, solib_target_free_so,
178         solib_target_relocate_section_addresses): Adjust.
179         * windows-nat.c (struct lm_info): Rename to ...
180         (struct lm_info_windows): ... this.  Extend lm_info_base.
181         (windows_make_so, handle_load_dll, handle_unload_dll,
182         windows_xfer_shared_libraries): Adjust.
183
184 2017-04-28  Simon Marchi  <simon.marchi@ericsson.com>
185
186         * solib-darwin.c (struct darwin_so_list): Remove.
187         (darwin_current_sos): Allocate an so_list object instead of a
188         darwin_so_list, separately allocate an lm_info object.
189         (darwin_free_so): Free lm_info.
190
191 2017-04-28  John Baldwin  <jhb@FreeBSD.org>
192
193         * mips-tdep.c (print_gp_register_row): Replace printf_filtered
194         with fprintf_filtered.
195
196 2017-04-28  Yao Qi  <yao.qi@linaro.org>
197
198         * regcache.c (regcache::regcache): New function.
199         (regcache::~regcache): New function.
200         (regcache_xmalloc_1): Remove.
201         (regcache_xmalloc): Call new regcache.
202         (regcache_xfree): Call delete regcache.
203         (get_thread_arch_aspace_regcache): Call new regcache.
204
205 2017-04-28  Yao Qi  <yao.qi@linaro.org>
206
207         * mips-linux-nat.c (mips_linux_new_thread): Use ptid method
208         lwp instead of ptid_get_lwp.
209
210 2017-04-28  Yao Qi  <yao.qi@linaro.org>
211
212         * mips-linux-nat.c (mips_linux_new_thread): Get lwpid from
213         lwp_info instead of getting from inferior_ptid.
214
215 2017-04-27  Keith Seitz  <keiths@redhat.com>
216
217         * gdbtypes.c (LVALUE_REFERENCE_TO_RVALUE_BINDING_BADNESS)
218         DIFFERENT_REFERENCE_TYPE_BADNESS): Remove.
219         (CV_CONVERSION_BADNESS): Define.
220         (rank_one_type): Remove overly restrictive rvalue reference
221         rank checks.
222         Add cv-qualifier checks and subranks for type equality.
223         * gdbtypes.h (REFERENCE_CONVERSION_RVALUE,
224         REFERENCE_CONVERSION_CONST_LVALUE, CV_CONVERSION_BADNESS,
225         CV_CONVERSION_CONST, CV_CONVERSION_VOLATILE): Declare.
226
227 2017-04-27  Simon Marchi  <simon.marchi@ericsson.com>
228
229         * python/py-inferior.c (inferior_to_inferior_object): Increment reference
230         count when creating the object.
231
232 2017-04-27  Sangamesh Mallayya  <sangamesh.swamy@in.ibm.com>
233             Ulrich Weigand  <uweigand@de.ibm.com>
234
235         * xcoffread.c (read_xcoff_symtab): Read correct function auxiliary
236         entry if xlc -qfuncsect or gcc -ffunction-sections compiler option
237         is used in AIX.
238         (read_xcoff_symtab): Handle C_WEAKEXT storage class.
239         (process_xcoff_symbol): Likewise.
240         (scan_xcoff_symtab): Likewise.
241
242 2017-04-26  Alan Hayward  <alan.hayward@arm.com>
243
244         * ia64-tdep.c (examine_prologue): Use get_frame_register_unsigned.
245         (ia64_sigtramp_frame_prev_register): Use read_memory_unsigned_integer.
246         (ia64_access_reg): Use get_frame_register_unsigned.
247         (ia64_access_rse_reg): Likewise.
248         (ia64_libunwind_frame_prev_register): Likewise.
249
250 2017-04-26  Jiong Wang  <jiong.wang@arm.com>
251
252         * gdbarch.sh: New gdbarch method execute_dwarf_cfa_vendor_op.
253         * gdbarch.c: Regenerated.
254         * gdbarch.h: Regenerated.
255         * dwarf2-frame.c (dwarf2_frame_state_alloc_regs): Made the
256         visibility external.
257         (execute_cfa_program): Call execute_dwarf_cfa_vendor_op for CFI
258         between DW_CFA_lo_user and DW_CFA_high_user inclusive.
259         (enum cfa_how_kind): Move to ...
260         (struct dwarf2_frame_state_reg_info): Likewise.
261         (struct dwarf2_frame_state): Likewise.
262         * dwarf2-frame.h: ... here.
263         (dwarf2_frame_state_alloc_regs): New declaration.
264         * sparc-tdep.c (sparc_execute_dwarf_cfa_vendor_op): New function.
265         (sparc32_gdbarch_init): Register execute_dwarf_cfa_vendor_op hook.
266
267 2017-04-26  Alan Hayward  <alan.hayward@arm.com>
268
269         * xtensa-tdep.c (xtensa_pseudo_register_read): Use
270         regcache_raw_read_unsigned.
271         (xtensa_pseudo_register_write): Likewise.
272
273 2017-04-26  Alan Hayward  <alan.hayward@arm.com>
274
275         * nds32-tdep.c (nds32_pseudo_register_read): Abort on errors.
276         (nds32_pseudo_register_write): Likewise.
277
278 2017-04-25  Yao Qi  <yao.qi@linaro.org>
279
280         * regcache.c (struct regcache) <readonly_p>: Change its type
281         to bool.
282         (regcache_xmalloc_1): Update parameter type and callers update.
283
284 2017-04-25  Yao Qi  <yao.qi@linaro.org>
285
286         * aarch64-tdep.c (aarch64_gdbarch_init): Don't call
287         set_gdbarch_wchar_bit.
288         * arm-tdep.c (arm_gdbarch_init): Likewise.
289
290 2017-04-25  Pedro Alves  <palves@redhat.com>
291
292         * common/poison.h [!HAVE_IS_TRIVIALLY_COPYABLE] (IsRelocatable)
293         (BothAreRelocatable, memcopy, memmove): Don't define.
294         * common/traits.h (__has_feature, HAVE_IS_TRIVIALLY_COPYABLE): New
295         macros.
296
297 2017-04-25  Pedro Alves  <palves@redhat.com>
298
299         * common/common-defs.h: Include "common/poison.h".
300         * common/function-view.h: (Not, Or, Requires): Move to traits.h
301         and adjust.
302         * common/poison.h: New file.
303         * common/traits.h: Include <type_traits>.
304         (Not, Or, Requires): New, moved from common/function-view.h.
305
306 2017-04-25  Pedro Alves  <palves@redhat.com>
307
308         * breakpoint.h (struct breakpoint): In-class initialize all
309         fields.  Make boolean fields "bool".
310         * breakpoint.c (init_raw_breakpoint_without_location): Remove
311         memset call and initializations no longer necessary.
312
313 2017-04-25  Pedro Alves  <palves@redhat.com>
314
315         * btrace.c (pt_btrace_insn_flags): Change parameter type to
316         reference.
317         (pt_btrace_insn): New function.
318         (ftrace_add_pt): Remove memset call and use pt_btrace_insn.
319
320 2017-04-25  Pedro Alves  <palves@redhat.com>
321
322         * ada-lang.c (ada_catchpoint_location): Now a "class".  Remove
323         "base" field and inherit from "bp_location" instead.  Add
324         non-default ctor.
325         (allocate_location_exception): Use new non-default ctor.
326         * breakpoint.c (get_first_locp_gte_addr): Remove memset call.
327         (init_bp_location): Convert to ...
328         (bp_location::bp_location): ... this new ctor, and remove memset
329         call.
330         (base_breakpoint_allocate_location): Use the new non-default ctor.
331         * breakpoint.h (bp_location): Now a class.  Declare default and
332         non-default ctors.  In-class initialize all members.
333         (init_bp_location): Remove declaration.
334
335 2017-04-25  Pedro Alves  <palves@redhat.com>
336
337         * common/enum-flags.h (enum_flags): Don't implement copy ctor and
338         assignment operator.
339
340 2017-04-24  Yao Qi  <yao.qi@linaro.org>
341
342         * doublest.c (convert_doublest_to_floatformat): Call
343         floatformat_totalsize_bytes.
344
345 2017-04-22  Tom Tromey  <tom@tromey.com>
346
347         * mi/mi-cmd-file.c (mi_cmd_file_list_shared_libraries): Use
348         ui_out_emit_list.
349         * stack.c (print_frame): Use ui_out_emit_list.
350         * mi/mi-symbol-cmds.c (mi_cmd_symbol_list_lines): Use
351         ui_out_emit_list.
352         * mi/mi-main.c (print_one_inferior)
353         (mi_cmd_data_list_register_names)
354         (mi_cmd_data_list_register_values, mi_cmd_list_features)
355         (mi_cmd_list_target_features, mi_cmd_trace_frame_collected): Use
356         ui_out_emit_list.
357         * mi/mi-interp.c (mi_on_normal_stop_1): Use ui_out_emit_list.
358         (mi_output_solib_attribs): Use ui_out_emit_list,
359         ui_out_emit_tuple.
360         * mi/mi-cmd-var.c (varobj_update_one): Use ui_out_emit_list.
361         * mi/mi-cmd-stack.c (mi_cmd_stack_list_frames)
362         (mi_cmd_stack_list_args, list_args_or_locals): Use
363         ui_out_emit_list.
364         * disasm.c (do_assembly_only): Use ui_out_emit_list.
365         * breakpoint.c (print_solib_event, output_thread_groups): Use
366         ui_out_emit_list.
367
368 2017-04-22  Tom Tromey  <tom@tromey.com>
369
370         * mi/mi-main.c (print_variable_or_computed): Use ui_out_emit_tuple.
371         * mi/mi-cmd-var.c (varobj_update_one): Use ui_out_emit_tuple.
372         * mi/mi-cmd-stack.c (list_arg_or_local): Use ui_out_emit_tuple.
373
374 2017-04-22  Tom Tromey  <tom@tromey.com>
375
376         * tracepoint.c (tvariables_info_1)
377         (print_one_static_tracepoint_marker): Use ui_out_emit_tuple.
378
379 2017-04-22  Tom Tromey  <tom@tromey.com>
380
381         * stack.c (print_frame_arg): Use ui_out_emit_tuple,
382         annotate_arg_emitter.
383         * breakpoint.c (print_mention_watchpoint)
384         (print_mention_masked_watchpoint): Use ui_out_emit_tuple.
385         * annotate.h (struct annotate_arg_emitter): New.
386
387 2017-04-22  Tom Tromey  <tom@tromey.com>
388
389         * record-btrace.c (record_btrace_insn_history)
390         (record_btrace_insn_history_range, record_btrace_call_history)
391         (record_btrace_call_history_range): Use ui_out_emit_tuple.
392         * thread.c (do_captured_list_thread_ids, print_thread_info_1): Use
393         ui_out_emit_tuple.
394         * stack.c (print_frame_info): Use ui_out_emit_tuple.
395         * solib.c (info_sharedlibrary_command): Use ui_out_emit_tuple.
396         * skip.c (skip_info): Use ui_out_emit_tuple.
397         * remote.c (show_remote_cmd): Use ui_out_emit_tuple.
398         * progspace.c (print_program_space): Use ui_out_emit_tuple.
399         * probe.c (info_probes_for_ops): Use ui_out_emit_tuple.
400         * osdata.c (info_osdata): Use ui_out_emit_tuple.
401         * mi/mi-symbol-cmds.c (mi_cmd_symbol_list_lines): Use
402         ui_out_emit_tuple.
403         * mi/mi-main.c (print_one_inferior, list_available_thread_groups)
404         (output_register, mi_cmd_data_read_memory)
405         (mi_cmd_data_read_memory_bytes, mi_load_progress)
406         (mi_cmd_trace_frame_collected): Use ui_out_emit_tuple.
407         * mi/mi-cmd-var.c (mi_cmd_var_list_children, varobj_update_one):
408         Use ui_out_emit_tuple.
409         * mi/mi-cmd-stack.c (mi_cmd_stack_list_args): Use
410         ui_out_emit_tuple.
411         * mi/mi-cmd-info.c (mi_cmd_info_ada_exceptions)
412         (mi_cmd_info_gdb_mi_command): Use ui_out_emit_tuple.
413         * linux-thread-db.c (info_auto_load_libthread_db): Use
414         ui_out_emit_tuple.
415         * inferior.c (print_inferior): Use ui_out_emit_tuple.
416         * gdb_bfd.c (print_one_bfd): Use ui_out_emit_tuple.
417         * disasm.c (do_mixed_source_and_assembly_deprecated)
418         (do_mixed_source_and_assembly): Use ui_out_emit_tuple.
419         * cp-abi.c (list_cp_abis): Use ui_out_emit_tuple.
420         * cli/cli-setshow.c (cmd_show_list): Use ui_out_emit_tuple.
421         * breakpoint.c (print_one_breakpoint_location)
422         (print_one_breakpoint): Use ui_out_emit_tuple.
423         * auto-load.c (print_script, info_auto_load_cmd): Use
424         ui_out_emit_tuple.
425         * ada-tasks.c (print_ada_task_info): Use ui_out_emit_tuple.
426
427 2017-04-21  Simon Marchi  <simon.marchi@ericsson.com>
428
429         * thread.c (print_thread_info_1): Remove dead code.
430
431 2017-04-21  Jan Kratochvil  <jan.kratochvil@redhat.com>
432
433         * aarch64-tdep.c (selftests::aarch64_process_record_test): Make it #if
434         GDB_SELF_TEST.
435         * arm-tdep.c (selftests::arm_record_test): Likewise.
436
437 2017-04-21  Yao Qi  <yao.qi@linaro.org>
438
439         * regcache.c (regcache_restore): Remove argument 2.  Replace
440         argument 3 with regcache.  Get register status from
441         src->register_status and get register contents from
442         register_buffer (src, regnum).
443         (regcache_cpy): Update.
444
445 2017-04-19  Pedro Alves  <palves@redhat.com>
446
447         * gdbthread.h (thread): Add missing closing parenthesis in
448         comment.
449
450 2017-04-19  Pedro Alves  <palves@redhat.com>
451
452         * common/refcounted-object.h: New file.
453         * gdbthread.h: Include "common/refcounted-object.h".
454         (thread_info): Inherit from refcounted_object and add comments.
455         (thread_info::incref, thread_info::decref)
456         (thread_info::m_refcount): Delete.
457         (thread_info::deletable): Use the refcounted_object::refcount()
458         method.
459         * inferior.c (current_inferior_): Add comment.
460         (set_current_inferior): Increment/decrement refcounts.
461         (prune_inferiors, remove_inferior_command): Skip inferiors marked
462         not-deletable instead of comparing with the current inferior.
463         (initialize_inferiors): Increment the initial inferior's refcount.
464         * inferior.h (struct inferior): Forward declare.
465         Include "common/refcounted-object.h".
466         (current_inferior, set_current_inferior): Move declaration to
467         before struct inferior's definition, and fix comment.
468         (inferior): Inherit from refcounted_object.  Add comments.
469         * thread.c (switch_to_thread_no_regs): Reference the thread's
470         inferior pointer directly instead of doing a ptid lookup.
471         (switch_to_no_thread): New function.
472         (switch_to_thread(thread_info *)): New function, factored out
473         from ...
474         (switch_to_thread(ptid_t)): ... this.
475         (restore_current_thread): Delete.
476         (current_thread_cleanup): Remove 'inf_id' and 'was_removable'
477         fields, and add 'inf' field.
478         (do_restore_current_thread_cleanup): Check whether old->inf is
479         alive instead of looking up an inferior by ptid.  Use
480         switch_to_thread and switch_to_no_thread.
481         (restore_current_thread_cleanup_dtor): Use old->inf directly
482         instead of lookup up an inferior by id.  Decref the inferior.
483         Don't restore 'removable'.
484         (make_cleanup_restore_current_thread): Same the inferior pointer
485         in old, instead of the inferior number.  Incref the inferior.
486         Don't save/clear 'removable'.
487
488 2017-04-19  Pedro Alves  <palves@redhat.com>
489
490         * Makefile.in (SUBDIR_UNITTESTS_SRCS): Add
491         unittests/scoped_restore-selftests.c.
492         (SUBDIR_UNITTESTS_OBS): Add scoped_restore-selftests.o.
493         * common/scoped_restore.h (scoped_restore_base): Make "class".
494         (scoped_restore_base::release): New public method.
495         (scoped_restore_base::scoped_restore_base): New protected ctor.
496         (scoped_restore_base::m_saved_var): New protected field.
497         (scoped_restore_tmpl::scoped_restore_tmpl(T*)): Initialize the
498         scoped_restore_base base class instead of m_saved_var directly.
499         (scoped_restore_tmpl::scoped_restore_tmpl(T*, T2)): Likewise.
500         (scoped_restore_tmpl::scoped_restore_tmpl(const
501         scoped_restore_tmpl<T>&)): Likewise.
502         (scoped_restore_tmpl::~scoped_restore_tmpl): Use the saved_var
503         method.
504         (scoped_restore_tmpl::saved_var): New method.
505         (scoped_restore_tmpl::m_saved_var): Delete.
506         * inferior.h (inferior::detaching): Now a bool.
507         * infrun.c (prepare_for_detach): Use a scoped_restore instead of a
508         cleanup.
509         * unittests/scoped_restore-selftests.c: New file.
510
511 2017-04-19  Pedro Alves  <palves@redhat.com>
512
513         * Makefile.in (SUBDIR_UNITTESTS_SRCS, SUBDIR_UNITTESTS_OBS):
514         Re-sort in alphabetic order.
515
516 2017-04-18  Pedro Alves  <palves@redhat.com>
517
518         * xml-support.c (obstack_xml_printf): Delete.
519         * xml-support.h (obstack_xml_printf): Delete.
520
521 2017-04-18  Pedro Alves  <palves@redhat.com>
522
523         * xml-support.c (gdb_xml_parser) <use_dtd, dtd_name, parse,
524         vdebug, verror, body_text, start_element, end_element, name,
525         user_data, set_is_xinclude, set_error, expat_parser>: New methods.
526         <name, user_data, expat_parser, scopes, error, last_line, dtd_name,
527         is_xinclude>: Make private and add m_ prefix.
528         (gdb_xml_parser::body_text): New method, based on ...
529         (gdb_xml_body_text): ... this.  Adjust.
530         (gdb_xml_parser::vdebug): New method, based on ...
531         (gdb_xml_debug): ... this.  Adjust.
532         (gdb_xml_parser::verror): New method, based on ...
533         (gdb_xml_error): ... this.  Adjust.
534         (gdb_xml_parser::start_element): New method, based on ...
535         (gdb_xml_start_element): ... this.  Adjust.
536         (gdb_xml_start_element_wrapper): Defer to
537         gdb_xml_parser::start_element and gdb_xml_parser::set_error.
538         (gdb_xml_parser::end_element): New method, based on ...
539         (gdb_xml_end_element_wrapper): ... this.  Adjust.
540         (gdb_xml_parser::~gdb_xml_parser): Adjust.
541         (gdb_xml_parser::gdb_xml_parser): Adjust to field renames.
542         (gdb_xml_parser::use_dtd): New method, based on ...
543         (gdb_xml_use_dtd): ... this.  Adjust.
544         (gdb_xml_parser::parse): New method, based on ...
545         (gdb_xml_parse): ... this.  Adjust.
546         (gdb_xml_parse_quick): Adjust to call the parser's parse method.
547         (xinclude_start_include): Adjust to call the parser's name method.
548         (xml_xinclude_default, xml_xinclude_start_doctype)
549         (xml_xinclude_end_doctype): Adjust to call the parser's user_data
550         method.
551         (xml_process_xincludes): Adjust to call parser methods.
552         * xml-support.h (gdb_xml_use_dtd, gdb_xml_parse): Delete
553         declarations.
554
555 2017-04-18  Pedro Alves  <palves@redhat.com>
556
557         * tracefile-tfile.c (tfile_write_tdesc): Adjust to use
558         gdb::optional<std::string>.
559         * xml-support.c: Include <string>.
560         (scope_level::scope_level(scope_level &&))
561         (scope_level::~scope_level): Delete.
562         (scope_level::body): Now a std::string.
563         (gdb_xml_body_text, gdb_xml_end_element): Adjust.
564         (xinclude_parsing_data::xinclude_parsing_data): Add 'output'
565         parameter.
566         (xinclude_parsing_data::~xinclude_parsing_data): Delete.
567         (xinclude_parsing_data::output): Now a std::string reference.
568         (xinclude_start_include): Adjust.
569         (xml_xinclude_default): Adjust.
570         (xml_process_xincludes): Add 'output' parameter, and return bool.
571         * xml-support.h (xml_process_xincludes): Add 'output' parameter,
572         and return bool.
573         * xml-tdesc.c: Include <unordered_map> and <string>.
574         (tdesc_xml_cache): Delete.
575         (tdesc_xml_cache_s): Delete.
576         (xml_cache): Now an std::unordered_map.
577         (tdesc_parse_xml): Adjust to use std::string and unordered_map.
578         (target_fetch_description_xml): Change return type to
579         gdb::optional<std::string>, and adjust.
580         * xml-tdesc.h: Include "common/gdb_optional.h" and <string>.
581         (target_fetch_description_xml): Change return type to
582         gdb::optional<std::string>.
583
584 2017-04-18  Pedro Alves  <palves@redhat.com>
585
586         * Makefile.in (SUBDIR_UNITTESTS_SRCS): Add
587         unittests/optional-selftests.c.
588         (SUBDIR_UNITTESTS_OBS): Add optional-selftests.o.
589         * unittests/optional-selftests.c: New file.
590         * unittests/optional/assignment/1.cc: New file.
591         * unittests/optional/assignment/2.cc: New file.
592         * unittests/optional/assignment/3.cc: New file.
593         * unittests/optional/assignment/4.cc: New file.
594         * unittests/optional/assignment/5.cc: New file.
595         * unittests/optional/assignment/6.cc: New file.
596         * unittests/optional/assignment/7.cc: New file.
597         * unittests/optional/cons/copy.cc: New file.
598         * unittests/optional/cons/default.cc: New file.
599         * unittests/optional/cons/move.cc: New file.
600         * unittests/optional/cons/value.cc: New file.
601         * unittests/optional/in_place.cc: New file.
602         * unittests/optional/observers/1.cc: New file.
603         * unittests/optional/observers/2.cc: New file.
604
605 2017-04-18  Pedro Alves  <palves@redhat.com>
606
607         * common/gdb_optional.h: Include common/traits.h.
608         (in_place_t): New type.
609         (in_place): New constexpr variable.
610         (optional::optional): Remove member initialization of
611         m_instantiated.
612         (optional::optional(in_place_t...)): New constructor.
613         (optional::~optional): Use reset.
614         (optional::optional(const optional&)): New.
615         (optional::optional(const optional&&)): New.
616         (optional::optional(T &)): New.
617         (optional::optional(T &&)): New.
618         (operator::operator=(const optional &)): New.
619         (operator::operator=(optional &&)): New.
620         (operator::operator= (const T &))
621         (operator::operator= (T &&))
622         (operator::emplace (Args &&... args)): Return a T&.  Use reset.
623         (operator::reset): New.
624         (operator::m_instantiated):: Add in-class initializer.
625         * common/traits.h: Include <type_traits>.
626         (struct And): New types.
627
628 2017-04-18  Pedro Alves  <palves@redhat.com>
629
630         * xml-support.c: Include <vector>.
631         (scope_level::scope_level(const gdb_xml_element *))
632         (scope_level::scope_level(scope_level&&)): New.
633         (scope_level::~scope_level): New.
634         (scope_level_s): Delete.
635         (gdb_xml_parser::scopes): Now a std::vector.
636         (gdb_xml_body_text, gdb_xml_start_element, gdb_xml_end_element):
637         Use std::vector.
638         (gdb_xml_parser::~gdb_xml_parser): Remove now unnecessary
639         scope cleanup code.
640         (gdb_xml_parser::gdb_xml_parser): Remove explicit initialization
641         of the scopes member.  Use std::vector::emplace_back.
642
643 2017-04-18  Pedro Alves  <palves@redhat.com>
644
645         * xml-support.c (gdb_xml_parser): Add ctor/dtor.  Make is_xinclude
646         a bool.
647         (gdb_xml_end_element): Change type of first parameter.
648         (gdb_xml_cleanup): Rename to ...
649         (gdb_xml_parser::~gdb_xml_parser): ... this.
650         (gdb_xml_create_parser_and_cleanup): Delete with ...
651         (gdb_xml_parser::gdb_xml_parser): ... creation parts factored out
652         to this new ctor.
653         (gdb_xml_parse_quick): Create a local gdb_xml_parser instead of
654         using gdb_xml_create_parser_and_cleanup.
655         (xinclude_parsing_data): Add ctor/dtor.
656         (xml_xinclude_cleanup): Delete.
657         (xml_process_xincludes): Create a local xinclude_parsing_data
658         instead of heap-allocating one.  Create a local gdb_xml_parser
659         instead of heap-allocating one with
660         gdb_xml_create_parser_and_cleanup.
661
662 2017-04-18  John Baldwin  <jhb@FreeBSD.org>
663
664         PR threads/20743
665         * fbsd-nat.c (resume_one_thread_cb): Remove.
666         (resume_all_threads_cb): Remove.
667         (fbsd_resume): Use ALL_NON_EXITED_THREADS instead of
668         iterate_over_threads.
669
670 2017-04-17  Joel Brobecker  <brobecker@adacore.com>
671
672         * NEWS: Create a new section for the next release branch.
673         Rename the section of the current branch, now that it has
674         been cut.
675
676 2017-04-17  Joel Brobecker  <brobecker@adacore.com>
677
678         GDB 8.0 branch created (725bf5cf125783c2a7ca4ab63d3768e220bab2db):
679         * version.in: Bump version to 8.0.50.DATE-git.
680
681 2017-04-13  Sergio Durigan Junior  <sergiodj@redhat.com>
682
683         PR gdb/21385
684         * windows-nat.c (windows_create_inferior): Declare 'allargs'
685         independently of the host, and fix build breakage on Cygwin.
686
687 2017-04-13  Pedro Alves  <palves@redhat.com>
688
689         * inferior.c (free_inferior): Convert to ...
690         (inferior::~inferior): ... this dtor.
691         (inferior::inferior): New ctor, factored out from ...
692         (add_inferior_silent): ... here.  Allocate the inferior with a new
693         expression.
694         (delete_inferior): Call delete instead of free_inferior.
695         * inferior.h (gdb_environ, continuation): Forward declare.
696         (inferior): Now a class.  Add in-class initialization to all
697         members.  Make boolean fields bool, except 'detaching'.
698         (inferior::inferior): New explicit ctor.
699         (inferior::~inferior): New.
700
701 2017-04-13  Pedro Alves  <palves@redhat.com>
702
703         * inferior.c (init_inferior_list): Delete.
704         * inferior.h (init_inferior_list): Delete.
705
706 2017-04-13  Pedro Alves  <palves@redhat.com>
707
708         PR threads/13217
709         * gdb.threads/threadapply.exp (thr_apply_detach): New procedure.
710         (top level): Call it twice, with different thread sets.
711
712 2017-04-13  Pedro Alves  <palves@redhat.com>
713
714         * thread.c: Include <algorithm>.
715         (thread_array_cleanup): Delete.
716         (scoped_inc_dec_ref): New class.
717         (live_threads_count): New function.
718         (set_thread_refcount): Delete.
719         (tp_array_compar_ascending): Now a bool.
720         (tp_array_compar): Convert to a std::sort comparison function.
721         (thread_apply_all_command): Use std::vector and scoped_inc_dec_ref
722         and live_threads_count.
723
724 2017-04-13  Pedro Alves  <palves@redhat.com>
725
726         * infrun.c (follow_fork_inferior): Also switch the current
727         inferior.
728
729 2017-04-13  Pedro Alves  <palves@redhat.com>
730
731         * breakpoint.c (watch_command_1): Save watchpoint-frame info
732         before calling create_internal_breakpoint.
733
734 2017-04-13  Pedro Alves  <palves@redhat.com>
735
736         * fork-child.c (execv_argv): New class.
737         (breakup_args): Refactored as ...
738         (execv_argv::init_for_no_shell): .. this method of execv_argv.
739         Copy arguments to storage and replace separators with NULL
740         terminators in place.
741         (escape_bang_in_quoted_argument): Adjust to return bool.
742         (execv_argv::execv_argv): New ctor.
743         (execv_argv::init_for_shell): New method, factored out from
744         fork_inferior.  Don't strdup strings into the vector.
745         (fork_inferior): Eliminate "shell" local and use execv_argv.  Use
746         Remove free_vector_argv call.
747
748 2017-04-13  Yao Qi  <yao.qi@linaro.org>
749
750         * rx-tdep.c (rx_fpsw_type): Check tdep->rx_fpsw_type instead of
751         tdep->rx_psw_type.
752
753 2017-04-13  Yao Qi  <yao.qi@linaro.org>
754
755         * rl78-tdep.c (rl78_gdbarch_init): Use XCNEW instead of XNEW.
756         * rx-tdep.c (rx_gdbarch_init): Likewise.
757
758 2017-04-13  Pedro Alves  <palves@redhat.com>
759
760         * breakpoint.h (struct breakpoint): Reindent.
761
762 2017-04-13  Pedro Alves  <palves@redhat.com>
763
764         * breakpoint.c (bp_location): Rename to ...
765         (bp_locations): ... this.  All references updated.
766         (bp_location_count): Rename to ...
767         (bp_locations_count): ... this.  All references updated.
768         (bp_location_placed_address_before_address_max): Rename to ...
769         (bp_locations_placed_address_before_address_max): ... this.  All
770         references updated.
771         (bp_location_shadow_len_after_address_max): Rename to ...
772         (bp_locations_shadow_len_after_address_max): ... this.  All
773         references updated.
774         (bp_location_compare_addrs): Rename to ...
775         (bp_locations_compare_addrs): ... this.  All references updated.
776         (bp_location_compare):Rename to ...
777         (bp_locations_compare): ... this.  All references updated.
778         (bp_location_target_extensions_update): Rename to ...
779         (bp_locations_target_extensions_update): ... this.  All references
780         updated.
781
782 2017-04-12  Sergio Durigan Junior  <sergiodj@redhat.com>
783
784         * Makefile.in (HFILES_NO_SRCDIR): Add "common/gdb_termios.h".
785         * common/common.m4: Check headers 'termios.h', 'termio.h' and
786         'sgtty.h'.
787         * common/gdb_termios.h: New file, with parts of "terminal.h".
788         * inflow.c: Include "gdb_termios.h".
789         * ser-unix.c: Include "gdb_termios.h".
790         * terminal.h: Move terminal-related defines to
791         "common/gdb_termios.h".
792
793 2017-04-12  Tom Tromey  <tom@tromey.com>
794
795         * probe.c (parse_probes): Update.
796         * location.h (delete_event_location): Don't declare.
797         (event_location_deleter::operator()): Update.
798         * location.c (event_location_deleter::operator()): Rename from
799         delete_event_location.
800         * linespec.h (linespec_result) <location>: Change type to
801         event_location_up.
802         * linespec.c (canonicalize_linespec, event_location_to_sals)
803         (decode_objc): Update.
804         (linespec_result): Don't call delete_event_location.
805         * breakpoint.c (create_breakpoints_sal)
806         (bkpt_probe_create_sals_from_location)
807         (strace_marker_create_sals_from_location): Update.
808
809 2017-04-12  Tom Tromey  <tom@tromey.com>
810
811         * linespec.h (struct linespec_result): Add constructor and
812         destructor.
813         (init_linespec_result, destroy_linespec_result)
814         (make_cleanup_destroy_linespec_result): Don't declare.
815         * linespec.c (init_linespec_result): Remove.
816         (linespec_result::~linespec_result): Rename from
817         destroy_linespec_result.  Update.
818         (cleanup_linespec_result, make_cleanup_destroy_linespec_result):
819         Remove.
820         * breakpoint.c (create_breakpoint, break_range_command)
821         (decode_location_default): Update.
822         * ax-gdb.c (agent_command_1): Update.
823
824 2017-04-12  Tom Tromey  <tom@tromey.com>
825
826         * remote.c (remote_download_tracepoint): Update.
827         * python/py-breakpoint.c (bppy_get_location): Update.
828         * guile/scm-breakpoint.c (bpscm_print_breakpoint_smob)
829         (gdbscm_breakpoint_location): Update.
830         * elfread.c (elf_gnu_ifunc_resolver_return_stop): Update.
831         * breakpoint.h (struct breakpoint) <location, location_range_end>:
832         Change type to event_location_up.
833         * breakpoint.c (create_overlay_event_breakpoint)
834         (create_longjmp_master_breakpoint)
835         (create_std_terminate_master_breakpoint)
836         (create_exception_master_breakpoint)
837         (breakpoint_event_location_empty_p, print_breakpoint_location)
838         (print_one_breakpoint_location, create_thread_event_breakpoint)
839         (init_breakpoint_sal, create_breakpoint)
840         (print_recreate_ranged_breakpoint, break_range_command)
841         (init_ada_exception_breakpoint, say_where): Update.
842         (base_breakpoint_dtor): Don't call delete_event_location.
843         (bkpt_print_recreate, tracepoint_print_recreate)
844         (dprintf_print_recreate, update_static_tracepoint)
845         (breakpoint_re_set_default): Update.
846
847 2017-04-12  Tom Tromey  <tom@tromey.com>
848
849         * compile/compile-loc2c.c (compute_stack_depth_worker): Change
850         type of "to_do".  Update.
851         (compute_stack_depth): Use std::vector.
852
853 2017-04-12  Tom Tromey  <tom@tromey.com>
854
855         * printcmd.c (find_instruction_backward): Use std::vector.
856
857 2017-04-12  Tom Tromey  <tom@tromey.com>
858
859         * symfile.c (objfilep): Remove typedef.
860         (reread_symbols): Use a std::vector.
861
862 2017-04-12  Tom Tromey  <tom@tromey.com>
863
864         * mi/mi-main.c (exec_direction_forward): Remove.
865         (exec_reverse_continue, mi_execute_command): Use scoped_restore.
866         * guile/scm-ports.c (ioscm_with_output_to_port_worker): Use
867         scoped_restore.
868         * guile/guile.c (guile_repl_command, guile_command)
869         (gdbscm_execute_gdb_command): Use scoped_restore.
870         * go-exp.y (go_parse): Use scoped_restore.
871         * d-exp.y (d_parse): Use scoped_restore.
872         * cli/cli-decode.c (cmd_func): Use scoped_restore.
873         * c-exp.y (c_parse): Use scoped_restore.
874
875 2017-04-12  Tom Tromey  <tom@tromey.com>
876
877         * mi/mi-parse.h (struct mi_parse): Add constructor, destructor.
878         (mi_parse): Update return type.
879         (mi_parse_free): Remove.
880         * mi/mi-parse.c (mi_parse::mi_parse): New constructor.
881         (mi_parse::~mi_parse): Rename from mi_parse_free.
882         (mi_parse_cleanup): Remove.
883         (mi_parse): Return a unique_ptr.  Use new.
884         * mi/mi-main.c (mi_execute_command): Update.
885
886 2017-04-12  Tom Tromey  <tom@tromey.com>
887
888         * location.c (explicit_location_lex_one): Return a
889         unique_xmalloc_ptr.
890         (string_to_explicit_location): Update.  Remove cleanups.
891
892 2017-04-12  Tom Tromey  <tom@tromey.com>
893
894         * gnu-v3-abi.c (value_and_voffset_p): Remove typedef.
895         (compare_value_and_voffset): Change type.  Update.
896         (compute_vtable_size): Change type of "offset_vec".
897         (gnuv3_print_vtable): Use std::vector.  Remove cleanups.
898         (gnuv3_get_typeid): Remove extraneous declaration.
899
900 2017-04-12  Tom Tromey  <tom@tromey.com>
901
902         * charset.h (wchar_iterator): Fix comment.
903
904 2017-04-12  Tom Tromey  <tom@tromey.com>
905
906         * charset.c (iconv_wrapper): New class.
907         (cleanup_iconv): Remove.
908         (convert_between_encodings): Use it.
909
910 2017-04-12  Tom Tromey  <tom@tromey.com>
911
912         * symfile.h (increment_reading_symtab): Update type.
913         * symfile.c (decrement_reading_symtab): Remove.
914         (increment_reading_symtab): Return a scoped_restore_tmpl<int>.
915         * psymtab.c (psymtab_to_symtab): Update.
916         * dwarf2read.c (dw2_instantiate_symtab): Update.
917
918 2017-04-12  Tom Tromey  <tom@tromey.com>
919
920         * jit.c (struct jit_reader): Declare separately.  Add constructor
921         and destructor.  Change type of "handle".
922         (loaded_jit_reader): Define separately.
923         (jit_reader_load): Update.  New "new".
924         (jit_reader_unload_command): Use "delete".
925         * gdb-dlfcn.h (struct dlclose_deleter): New.
926         (gdb_dlhandle_up): New typedef.
927         (gdb_dlopen, gdb_dlsym): Update types.
928         (gdb_dlclose): Remove.
929         * gdb-dlfcn.c (gdb_dlopen): Return a gdb_dlhandle_up.
930         (gdb_dlsym): Change type of "handle".
931         (make_cleanup_dlclose): Remove.
932         (dlclose_deleter::operator()): Rename from gdb_dlclose.
933         * compile/compile-c-support.c (load_libcc): Update.
934
935 2017-04-12  Tom Tromey  <tom@tromey.com>
936
937         * symtab.h (find_pcs_for_symtab_line): Change return type.
938         * symtab.c (find_pcs_for_symtab_line): Change return type.
939         * python/py-linetable.c (build_line_table_tuple_from_pcs): Change
940         type of "vec".  Update.
941         (ltpy_get_pcs_for_line): Update.
942         * linespec.c (decode_digits_ordinary): Update.
943
944 2017-04-12  Tom Tromey  <tom@tromey.com>
945
946         * tracepoint.c (actions_command): Update.
947         * python/python.c (python_command, python_interactive_command):
948         Update.
949         * mi/mi-cmd-break.c (mi_cmd_break_commands): Update.
950         * guile/guile.c (guile_command): Update.
951         * defs.h (read_command_lines, read_command_lines_1): Return
952         command_line_up.
953         (command_lines_deleter): New struct.
954         (command_line_up): New typedef.
955         * compile/compile.c (compile_code_command)
956         (compile_print_command): Update.
957         * cli/cli-script.h (get_command_line, copy_command_lines): Return
958         command_line_up.
959         (make_cleanup_free_command_lines): Remove.
960         * cli/cli-script.c (get_command_line, read_command_lines_1)
961         (copy_command_lines): Return command_line_up.
962         (while_command, if_command, read_command_lines, define_command)
963         (document_command): Update.
964         (do_free_command_lines_cleanup, make_cleanup_free_command_lines):
965         Remove.
966         * breakpoint.h (breakpoint_set_commands): Change type of
967         "commands".
968         * breakpoint.c (breakpoint_set_commands): Change type of
969         "commands".  Update.
970         (do_map_commands_command, update_dprintf_command_list)
971         (create_tracepoint_from_upload): Update.
972
973 2017-04-12  Tom Tromey  <tom@tromey.com>
974
975         * tracepoint.c (scope_info): Update.
976         * spu-tdep.c (spu_catch_start): Update.
977         * python/python.c (gdbpy_decode_line): Update.
978         * python/py-finishbreakpoint.c (bpfinishpy_init): Update.
979         * python/py-breakpoint.c (bppy_init): Update.
980         * probe.c (parse_probes): Update.
981         * mi/mi-cmd-break.c (mi_cmd_break_insert_1): Update.
982         * location.h (event_location_deleter): New struct.
983         (event_location_up): New typedef.
984         (new_linespec_location, new_address_location, new_probe_location)
985         (new_explicit_location, copy_event_location)
986         (string_to_event_location, string_to_event_location_basic)
987         (string_to_explicit_location): Update return type.
988         (make_cleanup_delete_event_location): Remove.
989         * location.c (new_linespec_location, new_address_location)
990         (new_probe_location, new_explicit_location, copy_event_location):
991         Return event_location_up.
992         (delete_event_location_cleanup)
993         (make_cleanup_delete_event_location): Remove.
994         (string_to_explicit_location, string_to_event_location_basic)
995         (string_to_event_location): Return event_location_up.
996         * linespec.c (canonicalize_linespec, event_location_to_sals)
997         (decode_line_with_current_source)
998         (decode_line_with_last_displayed, decode_objc): Update.
999         * guile/scm-breakpoint.c (gdbscm_register_breakpoint_x): Update.
1000         * completer.c (location_completer): Update.
1001         * cli/cli-cmds.c (edit_command, list_command): Update.
1002         * breakpoint.c (create_overlay_event_breakpoint)
1003         (create_longjmp_master_breakpoint)
1004         (create_std_terminate_master_breakpoint)
1005         (create_exception_master_breakpoint)
1006         (create_thread_event_breakpoint): Update.
1007         (init_breakpoint_sal): Update.  Remove some dead code.
1008         (create_breakpoint_sal): Change type of "location".  Update.
1009         (create_breakpoints_sal, create_breakpoint, break_command_1)
1010         (dprintf_command, break_range_command, until_break_command)
1011         (init_ada_exception_breakpoint)
1012         (strace_marker_create_sals_from_location)
1013         (update_static_tracepoint, trace_command, ftrace_command)
1014         (strace_command, create_tracepoint_from_upload): Update.
1015         * break-catch-throw.c (re_set_exception_catchpoint): Update.
1016         * ax-gdb.c (agent_command_1): Update.
1017
1018 2017-04-12  Pedro Alves  <palves@redhat.com>
1019
1020         * Makefile.in (ALL_TARGET_OBS): Add i386-go32-tdep.o.
1021         * configure.tgt: Handle i[34567]86-*-go32* and
1022         i[34567]86-*-msdosdjgpp*.
1023         * i386-tdep.c (i386_svr4_reg_to_regnum):
1024         Make extern.
1025         (i386_go32_init_abi, i386_coff_osabi_sniffer): Moved to
1026         i386-go32-tdep.c.
1027         (_initialize_i386_tdep): DJGPP bits moved to i386-go32-tdep.c.
1028         * i386-go32-tdep.c: New file.
1029         * i386-tdep.h (tdesc_i386_mmx, i386_svr4_reg_to_regnum): New
1030         declarations.
1031
1032 2017-04-12  Simon Marchi  <simon.marchi@ericsson.com>
1033
1034         * aix-thread.c (pd_status2str): Change return type to const char *.
1035
1036 2017-04-12  Pedro Alves  <palves@redhat.com>
1037
1038         * i386-tdep.c (i386_elf_init_abi, i386_go32_init_abi): Remove
1039         calls to set_gdbarch_gnu_triplet_regexp.
1040
1041 2017-04-12  Pedro Alves  <palves@redhat.com>
1042
1043         PR gdb/21323
1044         * c-lang.c (cplus_primitive_types) <cplus_primitive_type_wchar_t>:
1045         New enum value.
1046         (cplus_language_arch_info): Register cplus_primitive_type_wchar_t.
1047         * gdbtypes.h (struct builtin_type) <builtin_wchar>: New field.
1048         * gdbtypes.c (gdbtypes_post_init): Create the "wchar_t" type.
1049         * gdbarch.sh (wchar_bit, wchar_signed): New per-arch values.
1050         * gdbarch.h, gdbarch.c: Regenerate.
1051         * aarch64-tdep.c (aarch64_gdbarch_init): Override
1052         gdbarch_wchar_bit and gdbarch_wchar_signed.
1053         * alpha-tdep.c (alpha_gdbarch_init): Likewise.
1054         * arm-tdep.c (arm_gdbarch_init): Likewise.
1055         * avr-tdep.c (avr_gdbarch_init): Likewise.
1056         * h8300-tdep.c (h8300_gdbarch_init): Likewise.
1057         * i386-nto-tdep.c (i386nto_init_abi): Likewise.
1058         * i386-tdep.c (i386_go32_init_abi): Likewise.
1059         * m32r-tdep.c (m32r_gdbarch_init): Likewise.
1060         * moxie-tdep.c (moxie_gdbarch_init): Likewise.
1061         * nds32-tdep.c (nds32_gdbarch_init): Likewise.
1062         * rs6000-aix-tdep.c (rs6000_aix_init_osabi): Likewise.
1063         * sh-tdep.c (sh_gdbarch_init): Likewise.
1064         * sparc-tdep.c (sparc32_gdbarch_init): Likewise.
1065         * sparc64-tdep.c (sparc64_init_abi): Likewise.
1066         * windows-tdep.c (windows_init_abi): Likewise.
1067         * xstormy16-tdep.c (xstormy16_gdbarch_init): Likewise.
1068
1069 2017-04-12  Pedro Alves  <palves@redhat.com>
1070
1071         PR c++/21323
1072         * c-lang.c (cplus_primitive_types) <cplus_primitive_type_char16_t,
1073         cplus_primitive_type_char32_t>: New enum values.
1074         (cplus_language_arch_info): Register cplus_primitive_type_char16_t
1075         and cplus_primitive_type_char32_t.
1076         * dwarf2read.c (read_base_type) <DW_ATE_UTF>: If bit size is 16 or
1077         32, use the archtecture's built-in type for char16_t and char32_t,
1078         respectively.  Otherwise, fallback to init_integer_type as before,
1079         but make the type unsigned, and issue a complaint.
1080         * gdbtypes.c (gdbtypes_post_init): Make char16_t and char32_t unsigned.
1081
1082 2017-04-12  Alan Hayward  <alan.hayward@arm.com>
1083
1084         * m32r-tdep.c (M32R_ARG_REGISTER_SIZE): Added.
1085         (m32r_push_dummy_call): Use M32R_ARG_REGISTER_SIZE.
1086
1087 2017-04-12  Sergio Durigan Junior  <sergiodj@redhat.com>
1088
1089         * windows-nat.c (windows_create_inferior): Declare 'toexec' as
1090         'const char *'.
1091
1092 2017-04-12  Sergio Durigan Junior  <sergiodj@redhat.com>
1093
1094         * common/common-utils.c (free_vector_argv): New function.
1095         * common/common-utils.h: Include <vector>.
1096         (free_vector_argv): New prototype.
1097         * darwin-nat.c (darwin_create_inferior): Rewrite function
1098         prototype in order to constify "exec_file" and accept a
1099         "std::string" for "allargs".
1100         * fork-child.c: Include <vector>.
1101         (breakup_args): Rewrite function, using C++.
1102         (fork_inferior): Rewrite function header, constify "exec_file_arg"
1103         and accept "std::string" for "allargs".  Update the code to
1104         calculate "argv" based on "allargs".  Update calls to "exec_fun"
1105         and "execvp".
1106         * gnu-nat.c (gnu_create_inferior): Rewrite function prototype in
1107         order to constify "exec_file" and accept a "std::string" for
1108         "allargs".
1109         * go32-nat.c (go32_create_inferior): Likewise.
1110         * inf-ptrace.c (inf_ptrace_create_inferior): Likewise.
1111         * infcmd.c (run_command_1): Constify "exec_file".  Use
1112         "std::string" for inferior arguments.
1113         * inferior.h (fork_inferior): Update prototype.
1114         * linux-nat.c (linux_nat_create_inferior): Rewrite function
1115         prototype in order to constify "exec_file" and accept a
1116         "std::string" for "allargs".
1117         * nto-procfs.c (procfs_create_inferior): Likewise.
1118         * procfs.c (procfs_create_inferior): Likewise.
1119         * remote-sim.c (gdbsim_create_inferior): Likewise.
1120         * remote.c (extended_remote_run): Update code to accept
1121         "std::string" as argument.
1122         (extended_remote_create_inferior): Rewrite function prototype in
1123         order to constify "exec_file" and accept a "std::string" for
1124         "allargs".
1125         * rs6000-nat.c (super_create_inferior): Likewise.
1126         (rs6000_create_inferior): Likewise.
1127         * target.h (struct target_ops) <to_create_inferior>: Likewise.
1128         * windows-nat.c (windows_create_inferior): Likewise.
1129
1130 2017-04-11  Pedro Alves  <palves@redhat.com>
1131
1132         * thread.c: Fix whitespace throughout.
1133
1134 2017-04-11  Philipp Rudo  <prudo@linux.vnet.ibm.com>
1135
1136         * linux-nat.c (linux_nat_detach): Remove delete_lwp call.
1137
1138 2017-04-11  Alan Hayward  <alan.hayward@arm.com>
1139
1140         * arm-tdep.c (arm_store_return_value): Use FP_REGISTER_SIZE
1141
1142 2017-04-10  Sergio Durigan Junior  <sergiodj@redhat.com>
1143
1144         PR gdb/21364
1145         * osdata.c (info_osdata): Check if 'type' is an empty string
1146         instead of NULL.
1147
1148 2017-04-10  Pedro Alves  <palves@redhat.com>
1149
1150         * thread.c (add_thread_silent, delete_thread_1, find_thread_ptid)
1151         (ptid_to_global_thread_id, in_thread_list)
1152         (do_captured_list_thread_ids, set_resumed, set_running)
1153         (set_executing, set_stop_requested, finish_thread_state)
1154         (validate_registers_access, can_access_registers_ptid)
1155         (print_thread_info_1, switch_to_thread)
1156         (do_restore_current_thread_cleanup)
1157         (make_cleanup_restore_current_thread, thread_command)
1158         (thread_name_command): Use operator== instead of ptid_equal.
1159
1160 2017-04-10  Pedro Alves  <palves@redhat.com>
1161
1162         * thread.c (struct current_thread_cleanup) <next>: Delete field.
1163         (current_thread_cleanup_chain): Delete.
1164         (restore_current_thread_cleanup_dtor)
1165         (make_cleanup_restore_current_thread): Remove references to
1166         current_thread_cleanup_chain.
1167
1168 2017-04-10  Alan Hayward  <alan.hayward@arm.com>
1169
1170         * msp430-tdep.c (msp430_pseudo_register_read): Never return
1171         REG_UNKNOWN.
1172
1173 2017-04-10  Yao Qi  <yao.qi@linaro.org>
1174
1175         PR gdb/19942
1176         * gdbthread.h (thread_info::deletable): New method.
1177         (thread_info::incref): New method.
1178         (thread_info::decref): New method.
1179         (thread_info::refcount): Move it to private.
1180         * infrun.c (save_stop_context): Call inc_refcount.
1181         (release_stop_context_cleanup): Likewise.
1182         * thread.c (set_thread_exited): New function.
1183         (init_thread_list): Delete "tp" only it is deletable, otherwise
1184         call set_thread_exited.
1185         (delete_thread_1): Call set_thread_exited.
1186         (current_thread_cleanup) <inferior_pid>: Remove.
1187         <thread>: New field.
1188         (restore_current_thread_ptid_changed): Removed.
1189         (do_restore_current_thread_cleanup): Adjust.
1190         (restore_current_thread_cleanup_dtor): Don't call
1191         find_thread_ptid.
1192         (set_thread_refcount): Use dec_refcount.
1193         (make_cleanup_restore_current_thread): Adjust.
1194         (thread_apply_all_command): Call inc_refcount.
1195         (_initialize_thread): Don't call
1196         observer_attach_thread_ptid_changed.
1197
1198 2017-04-10  Yao Qi  <yao.qi@linaro.org>
1199
1200         * thread.c (delete_thread_1): Hoist code on marking thread as
1201         exited.
1202
1203 2017-04-09  Simon Marchi  <simon.marchi@polymtl.ca>
1204
1205         * windows-nat.c (windows_detach): Initialize ptid with
1206         minus_one_ptid.
1207
1208 2017-04-07  Simon Marchi  <simon.marchi@ericsson.com>
1209
1210         * unittests/ptid-selftests.c: Fix erroneous assert messages.
1211
1212 2017-04-07  Alan Hayward  <alan.hayward@arm.com>
1213
1214         * bfin-tdep.c (BFIN_MAX_REGISTER_SIZE): Add.
1215         (bfin_pseudo_register_read): Use BFIN_MAX_REGISTER_SIZE.
1216         (bfin_pseudo_register_write): Likewise
1217
1218 2017-04-06  Simon Marchi  <simon.marchi@ericsson.com>
1219
1220         * common/ptid.h (struct ptid): Change to...
1221         (class ptid_t): ... this.
1222         <ptid_t>: New constructors.
1223         <pid, lwp_p, lwp, tid_p, tid, is_pid, operator==, operator!=,
1224         matches>: New methods.
1225         <make_null, make_minus_one>: New static methods.
1226         <pid>: Rename to...
1227         <m_pid>: ...this.
1228         <lwp>: Rename to...
1229         <m_lwp>: ...this.
1230         <tid>: Rename to...
1231         <m_tid>: ...this.
1232         (ptid_build, ptid_get_pid, ptid_get_lwp, ptid_get_tid, ptid_equal,
1233         ptid_is_pid, ptid_lwp_p, ptid_tid_p, ptid_match): Take ptid arguments
1234         as references, move comment to class ptid_t.
1235         * common/ptid.c (null_ptid, minus_one_ptid): Initialize with
1236         ptid_t static methods.
1237         (ptid_build, pid_to_ptid, ptid_get_pid, ptid_get_tid,
1238         ptid_equal, ptid_is_pid, ptid_lwp_p, ptid_tid_p, ptid_match):
1239         Take ptid arguments as references, implement using ptid_t methods.
1240         * unittests/ptid-selftests.c: New file.
1241         * Makefile.in (SUBDIR_UNITTESTS_SRCS): Add
1242         unittests/ptid-selftests.c.
1243         (SUBDIR_UNITTESTS_OBS): Add unittests/ptid-selftests.o.
1244
1245 2017-04-06  Thomas Preud'homme  <thomas.preudhomme@arm.com>
1246
1247         * python/python.c (python_run_simple_file): Cast mode literal to
1248         non-const char pointer as expected by PyFile_FromString.
1249
1250 2017-04-05  Simon Marchi  <simon.marchi@ericsson.com>
1251
1252         * common/ptid.c (ptid_lwp_p, ptid_tid_p): Remove comparison with
1253         minus_one_ptid and null_ptid.
1254
1255 2017-04-05  Pedro Alves  <palves@redhat.com>
1256
1257         * warning.m4 (build_warnings): Remove -Wno-write-strings.
1258         * configure: Regenerate.
1259
1260 2017-04-05  Pedro Alves  <palves@redhat.com>
1261
1262         * ada-exp.y (yyerror): Constify.
1263         * ada-lang.c (bound_name, get_selections)
1264         (ada_variant_discrim_type)
1265         (ada_variant_discrim_name, ada_value_struct_elt)
1266         (ada_lookup_struct_elt_type, is_unchecked_variant)
1267         (ada_which_variant_applies, standard_exc, ada_get_next_arg)
1268         (catch_ada_exception_command_split)
1269         (catch_ada_assert_command_split, catch_assert_command)
1270         (ada_op_name): Constify.
1271         * ada-lang.h (ada_yyerror, get_selections)
1272         (ada_variant_discrim_name, ada_value_struct_elt): Constify.
1273         * arc-tdep.c (arc_print_frame_cache): Constify.
1274         * arm-tdep.c (arm_skip_stub): Constify.
1275         * ax-gdb.c (gen_binop, gen_struct_ref_recursive, gen_struct_ref)
1276         (gen_aggregate_elt_ref): Constify.
1277         * bcache.c (print_bcache_statistics): Constify.
1278         * bcache.h (print_bcache_statistics): Constify.
1279         * break-catch-throw.c (catch_exception_command_1):
1280         * breakpoint.c (struct ep_type_description::description):
1281         Constify.
1282         (add_solib_catchpoint): Constify.
1283         (catch_fork_command_1): Add cast.
1284         (add_catch_command): Constify.
1285         * breakpoint.h (add_catch_command, add_solib_catchpoint):
1286         Constify.
1287         * bsd-uthread.c (bsd_uthread_state): Constify.
1288         * buildsym.c (patch_subfile_names): Constify.
1289         * buildsym.h (next_symbol_text_func, patch_subfile_names):
1290         Constify.
1291         * c-exp.y (yyerror): Constify.
1292         (token::oper): Constify.
1293         * c-lang.h (c_yyerror, cp_print_class_member): Constify.
1294         * c-varobj.c (cplus_describe_child): Constify.
1295         * charset.c (find_charset_names): Add cast.
1296         (find_charset_names): Constify array and add const_cast.
1297         * cli/cli-cmds.c (complete_command, cd_command): Constify.
1298         (edit_command): Constify.
1299         * cli/cli-decode.c (lookup_cmd): Constify.
1300         * cli/cli-dump.c (dump_memory_command, dump_value_command):
1301         Constify.
1302         (struct dump_context): Constify.
1303         (add_dump_command, restore_command): Constify.
1304         * cli/cli-script.c (get_command_line): Constify.
1305         * cli/cli-script.h (get_command_line): Constify.
1306         * cli/cli-utils.c (check_for_argument): Constify.
1307         * cli/cli-utils.h (check_for_argument): Constify.
1308         * coff-pe-read.c (struct read_pe_section_data): Constify.
1309         * command.h (lookup_cmd): Constify.
1310         * common/print-utils.c (decimal2str): Constify.
1311         * completer.c (gdb_print_filename): Constify.
1312         * corefile.c (set_gnutarget): Constify.
1313         * cp-name-parser.y (yyerror): Constify.
1314         * cp-valprint.c (cp_print_class_member): Constify.
1315         * cris-tdep.c (cris_register_name, crisv32_register_name):
1316         Constify.
1317         * d-exp.y (yyerror): Constify.
1318         (struct token::oper): Constify.
1319         * d-lang.h (d_yyerror): Constify.
1320         * dbxread.c (struct header_file_location::name): Constify.
1321         (add_old_header_file, add_new_header_file, last_function_name)
1322         (dbx_next_symbol_text, add_bincl_to_list)
1323         (find_corresponding_bincl_psymtab, set_namestring)
1324         (find_stab_function_addr, read_dbx_symtab, start_psymtab)
1325         (dbx_end_psymtab, read_ofile_symtab, process_one_symbol):
1326         * defs.h (command_line_input, print_address_symbolic)
1327         (deprecated_readline_begin_hook): Constify.
1328         * dwarf2read.c (anonymous_struct_prefix, dwarf_bool_name):
1329         Constify.
1330         * event-top.c (handle_line_of_input): Constify and add cast.
1331         * exceptions.c (catch_errors): Constify.
1332         * exceptions.h (catch_errors): Constify.
1333         * expprint.c (print_subexp_standard, op_string, op_name)
1334         (op_name_standard, dump_raw_expression, dump_raw_expression):
1335         * expression.h (op_name, op_string, dump_raw_expression):
1336         Constify.
1337         * f-exp.y (yyerror): Constify.
1338         (struct token::oper): Constify.
1339         (struct f77_boolean_val::name): Constify.
1340         * f-lang.c (f_word_break_characters): Constify.
1341         * f-lang.h (f_yyerror): Constify.
1342         * fork-child.c (fork_inferior): Add cast.
1343         * frv-tdep.c (struct gdbarch_tdep::register_names): Constify.
1344         (new_variant): Constify.
1345         * gdbarch.sh (pstring_ptr, pstring_list): Constify.
1346         * gdbarch.c: Regenerate.
1347         * gdbcore.h (set_gnutarget): Constify.
1348         * go-exp.y (yyerror): Constify.
1349         (token::oper): Constify.
1350         * go-lang.h (go_yyerror): Constify.
1351         * go32-nat.c (go32_sysinfo): Constify.
1352         * guile/scm-breakpoint.c (gdbscm_breakpoint_expression): Constify.
1353         * guile/scm-cmd.c (cmdscm_function): Constify.
1354         * guile/scm-param.c (pascm_param_value): Constify.
1355         * h8300-tdep.c (h8300_register_name, h8300s_register_name)
1356         (h8300sx_register_name): Constify.
1357         * hppa-tdep.c (hppa32_register_name, hppa64_register_name):
1358         Constify.
1359         * ia64-tdep.c (ia64_register_names): Constify.
1360         * infcmd.c (construct_inferior_arguments): Constify.
1361         (path_command, attach_post_wait): Constify.
1362         * language.c (show_range_command, show_case_command)
1363         (unk_lang_error): Constify.
1364         * language.h (language_defn::la_error)
1365         (language_defn::la_name_of_this): Constify.
1366         * linespec.c (decode_line_2): Constify.
1367         * linux-thread-db.c (thread_db_err_str): Constify.
1368         * lm32-tdep.c (lm32_register_name): Constify.
1369         * m2-exp.y (yyerror): Constify.
1370         * m2-lang.h (m2_yyerror): Constify.
1371         * m32r-tdep.c (m32r_register_names): Constify and make static.
1372         * m68hc11-tdep.c (m68hc11_register_names): Constify.
1373         * m88k-tdep.c (m88k_register_name): Constify.
1374         * macroexp.c (appendmem): Constify.
1375         * mdebugread.c (fdr_name, add_data_symbol, parse_type)
1376         (upgrade_type, parse_external, parse_partial_symbols)
1377         (mdebug_next_symbol_text, cross_ref, mylookup_symbol, new_psymtab)
1378         (new_symbol): Constify.
1379         * memattr.c (mem_info_command): Constify.
1380         * mep-tdep.c (register_name_from_keyword): Constify.
1381         * mi/mi-cmd-env.c (mi_cmd_env_path, _initialize_mi_cmd_env):
1382         Constify.
1383         * mi/mi-cmd-stack.c (list_args_or_locals): Constify.
1384         * mi/mi-cmd-var.c (mi_cmd_var_show_attributes): Constify.
1385         * mi/mi-main.c (captured_mi_execute_command): Constify and add
1386         cast.
1387         (mi_execute_async_cli_command): Constify.
1388         * mips-tdep.c (mips_register_name): Constify.
1389         * mn10300-tdep.c (register_name, mn10300_generic_register_name)
1390         (am33_register_name, am33_2_register_name)
1391         * moxie-tdep.c (moxie_register_names): Constify.
1392         * nat/linux-osdata.c (osdata_type): Constify fields.
1393         * nto-tdep.c (nto_parse_redirection): Constify.
1394         * objc-lang.c (lookup_struct_typedef, lookup_objc_class)
1395         (lookup_child_selector): Constify.
1396         (objc_methcall::name): Constify.
1397         * objc-lang.h (lookup_objc_class, lookup_child_selector)
1398         (lookup_struct_typedef): Constify.
1399         * objfiles.c (pc_in_section): Constify.
1400         * objfiles.h (pc_in_section): Constify.
1401         * p-exp.y (struct token::oper): Constify.
1402         (yyerror): Constify.
1403         * p-lang.h (pascal_yyerror): Constify.
1404         * parser-defs.h (op_name_standard): Constify.
1405         (op_print::string): Constify.
1406         (exp_descriptor::op_name): Constify.
1407         * printcmd.c (print_address_symbolic): Constify.
1408         * psymtab.c (print_partial_symbols): Constify.
1409         * python/py-breakpoint.c (stop_func): Constify.
1410         (bppy_get_expression): Constify.
1411         * python/py-cmd.c (cmdpy_completer::name): Constify.
1412         (cmdpy_function): Constify.
1413         * python/py-event.c (evpy_add_attribute)
1414         (gdbpy_initialize_event_generic): Constify.
1415         * python/py-event.h (evpy_add_attribute)
1416         (gdbpy_initialize_event_generic): Constify.
1417         * python/py-evts.c (add_new_registry): Constify.
1418         * python/py-finishbreakpoint.c (outofscope_func): Constify.
1419         * python/py-framefilter.c (get_py_iter_from_func): Constify.
1420         * python/py-inferior.c (get_buffer): Add cast.
1421         * python/py-param.c (parm_constant::name): Constify.
1422         * python/py-unwind.c (fprint_frame_id): Constify.
1423         * python/python.c (gdbpy_parameter_value): Constify.
1424         * remote-fileio.c (remote_fio_func_map): Make 'name' const.
1425         * remote.c (memory_packet_config::name): Constify.
1426         (show_packet_config_cmd, remote_write_bytes)
1427         (remote_buffer_add_string):
1428         * reverse.c (exec_reverse_once): Constify.
1429         * rs6000-tdep.c (variant::name, variant::description): Constify.
1430         * rust-exp.y (rustyyerror): Constify.
1431         * rust-lang.c (rust_op_name): Constify.
1432         * rust-lang.h (rustyyerror): Constify.
1433         * serial.h (serial_ops::name): Constify.
1434         * sh-tdep.c (sh_sh_register_name, sh_sh3_register_name)
1435         (sh_sh3e_register_name, sh_sh2e_register_name)
1436         (sh_sh2a_register_name, sh_sh2a_nofpu_register_name)
1437         (sh_sh_dsp_register_name, sh_sh3_dsp_register_name)
1438         (sh_sh4_register_name, sh_sh4_nofpu_register_name)
1439         (sh_sh4al_dsp_register_name): Constify.
1440         * sh64-tdep.c (sh64_register_name): Constify.
1441         * solib-darwin.c (lookup_symbol_from_bfd): Constify.
1442         * spu-tdep.c (spu_register_name, info_spu_dma_cmdlist): Constify.
1443         * stabsread.c (patch_block_stabs, read_type_number)
1444         (ref_map::stabs, ref_add, process_reference)
1445         (symbol_reference_defined, define_symbol, define_symbol)
1446         (error_type, read_type, read_member_functions, read_cpp_abbrev)
1447         (read_one_struct_field, read_struct_fields, read_baseclasses)
1448         (read_tilde_fields, read_struct_type, read_array_type)
1449         (read_enum_type, read_sun_builtin_type, read_sun_floating_type)
1450         (read_huge_number, read_range_type, read_args, common_block_start)
1451         (find_name_end): Constify.
1452         * stabsread.h (common_block_start, define_symbol)
1453         (process_one_symbol, symbol_reference_defined, ref_add):
1454         * symfile.c (get_section_index, add_symbol_file_command):
1455         * symfile.h (get_section_index): Constify.
1456         * target-descriptions.c (tdesc_type::name): Constify.
1457         (tdesc_free_type): Add cast.
1458         * target.c (find_default_run_target):
1459         (add_deprecated_target_alias, find_default_run_target)
1460         (target_announce_detach): Constify.
1461         (do_option): Constify.
1462         * target.h (add_deprecated_target_alias): Constify.
1463         * thread.c (print_thread_info_1): Constify.
1464         * top.c (deprecated_readline_begin_hook, command_line_input):
1465         Constify.
1466         (init_main): Add casts.
1467         * top.h (handle_line_of_input): Constify.
1468         * tracefile-tfile.c (tfile_write_uploaded_tsv): Constify.
1469         * tracepoint.c (tvariables_info_1, trace_status_mi): Constify.
1470         (tfind_command): Rename to ...
1471         (tfind_command_1): ... this and constify.
1472         (tfind_command): New function.
1473         (tfind_end_command, tfind_start_command): Adjust.
1474         (encode_source_string): Constify.
1475         * tracepoint.h (encode_source_string): Constify.
1476         * tui/tui-data.c (tui_partial_win_by_name): Constify.
1477         * tui/tui-data.h (tui_partial_win_by_name): Constify.
1478         * tui/tui-source.c (tui_set_source_content_nil): Constify.
1479         * tui/tui-source.h (tui_set_source_content_nil): Constify.
1480         * tui/tui-win.c (parse_scrolling_args): Constify.
1481         * tui/tui-windata.c (tui_erase_data_content): Constify.
1482         * tui/tui-windata.h (tui_erase_data_content): Constify.
1483         * tui/tui-winsource.c (tui_erase_source_content): Constify.
1484         * tui/tui.c (tui_enable): Add cast.
1485         * utils.c (defaulted_query): Constify.
1486         (init_page_info): Add cast.
1487         (puts_debug, subset_compare): Constify.
1488         * utils.h (subset_compare): Constify.
1489         * varobj.c (varobj_format_string): Constify.
1490         * varobj.h (varobj_format_string): Constify.
1491         * vax-tdep.c (vax_register_name): Constify.
1492         * windows-nat.c (windows_detach): Constify.
1493         * xcoffread.c (process_linenos, xcoff_next_symbol_text): Constify.
1494         * xml-support.c (gdb_xml_end_element): Constify.
1495         * xml-tdesc.c (tdesc_start_reg): Constify.
1496         * xstormy16-tdep.c (xstormy16_register_name): Constify.
1497         * xtensa-tdep.c (xtensa_find_register_by_name): Constify.
1498         * xtensa-tdep.h (xtensa_register_t::name): Constify.
1499
1500 2017-04-05  Pedro Alves  <palves@redhat.com>
1501
1502         * proc-api.c (struct trans): Constify.
1503         (procfs_note): Constify.
1504         * proc-events.c (struct trans, syscall_table):
1505         * proc-flags.c (struct trans): Constify.
1506         * proc-utils.h (procfs_note): Constify.
1507         * proc-why.c (struct trans): Constify.
1508         * procfs.c (dead_procinfo, find_syscall, proc_warn, proc_error)
1509         (procfs_detach): Constify.
1510         * sol-thread.c (struct string_map): Constify.
1511         (td_err_string, td_state_string): Constify.
1512
1513 2017-04-05  Pedro Alves  <palves@redhat.com>
1514
1515         * proc-api.c (procfs_filename): Don't initialize
1516         procfs_filename.
1517         (prepare_to_trace): Assume procfs_filename is non-NULL.
1518         (_initialize_proc_api): Give procfs_filename a default value here.
1519
1520 2017-04-05  Pedro Alves  <palves@redhat.com>
1521
1522         * break-catch-throw.c (handle_gnu_v3_exceptions): Constify
1523         'cond_string' parameter.
1524         (extract_exception_regexp): Constify 'string' parameter.
1525         (catch_exception_command_1): Constify.
1526         * breakpoint.c (init_catchpoint)
1527         (create_fork_vfork_event_catchpoint): Constify 'cond_string'
1528         parameter.
1529         (ep_parse_optional_if_clause, catch_fork_command_1)
1530         (catch_exec_command_1): Constify.
1531         * breakpoint.h (init_catchpoint): Constify 'cond_string'
1532         parameter.
1533         (ep_parse_optional_if_clause): Constify.
1534         * cli/cli-utils.c (remove_trailing_whitespace)
1535         (check_for_argument): Constify.
1536         * cli/cli-utils.h (remove_trailing_whitespace): Constify and add
1537         non-const overload.
1538         (check_for_argument): Likewise.
1539
1540 2017-04-05  Pedro Alves  <palves@redhat.com>
1541
1542         * event-top.c (command_line_handler): Add cast to execute_command
1543         call.
1544         * record-btrace.c (cmd_record_btrace_bts_start)
1545         (cmd_record_btrace_pt_start, cmd_record_btrace_start)
1546         (cmd_record_btrace_start): Add cast to execute_command call.
1547         * record-full.c (record_full_goto_insn):
1548         * record.c (record_start, record_stop): Add cast to
1549         execute_command_to_string calls.
1550         (cmd_record_start): Add cast to execute_command calls.
1551
1552 2017-04-05  Pedro Alves  <palves@redhat.com>
1553
1554         * python/python-internal.h (gdb_PyArg_ParseTupleAndKeywords): New
1555         static inline function.
1556         * python/py-arch.c (archpy_disassemble): Constify 'keywords'
1557         array and use gdb_PyArg_ParseTupleAndKeywords.
1558         * python/py-cmd.c (cmdpy_init): Likewise.
1559         * python/py-finishbreakpoint.c (bpfinishpy_init): Likewise.
1560         * python/py-inferior.c (infpy_read_memory, infpy_write_memory)
1561         (infpy_search_memory): Likewise.
1562         * python/py-objfile.c (objfpy_add_separate_debug_file)
1563         (gdbpy_lookup_objfile): Likewise.
1564         * python/py-symbol.c (gdbpy_lookup_symbol)
1565         (gdbpy_lookup_global_symbol): Likewise.
1566         * python/py-type.c (gdbpy_lookup_type): Likewise.
1567         * python/py-value.c (valpy_lazy_string, valpy_string): Likewise.
1568         * python/python.c (execute_gdb_command, gdbpy_write, gdbpy_flush):
1569         Likewise.
1570
1571 2017-04-05  Pedro Alves  <palves@redhat.com>
1572
1573         * python/python-internal.h (gdb_PyGetSetDef): New type.
1574         * python/py-block.c (block_object_getset)
1575         (breakpoint_object_getset): Now a gdb_PyGetSetDef array.
1576         * python/py-event.c (event_object_getset)
1577         (finish_breakpoint_object_getset): Likewise.
1578         * python/py-inferior.c (inferior_object_getset): Likewise.
1579         * python/py-infthread.c (thread_object_getset): Likewise.
1580         * python/py-lazy-string.c (lazy_string_object_getset): Likewise.
1581         * python/py-linetable.c (linetable_entry_object_getset): Likewise.
1582         * python/py-objfile.c (objfile_getset): Likewise.
1583         * python/py-progspace.c (pspace_getset): Likewise.
1584         * python/py-record-btrace.c (btpy_insn_getset, btpy_call_getset):
1585         Likewise.
1586         * python/py-record.c (recpy_record_getset): Likewise.
1587         * python/py-symbol.c (symbol_object_getset): Likewise.
1588         * python/py-symtab.c (symtab_object_getset, sal_object_getset):
1589         Likewise.
1590         * python/py-type.c (type_object_getset, field_object_getset):
1591         Likewise.
1592         * python/py-value.c (value_object_getset): Likewise.
1593
1594 2017-04-05  Pedro Alves  <palves@redhat.com>
1595
1596         * python/python-internal.h (gdb_PyObject_CallMethod)
1597         (gdb_PyErr_NewException, gdb_PySys_GetObject, gdb_PySys_SetPath):
1598         New functions.
1599         (GDB_PYSYS_SETPATH_CHAR, PyObject_CallMethod, PyErr_NewException)
1600         (PySys_GetObject, PySys_SetPath): New macros.
1601
1602 2017-04-05  Pedro Alves  <palves@redhat.com>
1603
1604         * mi/mi-cmd-info.c (mi_cmd_info_os): Call info_osdata instead of
1605         info_osdata_command.
1606         * osdata.c (info_osdata_command): Rename to ...
1607         (info_osdata): ... this.  Constify 'type' parameter, and remove
1608         the 'from_tty' parameter.  Accept NULL TYPE.
1609         (info_osdata_command): New function.
1610         * osdata.h (info_osdata_command): Remove declaration.
1611         (info_osdata): New declaration.
1612
1613 2017-04-05  Pedro Alves  <palves@redhat.com>
1614
1615         * mi/mi-cmd-break.c (mi_cmd_break_insert_1, mi_cmd_break_insert)
1616         (mi_cmd_dprintf_insert, mi_cmd_break_passcount)
1617         (mi_cmd_break_watch, mi_cmd_break_commands): Constify 'command'
1618         parameter.
1619         * mi/mi-cmd-catch.c (mi_cmd_catch_assert, mi_cmd_catch_exception)
1620         (mi_cmd_catch_load, mi_cmd_catch_unload): Constify cmd' parameter.
1621         * mi/mi-cmd-disas.c (mi_cmd_disassemble): Constify 'command'
1622         parameter.
1623         * mi/mi-cmd-env.c (mi_cmd_env_pwd, mi_cmd_env_cd, mi_cmd_env_path)
1624         (mi_cmd_env_dir, mi_cmd_inferior_tty_set, _cmd_inferior_tty_show)
1625         * mi/mi-cmd-file.c (mi_cmd_file_list_exec_source_file)
1626         (mi_cmd_file_list_exec_source_files)
1627         (mi_cmd_file_list_shared_libraries): Constify 'command' parameter.
1628         * mi/mi-cmd-info.c (mi_cmd_info_ada_exceptions)
1629         (mi_cmd_info_gdb_mi_command, mi_cmd_info_os): Constify 'command'
1630         parameter.
1631         * mi/mi-cmd-stack.c (mi_cmd_enable_frame_filters)
1632         (mi_cmd_stack_list_frames, mi_cmd_stack_info_depth)
1633         (mi_cmd_stack_list_locals, mi_cmd_stack_list_args)
1634         (mi_cmd_stack_list_variables, mi_cmd_stack_select_frame)
1635         (mi_cmd_stack_info_frame): Constify 'command' parameter.
1636         * mi/mi-cmd-target.c (mi_cmd_target_file_get)
1637         (mi_cmd_target_file_put, mi_cmd_target_file_delete): Constify
1638         'command' parameter.
1639         * mi/mi-cmd-var.c (mi_cmd_var_create, mi_cmd_var_delete)
1640         (mi_cmd_var_set_format, mi_cmd_var_set_visualizer)
1641         (mi_cmd_var_set_frozen, mi_cmd_var_show_format)
1642         (mi_cmd_var_info_num_children, mi_cmd_var_list_children)
1643         (mi_cmd_var_info_type, mi_cmd_var_info_path_expression)
1644         (mi_cmd_var_info_expression, mi_cmd_var_show_attributes)
1645         (mi_cmd_var_evaluate_expression, mi_cmd_var_assign)
1646         (mi_cmd_var_update, mi_cmd_enable_pretty_printing)
1647         (mi_cmd_var_set_update_range): Constify 'command' parameter.
1648         * mi/mi-cmds.h (mi_cmd_argv_ftype): Constify 'command' parameter.
1649         * mi/mi-interp.c (mi_cmd_interpreter_exec): Constify 'command'
1650         parameter.
1651         * mi/mi-main.c (mi_cmd_gdb_exit, mi_cmd_exec_next)
1652         (mi_cmd_exec_next_instruction, mi_cmd_exec_step)
1653         (mi_cmd_exec_step_instruction, mi_cmd_exec_finish)
1654         (mi_cmd_exec_return ,mi_cmd_exec_jump, mi_cmd_exec_continue)
1655         (mi_cmd_exec_interrupt, mi_cmd_exec_run, mi_cmd_target_detach)
1656         (mi_cmd_target_flash_erase, mi_cmd_thread_select)
1657         (mi_cmd_thread_list_ids, mi_cmd_thread_info)
1658         (mi_cmd_list_thread_groups, mi_cmd_data_list_register_names)
1659         (mi_cmd_data_list_changed_registers)
1660         (mi_cmd_data_write_register_values)
1661         (mi_cmd_data_evaluate_expression, mi_cmd_data_read_memory)
1662         (mi_cmd_data_read_memory_bytes, mi_cmd_data_write_memory)
1663         (mi_cmd_data_write_memory_bytes, mi_cmd_enable_timings)
1664         (mi_cmd_list_features, mi_cmd_list_target_features)
1665         (mi_cmd_add_inferior, mi_cmd_remove_inferior)
1666         (mi_cmd_trace_define_variable, mi_cmd_trace_list_variables)
1667         (mi_cmd_trace_find, mi_cmd_trace_save, mi_cmd_trace_start)
1668         (mi_cmd_trace_status, mi_cmd_trace_stop, mi_cmd_ada_task_info)
1669         (mi_cmd_trace_frame_collected): Constify 'command'
1670         parameter.
1671         * mi/mi-symbol-cmds.c (mi_cmd_symbol_list_lines): Constify
1672         'command' parameter.
1673
1674 2017-04-05  Pedro Alves  <palves@redhat.com>
1675
1676         * ada-lang.c (ada_completer_word_break_characters): Now a const
1677         array.
1678         (ada_get_gdb_completer_word_break_characters): Constify.
1679         * completer.c (gdb_completer_command_word_break_characters)
1680         (gdb_completer_file_name_break_characters)
1681         (gdb_completer_quote_characters): Now const arrays.
1682         (get_gdb_completer_quote_characters): Constify.
1683         (set_rl_completer_word_break_characters): New function.
1684         (set_gdb_completion_word_break_characters)
1685         (complete_line_internal): Use it.
1686         * completer.h (get_gdb_completer_quote_characters): Constify.
1687         (set_rl_completer_word_break_characters): Declare.
1688         * f-lang.c (f_word_break_characters): Constify.
1689         * language.c (default_word_break_characters): Constify.
1690         * language.h (language_defn::la_word_break_characters): Constify.
1691         (default_word_break_characters): Constify.
1692         * top.c (init_main): Use set_rl_completer_word_break_characters.
1693
1694 2017-04-05  Pedro Alves  <palves@redhat.com>
1695
1696         * aix-thread.c (aix_thread_pid_to_str)
1697         (aix_thread_extra_thread_info): Constify.
1698         * bsd-kvm.c (bsd_kvm_pid_to_str): Constify.
1699         * bsd-uthread.c (bsd_uthread_extra_thread_info)
1700         (bsd_uthread_pid_to_str): Constify.
1701         * corelow.c (core_pid_to_str): Constify.
1702         * darwin-nat.c (darwin_pid_to_str): Constify.
1703         * fbsd-nat.c (fbsd_pid_to_str): Constify.
1704         * fbsd-tdep.c (fbsd_core_pid_to_str, gdbarch_core_pid_to_str):
1705         Constify.
1706         * gnu-nat.c (gnu_pid_to_str): Constify.
1707         * go32-nat.c (go32_pid_to_str): Constify.
1708         * i386-cygwin-tdep.c (i386_windows_core_pid_to_str): Constify.
1709         * inf-ptrace.c (inf_ptrace_pid_to_str): Constify.
1710         * inferior.c (inferior_pid_to_str): Constify.
1711         * linux-nat.c (linux_nat_pid_to_str): Constify.
1712         * linux-tdep.c (linux_core_pid_to_str): Constify.
1713         * linux-thread-db.c (thread_db_pid_to_str)
1714         (thread_db_extra_thread_info): Constify.
1715         * nto-tdep.c (nto_extra_thread_info): Constify.
1716         * nto-tdep.h (nto_extra_thread_info): Constify.
1717         * obsd-nat.c (obsd_pid_to_str): Constify.
1718         * procfs.c (procfs_pid_to_str): Constify.
1719         * ravenscar-thread.c (ravenscar_extra_thread_info)
1720         (ravenscar_pid_to_str): Constify.
1721         * remote-sim.c (gdbsim_pid_to_str): Constify.
1722         * remote.c (remote_threads_extra_info, remote_pid_to_str):
1723         Constify.
1724         * sol-thread.c (solaris_pid_to_str): Constify.
1725         * sol2-tdep.c (sol2_core_pid_to_str): Constify.
1726         * sol2-tdep.h (sol2_core_pid_to_str): Constify.
1727         * target.c (default_pid_to_str, target_pid_to_str)
1728         (normal_pid_to_str, default_pid_to_str): Constify.
1729         * target.h (target_ops::to_pid_to_str)
1730         (target_ops::to_extra_thread_info): Constify.
1731         (target_pid_to_str, normal_pid_to_str): Constify.
1732         * windows-nat.c (windows_pid_to_str): Constify.
1733         * gdbarch.sh (core_pid_to_str): Constify.
1734         * target-delegates.c: Regenerate.
1735         * gdbarch.h, gdbarch.c: Regenerate.
1736
1737 2017-04-05  Pedro Alves  <palves@redhat.com>
1738
1739         * main.c (captured_main_1): Use gdb::unique_xmalloc_ptr to manage
1740         the memory of the temporary warning_pre_print override.
1741         * utils.c (warning_pre_print): Constify.
1742         * utils.h (warning_pre_print): Constify.
1743
1744 2017-04-05  Pedro Alves  <palves@redhat.com>
1745
1746         * cli/cli-cmds.c (shell_escape): Constify 'arg' parameter.
1747         (shell_command): New function.
1748         (make_command): Use std::string.
1749         (init_cli_cmds): Register shell_command instead of shell_escape.
1750
1751 2017-04-05  Pedro Alves  <palves@redhat.com>
1752
1753         * breakpoint.c (dprintf_function, dprintf_channel): Don't initialize.
1754         * tracepoint.c (default_collect): Don't initialize.
1755
1756 2017-04-05  Pedro Alves  <palves@redhat.com>
1757
1758         * macroexp.c (macro_buffer::shared): Now a bool.
1759         (init_buffer): Update.
1760         (init_shared_buffer): Constify 'addr' parameter.
1761         (substitute_args, expand, macro_expand, macro_expand_next): Remove
1762         casts.
1763
1764 2017-04-05  Pedro Alves  <palves@redhat.com>
1765
1766         * arm-tdep.c (show_disassembly_style_sfunc): Constify local.
1767         * disasm.c (set_disassembler_options): Constify local.
1768         * i386-tdep.c (i386_print_insn): Remove cast and FIXME comment.
1769
1770 2017-04-05  Sergio Durigan Junior  <sergiodj@redhat.com>
1771
1772         PR gdb/21352
1773         * tracefile.c (tsave_command): Fix argument parsing for '-r'
1774         option.
1775
1776 2017-04-05  Yao Qi  <yao.qi@linaro.org>
1777
1778         * frame.c (frame_unwind_register_unsigned): Call
1779         frame_unwind_register_value.
1780
1781 2017-04-05  Yao Qi  <yao.qi@linaro.org>
1782
1783         * gdb.threads/thread-specific-bp.exp (check_thread_specific_breakpoint):
1784         Use gdb_test_multiple, and don't match anchor.
1785
1786 2017-04-05  Pedro Alves  <palves@redhat.com>
1787
1788         * MAINTAINERS (Global Maintainers): Add Simon Marchi.
1789         (Write After Approval): Remove Simon Marchi.
1790
1791 2017-04-05  Pedro Alves  <palves@redhat.com>
1792
1793         * common/gdb_optional.h (optional::optional): Make constexpr and
1794         initialize m_dummy.
1795
1796 2017-04-04  John Baldwin  <jhb@FreeBSD.org>
1797
1798         * amd64-fbsd-tdep.c: Remove "bsd-uthread.h" include.
1799         (amd64fbsd_jmp_buf_reg_offset): Remove.
1800         (amd64fbsd_supply_uthread): Remove function.
1801         (amd64fbsd_collect_uthread): Remove function.
1802         (amd64fbsd_init_abi): Don't set bsd-uthread callbacks.
1803         * configure.tgt (i[34567]86-*-freebsd*): Remove bsd-uthread.o.
1804         (x86_64-*-freebsd*): Remove bsd-uthread.o.
1805         (fbsd-nat.c): Update comment.
1806         * i386-fbsd-tdep.c: Remove "bsd-uthread.h" include.
1807         (i386fbsd_jmp_buf_reg_offset): Remove.
1808         (i386fbsd_supply_uthread): Remove function.
1809         (i386fbsd_collect_uthread): Remove function.
1810         (i386fbsd_init_abi): Don't set bsd-uthread callbacks.
1811
1812 2017-04-04  John Baldwin  <jhb@FreeBSD.org>
1813
1814         * Makefile.in (ALL_64_TARGET_OBS): Remove alpha-fbsd-tdep.o.
1815         (ALLDEPFILES): Remove alpha-fbsd-tdep.c
1816         * NEWS: Mention that support for FreeBSD/alpha was removed.
1817         * alpha-fbsd-tdep.c: Delete file.
1818         * config/alpha/fbsd.mh: Delete file.
1819         * configure.host: Delete alpha*-*-freebsd* and
1820         alpha*-*-kfreebsd*-gnu.
1821         * configure.tgt: Delete alpha*-*-freebsd* and
1822         alpha*-*-kfreebsd*-gnu.
1823
1824 2017-04-04  John Baldwin  <jhb@FreeBSD.org>
1825
1826         * amd64-bsd-nat.c (amd64bsd_fetch_inferior_registers,
1827         amd64bsd_store_inferior_registers): Use ptid from regcache.
1828
1829 2017-04-04  Pedro Alves  <palves@redhat.com>
1830
1831         * dwarf2read.c (lnp_state_machine): Now a class.  Initialize all
1832         data fields, make them private and add "m_" prefixes.
1833         (lnp_state_machine::lnp_state_machine): New ctor.
1834         (record_line, check_line_address, handle_set_discriminator)
1835         (handle_set_address, handle_advance_pc, handle_special_opcode)
1836         (handle_advance_line, handle_set_file, handle_negate_stmt)
1837         (handle_const_add_pc, handle_fixed_advance_pc, handle_copy)
1838         (end_sequence, advance_line): New methods.
1839         (m_gdbarch, m_record_lines_p): New fields.
1840         (lnp_reader_state): Delete.
1841         (dwarf_record_line): Rename to ...
1842         (lnp_state_machine::record_line): ... adjust.
1843         (init_lnp_state_machine): Delete.
1844         (lnp_state_machine::lnp_state_machine): New.
1845         (check_line_address): Rename to ...
1846         (lnp_state_machine::check_line_address): This.
1847         (dwarf_decode_lines_1): Remove reference to "reader_state".
1848         Adjust lnp_state_machine having a non-default ctor.  Use bool.
1849         State machine internal state manipulation moved to
1850         lnp_state_machine methods.
1851
1852 2017-04-04  Pedro Alves  <palves@redhat.com>
1853
1854         * Makefile.in (SUBDIR_UNITTESTS_SRCS): Add
1855         unittests/offset-type-selftests.c.
1856         (SUBDIR_UNITTESTS_OBS): Add offset-type-selftests.o.
1857         * common/offset-type.h: New file.
1858         * common/preprocessor.h: New file.
1859         * common/traits.h: New file.
1860         * common/valid-expr.h: New file.
1861         * dwarf2expr.c: Include "common/underlying.h".  Adjust to use
1862         sect_offset and cu_offset strong typedefs throughout.
1863         * dwarf2expr.h: Adjust to use sect_offset and cu_offset strong
1864         typedefs throughout.
1865         * dwarf2loc.c: Include "common/underlying.h".  Adjust to use
1866         sect_offset and cu_offset strong typedefs throughout.
1867         * dwarf2read.c: Adjust to use sect_offset and cu_offset strong
1868         typedefs throughout.
1869         * gdbtypes.h: Include "common/offset-type.h".
1870         (cu_offset): Now an offset type (strong typedef) instead of a
1871         struct.
1872         (sect_offset): Likewise.
1873         (union call_site_parameter_u): Rename "param_offset" field to
1874         "param_cu_off".
1875         * unittests/offset-type-selftests.c: New file.
1876
1877 2017-04-04  Pedro Alves  <palves@redhat.com>
1878
1879         * common/underlying.h: New file.
1880         * dwarf2read.c: Include "common/gdb_optional.h" and
1881         "common/underlying.h".
1882         (dir_index, file_name_index): New types.
1883         (file_entry): Use them.
1884         (file_entry::include): Use to_underlying.
1885         (line_header::add_file_name): Use dir_index.
1886         (read_formatted_entries): Use gdb::optional.  Read form before
1887         writting to file_entry.
1888         (dwarf_decode_line_header): Use dir_index.
1889         (lnp_state_machine::current_file): Use to_underlying.
1890         (lnp_state_machine::file): Change type to file_name_index.
1891         (dwarf_record_line): Use to_underlying.
1892         (init_lnp_state_machine): Use file_name_index.
1893         (dwarf_decode_lines_1): Use dir_index and file_name_index.
1894
1895 2017-04-04  Pedro Alves  <palves@redhat.com>
1896
1897         * common/gdb_optional.h (gdb::optiona): Add operator->, operator*,
1898         operator bool, has_value and get methods.
1899
1900 2017-04-04  Pedro Alves  <palves@redhat.com>
1901
1902         * dwarf2read.c (struct file_entry): Add ctors, and initialize all
1903         fields.
1904         (line_header): Initialize all data fields.  Change type of
1905         standard_opcode_lengths to std::unique_ptr<unsigned char[]>.
1906         Change type of include_dirs to std::vector<const char *>.  Remove
1907         num_include_dirs, include_dirs_size.  Change type of file_names to
1908         std::vector<file_entry>.  Remove num_file_names, file_names_size.
1909         (line_header::line_header): New.
1910         (line_header::add_include_dir, line_header::add_file_name): New
1911         methods.
1912         (line_header::include_dir_at): Remove NULL check.
1913         (line_header::file_name_at): Add const overload.
1914         (line_header_up): New unique_ptr typedef.
1915         (dw2_get_file_names_reader): Use line_header_up.  Adjust to use
1916         std::vector.  Remove free_line_header call.
1917         (dwarf2_build_include_psymtabs): Use line_header_up.  Remove
1918         free_line_header call.
1919         (free_cu_line_header): Delete.
1920         (handle_DW_AT_stmt_list, handle_DW_AT_stmt_list)
1921         (setup_type_unit_groups): Use line_header_up instead of cleanups.
1922         Adjust to use std::vector.
1923         (free_line_header): Delete.
1924         (free_line_header_voidp): Use delete.
1925         (add_include_dir): Replace with ...
1926         (line_header::add_include_dir): ... this method.  Use std::vector.
1927         (add_file_name): Replace with ...
1928         (line_header::add_file_name): ... this method.  Use std::vector.
1929         (add_include_dir_stub): Delete.
1930         (read_formatted_entries): Remove memset.
1931         (dwarf_decode_line_header): Return a line_header_up instead of a
1932         raw pointer.  Remove cleanup handling.  Pass lambdas to
1933         read_formatted_entries.  Adjust to use line_header methods.
1934         (dwarf_decode_lines_1): Adjust to use line_header methods.
1935         (dwarf_decode_lines, file_file_name, file_full_name): Adjust to
1936         use std::vector.
1937
1938 2017-04-04  Simon Marchi  <simon.marchi@polymtl.ca>
1939
1940         * remote.c (set_general_thread, set_continue_thread): Use ptid_t
1941         instead of struct ptid.
1942
1943 2017-05-04  Alan Hayward  <alan.hayward@arm.com>
1944
1945         * frame.c (get_frame_register_bytes): Unwind using value.
1946         (put_frame_register_bytes): Likewise.
1947
1948 2017-03-30  Iain Buclaw  <ibuclaw@gdcproject.org>
1949
1950         * d-exp.y (type_aggregate_p): Treat TYPE_CODE_MODULE as being
1951         aggregate-like.
1952
1953 2017-03-29  Jan Kratochvil  <jan.kratochvil@redhat.com>
1954
1955         * auto-load.c (auto_load_section_scripts): Check SEC_HAS_CONTENTS.
1956
1957 2017-03-29  Yao Qi  <yao.qi@linaro.org>
1958
1959         * gdbthread.h (struct thread_info): Declare constructor and
1960         destructor.  Add some in-class member initializers.
1961         * thread.c (free_thread): Remove.
1962         (init_thread_list): Call delete instead of free_thread.
1963         (new_thread): Call thread_info constructor.
1964         (thread_info::thread_info): New function.
1965         (thread_info::~thread_info): New function.
1966         (delete_thread_1): Call delete instead of free_thread.
1967         (make_cleanup_restore_current_thread): Move tp and frame to
1968         inner block.
1969
1970 2017-03-28  Anton Kolesov  <anton.kolesov@synopsys.com>
1971
1972         * arc-tdep.c (arc_frame_cache): Add support for prologue analysis.
1973         (arc_skip_prologue): Likewise.
1974         (arc_make_frame_cache): Likewise.
1975         (arc_pv_get_operand): New function.
1976         (arc_is_in_prologue): Likewise.
1977         (arc_analyze_prologue): Likewise.
1978         (arc_print_frame_cache): Likewise.
1979         (MAX_PROLOGUE_LENGTH): New constant.
1980
1981 2017-03-28  Anton Kolesov  <anton.kolesov@synopsys.com>
1982
1983         * configure.tgt: Add arc-insn.o.
1984         * arc-tdep.c (arc_delayed_print_insn): Make non-static.
1985         (dump_arc_instruction_command): New function.
1986         (arc_fprintf_disasm): Likewise.
1987         (arc_disassemble_info): Likewise.
1988         (arc_insn_get_operand_value): Likewise.
1989         (arc_insn_get_operand_value_signed): Likewise.
1990         (arc_insn_get_memory_base_reg): Likewise.
1991         (arc_insn_get_memory_offset): Likewise.
1992         (arc_insn_get_branch_target): Likewise.
1993         (arc_insn_dump): Likewise.
1994         (arc_insn_get_linear_next_pc): Likewise.
1995         * arc-tdep.h (arc_delayed_print_insn): Add function declaration.
1996         (arc_disassemble_info): Likewise.
1997         (arc_insn_get_branch_target): Likewise.
1998         (arc_insn_get_linear_next_pc): Likewise.
1999         * NEWS: Mention new "maint print arc arc-instruction".
2000
2001 2017-03-28  Anton Kolesov  <anton.kolesov@synopsys.com>
2002
2003         * arc-tdep (maintenance_print_arc_list): New variable.
2004         (maintenance_print_arc_command): New function.
2005
2006 2017-03-28  Anton Kolesov  <anton.kolesov@synopsys.com>
2007
2008         * arc-tdep.c (core_v2_register_names, core_arcompact_register_names)
2009         Add "limm" and "reserved".
2010         (arc_cannot_fetch_register, arc_cannot_store_register): Add
2011         ARC_RESERVED_REGNUM and ARC_LIMM_REGNUM.
2012         * arc-tdep.h (arc_regnum): Likewise.
2013
2014 2017-03-27  Max Filippov  <jcmvbkbc@gmail.com>
2015
2016         * xtensa-linux-nat.c (fill_gregset): Call regcache_raw_collect
2017         for THREADPTR register.
2018         (supply_gregset_reg): Call regcache_raw_supply for THREADPTR
2019         register.
2020         * xtensa-tdep.c (XTENSA_DBREGN_UREG): New definition.
2021         (xtensa_derive_tdep): Initialize tdep->threadptr_regnum.
2022         * xtensa-tdep.h (gdbarch_tdep::threadptr_regnum): New field.
2023
2024 2017-03-27  Max Filippov  <jcmvbkbc@gmail.com>
2025
2026         * xtensa-tdep.c (xtensa_pseudo_register_read): Treat all
2027         registers above gdbarch_num_regs (gdbarch) as privileged in
2028         call0 ABI.
2029
2030 2017-03-27  Max Filippov  <jcmvbkbc@gmail.com>
2031
2032         * xtensa-linux-nat.c (fill_gregset): Call regcache_raw_collect
2033         for a single specified register or for all registers in
2034         a0_base..a0_base + C0_NREGS range.
2035         (supply_gregset_reg): Call regcache_raw_supply for a single
2036         specified register or for all registers in a0_base..a0_base +
2037         C0_NREGS range.
2038
2039 2017-03-27  Max Filippov  <jcmvbkbc@gmail.com>
2040
2041         * arch/xtensa.h (C0_NREGS): Add definition.
2042         * xtensa-tdep.c (C0_NREGS): Remove definition.
2043
2044 2017-03-27  Max Filippov  <jcmvbkbc@gmail.com>
2045
2046         * xtensa-tdep.c (xtensa_scan_prologue, call0_analyze_prologue):
2047         Drop xtensa_default_isa initialization.
2048         (xtensa_gdbarch_init): Initialize xtensa_default_isa.
2049
2050 2017-03-27  Pedro Alves  <palves@redhat.com>
2051
2052         * dwarf2read.c (file_entry) <dir_index>: Add comment.
2053         (file_entry::include_dir): New method.
2054         (line_header::include_dir_at, line_header::file_name_at): New
2055         methods.
2056         (setup_type_unit_groups, setup_type_unit_groups)
2057         (psymtab_include_file_name): Simplify using the new methods.
2058         (lnp_state_machine) <the_line_header>: New field.
2059         <file>: Add comment.
2060         (lnp_state_machine::current_file): New method.
2061         (dwarf_record_line): Simplify using the new methods.
2062         (init_lnp_state_machine): Initialize the "the_line_header" field.
2063         (dwarf_decode_lines_1, dwarf_decode_lines, file_file_name):
2064         Simplify using the new methods.
2065
2066 2017-03-27  Pedro Alves  <palves@redhat.com>
2067
2068         * cp-name-parser.y (make_empty): Delete.
2069         (demangler_special, nested_name, ptr_operator, array_indicator)
2070         (direct_declarator, declarator_1): Use fill_comp instead of
2071         make_empty.
2072
2073 2017-03-27  Pedro Alves  <palves@redhat.com>
2074
2075         * xml-support.h (gdb_xml_debug): Pass a "first-to-check" argument
2076         to ATTRIBUTE_PRINTF.
2077         * solib-target.c (library_list_start_list): Print "string" not
2078         "version".
2079         * xml-tdesc.c (tdesc_start_field): Pass "field_name" to
2080         gdb_xml_error call.
2081
2082 2017-03-27  Pedro Alves  <palves@redhat.com>
2083
2084         * dwarf2read.c (struct file_and_directory): New.
2085         (dwarf2_get_dwz_file): Adjust to use std::string.
2086         (dw2_get_file_names_reader): Adjust to use file_and_directory.
2087         (find_file_and_directory): Adjust to return a file_and_directory
2088         object.
2089         (read_file_scope): Adjust to use file_and_directory.  Remove
2090         make_cleanup/do_cleanups calls.
2091         (open_and_init_dwp_file): Adjust to use std::string.  Remove
2092         make_cleanup/do_cleanups calls.
2093         * python/python.c (do_start_initialization): Adjust to ldirname
2094         returning a std::string.
2095         * utils.c (ldirname): Now returns a std::string.
2096         * utils.h (ldirname): Change return type to std::string.
2097         * xml-syscall.c (xml_init_syscalls_info): Adjust to ldirname
2098         returning a std::string.
2099         * xml-tdesc.c (file_read_description_xml): Likewise.
2100
2101 2017-03-24  Alan Hayward  <alan.hayward@arm.com>
2102
2103         * regcache.c (regcache_debug_print_register): New function.
2104         * regcache.h (regcache_debug_print_register): New declaration.
2105         * target.c (debug_print_register): Remove.
2106         (target_fetch_registers): Call regcache_debug_print_register.
2107         (target_store_registers): Likewise.
2108
2109 2017-03-24  Pádraig Brady  <pbrady@fb.com>
2110
2111         * dwarf2read.c (setup_type_unit_groups): Ensure dir_index doesn't
2112         reference beyond the 'lh->include_dirs' array before accessing to
2113         it.
2114         (psymtab_include_file_name): Likewise.
2115         (dwarf_decode_lines_1): Likewise.
2116         (dwarf_decode_lines): Likewise.
2117         (file_file_name): Likewise.
2118
2119 2017-03-23  Simon Marchi  <simon.marchi@ericsson.com>
2120
2121         * fbsd-tdep.c (fbsd_corefile_thread): Don't set/restore
2122         inferior_ptid.
2123         * proc-service.c (ps_lgetregs, ps_lsetregs, ps_lgetfpregs,
2124         ps_lsetfpregs): Likewise.
2125         * regcache.c (regcache_raw_update, regcache_raw_write): Likewise.
2126         * sol-thread.c (ps_lgetregs, ps_lsetregs, ps_lgetfpregs,
2127         ps_lsetfpregs): Likewise.
2128         * target.c (target_fetch_registers, target_store_registers):
2129         Remove asserts.
2130
2131 2017-03-23  Alan Hayward  <alan.hayward@arm.com>
2132
2133         * sol-thread.c (sol_thread_store_registers): Remove regcache calls.
2134
2135 2017-03-23  Yao Qi  <yao.qi@linaro.org>
2136
2137         * aarch64-tdep.c (aarch64_process_record_test): Declare.
2138         (_initialize_aarch64_tdep): Register it.
2139         (aarch64_record_load_store): Handle PRFM instruction.
2140         (aarch64_process_record_test): New function.
2141
2142 2017-03-23  Yao Qi  <yao.qi@linaro.org>
2143
2144         * aarch64-tdep.c (aarch64_record_load_store): Fix code
2145         indentation.
2146
2147 2017-03-23  Yao Qi  <yao.qi@linaro.org>
2148
2149         * aarch64-tdep.c: Remove AARCH64_RECORD_FAILURE.
2150
2151 2017-03-23  Philipp Rudo  <prudo@linux.vnet.ibm.com>
2152
2153         python/python.c (do_start_initialization): Fix memory leak.
2154
2155 2017-03-22  Simon Marchi  <simon.marchi@polymtl.ca>
2156
2157         * inf-ptrace.c (inf_ptrace_xfer_partial): Get pid from ptid
2158         using get_ptrace_pid.
2159         * linux-nat.c (linux_nat_xfer_partial): Don't set/restore
2160         inferior_ptid.
2161         (linux_proc_xfer_partial, linux_proc_xfer_spu): Use lwp of
2162         inferior_ptid instead of pid.
2163
2164 2017-03-22  Yao Qi  <yao.qi@linaro.org>
2165
2166         * aarch64-tdep.c: Wrap locally used classes in anonymous
2167         namespace.
2168         * arm-tdep.c: Likewise.
2169         * linespec.c: Likewise.
2170         * ui-out.c: Likewise.
2171
2172 2017-03-22  Jonah Graham  <jonah@kichwacoders.com>
2173
2174         PR gdb/19637
2175         * python/lib/gdb/printer/bound_registers.py: Import sys.
2176
2177 2017-03-21  Simon Marchi  <simon.marchi@ericsson.com>
2178
2179         * windows-nat.c (do_windows_fetch_inferior_registers): Add
2180         windows_thread_info parameter and use it instead of
2181         current_thread.
2182         (windows_fetch_inferior_registers): Don't set current_thread,
2183         pass the thread to do_windows_fetch_inferior_registers.  Use
2184         ptid from regcache instead of inferior_ptid.
2185         (do_windows_store_inferior_registers): Add windows_thread_info
2186         parameter and use it instead of current_thread.
2187         (windows_store_inferior_registers): Don't set current_thread,
2188         pass the thread to do_windows_store_inferior_registers.  Use
2189         ptid from regcache instead of inferior_ptid.
2190
2191 2017-03-21  Simon Marchi  <simon.marchi@ericsson.com>
2192
2193         * ser-mingw.c (ser_windows_raw): Remove reference to
2194         struct serial::current_timeout.
2195
2196 2017-03-21  Ivo Raisr  <ivo.raisr@oracle.com>
2197
2198         PR tdep/20928
2199         * gdb/sparc-tdep.h (gdbarch_tdep) <sparc64_ccr_type>: New field.
2200         * gdb/sparc64-tdep.c (sparc64_ccr_type): New function.
2201         (sparc64_fsr_type): Fix %fsr decoding.
2202
2203 2017-03-21  Tim Wiederhake  <tim.wiederhake@intel.com>
2204
2205         * python/py-record-btrace.c (btpy_insn_data): Change return type
2206         for Python 2.
2207
2208 2017-03-20  Simon Marchi  <simon.marchi@polymtl.ca>
2209
2210         * spu-linux-nat.c (spu_fetch_inferior_registers,
2211         spu_store_inferior_registers): Use ptid from regcache, set and
2212         restore inferior_ptid.
2213         * spu-multiarch.c (spu_fetch_registers, spu_store_registers):
2214         Likewise.
2215
2216 2017-03-20  Simon Marchi  <simon.marchi@polymtl.ca>
2217
2218         * i386-linux-nat.c (fetch_register, store_register,
2219         i386_linux_fetch_inferior_registers,
2220         i386_linux_store_inferior_registers): Use ptid from regcache.
2221         * ia64-linux-nat.c (ia64_linux_fetch_register,
2222         ia64_linux_store_register): Likewise.
2223         * inf-ptrace.c (inf_ptrace_fetch_register,
2224         inf_ptrace_store_register): Likewise.
2225         * m32r-linux-nat.c (m32r_linux_fetch_inferior_registers,
2226         m32r_linux_store_inferior_registers): Likewise.
2227         * m68k-bsd-nat.c (m68kbsd_fetch_inferior_registers,
2228         m68kbsd_store_inferior_registers): Likewise.
2229         * m68k-linux-nat.c (fetch_register, store_register,
2230         m68k_linux_fetch_inferior_registers,
2231         m68k_linux_store_inferior_registers): Likewise.
2232         * m88k-bsd-nat.c (m88kbsd_fetch_inferior_registers,
2233         m88kbsd_store_inferior_registers): Likewise.
2234         * mips-fbsd-nat.c (mips_fbsd_fetch_inferior_registers,
2235         mips_fbsd_store_inferior_registers): Likewise.
2236         * mips-linux-nat.c (mips64_linux_regsets_fetch_registers,
2237         mips64_linux_regsets_store_registers): Likewise.
2238         * mips-nbsd-nat.c (mipsnbsd_fetch_inferior_registers,
2239         mipsnbsd_store_inferior_registers): Likewise.
2240         * mips-obsd-nat.c (mips64obsd_fetch_inferior_registers,
2241         mips64obsd_store_inferior_registers): Likewise.
2242         * nto-procfs.c (procfs_fetch_registers, procfs_store_registers):
2243         Likewise.
2244         * ppc-fbsd-nat.c (ppcfbsd_fetch_inferior_registers,
2245         ppcfbsd_store_inferior_registers): Likewise.
2246         * ppc-linux-nat.c (ppc_linux_fetch_inferior_registers,
2247         ppc_linux_store_inferior_registers): Likewise.
2248         * ppc-nbsd-nat.c (ppcnbsd_fetch_inferior_registers,
2249         ppcnbsd_store_inferior_registers): Likewise.
2250         * ppc-obsd-nat.c (ppcobsd_fetch_registers,
2251         ppcobsd_store_registers): Likewise.
2252         * procfs.c (procfs_fetch_registers, procfs_store_registers):
2253         Likewise.
2254         * ravenscar-thread.c (ravenscar_fetch_registers,
2255         ravenscar_store_registers, ravenscar_prepare_to_store):
2256         Likewise.
2257         * record-btrace.c (record_btrace_fetch_registers,
2258         record_btrace_store_registers, record_btrace_prepare_to_store):
2259         Likewise.
2260         * remote-sim.c (gdbsim_fetch_register, gdbsim_store_register):
2261         Lookup inferior using ptid from regcache, instead of
2262         current_inferior.
2263         * remote.c (remote_fetch_registers, remote_store_registers): Use
2264         ptid from regcache.
2265         * rs6000-nat.c (fetch_register, store_register): Likewise.
2266         * s390-linux-nat.c (s390_linux_fetch_inferior_registers,
2267         s390_linux_store_inferior_registers): Likewise.
2268         * sh-nbsd-nat.c (shnbsd_fetch_inferior_registers,
2269         shnbsd_store_inferior_registers): Likewise.
2270         * sol-thread.c (sol_thread_fetch_registers,
2271         sol_thread_store_registers): Likewise.
2272         * sparc-nat.c (sparc_fetch_inferior_registers,
2273         sparc_store_inferior_registers): Likewise.
2274         * tilegx-linux-nat.c (fetch_inferior_registers,
2275         store_inferior_registers): Likewise.
2276         * vax-bsd-nat.c (vaxbsd_fetch_inferior_registers,
2277         vaxbsd_store_inferior_registers): Likewise.
2278         * xtensa-linux-nat.c (fetch_gregs, store_gregs, fetch_xtregs,
2279         store_xtregs): Likewise.
2280
2281 2017-03-20  Artemiy Volkov  <artemiyv@acm.org>
2282
2283         PR gdb/14441
2284         * NEWS: Mention support for rvalue references in GDB and python.
2285         * doc/gdb.texinfo (C Plus Plus Expressions): Mention that GDB
2286         supports both lvalue and rvalue references.
2287
2288 2017-03-20  Artemiy Volkov  <artemiyv@acm.org>
2289
2290         PR gdb/14441
2291         * gdbtypes.c (rank_one_type): Implement overloading
2292         resolution rules regarding rvalue references.
2293
2294 2017-03-20  Artemiy Volkov  <artemiyv@acm.org>
2295
2296         PR gdb/14441
2297         * aarch64-tdep.c (aarch64_type_align)
2298         (aarch64_extract_return_value, aarch64_store_return_value): Change
2299         lvalue reference type checks to general reference type checks.
2300         * amd64-tdep.c (amd64_classify): Likewise.
2301         * amd64-windows-tdep.c (amd64_windows_passed_by_integer_register):
2302         Likewise.
2303         * arm-tdep.c (arm_type_align, arm_extract_return_value)
2304         (arm_store_return_value): Likewise.
2305         * ax-gdb.c (gen_fetch, gen_cast): Likewise.
2306         * c-typeprint.c (c_print_type): Likewise.
2307         * c-varobj.c (adjust_value_for_child_access, c_value_of_variable)
2308         (cplus_number_of_children, cplus_describe_child): Likewise.
2309         * compile/compile-c-symbols.c (generate_vla_size): Likewise.
2310         * completer.c (expression_completer): Likewise.
2311         * cp-support.c (make_symbol_overload_list_adl_namespace):
2312         Likewise.
2313         * darwin-nat-info.c (info_mach_region_command): Likewise.
2314         * dwarf2loc.c (entry_data_value_coerce_ref)
2315         (value_of_dwarf_reg_entry): Likewise.
2316         * eval.c (ptrmath_type_p, evaluate_subexp_standard)
2317         (evaluate_subexp_for_address, evaluate_subexp_for_sizeof):
2318         Likewise.
2319         * findvar.c (extract_typed_address, store_typed_address):
2320         Likewise.
2321         * gdbtypes.c (rank_one_type): Likewise.
2322         * hppa-tdep.c (hppa64_integral_or_pointer_p): Likewise.
2323         * infcall.c (value_arg_coerce): Likewise.
2324         * language.c (pointer_type): Likewise.
2325         * m32c-tdep.c (m32c_reg_arg_type, m32c_m16c_address_to_pointer):
2326         Likewise.
2327         * m88k-tdep.c (m88k_integral_or_pointer_p): Likewise.
2328         * mn10300-tdep.c (mn10300_type_align): Likewise.
2329         * msp430-tdep.c (msp430_push_dummy_call): Likewise.
2330         * ppc-sysv-tdep.c (do_ppc_sysv_return_value)
2331         (ppc64_sysv_abi_push_param, ppc64_sysv_abi_return_value):
2332         Likewise.
2333         * printcmd.c (print_formatted, x_command): Likewise.
2334         * python/py-type.c (typy_get_composite, typy_template_argument):
2335         Likewise.
2336         * python/py-value.c (valpy_referenced_value)
2337         (valpy_get_dynamic_type, value_has_field): Likewise.
2338         * s390-linux-tdep.c (s390_function_arg_integer): Likewise.
2339         * sparc-tdep.c (sparc_integral_or_pointer_p): Likewise.
2340         * sparc64-tdep.c (sparc64_integral_or_pointer_p): Likewise.
2341         * spu-tdep.c (spu_scalar_value_p): Likewise.
2342         * symtab.c (lookup_symbol_aux): Likewise.
2343         * typeprint.c (whatis_exp, print_type_scalar): Likewise.
2344         * valarith.c (binop_types_user_defined_p, unop_user_defined_p):
2345         Likewise.
2346         * valops.c (value_cast_pointers, value_cast)
2347         (value_reinterpret_cast, value_dynamic_cast, value_addr, typecmp)
2348         (value_struct_elt, value_struct_elt_bitpos)
2349         (value_find_oload_method_list, find_overload_match)
2350         (value_rtti_indirect_type): Likewise.
2351         * valprint.c (val_print_scalar_type_p, generic_val_print):
2352         Likewise.
2353         * value.c (value_actual_type, value_as_address, unpack_long)
2354         (pack_long, pack_unsigned_long, coerce_ref_if_computed)
2355         (coerce_ref): Likewise.
2356         * varobj.c (varobj_get_value_type): Likewise.
2357
2358 2017-03-20  Artemiy Volkov  <artemiyv@acm.org>
2359
2360         PR gdb/14441
2361         * doc/python.texi (Types in Python): Add TYPE_CODE_RVALUE_REF to
2362         table of constants.
2363         * python/lib/gdb/command/explore.py: Support exploring values
2364         of rvalue reference types.
2365         * python/lib/gdb/types.py: Implement get_basic_type() for
2366         rvalue reference types.
2367         * python/py-type.c (pyty_codes) <TYPE_CODE_RVALUE_REF>: New
2368         constant.
2369         * python/py-value.c (valpy_getitem): Add an rvalue reference
2370         check.
2371         (valpy_reference_value): Add new parameter "refcode".
2372         (valpy_lvalue_reference_value, valpy_rvalue_reference_value):
2373         New wrappers for valpy_reference_value().
2374         * python/py-xmethods.c (gdbpy_get_xmethod_result_type)
2375         (gdbpy_invoke_xmethod): Likewise.
2376
2377 2017-03-20  Artemiy Volkov  <artemiyv@acm.org>
2378
2379         PR gdb/14441
2380         * dwarf2read.c (process_die, read_type_die_1): Handle the
2381         DW_TAG_rvalue_reference_type DIE.
2382         (read_tag_reference_type): Add new parameter "refcode".
2383
2384 2017-03-20  Artemiy Volkov  <artemiyv@acm.org>
2385
2386         PR gdb/14441
2387         * c-typeprint.c (c_print_type, c_type_print_varspec_prefix)
2388         (c_type_print_modifier, c_type_print_varspec_suffix)
2389         (c_type_print_base): Support printing rvalue reference types.
2390         * c-valprint.c (c_val_print, c_value_print): Support printing
2391         rvalue reference values.
2392
2393 2017-03-20  Artemiy Volkov  <artemiyv@acm.org>
2394
2395         PR gdb/14441
2396         * cp-name-parser.y (ptr_operator): Handle the '&&' token in
2397         typename.
2398         * cp-support.c (replace_typedefs): Handle
2399         DEMANGLE_COMPONENT_RVALUE_REFERENCE.
2400         * python/py-type.c (typy_lookup_type): Likewise.
2401
2402 2017-03-20  Artemiy Volkov  <artemiyv@acm.org>
2403
2404         PR gdb/14441
2405         * c-exp.y (ptr_operator): Handle the '&&' token in the typename.
2406         * parse.c (insert_type): Change assert statement.
2407         (follow_types): Handle rvalue reference types.
2408         * parser-defs.h (enum type_pieces) <tp_rvalue_reference>: New
2409         constant.
2410
2411 2017-03-20  Artemiy Volkov  <artemiyv@acm.org>
2412
2413         PR gdb/14441
2414         * ada-lang.c (ada_evaluate_subexp): Adhere to the new
2415         value_ref() interface.
2416         * c-valprint.c (c_value_print): Likewise.
2417         * infcall.c (value_arg_coerce): Likewise.
2418         * python/py-value.c (valpy_reference_value): Likewise.
2419         * valops.c (value_cast, value_reinterpret_cast)
2420         (value_dynamic_cast, typecmp): Likewise.
2421         (value_ref): Parameterize by kind of return value reference type.
2422         * value.h (value_ref): Add new parameter "refcode".
2423
2424 2017-03-20  Artemiy Volkov  <artemiyv@acm.org>
2425
2426         PR gdb/14441
2427         * dwarf2read.c (read_tag_reference_type): Use
2428         lookup_lvalue_reference_type() instead of lookup_reference_type().
2429         * eval.c (evaluate_subexp_standard): Likewise.
2430         * f-exp.y: Likewise.
2431         * gdbtypes.c (make_reference_type, lookup_reference_type):
2432         Generalize with rvalue reference types.
2433         (lookup_lvalue_reference_type, lookup_rvalue_reference_type): New
2434         convenience wrappers for lookup_reference_type().
2435         * gdbtypes.h (make_reference_type, lookup_reference_type): Add a
2436         reference kind parameter.
2437         (lookup_lvalue_reference_type, lookup_rvalue_reference_type): Add
2438         wrappers for lookup_reference_type().
2439         * guile/scm-type.c (gdbscm_type_reference): Use
2440         lookup_lvalue_reference_type() instead of lookup_reference_type().
2441         * guile/scm-value.c (gdbscm_value_dynamic_type): Likewise.
2442         * parse.c (follow_types): Likewise.
2443         * python/py-type.c (typy_reference, typy_lookup_type): Likewise.
2444         * python/py-value.c (valpy_get_dynamic_type, valpy_getitem):
2445         Likewise.
2446         * python/py-xmethods.c (gdbpy_get_xmethod_result_type)
2447         (gdbpy_invoke_xmethod): Likewise.
2448         * stabsread.c: Provide extra argument to make_reference_type()
2449         call.
2450         * valops.c (value_ref, value_rtti_indirect_type): Use
2451         lookup_lvalue_reference_type() instead of lookup_reference_type().
2452
2453 2017-03-20  Artemiy Volkov  <artemiyv@acm.org>
2454
2455         PR gdb/14441
2456         * gdbtypes.h (enum type_code) <TYPE_CODE_RVALUE_REF>: New constant.
2457         (TYPE_IS_REFERENCE): New macro.
2458         (struct type): Add rvalue_reference_type field.
2459         (TYPE_RVALUE_REFERENCE_TYPE): New macro.
2460
2461 2017-03-20  Marc-Andre Laperle  <marc-andre.laperle@ericsson.com>
2462
2463         * NEWS: Add an entry about new '-file-list-shared-libraries' command.
2464         * mi/mi-cmd-file.c (mi_cmd_file_list_shared_libraries):
2465         New function definition.
2466         * mi/mi-cmds.c (mi_cmds): Add -file-list-shared-libraries command.
2467         * mi/mi-cmds.h (mi_cmd_file_list_shared_libraries):
2468         New function declaration.
2469         * mi/mi-interp.c (mi_output_solib_attribs): New Function.
2470         * mi/mi-interp.h: New file.
2471         * solib.c (info_sharedlibrary_command): Replace for loop with
2472         ALL_SO_LIBS macro
2473         * solib.h (update_solib_list): New function declaration.
2474         (so_list_head): Move macro.
2475         * solist.h (ALL_SO_LIBS): New macro.
2476
2477 2017-03-20  Marc-Andre Laperle  <marc-andre.laperle@ericsson.com>
2478
2479         * infcmd.c (post_create_inferior): Remove unused argument in
2480         call to solib_add.
2481         * remote.c (remote_start_remote): Likewise.
2482         * solib-frv.c (frv_fetch_objfile_link_map): Likewise.
2483         * solib-svr4.c: (svr4_fetch_objfile_link_map): Likewise.
2484         (enable_break): Likewise.
2485         * solib.c (update_solib_list): Remove unused target argument
2486         and its documentation.
2487         (solib_add): Remove unused target argument.  Remove unused
2488         argument in call to update_solib_list.
2489         (info_sharedlibrary_command): Remove unused argument in call
2490         to update_solib_list.
2491         (sharedlibrary_command): Remove unused argument in call to
2492         solib_add.
2493         (handle_solib_event): Likewise.
2494         (reload_shared_libraries): Likewise.
2495         * solib.h (solib_add): Remove unused target argument.
2496
2497 2017-03-20  Andreas Arnez  <arnez@linux.vnet.ibm.com>
2498
2499         * s390-linux-tdep.c (is_rsi, is_rie): Remove functions.
2500         (s390_displaced_step_fixup): Cover relative branches with the
2501         default fixup handling.  This fixes lack of support for some
2502         relative branch instructions.
2503
2504 2017-03-17  Simon Marchi  <simon.marchi@polymtl.ca>
2505
2506         * i386-gnu-nat.c (gnu_fetch_registers, gnu_store_registers): Use
2507         ptid from regcache.
2508
2509 2017-03-17  Simon Marchi  <simon.marchi@polymtl.ca>
2510
2511         * i386-darwin-nat.c (i386_darwin_fetch_inferior_registers,
2512         i386_darwin_store_inferior_registers): Use ptid from regcache.
2513
2514 2017-03-17  Simon Marchi  <simon.marchi@polymtl.ca>
2515
2516         * i386-bsd-nat.c (i386bsd_fetch_inferior_registers,
2517         i386bsd_store_inferior_registers): Use ptid from regcache.
2518
2519 2017-03-17  Simon Marchi  <simon.marchi@polymtl.ca>
2520
2521         * hppa-obsd-nat.c (hppaobsd_fetch_registers,
2522         hppaobsd_store_registers): Use ptid from regcache.
2523
2524 2017-03-17  Simon Marchi  <simon.marchi@polymtl.ca>
2525
2526         * hppa-nbsd-nat.c (hppanbsd_fetch_registers,
2527         hppanbsd_store_registers): Use ptid from regcache.
2528
2529 2017-03-17  Simon Marchi  <simon.marchi@polymtl.ca>
2530
2531         * hppa-linux-nat.c (fetch_register, store_register): Use ptid
2532         from regcache.  Use get_ptrace_pid.
2533
2534 2017-03-17  Simon Marchi  <simon.marchi@polymtl.ca>
2535
2536         * corelow.c (get_core_register_section): Use ptid from regcache,
2537         update doc.
2538
2539 2017-03-17  Simon Marchi  <simon.marchi@polymtl.ca>
2540
2541         * bsd-uthread.c (bsd_uthread_fetch_registers,
2542         bsd_uthread_store_registers): Use ptid from regcache, set and
2543         restore inferior_ptid.
2544
2545 2017-03-17  Simon Marchi  <simon.marchi@polymtl.ca>
2546
2547         * arm-nbsd-nat.c (fetch_register, fetch_regs, fetch_fp_register,
2548         fetch_fp_regs, store_register, store_regs, store_fp_register,
2549         store_fp_regs): Use ptid from regcache.
2550
2551 2017-03-17  Simon Marchi  <simon.marchi@polymtl.ca>
2552
2553         * arm-linux-nat.c (fetch_fpregs, store_fpregs, fetch_regs,
2554         store_regs, fetch_wmmx_regs, store_wmmx_regs, fetch_vfp_regs,
2555         store_vfp_regs): Use ptid from regcache.
2556
2557 2017-03-17  Pedro Alves  <palves@redhat.com>
2558
2559         PR remote/21188
2560         * ser-base.c (ser_base_wait_for): Add comment.
2561         (do_ser_base_readchar): Improve comment based on the ser-unix.c's
2562         version.
2563         * ser-unix.c (hardwire_raw): Remove reference to
2564         scb->current_timeout.
2565         (wait_for, do_hardwire_readchar, hardwire_readchar): Delete.
2566         (hardwire_ops): Install ser_base_readchar instead of
2567         hardwire_readchar.
2568         * serial.h (struct serial) <current_timeout, timeout_remaining>:
2569         Remove fields.
2570
2571 2017-03-17  Jonah Graham  <jonah@kichwacoders.com>
2572
2573         PR gdb/19637
2574         * python/lib/gdb/printer/bound_registers.py: Add support for
2575         Python 3.
2576
2577 2017-03-16  Andreas Arnez  <arnez@linux.vnet.ibm.com>
2578
2579         * dwarf2loc.c (indirect_synthetic_pointer): Get data type of
2580         pointed-to DIE and pass it to dwarf2_evaluate_loc_desc_full.
2581         (dwarf2_evaluate_loc_desc_full): New parameter subobj_type; rename
2582         byte_offset to subobj_byte_offset.  Fix the handling of
2583         DWARF_VALUE_STACK on big-endian targets when coming via an
2584         implicit pointer.
2585         (dwarf2_evaluate_loc_desc): Adjust call to
2586         dwarf2_evaluate_loc_desc_full.
2587         * dwarf2loc.h (dwarf2_fetch_die_type_sect_off): New declaration.
2588         * dwarf2read.c (dwarf2_fetch_die_type_sect_off): New function.
2589
2590 2017-03-16  Yao Qi  <yao.qi@linaro.org>
2591
2592         * arm-tdep.c (thumb_record_misc): Decode CBNZ, CBZ, REV16,
2593         and REVSH instructions.
2594
2595 2017-03-16  Yao Qi  <yao.qi@linaro.org>
2596
2597         * arm-tdep.c [GDB_SELF_TEST]: include "selftests.h".
2598         (arm_record_test): Declare.
2599         (_initialize_arm_tdep) [GDB_SELF_TEST]: call register_self_test.
2600         (thumb_record_ld_st_reg_offset): Rewrite the opcode matching to
2601         align with the manual.
2602         (thumb_record_misc): Adjust the code order to align with the
2603         manual.
2604         (thumb2_record_decode_insn_handler): Fix instruction matching.
2605         (instruction_reader_thumb): New class.
2606         (arm_record_test): New function.
2607
2608 2017-03-16  Yao Qi  <yao.qi@linaro.org>
2609
2610         * arm-tdep.c (abstract_memory_reader): New class.
2611         (instruction_reader): New class.
2612         (extract_arm_insn): Add argument 'reader'.  Callers updated.
2613         (decode_insn): Likewise.
2614
2615 2017-03-16  Doug Evans  <dje@google.com>
2616
2617         * guile/scm-lazy-string.c (lazy_string_smob): Clarify use of LENGTH
2618         member.  Change type of TYPE member to SCM.  All uses updated.
2619         (lsscm_make_lazy_string_smob): Add assert.
2620         (lsscm_make_lazy_string): Flag bad length values.
2621         (lsscm_elt_type): New function.
2622         (gdbscm_lazy_string_to_value): Rewrite to use
2623         lsscm_safe_lazy_string_to_value.
2624         (lsscm_safe_lazy_string_to_value): Fix handling of TYPE_CODE_PTR.
2625         * guile/scm-value.c (gdbscm_value_to_lazy_string): Flag bad length
2626         values.  Fix TYPE_CODE_PTR.  Handle TYPE_CODE_ARRAY.  Handle typedefs
2627         in incoming type.
2628         * guile/guile-internal.h (tyscm_scm_to_type): Declare.
2629         * guile/scm-type.c (tyscm_scm_to_type): New function.
2630
2631 2017-03-15  Doug Evans  <dje@google.com>
2632
2633         PR python/17728, python/18439, python/18779
2634         * python/py-lazy-string.c (lazy_string_object): Clarify use of LENGTH
2635         member.  Change type of TYPE member to PyObject *.  All uses updated.
2636         (stpy_convert_to_value): Fix handling of TYPE_CODE_PTR.
2637         (gdbpy_create_lazy_string_object): Flag bad length values.
2638         Handle TYPE_CODE_ARRAY with possibly different user-provided length.
2639         Handle typedefs in incoming type.
2640         (stpy_lazy_string_elt_type): New function.
2641         (gdbpy_extract_lazy_string): Call it.
2642         * python/py-value.c (valpy_lazy_string): Flag bad length values.
2643         Fix handling of TYPE_CODE_PTR.  Handle TYPE_CODE_ARRAY.  Handle
2644         typedefs in incoming type.
2645
2646 2017-03-16  Doug Evans  <dje@google.com>
2647
2648         * guile/guile-internal.h (tyscm_scm_to_type): Declare.
2649         * guile/scm-type.c (tyscm_scm_to_type): New function.
2650
2651 2017-03-16  Jiong Wang  <jiong.wang@arm.com>
2652
2653         * inf-ptrace.c (inf_ptrace_peek_poke): Change the type to
2654         "ULONGEST" for "skip".
2655
2656 2017-03-14  Andreas Arnez  <arnez@linux.vnet.ibm.com>
2657
2658         PR gdb/21220
2659         * inf-ptrace.c (inf_ptrace_xfer_partial): In "case
2660         TARGET_OBJECT_MEMORY", extract the logic for ptrace peek/poke...
2661         (inf_ptrace_peek_poke): ...here.  New function.  Now also loop
2662         over ptrace peek/poke until end of buffer or error.
2663
2664 2017-03-14  Simon Marchi  <simon.marchi@ericsson.com>
2665
2666         * parse.c (length_of_subexp): Make static.
2667         * parser-defs.h (length_of_subexp): Remove.
2668
2669 2017-03-14  Andreas Arnez  <arnez@linux.vnet.ibm.com>
2670
2671         * linux-nat.c (linux_proc_xfer_partial): Handle write operations
2672         as well.
2673
2674 2017-03-14  Pedro Alves  <palves@redhat.com>
2675
2676         * cp-name-parser.y (cp_demangled_name_to_comp): Update comment.
2677         (main): Use std::unique_ptr.  Remove calls to
2678         cp_demangled_name_parse_free.
2679
2680 2017-03-13  Simon Marchi  <simon.marchi@polymtl.ca>
2681
2682         * alpha-bsd-nat.c (alphabsd_fetch_inferior_registers,
2683         alphabsd_store_inferior_registers): Use regcache->ptid instead
2684         of inferior_ptid.
2685
2686 2017-03-13  Simon Marchi  <simon.marchi@polymtl.ca>
2687
2688         * aix-thread.c (aix_thread_fetch_registers,
2689         aix_thread_store_registers): Use regcache->ptid instead of
2690         inferior_ptid.
2691
2692 2017-03-13  Simon Marchi  <simon.marchi@polymtl.ca>
2693
2694         * aarch64-linux-nat.c (fetch_gregs_from_thread,
2695         store_gregs_to_thread, fetch_fpregs_from_thread,
2696         store_fpregs_to_thread): Use regcache->ptid instead of
2697         inferior_ptid.
2698
2699 2017-03-13  Simon Marchi  <simon.marchi@polymtl.ca>
2700
2701         * amd64-linux-nat.c (amd64_linux_fetch_inferior_registers,
2702         amd64_linux_fetch_inferior_registers): Use regcache->ptid
2703         instead of inferior_ptid.
2704
2705 2017-03-13  Simon Marchi  <simon.marchi@polymtl.ca>
2706
2707         * target.c (target_fetch_registers, target_store_registers): Add
2708         assert.
2709
2710 2017-03-13  Simon Marchi  <simon.marchi@polymtl.ca>
2711
2712         * regcache.h (regcache_get_ptid): New function.
2713         * regcache.c (regcache_get_ptid): New function.
2714
2715 2017-03-13  Mark Wielaard  <mark@klomp.org>
2716
2717         * cp-name-parser.y (make_empty): Initialize d_printing to zero.
2718
2719 2017-03-10  Keith Seitz  <keiths@redhat.com>
2720
2721         PR c++/8218
2722         * c-typeprint.c (cp_type_print_method_args): Skip artificial arguments.
2723
2724 2017-03-08  Pedro Alves  <palves@redhat.com>
2725
2726         PR gdb/18360
2727         * infrun.c (start_step_over, do_target_resume, resume)
2728         (restart_threads): Assert we're not resuming a thread that is
2729         meant to be stopped.
2730         (infrun_thread_stop_requested_callback): Delete.
2731         (infrun_thread_stop_requested): If the thread is internally
2732         stopped, queue a pending stop event and clear the thread's
2733         inline-frame state.
2734         (handle_stop_requested): New function.
2735         (handle_syscall_event, handle_inferior_event_1): Use
2736         handle_stop_requested.
2737         (handle_stop_requested): New function.
2738         (handle_signal_stop): Set the thread's stop_signal here instead of
2739         at caller.
2740         (finish_step_over): Clear step over info unconditionally.
2741         (handle_signal_stop): If the user had interrupted the event
2742         thread, consider the stop a random signal.
2743         (handle_signal_stop) <signal arrived while stepping over
2744         breakpoint>: Don't restart threads here.
2745         (stop_waiting): Don't clear step-over info here.
2746
2747 2017-03-08  Pedro Alves  <palves@redhat.com>
2748
2749         PR 21206
2750         * common/gdb_unlinker.h (unlinker::unlinker): Attribute nonnull
2751         goes to argument 2, not 1.
2752
2753 2017-03-08  Pedro Alves  <palves@redhat.com>
2754
2755         PR cli/21218
2756         * top.c (gdb_readline_wrapper): Avoid passing NULL to
2757         display_gdb_prompt.
2758         (command_line_input): Add comment.
2759
2760 2017-03-08  Pedro Alves  <palves@redhat.com>
2761
2762         PR tui/21216
2763         * tui/tui-file.c (tui_file::write): New.
2764         * tui/tui-file.h (tui_file): Override "write".
2765         * tui/tui-io.c (do_tui_putc, update_start_line): New functions,
2766         factored out from ...
2767         (tui_puts): ... here.
2768         (tui_putc): Use them.
2769         (tui_write): New function.
2770         * tui/tui-io.h (tui_write): Declare.
2771
2772 2017-03-07  Sergio Durigan Junior  <sergiodj@redhat.com>
2773
2774         * Makefile.in (SFILES): Replace "environ.c" with
2775         "common/environ.c".
2776         (HFILES_NO_SRCDIR): Likewise, for "environ.h".
2777         * environ.c: Include "common-defs.h" instead of "defs.h.  Moved
2778         to...
2779         * common/environ.c: ... here.
2780         * environ.h: Moved to...
2781         * common/environ.h: ... here.
2782
2783 2017-03-07  Peter Bergner  <bergner@vnet.ibm.com>
2784
2785         * gdbarch.sh (pstring_ptr): New static function.
2786         (gdbarch_disassembler_options): Use it.
2787         (gdbarch_verify_disassembler_options): Print valid_disassembler_options,
2788         not valid_disassembler_option->name.
2789         * gdbarch.c: Regenerate.
2790
2791 2017-03-07  Peter Bergner  <bergner@vnet.ibm.com>
2792
2793         * config/powerpc/ppc64-linux.mh (MH_CFLAGS): Delete.
2794
2795 2017-03-07  Pedro Alves  <palves@redhat.com>
2796
2797         * tui/tui-regs.c (tui_restore_gdbout): Don't delete gdb_stdout.
2798
2799 2017-03-07  Walfred Tedeschi  <walfred.tedeschi@intel.com>
2800
2801         * i387-tdep.h (i387_reset_bnd_regs): Add function definition.
2802         * i387-tdep.c (i387_reset_bnd_regs): Add function implementation.
2803         * i386-tdep.c (i386_push_dummy_call): Call i387_reset_bnd_regs.
2804         * amd64-tdep.c (amd64_push_dummy_call): Call i387_reset_bnd_regs.
2805
2806 2017-03-06  Simon Marchi  <simon.marchi@ericsson.com>
2807
2808         * xtensa-linux-nat.c (fetch_gregs): Remove const.
2809
2810 2017-03-03  Simon Marchi  <simon.marchi@ericsson.com>
2811
2812         * remote.c (remote_add_target_side_commands): Use range-based
2813         for loop.
2814
2815 2017-03-03  Yao Qi  <yao.qi@linaro.org>
2816
2817         PR gdb/21165
2818         * ada-valprint.c (ada_val_print_ref): Call value_fetch_lazy if
2819         value is lazy.
2820         * valprint.c (common_val_print): Likewise.
2821
2822 2017-02-28  Peter Bergner  <bergner@vnet.ibm.com>
2823
2824         * NEWS: Mention new set/show disassembler-options commands.
2825         * doc/gdb.texinfo: Document new set/show disassembler-options commands.
2826         * disasm.c: Include "arch-utils.h", "gdbcmd.h" and "safe-ctype.h".
2827         (prospective_options): New static variable.
2828         (gdb_disassembler::gdb_disassembler): Initialize
2829         m_di.disassembler_options.
2830         (gdb_buffered_insn_length_init_dis): Initilize di->disassembler_options.
2831         (get_disassembler_options): New function.
2832         (set_disassembler_options): Likewise.
2833         (set_disassembler_options_sfunc): Likewise.
2834         (show_disassembler_options_sfunc): Likewise.
2835         (disassembler_options_completer): Likewise.
2836         (_initialize_disasm): Likewise.
2837         * disasm.h (get_disassembler_options): New prototype.
2838         (set_disassembler_options): Likewise.
2839         * gdbarch.sh (gdbarch_disassembler_options): New variable.
2840         (gdbarch_verify_disassembler_options): Likewise.
2841         * gdbarch.c: Regenerate.
2842         * gdbarch.h: Likewise.
2843         * arm-tdep.c (num_disassembly_options): Delete.
2844         (set_disassembly_style): Likewise.
2845         (arm_disassembler_options): New static variable.
2846         (set_disassembly_style_sfunc): Convert short style name into long
2847         option name.  Call set_disassembler_options.
2848         (show_disassembly_style_sfunc): New function.
2849         (arm_gdbarch_init): Call set_gdbarch_disassembler_options and
2850         set_gdbarch_verify_disassembler_options.
2851         (_initialize_arm_tdep): Delete regnames variable and update callers.
2852         (arm_disassembler_options): Initialize.
2853         (disasm_options): New variable.
2854         (num_disassembly_options): Rename from this...
2855         (num_disassembly_styles): ...to this.  Compute by scanning through
2856         disasm_options.
2857         (valid_disassembly_styles): Initialize using disasm_options.
2858         Remove calls to parse_arm_disassembler_option, get_arm_regnames and
2859         set_arm_regname_option.
2860         Pass show_disassembly_style_sfunc to the "disassembler" setshow command.
2861         * rs6000-tdep.c (powerpc_disassembler_options): New static variable.
2862         (rs6000_gdbarch_init): Call set_gdbarch_disassembler_options and
2863         set_gdbarch_verify_disassembler_options.
2864         * s390-tdep.c (s390_disassembler_options): New static variable.
2865         (s390_gdbarch_init):all set_gdbarch_disassembler_options and
2866         set_gdbarch_verify_disassembler_options.
2867
2868 2017-02-27  Simon Marchi  <simon.marchi@ericsson.com>
2869
2870         * remote.c (remote_add_target_side_condition): Remove "struct"
2871         keyword from range-based for loop.
2872
2873 2017-02-27  Simon Marchi  <simon.marchi@ericsson.com>
2874
2875         * remote.c (remote_add_target_side_condition): Use range-based
2876         for loop.  Update comment.
2877
2878 2017-02-27  Yao Qi  <yao.qi@linaro.org>
2879
2880         * f-typeprint.c (f_print_type): Check "varstring" is empty first.
2881
2882 2017-02-26  Alan Hayward  <alan.hayward@arm.com>
2883
2884         * regcache.c (regcache_raw_update): New function.
2885         (regcache_raw_read): Move code to regcache_raw_update.
2886         * regcache.h (regcache_raw_update): New declaration.
2887         * remote.c (remote_prepare_to_store): Call regcache_raw_update.
2888
2889 2017-02-26  Jan Kratochvil  <jan.kratochvil@redhat.com>
2890
2891         * dwarf2read.c (create_debug_type_hash_table): Initialize
2892         header.signature and header.type_offset_in_tu.
2893
2894 2017-02-24  Pedro Alves  <palves@redhat.com>
2895
2896         * symtab.c (make_file_symbol_completion_list_1): Use
2897         add_symtab_completions.
2898
2899 2017-02-24  Alan Hayward  <alan.hayward@arm.com>
2900
2901         * stack.c (frame_info): Use frame_unwind_register_value to avoid buf.
2902
2903 2017-02-24  Alan Hayward  <alan.hayward@arm.com>
2904
2905         * i386-tdep.c (i386_pseudo_register_read_into_value): Use
2906         I386_MAX_REGISTER_SIZE.
2907         (i386_pseudo_register_write): Likewise.
2908         (i386_process_record): Likewise.
2909         * i387-tdep.c (i387_supply_xsave): Likewise.
2910         * m68k-linux-nat.c (fetch_register): Use M68K_MAX_REGISTER_SIZE.
2911         (store_register): Likewise.
2912
2913 2017-02-23  Pedro Alves  <palves@redhat.com>
2914
2915         * ada-lang.c: Include "common/function-view.h".
2916         (ada_iterate_over_symbols): Adjust to use function_view as
2917         callback type.
2918         (struct add_partial_datum, ada_complete_symbol_matcher): Delete.
2919         (ada_make_symbol_completion_list): Use a lambda.
2920         (ada_exc_search_name_matches): Delete.
2921         (name_matches_regex): New.
2922         (ada_add_global_exceptions): Use a lambda and name_matches_regex.
2923         * compile/compile-c-support.c: Include "common/function-view.h".
2924         (print_one_macro): Change prototype to accept a ui_file pointer.
2925         (write_macro_definitions): Use a lambda.
2926         * dwarf2read.c: Include "common/function-view.h".
2927         (dw2_map_expand_apply, dw2_map_symtabs_matching_filename)
2928         (dw2_expand_symtabs_matching): Adjust to use function_view as
2929         callback type.
2930         * language.h: Include "common/function-view.h".
2931         (struct language_defn) <la_iterate_over_symbols>: Adjust to use
2932         function_view as callback type.
2933         (LA_ITERATE_OVER_SYMBOLS): Remove DATA parameter.
2934         * linespec.c: Include "common/function-view.h".
2935         (collect_info::add_symbol): New method.
2936         (struct symbol_and_data_callback, iterate_inline_only, struct
2937         symbol_matcher_data, iterate_name_matcher): Delete.
2938         (iterate_over_all_matching_symtabs): Adjust to use function_view
2939         as callback type and lambdas.
2940         (iterate_over_file_blocks): Adjust to use function_view as
2941         callback type.
2942         (decode_compound_collector): Now a class with private fields.
2943         (decode_compound_collector::release_symbols): New method.
2944         (collect_one_symbol): Rename to...
2945         (decode_compound_collector::operator()): ... this and adjust.
2946         (lookup_prefix_sym): decode_compound_collector construction bits
2947         move to decode_compound_collector ctor.  Pass the
2948         decode_compound_collector object directly as callback.  Remove
2949         cleanups and use decode_compound_collector::release_symbols
2950         instead.
2951         (symtab_collector): Now a class with private fields.
2952         (symtab_collector::release_symtabs): New method.
2953         (add_symtabs_to_list): Rename to...
2954         (symtab_collector::operator()): ... this and adjust.
2955         (collect_symtabs_from_filename): symtab_collector construction
2956         bits move to symtab_collector ctor.  Pass the symtab_collector
2957         object directly as callback.  Remove cleanups and use
2958         symtab_collector::release_symtabs instead.
2959         (collect_symbols): Delete.
2960         (add_matching_symbols_to_info): Use lambdas.
2961         * macrocmd.c (print_macro_callback): Delete.
2962         (info_macro_command): Use a lambda.
2963         (info_macros_command): Pass print_macro_definition as callable
2964         directly.
2965         (print_one_macro): Remove 'ignore' parameter.
2966         (macro_list_command): Adjust.
2967         * macrotab.c (macro_for_each_data::fn): Now a function_view.
2968         (macro_for_each_data::user_data): Delete field.
2969         (foreach_macro): Adjust to call the function_view.
2970         (macro_for_each): Adjust to use function_view as callback type.
2971         (foreach_macro_in_scope): Adjust to call the function_view.
2972         (macro_for_each_in_scope): Adjust to use function_view as callback
2973         type.
2974         * macrotab.h: Include "common/function-view.h".
2975         (macro_callback_fn): Declare a prototype instead of a pointer.
2976         Remove "user_data" parameter.
2977         (macro_for_each, macro_for_each_in_scope): Adjust to use
2978         function_view as callback type.
2979         * psymtab.c (partial_map_expand_apply)
2980         (psym_map_symtabs_matching_filename, recursively_search_psymtabs):
2981         Adjust to use function_view as callback type and to return bool.
2982         (psym_expand_symtabs_matching): Adjust to use function_view as
2983         callback types.
2984         * symfile-debug.c (debug_qf_map_symtabs_matching_filename): Adjust
2985         to use function_view as callback type and to return bool.
2986         (debug_qf_expand_symtabs_matching): Adjust to use function_view as
2987         callback types.
2988         * symfile.c (expand_symtabs_matching): Adjust to use function_view
2989         as callback types.
2990         * symfile.h: Include "common/function-view.h".
2991         (expand_symtabs_file_matcher_ftype)
2992         (expand_symtabs_symbol_matcher_ftype)
2993         (expand_symtabs_exp_notify_ftype): Remove "data" parameter and
2994         return bool.
2995         (quick_symbol_functions::map_symtabs_matching_filename)
2996         (quick_symbol_functions::expand_symtabs_matching): Adjust to use
2997         function_view as callback type and return bool.
2998         (expand_symtabs_matching): Adjust to use function_view as callback
2999         type.
3000         (maintenance_expand_name_matcher)
3001         (maintenance_expand_file_matcher): Delete.
3002         (maintenance_expand_symtabs): Use lambdas.
3003         * symtab.c (iterate_over_some_symtabs): Adjust to use
3004         function_view as callback types and return bool.
3005         (iterate_over_symtabs): Likewise.  Use unique_xmalloc_ptr instead
3006         of a cleanup.
3007         (lookup_symtab_callback): Delete.
3008         (lookup_symtab): Use a lambda.
3009         (iterate_over_symbols): Adjust to use function_view as callback
3010         type.
3011         (struct search_symbols_data, search_symbols_file_matches)
3012         (search_symbols_name_matches): Delete.
3013         (search_symbols): Use a pair of lambdas.
3014         (struct add_name_data, add_macro_name, symbol_completion_matcher)
3015         (symtab_expansion_callback): Delete.
3016         (default_make_symbol_completion_list_break_on_1): Use lambdas.
3017         * symtab.h: Include "common/function-view.h".
3018         (iterate_over_some_symtabs): Adjust to use function_view as
3019         callback type and return bool.
3020         (iterate_over_symtabs): Adjust to use function_view as callback
3021         type.
3022         (symbol_found_callback_ftype): Remove 'data' parameter and return
3023         bool.
3024         (iterate_over_symbols): Adjust to use function_view as callback
3025         type.
3026
3027 2017-02-23  Pedro Alves  <palves@redhat.com>
3028
3029         * Makefile.in (SUBDIR_UNITTESTS_SRCS, SUBDIR_UNITTESTS_OBS): New.
3030         (%.o) <unittests/%.c>: New pattern.
3031         * configure.ac ($development): Add $(SUBDIR_UNITTESTS_OBS) to
3032         CONFIG_OBS, and $(SUBDIR_UNITTESTS_SRCS) to CONFIG_SRCS.
3033         * common/function-view.h: New file.
3034         * unittests/function-view-selftests.c: New file.
3035         * configure: Regenerate.
3036
3037 2017-02-23  Simon Marchi  <simon.marchi@ericsson.com>
3038
3039         * bsd-uthread.c (bsd_uthread_thread_alive): Use ptid instead of
3040         inferior_ptid.
3041         * go32-nat.c (go32_thread_alive): Likewise.
3042
3043 2017-02-23  Yao Qi  <yao.qi@linaro.org>
3044
3045         * varobj-iter.h (varobj_iter_delete): Call xfree instead of
3046         delete.
3047
3048 2017-02-23  Yao Qi  <yao.qi@linaro.org>
3049
3050         * varobj.c (varobj_clear_saved_item): Use delete instead of
3051         xfree.
3052         (update_dynamic_varobj_children): Likewise.
3053
3054 2017-02-21  Jan Kratochvil  <jan.kratochvil@redhat.com>
3055
3056         * dwarf2read.c (dwarf2_record_block_ranges): Add forgotten BASEADDR.
3057
3058 2017-02-21  Simon Marchi  <simon.marchi@ericsson.com>
3059
3060         * common/enum-flags.h (enum_flags::enum_flags): Initialize
3061         m_enum_value to 0 in default constructor.
3062
3063 2017-02-21  Edjunior Barbosa Machado  <emachado@linux.vnet.ibm.com>
3064
3065         * rs6000-tdep.c (LOAD_AND_RESERVE_MASK): Rename from LWARX_MASK.
3066         (STORE_CONDITIONAL_MASK): Rename from STWCX_MASK.
3067         (LBARX_INSTRUCTION, LHARX_INSTRUCTION, LQARX_INSTRUCTION,
3068         STBCX_INSTRUCTION, STHCX_INSTRUCTION, STQCX_INSTRUCTION): New defines.
3069         (IS_LOAD_AND_RESERVE_INSN, IS_STORE_CONDITIONAL_INSN): New macros.
3070         (ppc_displaced_step_copy_insn): Use IS_LOAD_AND_RESERVE_INSN.
3071         (ppc_deal_with_atomic_sequence): Use IS_LOAD_AND_RESERVE_INSN and
3072         IS_STORE_CONDITIONAL_INSN.
3073
3074 2017-02-21  Jan Kratochvil  <jan.kratochvil@redhat.com>
3075
3076         * dwarf2_rnglists_process: Initialize range_beginning and range_end.
3077
3078 2017-02-20  Jan Kratochvil  <jan.kratochvil@redhat.com>
3079
3080         * NEWS (Changes since GDB 7.12): Add DWARF-5.
3081
3082 2017-02-20  Jan Kratochvil  <jan.kratochvil@redhat.com>
3083
3084         * dwarf2read.c (skip_one_die, read_attribute_value)
3085         (dwarf2_const_value_attr, dump_die_shallow)
3086         (dwarf2_get_attr_constant_value, dwarf2_fetch_constant_bytes)
3087         (skip_form_bytes, attr_form_is_constant): Handle DW_FORM_data16.
3088
3089 2017-02-20  Jan Kratochvil  <jan.kratochvil@redhat.com>
3090
3091         * dwarf2read.c (read_file_scope): Rename DW_MACRO_GNU_*.
3092         (dwarf_parse_macro_header): Accept DWARF version 5.
3093         (dwarf_decode_macro_bytes, dwarf_decode_macros): Rename DW_MACRO_GNU_*.
3094
3095 2017-02-20  Jan Kratochvil  <jan.kratochvil@redhat.com>
3096
3097         * block.c (call_site_for_pc): Rename DW_OP_GNU_*, DW_TAG_GNU_* and
3098         DW_AT_GNU_*.
3099         * common/common-exceptions.h (enum errors): Likewise.
3100         * dwarf2-frame.c (class dwarf_expr_executor): Likewise.
3101         * dwarf2expr.c (dwarf_block_to_dwarf_reg)
3102         (dwarf_expr_context::execute_stack_op): Likewise.
3103         * dwarf2expr.h (struct dwarf_expr_context, struct dwarf_expr_piece):
3104         Likewise.
3105         * dwarf2loc.c (dwarf_evaluate_loc_desc::get_base_type)
3106         (dwarf_evaluate_loc_desc::push_dwarf_reg_entry_value)
3107         (show_entry_values_debug, call_site_to_target_addr)
3108         (func_addr_to_tail_call_list, func_verify_no_selftailcall)
3109         (dwarf_expr_reg_to_entry_parameter, dwarf_entry_parameter_to_value)
3110         (entry_data_value_free_closure, value_of_dwarf_reg_entry)
3111         (value_of_dwarf_block_entry, indirect_pieced_value)
3112         (symbol_needs_eval_context::push_dwarf_reg_entry_value):
3113         (disassemble_dwarf_expression): Likewise.
3114         * dwarf2read.c (process_die, inherit_abstract_dies)
3115         (read_call_site_scope): Likewise.
3116         * gdbtypes.h (struct func_type, struct call_site_parameter)
3117         (struct call_site): Likewise.
3118         * stack.c (read_frame_arg): Likewise.
3119         * std-operator.def (OP_VAR_ENTRY_VALUE): Likewise.
3120
3121 2017-02-20  Jan Kratochvil  <jan.kratochvil@redhat.com>
3122
3123         * defs.h (read_unsigned_leb128): New declaration.
3124         * dwarf2loc.c (decode_debug_loclists_addresses): New function.
3125         (decode_debug_loc_dwo_addresses): Update DEBUG_LOC_* to DW_LLE_*.
3126         (dwarf2_find_location_expression): Call also
3127         decode_debug_loclists_addresses.  Handle DWARF-5 ULEB128 length.
3128         * dwarf2loc.h (dwarf2_version): New declaration.
3129         * dwarf2read.c (struct dwarf2_per_objfile): Add loclists, line_str,
3130         rnglists.
3131         (dwarf2_elf_names): Add .debug_loclists, .debug_line_str,
3132         .debug_rnglists.
3133         (struct dwop_section_names): Add loclists_dwo.
3134         (dwop_section_names): Add .debug_loclists.dwo.
3135         (struct comp_unit_head): Add unit_type, signature, type_offset_in_tu.
3136         (struct dwarf2_per_cu_data): Add dwarf_version.
3137         (struct dwo_sections): Add loclists.
3138         (struct attr_abbrev): Add implicit_const.
3139         (read_indirect_line_string): New declaration.
3140         (read_unsigned_leb128): Delete declaration.
3141         (rcuh_kind): New definition.
3142         (read_and_check_comp_unit_head): Change parameter
3143         is_debug_types_section to section_kind.
3144         (dwarf2_locate_sections): Handle loclists, line_str and rnglists.
3145         (read_comp_unit_head): Change parameter abfd to section, add parameter
3146         section_kind.  Handle DWARF-5.
3147         (error_check_comp_unit_head): Accept also DWARF version 5.
3148         (read_and_check_comp_unit_head): Change parameter
3149         is_debug_types_section to section_kind.
3150         (read_and_check_type_unit_head): Delete function.
3151         (read_abbrev_offset): Handle DWARF-5.
3152         (create_debug_type_hash_table): Add parameter section_kind.  Process
3153         only DW_UT_type.  Use signature and type_offset_in_tu from struct
3154         comp_unit_head.
3155         (create_debug_types_hash_table): Update create_debug_type_hash_table
3156         caller.
3157         (create_all_type_units): Call create_debug_type_hash_table.
3158         (read_cutu_die_from_dwo, init_cutu_and_read_dies): Change
3159         read_and_check_type_unit_head caller to read_and_check_comp_unit_head
3160         caller.
3161         (skip_one_die): Handle DW_FORM_implicit_const.
3162         (dwarf2_rnglists_process): New function.
3163         (dwarf2_ranges_process): Call dwarf2_rnglists_process for DWARF-5.
3164         (abbrev_table_read_table): Handle DW_FORM_implicit_const.
3165         (read_attribute_value): Handle DW_FORM_implicit_const,
3166         DW_FORM_line_strp.
3167         (read_attribute): Handle DW_FORM_implicit_const.
3168         (read_indirect_string_at_offset_from): New function from
3169         read_indirect_string_at_offset.
3170         (read_indirect_string_at_offset): Call
3171         read_indirect_string_at_offset_from.
3172         (read_indirect_line_string_at_offset): New function.
3173         (read_indirect_string): New function comment.
3174         (read_indirect_line_string): New function.
3175         (read_unsigned_leb128): Make it global.
3176         (dwarf2_string_attr): Handle DWARF-5.
3177         (add_include_dir_stub, read_formatted_entries): New functions.
3178         (dwarf_decode_line_header, dump_die_shallow, cu_debug_loc_section):
3179         Handle DWARF-5.
3180         (per_cu_header_read_in): Update read_comp_unit_head caller.
3181         (dwarf2_version): New function.
3182         * symfile.h (struct dwarf2_debug_sections): Add loclists, line_str and
3183         rnglists.
3184         * xcoffread.c (dwarf2_xcoff_names): Update struct dwarf2_debug_sections
3185         fields.
3186
3187 2017-02-20  Jan Kratochvil  <jan.kratochvil@redhat.com>
3188
3189         * dwarf2read.c (abbrev_table_read_table): Read the data only once.
3190
3191 2017-02-20  Jan Kratochvil  <jan.kratochvil@redhat.com>
3192
3193         * dwarf2read.c (dwarf2_ranges_process): New function from
3194         dwarf2_ranges_read.
3195         (dwarf2_ranges_read, dwarf2_record_block_ranges): Use
3196         dwarf2_ranges_process.
3197
3198 2017-02-20  Jan Kratochvil  <jan.kratochvil@redhat.com>
3199
3200         * dwarf2read.c (create_debug_type_hash_table): New function from
3201         create_debug_types_hash_table.
3202         (create_debug_types_hash_table): Call create_debug_type_hash_table.
3203         (create_all_type_units, open_and_init_dwo_file): Update
3204         create_debug_types_hash_table callers.
3205
3206 2017-02-20  Sergio Durigan Junior  <sergiodj@redhat.com>
3207
3208         PR gdb/16188
3209         * fork-child.c (trace_start_error): Fix thinko.  va_end should
3210         refer to 'ap', not 'args'.
3211
3212 2017-02-20  Sergio Durigan Junior  <sergiodj@redhat.com>
3213             Pedro Alves  <palves@redhat.com>
3214
3215         PR gdb/16188
3216         * darwin-nat.c (darwin_ptrace_me): Check if calls to system
3217         calls succeeded.
3218         * fork-child.c (trace_start_error): New function.
3219         (trace_start_error_with_name): Likewise.
3220         * gnu-nat.c (gnu_ptrace_me): Check if call to PTRACE succeeded.
3221         * inf-ptrace.c (inf_ptrace_me): Likewise.
3222         * inferior.h (trace_start_error): New prototype.
3223         (trace_start_error_with_name): Likewise.
3224
3225 2017-02-15  Sergio Durigan Junior  <sergiodj@redhat.com>
3226
3227         PR gdb/21164
3228         * psymtab.c (maintenance_print_psymbols): Verify if 'argv' is not
3229         NULL before using it.
3230         * symmisc.c (maintenance_print_symbols): Likewise.
3231         (maintenance_print_msymbols): Likewise.
3232
3233 2017-02-14  Tim Wiederhake  <tim.wiederhake@intel.com>
3234
3235         * NEWS: Add record Python bindings entry.
3236
3237 2017-02-14  Tim Wiederhake  <tim.wiederhake@intel.com>
3238
3239         * Makefile.in (SUBDIR_PYTHON_OBS): Add py-record-btrace.o,
3240         py-record-full.o.
3241         (SUBDIR_PYTHON_SRCS): Add py-record-btrace.c, py-record-full.c.
3242         * python/py-record-btrace.c, python/py-record-btrace.h,
3243         python/py-record-full.c, python/py-record-full.h: New file.
3244         * python/py-record.c: Add include for py-record-btrace.h and
3245         py-record-full.h.
3246         (recpy_method, recpy_format, recpy_goto, recpy_replay_position,
3247         recpy_instruction_history, recpy_function_call_history, recpy_begin,
3248         recpy_end): Use functions from py-record-btrace.c and py-record-full.c.
3249         * python/python-internal.h (PyInt_FromSsize_t, PyInt_AsSsize_t):
3250         New definition.
3251         (gdbpy_initialize_btrace): New export.
3252         * python/python.c (_initialize_python): Add gdbpy_initialize_btrace.
3253
3254 2017-02-14  Tim Wiederhake  <tim.wiederhake@intel.com>
3255
3256         * Makefile.in (SUBDIR_PYTHON_OBS): Add python/py-record.o.
3257         (SUBDIR_PYTHON_SRCS): Add python/py-record.c.
3258         * python/py-record.c: New file.
3259         * python/python-internal.h (gdbpy_start_recording,
3260         gdbpy_current_recording, gdpy_stop_recording,
3261         gdbpy_initialize_record): New export.
3262         * python/python.c (_initialize_python): Add gdbpy_initialize_record.
3263         (python_GdbMethods): Add gdbpy_start_recording,
3264         gdbpy_current_recording and gdbpy_stop_recording.
3265
3266 2017-02-14  Tim Wiederhake  <tim.wiederhake@intel.com>
3267
3268         * record-btrace.c (record_btrace_record_method): New function.
3269         (init_record_btrace_ops): Initialize to_record_method.
3270         * record-full.c (record_full_record_method): New function.
3271         (init_record_full_ops, init_record_full_core_ops): Add
3272         record_full_record_method.
3273         * record.h (enum record_method): New enum.
3274         * target-debug.h (target_debug_print_enum_record_method: New define.
3275         * target-delegates.c: Regenerate.
3276         * target.c (target_record_method): New function.
3277         * target.h: Include record.h.
3278         (struct target_ops) <to_record_method>: New field.
3279         (target_record_method): New export.
3280
3281 2017-02-14  Tim Wiederhake  <tim.wiederhake@intel.com>
3282
3283         * record.h (record_start, record_stop): New export.
3284         * record.c (record_start, record_stop): New function.
3285
3286 2017-02-14  Tim Wiederhake  <tim.wiederhake@intel.com>
3287
3288         * btrace.c (btrace_fetch): Copy function call segments pointer
3289         into a vector.
3290         (btrace_clear): Clear the vector.
3291         (btrace_find_insn_by_number): Use binary search to find the correct
3292         function call segment.
3293         * btrace.h (brace_fun_p): New typedef.
3294         (struct btrace_thread_info) <functions>: New field.
3295
3296 2017-02-14  Tim Wiederhake  <tim.wiederhake@intel.com>
3297
3298         * record-btrace.c (btrace_ui_out_decode_error): Move most of it ...
3299         * btrace.c (btrace_decode_error): ... here.  New function.
3300         * btrace.h (btrace_decode_error): New export.
3301
3302 2017-02-14  Tim Wiederhake  <tim.wiederhake@intel.com>
3303
3304         * btrace.c (ftrace_call_num_insn, btrace_insn_get_error): New function.
3305         (ftrace_new_function, btrace_insn_number, btrace_insn_cmp,
3306         btrace_find_insn_by_number): Remove special case for gaps.
3307         * btrace.h (btrace_insn_get_error): New export.
3308         (btrace_insn_number, btrace_find_insn_by_number): Adjust comment.
3309         * record-btrace.c (btrace_insn_history): Print number for gaps.
3310         (record_btrace_info, record_btrace_goto): Handle gaps.
3311
3312 2017-02-14  Tom Tromey  <tom@tromey.com>
3313
3314         PR python/13598:
3315         * python/python.c (gdbpy_before_prompt_hook): Emit before_prompt
3316         event.
3317         * python/py-evts.c (gdbpy_initialize_py_events): Add
3318         before_prompt registry.
3319         * python/py-events.h (events_object) <before_prompt>: New field.
3320
3321 2017-02-14  Markus Metzger  <markus.t.metzger@intel.com>
3322
3323         * btrace.c (ftrace_new_switch): Preserve up link and flags.
3324
3325 2017-02-13  Luis Machado  <lgustavo@codesourcery.com>
3326
3327         * symfile (_initialize_symfile): Add usage text to the load command's
3328         help text.
3329
3330 2017-02-10  Simon Marchi  <simon.marchi@ericsson.com>
3331
3332         * utils.c (defaulted_query): Don't query on secondary UIs.
3333
3334 2017-02-10  Tom Tromey  <tom@tromey.com>
3335
3336         * rust-lang.c (rust_get_disr_info): Remove unused variable.
3337
3338 2017-02-10  Tom Tromey  <tom@tromey.com>
3339
3340         * python/py-value.c (valpy_richcompare_throw): Remove unnecessary
3341         "cleanup" local.
3342         * python/py-type.c (typy_legacy_template_argument): Remove
3343         unnecessary "cleanup" local.
3344
3345 2017-02-10  Tom Tromey  <tom@tromey.com>
3346
3347         * python/python.c (do_start_initialization): New function, from
3348         _initialize_python.
3349         (_initialize_python): Call do_start_initialization.
3350         * python/py-linetable.c (ltpy_iternext): Use explicit returns, not
3351         goto.
3352
3353 2017-02-10  Tom Tromey  <tom@tromey.com>
3354
3355         * python/py-prettyprint.c (pretty_print_one_value): Use
3356         gdbpy_ref.
3357
3358 2017-02-10  Tom Tromey  <tom@tromey.com>
3359
3360         * python/py-cmd.c (cmdpy_destroyer): Use gdbpy_ref.
3361         * python/py-breakpoint.c (gdbpy_breakpoint_deleted): Use
3362         gdbpy_ref.
3363         * python/py-type.c (field_new): Use gdbpy_ref.
3364         * python/py-symtab.c (symtab_and_line_to_sal_object): Use
3365         gdbpy_ref.
3366         * python/py-progspace.c (pspy_new): Use gdbpy_ref.
3367         (py_free_pspace): Likewise.
3368         (pspace_to_pspace_object): Likewise.
3369         * python/py-objfile.c (objfpy_new): Use gdbpy_ref.
3370         (py_free_objfile): Likewise.
3371         (objfile_to_objfile_object): Likewise.
3372         * python/py-inferior.c (delete_thread_object): Use
3373         gdbpy_ref.
3374         (infpy_read_memory): Likewise.
3375         (py_free_inferior): Likewise.
3376         * python/py-evtregistry.c (create_eventregistry_object): Use
3377         gdbpy_ref.
3378         * python/py-event.c (create_event_object): Use gdbpy_ref.
3379
3380 2017-02-10  Tom Tromey  <tom@tromey.com>
3381
3382         * python/py-ref.h (gdbpy_ref_policy): Now a template.
3383         (gdbpy_ref): Now a template; allow subclasses of PyObject to be
3384         used.
3385         * python/py-arch.c, python/py-bpevent.c, python/py-breakpoint.c,
3386         python/py-cmd.c, python/py-continueevent.c, python/py-event.c,
3387         python/py-exitedevent.c, python/py-finishbreakpoint.c,
3388         python/py-framefilter.c, python/py-function.c,
3389         python/py-inferior.c, python/py-infevents.c,
3390         python/py-linetable.c, python/py-newobjfileevent.c,
3391         python/py-param.c, python/py-prettyprint.c, python/py-ref.h,
3392         python/py-signalevent.c, python/py-stopevent.c,
3393         python/py-symbol.c, python/py-threadevent.c, python/py-type.c,
3394         python/py-unwind.c, python/py-utils.c, python/py-value.c,
3395         python/py-varobj.c, python/py-xmethods.c, python/python.c,
3396         varobj.c: Change gdbpy_ref to gdbpy_ref<>.
3397
3398 2017-02-10  Tom Tromey  <tom@tromey.com>
3399
3400         * ui-out.h (ui_out_emit_type): New class.
3401         (ui_out_emit_tuple, ui_out_emit_list): New typedefs.
3402         * python/py-framefilter.c (py_print_single_arg): Use gdb::optional
3403         and ui_out_emit_tuple.
3404         (enumerate_locals): Likewise.
3405         (py_mi_print_variables, py_print_locals, py_print_args): Use
3406         ui_out_emit_list.
3407         (py_print_frame): Use gdb::optional, ui_out_emit_tuple,
3408         ui_out_emit_list.
3409         * common/gdb_optional.h: New file.
3410
3411 2017-02-10  Martin Galvan  <martingalvan@sourceware.org>
3412
3413         * MAINTAINERS (Write After Approval): Update my e-mail address.
3414
3415 2017-02-10  Martin Galvan  <martingalvan@sourceware.org>
3416
3417         PR gdb/21122
3418         * breakpoint.c (_initialize_breakpoint): Update the help description
3419         of the 'commands' command to indicate that it takes a list argument.
3420
3421 2017-02-09  Simon Marchi  <simon.marchi@ericsson.com>
3422
3423         * interps.c (current_interp_set_logging): Remove "return".
3424
3425 2017-02-09  Gary Benson  <gbenson@redhat.com>
3426
3427         * symtab.c (add_symtab_completions): Prevent NULL pointer
3428         dereference.
3429
3430 2017-02-08  Pedro Alves  <palves@redhat.com>
3431
3432         * interps.c (interp::interp): Remove reference to quiet_p.
3433         (interp_set): Make static.  Remove dead "Switching to" output
3434         code.
3435         (interp_quiet_p, interp_set_quiet): Delete.
3436         (interpreter_exec_cmd): Don't set the interpreter quiet.
3437         * interps.h (interp_quiet_p): Make static.
3438         (class interp) <quiet_p>: Remove field
3439
3440 2017-02-08  Jerome Guitton  <guitton@adacore.com>
3441
3442         * cli/cli-decode.c (find_command_name_length): Make it extern.
3443         * cli/cli-decode.h (find_command_name_length): Declare.
3444         * cli/cli-script.c (command_name_equals, line_first_arg):
3445         New functions.
3446         (process_next_line): Use cli-decode to parse command names.
3447         (build_command_line): Make args a constant pointer.
3448
3449 2017-02-08  Jerome Guitton  <guitton@adacore.com>
3450
3451         * cli-decode.c (lookup_cmd_1, lookup_cmd_composition):
3452         Remove case-insensitive search.
3453
3454 2017-02-07  Jose E. Marchesi  <jose.marchesi@oracle.com>
3455
3456         * sparc-tdep.c (sparc32_gdbarch_init): Do not place a + operator
3457         at the end of the line.  Avoids an ARI warning.
3458
3459 2017-02-06  Luis Machado  <lgustavo@codesourcery.com>
3460
3461         * NEWS: Mention support for record/replay of Intel 64 rdrand and
3462         rdseed instructions.
3463         i386-tdep.c (i386_process_record): Handle Intel 64 rdrand and rseed.
3464
3465 2017-02-06  Ivo Raisr  <ivo.raisr@oracle.com>
3466
3467         PR tdep/20936
3468         Provide and use sparc32 and sparc64 target description XML files.
3469         * features/sparc/sparc32-cp0.xml, features/sparc/sparc32-cpu.xml,
3470         features/sparc/sparc32-fpu.xml: New files for sparc 32-bit.
3471         * features/sparc/sparc64-cp0.xml, features/sparc/sparc64-cpu.xml,
3472         features/sparc/sparc64-fpu.xml: New files for sparc 64-bit.
3473         * features/sparc/sparc32-solaris.xml: New file.
3474         * features/sparc/sparc64-solaris.xml: New file.
3475         * features/sparc/sparc32-solaris.c: Generated.
3476         * features/sparc/sparc64-solaris.c: Generated.
3477         * sparc-tdep.h: Account for differences in target descriptions.
3478         * sparc-tdep.c (sparc32_register_name): Use target provided registers.
3479         (sparc32_register_type): Use target provided registers.
3480         (validate_tdesc_registers): New function.
3481         (sparc32_gdbarch_init): Use tdesc_has_registers.
3482         Set pseudoregister functions.
3483         * sparc64-tdep.c (sparc64_register_name): Use target provided registers.
3484         (sparc64_register_type): Use target provided registers.
3485         (sparc64_init_abi): Set pseudoregister functions.
3486
3487 2017-02-03  Tom Tromey  <tom@tromey.com>
3488
3489         PR rust/21097:
3490         * rust-lang.c (rust_print_type) <TYPE_CODE_UNION>: Handle enums
3491         with a single member.
3492
3493 2017-02-03  Pedro Alves  <palves@redhat.com>
3494
3495         * cli/cli-interp.c (cli_interp_base::cli_interp_base)
3496         (cli_interp_base::~cli_interp_base): New.
3497         (cli_interp): New struct.
3498         (as_cli_interp): Cast the interp itself to cli_interp.
3499         (cli_interpreter_pre_command_loop): Rename to ...
3500         (cli_interp_base::pre_command_loop): ... this.  Remove 'self'
3501         parameter.
3502         (cli_interpreter_init): Rename to ...
3503         (cli_interp::init): ... this.  Remove 'self' parameter.  Use
3504         boolean.  Make extern.
3505         (cli_interpreter_resume): Rename to ...
3506         (cli_interp::resume): ... this.  Remove 'data' parameter.  Make
3507         extern.
3508         (cli_interpreter_suspend): Rename to ...
3509         (cli_interp::suspend): ... this.  Remove 'data' parameter.  Make
3510         extern.
3511         (cli_interpreter_exec): Rename to ...
3512         (cli_interp::exec): ... this.  Remove 'data' parameter.  Make
3513         extern.
3514         (cli_interpreter_supports_command_editing): Rename to ...
3515         (cli_interp_base::supports_command_editing): ... this.  Remove
3516         'interp' parameter.  Make extern.
3517         (cli_ui_out): Rename to ...
3518         (cli_interp::interp_ui_out): ... this.  Remove 'interp' parameter.
3519         Make extern.
3520         (cli_set_logging): Rename to ...
3521         (cli_interp_base::set_logging): ... this.  Remove 'interp'
3522         parameter.  Make extern.
3523         (cli_interp_procs): Delete.
3524         (cli_interp_factory): Adjust to use "new".
3525         * cli/cli-interp.h: Include "interps.h".
3526         (struct cli_interp_base): New struct.
3527         * interps.c (struct interp): Delete.  Fields moved to interps.h.
3528         (interp_new): Delete.
3529         (interp::interp, interp::~interp): New.
3530         (interp_set): Use bool, and return void.  Assume the interpreter
3531         has suspend, init and resume methods, and that the all return
3532         void.
3533         (set_top_level_interpreter): interp_set returns void.
3534         (interp_ui_out): Adapt.
3535         (current_interp_set_logging): Adapt.
3536         (interp_data): Delete.
3537         (interp_pre_command_loop, interp_supports_command_editing): Adapt.
3538         (interp_exec): Adapt.
3539         (top_level_interpreter_data): Delete.
3540         * interps.h (interp_init_ftype, interp_resume_ftype)
3541         (interp_suspend_ftype, interp_exec_ftype)
3542         (interp_pre_command_loop_ftype, interp_ui_out_ftype): Delete.
3543         (class interp): New.
3544         (interp_new): Delete.
3545         (interp_set): Now returns void.  Use bool.
3546         (interp_data, top_level_interpreter_data): Delete.
3547         * mi/mi-common.h: Include interps.h.
3548         (class mi_interp): Inherit from interp.  Define a ctor.  Declare
3549         init, resume, suspect, exec, interp_ui_out, set_logging and
3550         pre_command_loop methods.
3551         * mi/mi-interp.c (as_mi_interp): Cast the interp itself.
3552         (mi_interpreter_init): Rename to ...
3553         (mi_interp::init): ... this.  Remove the 'interp' parameter, use
3554         bool, return void and make extern.  Adjust.
3555         (mi_interpreter_resume): ... Rename to ...
3556         (mi_interp::resume): ... this.  Remove the 'data' parameter,
3557         return void and make extern.  Adjust.
3558         (mi_interpreter_suspend): ... Rename to ...
3559         (mi_interp::suspend): ... this.  Remove the 'data' parameter,
3560         return void and make extern.  Adjust.
3561         (mi_interpreter_exec): ... Rename to ...
3562         (mi_interp::exec): ... this.  Remove the 'data' parameter and make
3563         extern.  Adjust.
3564         (mi_interpreter_pre_command_loop): ... Rename to ...
3565         (mi_interp::pre_command_loop): ... this.  Remove the 'self'
3566         parameter and make extern.
3567         (mi_on_normal_stop_1): Adjust.
3568         (mi_ui_out): Rename to ...
3569         (mi_interp::interp_ui_out): ... this.  Remove the 'interp'
3570         parameter and make extern.  Adjust.
3571         (mi_set_logging): Rename to ...
3572         (mi_interp::set_logging): ... this.  Remove the 'interp'
3573         parameter and make extern.  Adjust.
3574         (mi_interp_procs): Delete.
3575         (mi_interp_factory): Adjust to use 'new'.
3576         * mi/mi-main.c (mi_cmd_gdb_exit, captured_mi_execute_command)
3577         (mi_print_exception, mi_execute_command, mi_load_progress):
3578         Adjust.
3579         * tui/tui-interp.c (tui_interp): New class.
3580         (as_tui_interp): Return a tui_interp pointer.
3581         (tui_on_normal_stop, tui_on_signal_received)
3582         (tui_on_end_stepping_range, tui_on_signal_exited, tui_on_exited)
3583         (tui_on_no_history, tui_on_user_selected_context_changed): Adjust
3584         to use interp::interp_ui_out.
3585         (tui_init): Rename to ...
3586         (tui_interp::init): ... this.  Remove the 'self' parameter, use
3587         bool, return void and make extern.  Adjust.
3588         (tui_resume): Rename to ...
3589         (tui_interp::resume): ... this.  Remove the 'data' parameter,
3590         return void and make extern.  Adjust.
3591         (tui_suspend): Rename to ...
3592         (tui_interp::suspend): ... this.  Remove the 'data' parameter,
3593         return void and make extern.  Adjust.
3594         (tui_ui_out): Rename to ...
3595         (tui_interp::interp_ui_out): ... this.  Remove the 'self'
3596         parameter, and make extern.  Adjust.
3597         (tui_exec): Rename to ...
3598         (tui_interp::exec): ... this.  Remove the 'data' parameter and
3599         make extern.
3600         (tui_interp_procs): Delete.
3601         (tui_interp_factory): Use "new".
3602
3603 2017-02-02  Tom Tromey  <tom@tromey.com>
3604
3605         * rust-exp.y (ends_raw_string, space_then_number)
3606         (rust_identifier_start_p): Return bool.
3607         * rust-lang.c (rust_tuple_type_p, rust_underscore_fields)
3608         (rust_tuple_struct_type_p, rust_tuple_variant_type_p)
3609         (rust_slice_type_p, rust_range_type_p, rust_u8_type_p)
3610         (rust_chartype_p): Return bool.
3611         (val_print_struct, rust_print_struct_def, rust_print_type):
3612         Update.
3613         * rust-lang.h (rust_tuple_type_p, rust_tuple_struct_type_p):
3614         Return bool.
3615
3616 2017-02-02  Tom Tromey  <tom@tromey.com>
3617
3618         * rust-lang.c: Reindent.
3619
3620 2017-02-02  Tom Tromey  <tom@tromey.com>
3621
3622         * rust-lang.h (rust_crate_for_block): Update.
3623         * rust-lang.c (rust_crate_for_block): Return std::string.
3624         (rust_get_disr_info): Use std:;string, not
3625         gdb::unique_xmalloc_ptr.
3626         * rust-exp.y (crate_name): Update.
3627
3628 2017-02-02  Pedro Alves  <palves@redhat.com>
3629
3630         * disasm-selftests.c (print_one_insn_test): Move the "verbose"
3631         field out of gdb_disassembler_test and make it static.
3632
3633 2017-02-02  Pedro Alves  <palves@redhat.com>
3634
3635         * mi/mi-common.h (struct mi_interp): Delete the mi2_interp,
3636         mi1_interp and mi_interp fields.
3637
3638 2017-02-02  Pedro Alves  <palves@redhat.com>
3639
3640         * cli/cli-interp.c (struct saved_output_files, saved_output):
3641         Moved from cli/cli-logging.c.
3642         (cli_set_logging): New function.
3643         (cli_interp_procs): Install cli_set_logging.
3644         * cli/cli-interp.h (make_logging_output, cli_set_logging):
3645         Declare.
3646         * cli/cli-logging.c (struct saved_output_files, saved_output):
3647         Moved to cli/cli-interp.c.
3648         (pop_output_files): Don't save outputs here.
3649         (make_logging_output): New function.
3650         (handle_redirections): Don't build tee nor save previous outputs
3651         here.
3652         * interps.c (current_interp_set_logging): Change prototype.
3653         Assume there's always a set_logging_proc method installed.
3654         * interps.h (interp_set_logging_ftype): Change prototype.
3655         (current_interp_set_logging): Change prototype and adjust comment.
3656         * mi/mi-interp.c (mi_set_logging): Change protototype.  Adjust to
3657         use make_logging_output.
3658         * tui/tui-interp.c (tui_interp_procs): Install cli_set_logging.
3659 2017-02-02  Pedro Alves  <palves@redhat.com>
3660
3661         * cli/cli-logging.c (maybe_warn_already_logging): New factored out
3662         from ...
3663         (set_logging_overwrite): ... here.
3664         (logging_no_redirect_file): Delete.
3665         (set_logging_redirect): Don't handle redirection on the fly.
3666         Instead warn that "logging off" / "logging on" is necessary.
3667         (pop_output_files): Delete references to logging_no_redirect_file.
3668         (show_logging_command): Always speak in terms of what will happen
3669         once logging is reenabled.
3670
3671 2017-02-02  Pedro Alves  <palves@redhat.com>
3672
3673         * disasm.h (gdb_pretty_print_disassembler): Tweak intro comment.
3674
3675 2017-02-02  Pedro Alves  <palves@redhat.com>
3676
3677         * disasm.c (gdb_pretty_print_insn): Rename to ...
3678         (gdb_pretty_print_disassembler::pretty_print_insn): ... this.
3679         Remove gdbarch parameter.  Adapt to clear the object's buffers
3680         instead of allocating new buffers, and to print using the object's
3681         gdb_disassembler instead of calling gdb_print_insn.
3682         (dump_insns): Use gdb_pretty_print_disassembler.
3683         * disasm.h (gdb_pretty_print_insn): Delete declaration.
3684         (gdb_pretty_print_disassembler): New class.
3685         * record-btrace.c (btrace_insn_history): Use
3686         gdb_pretty_print_disassembler.
3687
3688 2017-02-02  Pedro Alves  <palves@redhat.com>
3689
3690         * ada-lang.c (type_as_string): Use string_file.
3691         * ada-valprint.c (ada_print_floating): Use string_file.
3692         * ada-varobj.c (ada_varobj_scalar_image)
3693         (ada_varobj_get_value_image): Use string_file.
3694         * aix-thread.c (aix_thread_extra_thread_info): Use string_file.
3695         * arm-tdep.c (_initialize_arm_tdep): Use string_printf.
3696         * breakpoint.c (update_inserted_breakpoint_locations)
3697         (insert_breakpoint_locations, reattach_breakpoints)
3698         (print_breakpoint_location, print_one_detail_ranged_breakpoint)
3699         (print_it_watchpoint): Use string_file.
3700         (save_breakpoints): Use stdio_file.
3701         * c-exp.y (oper): Use string_file.
3702         * cli/cli-logging.c (set_logging_redirect): Use ui_file_up and
3703         tee_file.
3704         (pop_output_files): Use delete.
3705         (handle_redirections): Use stdio_file and tee_file.
3706         * cli/cli-setshow.c (do_show_command): Use string_file.
3707         * compile/compile-c-support.c (c_compute_program): Use
3708         string_file.
3709         * compile/compile-c-symbols.c (generate_vla_size): Take a
3710         'string_file &' instead of a 'ui_file *'.
3711         (generate_c_for_for_one_variable): Take a 'string_file &' instead
3712         of a 'ui_file *'.  Use string_file.
3713         (generate_c_for_variable_locations): Take a 'string_file &'
3714         instead of a 'ui_file *'.
3715         * compile/compile-internal.h (generate_c_for_for_one_variable):
3716         Take a 'string_file &' instead of a 'ui_file *'.
3717         * compile/compile-loc2c.c (push, pushf, unary, binary)
3718         (print_label, pushf_register_address, pushf_register)
3719         (do_compile_dwarf_expr_to_c): Take a 'string_file &' instead of a
3720         'ui_file *'.  Adjust.
3721         * compile/compile.c (compile_to_object): Use string_file.
3722         * compile/compile.h (compile_dwarf_expr_to_c)
3723         (compile_dwarf_bounds_to_c): Take a 'string_file &' instead of a
3724         'ui_file *'.
3725         * cp-support.c (inspect_type): Use string_file and obstack_copy0.
3726         (replace_typedefs_qualified_name): Use string_file and
3727         obstack_copy0.
3728         * disasm.c (gdb_pretty_print_insn): Use string_file.
3729         (gdb_disassembly): Adjust reference the null_stream global.
3730         (do_ui_file_delete): Delete.
3731         (gdb_insn_length): Use null_stream.
3732         * dummy-frame.c (maintenance_print_dummy_frames): Use stdio_file.
3733         * dwarf2loc.c (dwarf2_compile_property_to_c)
3734         (locexpr_generate_c_location, loclist_generate_c_location): Take a
3735         'string_file &' instead of a 'ui_file *'.
3736         * dwarf2loc.h (dwarf2_compile_property_to_c): Likewise.
3737         * dwarf2read.c (do_ui_file_peek_last): Delete.
3738         (dwarf2_compute_name): Use string_file.
3739         * event-top.c (gdb_setup_readline): Use stdio_file.
3740         * gdbarch.sh (verify_gdbarch): Use string_file.
3741         * gdbtypes.c (safe_parse_type): Use null_stream.
3742         * guile/scm-breakpoint.c (gdbscm_breakpoint_commands): Use
3743         string_file.
3744         * guile/scm-disasm.c (gdbscm_print_insn_from_port): Take a
3745         'string_file *' instead of a 'ui_file *'.
3746         (gdbscm_arch_disassemble): Use string_file.
3747         * guile/scm-frame.c (frscm_print_frame_smob): Use string_file.
3748         * guile/scm-ports.c (class ioscm_file_port): Now a class that
3749         inherits from ui_file.
3750         (ioscm_file_port_delete, ioscm_file_port_rewind)
3751         (ioscm_file_port_put): Delete.
3752         (ioscm_file_port_write): Rename to ...
3753         (ioscm_file_port::write): ... this.  Remove file_port_magic
3754         checks.
3755         (ioscm_file_port_new): Delete.
3756         (ioscm_with_output_to_port_worker): Use ioscm_file_port and
3757         ui_file_up.
3758         * guile/scm-type.c (tyscm_type_name): Use string_file.
3759         * guile/scm-value.c (vlscm_print_value_smob, gdbscm_value_print):
3760         Use string_file.
3761         * infcmd.c (print_return_value_1): Use string_file.
3762         * infrun.c (print_target_wait_results): Use string_file.
3763         * language.c (add_language): Use string_file.
3764         * location.c (explicit_to_string_internal): Use string_file.
3765         * main.c (captured_main_1): Use null_file.
3766         * maint.c (maintenance_print_architecture): Use stdio_file.
3767         * mi/mi-cmd-stack.c (list_arg_or_local): Use string_file.
3768         * mi/mi-common.h (struct mi_interp) <out, err, log, targ,
3769         event_channel>: Change type to mi_console_file pointer.
3770         * mi/mi-console.c (mi_console_file_fputs, mi_console_file_flush)
3771         (mi_console_file_delete): Delete.
3772         (struct mi_console_file): Delete.
3773         (mi_console_file_magic): Delete.
3774         (mi_console_file_new): Delete.
3775         (mi_console_file::mi_console_file): New.
3776         (mi_console_file_delete): Delete.
3777         (mi_console_file_fputs): Delete.
3778         (mi_console_file::write): New.
3779         (mi_console_raw_packet): Delete.
3780         (mi_console_file::flush): New.
3781         (mi_console_file_flush): Delete.
3782         (mi_console_set_raw): Rename to ...
3783         (mi_console_file::set_raw): ... this.
3784         * mi/mi-console.h (class mi_console_file): New class.
3785         (mi_console_file_new, mi_console_set_raw): Delete.
3786         * mi/mi-interp.c (mi_interpreter_init): Use mi_console_file.
3787         (mi_set_logging): Use delete and tee_file.  Adjust.
3788         * mi/mi-main.c (output_register): Use string_file.
3789         (mi_cmd_data_evaluate_expression): Use string_file.
3790         (mi_cmd_data_read_memory): Use string_file.
3791         (mi_cmd_execute, print_variable_or_computed): Use string_file.
3792         * mi/mi-out.c (mi_ui_out::main_stream): New.
3793         (mi_ui_out::rewind): Use main_stream and
3794         string_file.
3795         (mi_ui_out::put): Use main_stream and string_file.
3796         (mi_ui_out::mi_ui_out): Remove 'stream' parameter.
3797         Allocate a 'string_file' instead.
3798         (mi_out_new): Don't allocate a mem_fileopen stream here.
3799         * mi/mi-out.h (mi_ui_out::mi_ui_out): Remove 'stream' parameter.
3800         (mi_ui_out::main_stream): Declare method.
3801         * printcmd.c (eval_command): Use string_file.
3802         * psymtab.c (maintenance_print_psymbols): Use stdio_file.
3803         * python/py-arch.c (archpy_disassemble): Use string_file.
3804         * python/py-breakpoint.c (bppy_get_commands): Use string_file.
3805         * python/py-frame.c (frapy_str): Use string_file.
3806         * python/py-framefilter.c (py_print_type, py_print_single_arg):
3807         Use string_file.
3808         * python/py-type.c (typy_str): Use string_file.
3809         * python/py-unwind.c (unwind_infopy_str): Use string_file.
3810         * python/py-value.c (valpy_str): Use string_file.
3811         * record-btrace.c (btrace_insn_history): Use string_file.
3812         * regcache.c (regcache_print): Use stdio_file.
3813         * reggroups.c (maintenance_print_reggroups): Use stdio_file.
3814         * remote.c (escape_buffer): Use string_file.
3815         * rust-lang.c (rust_get_disr_info): Use string_file.
3816         * serial.c (serial_open_ops_1): Use stdio_file.
3817         (do_serial_close): Use delete.
3818         * stack.c (print_frame_arg): Use string_file.
3819         (print_frame_args): Remove local mem_fileopen stream, not used.
3820         (print_frame): Use string_file.
3821         * symmisc.c (maintenance_print_symbols): Use stdio_file.
3822         * symtab.h (struct symbol_computed_ops) <generate_c_location>:
3823         Take a 'string_file *' instead of a 'ui_file *'.
3824         * top.c (new_ui): Use stdio_file and stderr_file.
3825         (free_ui): Use delete.
3826         (execute_command_to_string): Use string_file.
3827         (quit_confirm): Use string_file.
3828         * tracepoint.c (collection_list::append_exp): Use string_file.
3829         * tui/tui-disasm.c (tui_disassemble): Use string_file.
3830         * tui/tui-file.c: Don't include "ui-file.h".
3831         (enum streamtype, struct tui_stream): Delete.
3832         (tui_file_new, tui_file_delete, tui_fileopen, tui_sfileopen)
3833         (tui_file_isatty, tui_file_rewind, tui_file_put): Delete.
3834         (tui_file::tui_file): New method.
3835         (tui_file_fputs): Delete.
3836         (tui_file_get_strbuf): Delete.
3837         (tui_file::puts): New method.
3838         (tui_file_adjust_strbuf): Delete.
3839         (tui_file_flush): Delete.
3840         (tui_file::flush): New method.
3841         * tui/tui-file.h: Tweak intro comment.
3842         Include ui-file.h.
3843         (tui_fileopen, tui_sfileopen, tui_file_get_strbuf)
3844         (tui_file_adjust_strbuf): Delete declarations.
3845         (class tui_file): New class.
3846         * tui/tui-io.c (tui_initialize_io): Use tui_file.
3847         * tui/tui-regs.c (tui_restore_gdbout): Use delete.
3848         (tui_register_format): Use string_stream.
3849         * tui/tui-stack.c (tui_make_status_line): Use string_file.
3850         (tui_get_function_from_frame): Use string_file.
3851         * typeprint.c (type_to_string): Use string_file.
3852         * ui-file.c (struct ui_file, ui_file_magic, ui_file_new): Delete.
3853         (null_stream): New global.
3854         (ui_file_delete): Delete.
3855         (ui_file::ui_file): New.
3856         (null_file_isatty): Delete.
3857         (ui_file::~ui_file): New.
3858         (null_file_rewind): Delete.
3859         (ui_file::printf): New.
3860         (null_file_put): Delete.
3861         (null_file_flush): Delete.
3862         (ui_file::putstr): New.
3863         (null_file_write): Delete.
3864         (ui_file::putstrn): New.
3865         (null_file_read): Delete.
3866         (ui_file::putc): New.
3867         (null_file_fputs): Delete.
3868         (null_file_write_async_safe): Delete.
3869         (ui_file::vprintf): New.
3870         (null_file_delete): Delete.
3871         (null_file::write): New.
3872         (null_file_fseek): Delete.
3873         (null_file::puts): New.
3874         (ui_file_data): Delete.
3875         (null_file::write_async_safe): New.
3876         (gdb_flush, ui_file_isatty): Adjust.
3877         (ui_file_put, ui_file_rewind): Delete.
3878         (ui_file_write): Adjust.
3879         (ui_file_write_for_put): Delete.
3880         (ui_file_write_async_safe, ui_file_read): Adjust.
3881         (ui_file_fseek): Delete.
3882         (fputs_unfiltered): Adjust.
3883         (set_ui_file_flush, set_ui_file_isatty, set_ui_file_rewind)
3884         (set_ui_file_put, set_ui_file_write, set_ui_file_write_async_safe)
3885         (set_ui_file_read, set_ui_file_fputs, set_ui_file_fseek)
3886         (set_ui_file_data): Delete.
3887         (string_file::~string_file, string_file::write)
3888         (struct accumulated_ui_file, do_ui_file_xstrdup, ui_file_xstrdup)
3889         (do_ui_file_as_string, ui_file_as_string): Delete.
3890         (do_ui_file_obsavestring, ui_file_obsavestring): Delete.
3891         (struct mem_file): Delete.
3892         (mem_file_new): Delete.
3893         (stdio_file::stdio_file): New.
3894         (mem_file_delete): Delete.
3895         (stdio_file::stdio_file): New.
3896         (mem_fileopen): Delete.
3897         (stdio_file::~stdio_file): New.
3898         (mem_file_rewind): Delete.
3899         (stdio_file::set_stream): New.
3900         (mem_file_put): Delete.
3901         (stdio_file::open): New.
3902         (mem_file_write): Delete.
3903         (stdio_file_magic, struct stdio_file): Delete.
3904         (stdio_file_new, stdio_file_delete, stdio_file_flush): Delete.
3905         (stdio_file::flush): New.
3906         (stdio_file_read): Rename to ...
3907         (stdio_file::read): ... this.  Adjust.
3908         (stdio_file_write): Rename to ...
3909         (stdio_file::write): ... this.  Adjust.
3910         (stdio_file_write_async_safe): Rename to ...
3911         (stdio_file::write_async_safe) ... this.  Adjust.
3912         (stdio_file_fputs): Rename to ...
3913         (stdio_file::puts) ... this.  Adjust.
3914         (stdio_file_isatty): Delete.
3915         (stdio_file_fseek): Delete.
3916         (stdio_file::isatty): New.
3917         (stderr_file_write): Rename to ...
3918         (stderr_file::write) ... this.  Adjust.
3919         (stderr_file_fputs): Rename to ...
3920         (stderr_file::puts) ... this.  Adjust.
3921         (stderr_fileopen, stdio_fileopen, gdb_fopen): Delete.
3922         (stderr_file::stderr_file): New.
3923         (tee_file_magic): Delete.
3924         (struct tee_file): Delete.
3925         (tee_file::tee_file): New.
3926         (tee_file_new): Delete.
3927         (tee_file::~tee_file): New.
3928         (tee_file_delete): Delete.
3929         (tee_file_flush): Rename to ...
3930         (tee_file::flush): ... this.  Adjust.
3931         (tee_file_write): Rename to ...
3932         (tee_file::write): ... this.  Adjust.
3933         (tee_file::write_async_safe): New.
3934         (tee_file_fputs): Rename to ...
3935         (tee_file::puts): ... this.  Adjust.
3936         (tee_file_isatty): Rename to ...
3937         (tee_file::isatty): ... this.  Adjust.
3938         * ui-file.h (struct obstack, struct ui_file): Don't
3939         forward-declare.
3940         (ui_file_new, ui_file_flush_ftype, set_ui_file_flush)
3941         (ui_file_write_ftype)
3942         (set_ui_file_write, ui_file_fputs_ftype, set_ui_file_fputs)
3943         (ui_file_write_async_safe_ftype, set_ui_file_write_async_safe)
3944         (ui_file_read_ftype, set_ui_file_read, ui_file_isatty_ftype)
3945         (set_ui_file_isatty, ui_file_rewind_ftype, set_ui_file_rewind)
3946         (ui_file_put_method_ftype, ui_file_put_ftype, set_ui_file_put)
3947         (ui_file_delete_ftype, set_ui_file_data, ui_file_fseek_ftype)
3948         (set_ui_file_fseek): Delete.
3949         (ui_file_data, ui_file_delete, ui_file_rewind)
3950         (struct ui_file): New.
3951         (ui_file_up): New.
3952         (class null_file): New.
3953         (null_stream): Declare.
3954         (ui_file_write_for_put, ui_file_put): Delete.
3955         (ui_file_xstrdup, ui_file_as_string, ui_file_obsavestring):
3956         Delete.
3957         (ui_file_fseek, mem_fileopen, stdio_fileopen, stderr_fileopen)
3958         (gdb_fopen, tee_file_new): Delete.
3959         (struct string_file): New.
3960         (struct stdio_file): New.
3961         (stdio_file_up): New.
3962         (struct stderr_file): New.
3963         (class tee_file): New.
3964         * ui-out.c (ui_out::field_stream): Take a 'string_file &' instead
3965         of a 'ui_file *'.  Adjust.
3966         * ui-out.h (class ui_out) <field_stream>: Likewise.
3967         * utils.c (do_ui_file_delete, make_cleanup_ui_file_delete)
3968         (null_stream): Delete.
3969         (error_stream): Take a 'string_file &' instead of a 'ui_file *'.
3970         Adjust.
3971         * utils.h (struct ui_file): Delete forward declaration..
3972         (make_cleanup_ui_file_delete, null_stream): Delete declarations.
3973         (error_stream): Take a 'string_file &' instead of a
3974         'ui_file *'.
3975         * varobj.c (varobj_value_get_print_value): Use string_file.
3976         * xtensa-tdep.c (xtensa_verify_config): Use string_file.
3977         * gdbarch.c: Regenerate.
3978
3979 2017-02-02  Pedro Alves  <palves@redhat.com>
3980
3981         * disasm.c (gdb_disassembler::pretty_print_insn): Rename to...
3982         (gdb_pretty_print_insn): ... this.  Now a free function.  Add back
3983         a 'gdbarch' parameter.  Allocate a mem_fileopen stream here.
3984         Adjust to call gdb_print_insn instead of
3985         gdb_disassembler::print_insn.
3986         (dump_insns, do_mixed_source_and_assembly_deprecated)
3987         (do_mixed_source_and_assembly, do_assembly_only): Add back a
3988         'gdbarch' parameter.  Remove gdb_disassembler parameter.
3989         (gdb_disassembly): Don't allocate a gdb_disassembler here.
3990         * disasm.h (gdb_disassembler::pretty_print_insn): Delete
3991         declaration.
3992         (gdb_pretty_print_insn): Re-add declaration.
3993         * record-btrace.c (btrace_insn_history): Don't allocate a
3994         gdb_disassembler here.  Adjust to call gdb_pretty_print_insn.
3995
3996 2017-02-01  Simon Marchi  <simon.marchi@polymtl.ca>
3997
3998         * disasm.h (gdb_disassembly): Remove file_string parameter.
3999         * disasm.c (gdb_disassembly): Likewise.
4000         * cli/cli-cmds.c (print_disassembly): Adapt.
4001         * mi/mi-cmd-disas.c (mi_cmd_disassemble): Likewise.
4002         * stack.c (do_gdb_disassembly): Likewise.
4003
4004 2017-02-01  Andreas Arnez  <arnez@linux.vnet.ibm.com>
4005
4006         * dwarf2loc.c (dwarf2_evaluate_loc_desc_full): For
4007         DWARF_VALUE_LITERAL, no longer ignore the offset on big-endian
4008         targets.  And if the implicit value is longer than needed, extract
4009         the first bytes instead of the "least significant" ones.
4010
4011 2017-02-01  Markus Metzger  <markus.t.metzger@intel.com>
4012
4013         * btrace.c (btrace_enable): Do not call btrace_add_pc for
4014         BTRACE_FORMAT_PT or if can_access_registers_ptid returns false.
4015         (btrace_fetch): Assert can_access_registers_ptid.
4016         * record-btrace.c (require_btrace_thread, record_btrace_info): Call
4017         validate_registers_access.
4018
4019 2017-02-01  Markus Metzger  <markus.t.metzger@intel.com>
4020
4021         * gdbthread.h (can_access_registers_ptid): New.
4022         * thread.c (can_access_registers_ptid): New.
4023
4024 2017-02-01  Pedro Alves  <palves@redhat.com>
4025
4026         * i386-tdep.c (i386_fast_tracepoint_valid_at): Use gdb_insn_length.
4027
4028 2017-01-31  Pedro Alves  <palves@redhat.com>
4029
4030         * mi/mi-interp.c (mi_breakpoint_created, mi_breakpoint_modified):
4031         Fix typos.
4032
4033 2017-01-31  Pedro Alves  <palves@redhat.com>
4034
4035         * stack.c (print_frame_args): Remove local mem_fileopen stream,
4036         not used.
4037
4038 2017-01-31  Pedro Alves  <palves@redhat.com>
4039
4040         * varobj.c (varobj_value_get_print_value): Remove xstrdup call.
4041
4042 2017-01-31  Pedro Alves  <palves@redhat.com>
4043
4044         * common/scoped_restore.h
4045         (scoped_restore_tmpl::scoped_restore_tmpl): Template on T2, and
4046         change the value's parameter type to T2.
4047         (make_scoped_restore): Likewise.
4048
4049 2017-01-27  Walfred Tedeschi  <walfred.tedeschi@intel.com>
4050             Richard Henderson  <rth@redhat.com>
4051
4052         * amd64-linux-nat.c (PTRACE_ARCH_PRCTL): New define.
4053         (amd64_linux_fetch_inferior_registers): Add case to fetch FS_BASE
4054         GS_BASE for older kernels.
4055         (amd64_linux_store_inferior_registers): Add case to store FS_BASE
4056         GS_BASE for older kernels.
4057         * amd64-linux-tdep.c (amd64_linux_gregset_reg_offset): Add FS_BASE
4058         and GS_BASE to the offset table.
4059         (amd64_linux_register_reggroup_p): Add FS_BASE and GS_BASE to the
4060         system register group.
4061         * amd64-nat.c (amd64_native_gregset_reg_offset): Implements case
4062         for older kernels.
4063         * amd64-tdep.c (amd64_init_abi): Add segment registers for the
4064         amd64 ABI.
4065         * amd64-tdep.h (amd64_regnum): Add AMD64_FSBASE_REGNUM and
4066         AMD64_GSBASE_REGNUM.
4067         (AMD64_NUM_REGS): Set to AMD64_GSBASE_REGNUM + 1.
4068         * features/Makefile (amd64-linux.dat, amd64-avx-linux.dat)
4069         (amd64-mpx-linux.dat, amd64-avx512-linux.dat, x32-linux.dat)
4070         (x32-avx-linux.dat, x32-avx512-linux.dat): Add
4071         i386/64bit-segments.xml in those rules.
4072         * features/i386/64bit-segments.xml: New file.
4073         * features/i386/amd64-avx-mpx-linux.xml: Add 64bit-segments.xml.
4074         * features/i386/amd64-avx-linux.xml: Add 64bit-segments.xml.
4075         * features/i386/amd64-avx512-linux.xml: Add 64bit-segments.xml.
4076         * features/i386/amd64-mpx-linux.xml: Add 64bit-segments.xml.
4077         * features/i386/x32-avx512-linux.xml: Add 64bit-segments.xml.
4078         * features/i386/x32-avx-linux.xml: Add 64bit-segments.xml.
4079         * features/i386/amd64-linux.xml: Add 64bit-segments.xml.
4080         * features/i386/amd64-avx-linux.c: Regenerated.
4081         * features/i386/amd64-avx-mpx-linux.c: Regenerated.
4082         * features/i386/amd64-avx-mpx.c: Regenerated.
4083         * features/i386/amd64-avx512-linux.c: Regenerated.
4084         * features/i386/amd64-linux.c: Regenerated.
4085         * features/i386/amd64-mpx-linux.c: Regenerated.
4086         * features/i386/i386-avx-mpx-linux.c: Regenerated.
4087         * features/i386/i386-avx-mpx.c: Regenerated.
4088         * features/i386/x32-avx-linux.c: Regenerated.
4089         * features/i386/x32-avx512-linux.c: Regenerated.
4090         * regformats/i386/amd64-avx-linux.dat: Regenerated.
4091         * regformats/i386/amd64-avx-mpx-linux.dat: Regenerated.
4092         * regformats/i386/amd64-avx512-linux.dat: Regenerated.
4093         * regformats/i386/amd64-linux.dat: Regenerated.
4094         * regformats/i386/amd64-mpx-linux.dat: Regenerated.
4095         * regformats/i386/x32-avx-linux.dat: Regenerated.
4096         * regformats/i386/x32-avx512-linux.dat: Regenerated.
4097         * regformats/i386/x32-linux.dat: Regenerated.
4098
4099 2017-01-27  Walfred Tedeschi  <walfred.tedeschi@intel.com>
4100
4101         * amd64-linux-tdep.h (AMD64_LINUX_ORIG_RAX_REGNUM):
4102         Set to AMD64_NUM_REGS.
4103
4104 2017-01-27  Walfred Tedeschi  <walfred.tedeschi@intel.com>
4105
4106         * amd64-nat.c (amd64_native_gregset_reg_offset): Simplify logic
4107         that checks validity of a register number.
4108
4109 2017-01-27  Kees Cook  <keescook@google.com>
4110
4111         * gdb/arm-linux-nat.c (arm_linux_fetch_inferior_registers): Call
4112         fetch_fpregs if target has fpa registers.
4113         (arm_linux_store_inferior_registers): Call store_fpregs if target
4114         has fpa registers.
4115
4116 2017-01-26  Andreas Arnez  <arnez@linux.vnet.ibm.com>
4117
4118         * cris-tdep.c (cris_gdbarch_init): Remove check for
4119         info.byte_order and force it to BFD_ENDIAN_LITTLE.
4120
4121 2017-01-26  Antoine Tremblay  <antoine.tremblay@ericsson.com>
4122
4123         * corelow.c (get_core_register_section): Check for regset
4124         existence before checking for REGSET_VARIABLE_SIZE.
4125
4126 2017-01-26  Yao Qi  <yao.qi@linaro.org>
4127             Pedro Alves  <palves@redhat.com>
4128
4129         PR gdb/20939
4130         * disasm.c (gdb_disassembler::dis_asm_memory_error): Don't
4131         call memory_error, save memaddr instead.
4132         (gdb_disassembler::print_insn): If gdbarch_print_insn returns
4133         negative, cal memory_error.
4134         * disasm.h (gdb_disassembler) <m_err_memaddr>: New field.
4135
4136 2017-01-26  Yao Qi  <yao.qi@linaro.org>
4137
4138         * disasm-selftests.c (memory_error_test): New function.
4139         (_initialize_disasm_selftests): Register memory_error_test.
4140
4141 2017-01-26  Yao Qi  <yao.qi@linaro.org>
4142
4143         * Makefile.in (SFILES): Add disasm-selftests.c and
4144         selftest-arch.c.
4145         (COMMON_OBS): Add disasm-selftests.o and selftest-arch.o.
4146         * disasm-selftests.c: New file.
4147         * selftest-arch.c: New file.
4148         * selftest-arch.h: New file.
4149
4150 2017-01-26  Yao Qi  <yao.qi@linaro.org>
4151
4152         * mep-tdep.c (mep_gdb_print_insn): Set info->arch
4153         to bfd_arch_mep.  Don't return 0 if section is not
4154         found.  Call print_insn_mep.
4155
4156 2017-01-26  Pedro Alves  <palves@redhat.com>
4157             Yao Qi  <yao.qi@linaro.org>
4158
4159         * arm-tdep.c: Include "disasm.h".
4160         (gdb_print_insn_arm): Update code to get gdbarch.
4161         * disasm.c (dis_asm_read_memory): Change it to
4162         gdb_disassembler::dis_asm_read_memory.
4163         (dis_asm_memory_error): Likewise.
4164         (dis_asm_print_address): Likewise.
4165         (gdb_pretty_print_insn): Change it to
4166         gdb_disassembler::pretty_print_insn.
4167         (dump_insns): Add one argument gdb_disassemlber.  All
4168         callers updated.
4169         (do_mixed_source_and_assembly_deprecated): Likewise.
4170         (do_mixed_source_and_assembly): Likewise.
4171         (do_assembly_only): Likewise.
4172         (gdb_disassembler::gdb_disassembler): New.
4173         (gdb_disassembler::print_insn): New.
4174         * disasm.h (class gdb_disassembler): New.
4175         (gdb_pretty_print_insn): Remove declaration.
4176         (gdb_disassemble_info): Likewise.
4177         * guile/scm-disasm.c (class gdbscm_disassembler): New.
4178         (gdbscm_disasm_read_memory_worker): Update.
4179         (gdbscm_disasm_read_memory): Update.
4180         (gdbscm_disasm_memory_error): Remove.
4181         (gdbscm_disasm_print_address): Remove.
4182         (gdbscm_disassembler::gdbscm_disassembler): New.
4183         (gdbscm_print_insn_from_port): Update.
4184         * mips-tdep.c: Include disasm.h.
4185         (gdb_print_insn_mips): Update code to get gdbarch.
4186         * record-btrace.c (btrace_insn_history): Update.
4187         * spu-tdep.c: Include disasm.h.
4188         (struct spu_dis_asm_data): Remove.
4189         (struct spu_dis_asm_info): New.
4190         (spu_dis_asm_print_address): Use spu_dis_asm_info to get
4191         SPU id.
4192         (gdb_print_insn_spu): Cast disassemble_info to
4193         spu_dis_asm_info.
4194
4195 2017-01-26  Yao Qi  <yao.qi@linaro.org>
4196
4197         * disasm.c (do_ui_file_delete): Delete.
4198         (gdb_insn_length): Move code creating stream to ...
4199         * utils.c (null_stream): ... here.  New function.
4200         * utils.h (null_stream): Declare.
4201
4202 2017-01-23  Simon Marchi  <simon.marchi@polymtl.ca>
4203
4204         * python/py-inferior.c (find_thread_object): Return directly
4205         from the loop.  Remove "found" variable.
4206
4207 2017-01-21  Joel Brobecker  <brobecker@adacore.com>
4208
4209         GDB 7.12.1 released.
4210
4211 2017-01-20  Simon Marchi  <simon.marchi@ericsson.com>
4212
4213         * python/py-function.c (fnpy_call): Reorder declarations to have
4214         the gdbpy_enter object declared first.
4215         * python/py-xmethods.c (gdbpy_get_xmethod_arg_types): Likewise.
4216
4217 2017-01-20  Simon Marchi  <simon.marchi@ericsson.com>
4218
4219         PR python/21068
4220         * python/python-internal.h (PyMem_RawMalloc): Define for
4221         Python < 3.4.
4222         * python/py-gdb-readline.c (gdbpy_readline_wrapper): Use
4223         PyMem_RawMalloc instead of PyMem_Malloc.
4224
4225 2017-01-20  Mike Wrighton  <mike_wrighton@codesourcery.com>
4226             Luis Machado  <lgustavo@codesourcery.com>
4227
4228         * NEWS (New commands): Mention flash-erase.
4229         (New MI commands): Mention target-flash-erase.
4230         * mi/mi-cmds.c (mi_cmd_target_flash_erase): Add target-flash-erase MI
4231         command.
4232         * mi/mi-cmds.h (mi_cmd_target_flash_erase): New declaration.
4233         * mi/mi-main.c (mi_cmd_target_flash_erase): New function.
4234         * target.c (flash_erase_command): New function.
4235         (initialize_targets): Add new flash-erase command.
4236         * target.h (flash_erase_command): New declaration.
4237
4238 2017-01-20  Joel Brobecker  <brobecker@adacore.com>
4239
4240         * nat/linux-ptrace.c: Only include <sys/procfs.h> if
4241         HAVE_SYS_PROCFS_H is defined.
4242
4243 2017-01-18  Alan Hayward  <alan.hayward@arm.com>
4244
4245         * remote.c (struct cached_reg): Change data into a pointer.
4246         * (stop_reply_dtr): Free data pointers before deleting vector.
4247         (process_stop_reply): Likewise.
4248         (remote_parse_stop_reply): Allocate space for data
4249
4250 2017-01-18  Alan Hayward  <alan.hayward@arm.com>
4251
4252         * amd64-tdep.c (amd64_pseudo_register_read_value): remove
4253         MAX_REGISTER_SIZE.
4254         (amd64_pseudo_register_read_value): Likewise.
4255         * remote.c (fetch_register_using_p): Remove MAX_REGISTER_SIZE.
4256         (store_register_using_P): Likewise.
4257         * regcache.c (regcache_xfer_part): Likewise.
4258
4259 2017-01-16  Ivo Raisr  <ivo.raisr@oracle.com>
4260
4261         Split real and pseudo registers.
4262         * sparc-tdep.h (SPARC_CORE_REGISTERS): New macro.
4263         (sparc32_pseudo_regnum): New enum.
4264         * sparc64-tdep.h (sparc64_pseudo_regnum): New enum.
4265         * sparc-tdep.c (SPARC32_FPU_REGISTERS): New macro.
4266         (SPARC32_CP0_REGISTERS): New macro.
4267         (sparc32_pseudo_register_name): New function.
4268         (sparc32_register_name): Use sparc32_pseudo_register_name.
4269         (sparc32_pseudo_register_type): New function.
4270         (sparc32_register_type): Use sparc32_pseudo_register_type.
4271         (sparc32_pseudo_register_read, sparc32_pseudo_register_write): Handle
4272         pseudo register numbers.
4273         * sparc64-tdep.c SPARC64_FPU_REGISTERS): New macro.
4274         (SPARC64_CP0_REGISTERS): New macro.
4275         (sparc64_pseudo_register_name): New function.
4276         (sparc64_register_name): Use sparc64_pseudo_register_name.
4277         (sparc64_pseudo_register_type): New function.
4278         (sparc64_register_type): Use sparc64_pseudo_register_type.
4279         (sparc64_pseudo_register_read, sparc64_pseudo_register_write): Handle
4280         pseudo register numbers.
4281         (sparc64_store_floating_fields, sparc64_extract_floating_fields,
4282         sparc64_store_arguments): Handle pseudo register numbers.
4283
4284 2017-01-13  Yao Qi  <yao.qi@linaro.org>
4285
4286         * remote.c (REMOTE_DEBUG_MAX_CHAR): New macro.
4287         (putpkt_binary): Print only REMOTE_DEBUG_MAX_CHAR chars in debug
4288         output.
4289         (getpkt_or_notif_sane_1): Likewise.
4290
4291 2017-01-13  Yao Qi  <yao.qi@linaro.org>
4292
4293         * Makefile.in (checker-headers): Use CXX and CXX_DIALET instead
4294         of CC.  Pass "-x c++-header" instead of "-x c".
4295
4296 2017-01-12  Simon Marchi  <simon.marchi@ericsson.com>
4297
4298         * remote.c (remote_can_async_p): Update comment.
4299
4300 2017-01-12  Simon Marchi  <simon.marchi@ericsson.com>
4301
4302         * linux-nat.c (linux_nat_can_async_p): Update comment.
4303
4304 2017-01-12  Simon Marchi  <simon.marchi@ericsson.com>
4305
4306         * serial.c (serial_open): Forget about "pc" and "lpt" serial interface.
4307
4308 2017-01-11  Simon Marchi  <simon.marchi@ericsson.com>
4309
4310         * cli/cli-decode.c (lookup_cmd_1): Fix typo in comment.
4311
4312 2017-01-10  Tom Tromey  <tom@tromey.com>
4313
4314         * python/py-type.c (typy_legacy_template_argument): Update.
4315         * cp-support.h (struct demangle_parse_info) (demangle_parse_info,
4316         ~demangle_parse_info): Declare new members.
4317         (cp_demangled_name_to_comp): Return unique_ptr.
4318         (cp_demangled_name_parse_free)
4319         (make_cleanup_cp_demangled_name_parse_free)
4320         (cp_new_demangle_parse_info): Remove.
4321         * cp-support.c (do_demangled_name_parse_free_cleanup)
4322         (make_cleanup_cp_demangled_name_parse_free): Remove.
4323         (inspect_type, cp_canonicalize_string_full)
4324         (cp_canonicalize_string): Update.
4325         (mangled_name_to_comp): Change return type.
4326         (cp_class_name_from_physname, method_name_from_physname)
4327         (cp_func_name, cp_remove_params): Update.
4328         * cp-name-parser.y (demangle_parse_info): New constructor, from
4329         cp_new_demangle_parse_info.
4330         (~demangle_parse_info): New destructor, from
4331         cp_demangled_name_parse_free.
4332         (cp_merge_demangle_parse_infos): Update.
4333         (cp_demangled_name_to_comp): Change return type.
4334
4335 2017-01-10  Tom Tromey  <tom@tromey.com>
4336
4337         * top.c (prevent_dont_repeat): Change return type.
4338         * python/python.c (execute_gdb_command): Use std::string.
4339         Update.
4340         * guile/guile.c (gdbscm_execute_gdb_command): Update.
4341         * command.h (prevent_dont_repeat): Change return type.
4342         * breakpoint.c (bpstat_do_actions_1): Update.
4343
4344 2017-01-10  Tom Tromey  <tom@tromey.com>
4345
4346         * value.h (scoped_value_mark::~scoped_value_mark): Call
4347         free_to_mark.
4348         (scoped_value_mark::free_to_mark): New method.
4349         * dwarf2loc.c (dwarf2_evaluate_loc_desc_full): Use
4350         scoped_value_mark.
4351
4352 2017-01-10  Tom Tromey  <tom@tromey.com>
4353
4354         * python/py-value.c (valpy_dereference, valpy_referenced_value)
4355         (valpy_reference_value, valpy_const_value, valpy_get_address)
4356         (valpy_get_dynamic_type, valpy_lazy_string, valpy_do_cast)
4357         (valpy_getitem, valpy_call, valpy_binop_throw, valpy_negative)
4358         (valpy_absolute, valpy_richcompare_throw): Use scoped_value_mark.
4359         * dwarf2loc.c (dwarf2_loc_desc_get_symbol_read_needs): Use
4360         scoped_value_mark.
4361         * dwarf2-frame.c (execute_stack_op): Use scoped_value_mark.
4362         * value.h (scoped_value_mark): New class.
4363
4364 2017-01-10  Tom Tromey  <tom@tromey.com>
4365
4366         * dwarf2read.c (dwarf2_build_psymtabs): Use psymtab_discarder.
4367         * psympriv.h (make_cleanup_discard_psymtabs): Don't declare.
4368         * psymtab.c (discard_psymtabs_upto): Remove.
4369         (make_cleanup_discard_psymtabs): Remove.
4370         (struct psymtab_state): Remove.
4371
4372 2017-01-10  Tom Tromey  <tom@tromey.com>
4373
4374         * record-full.c (record_full_save_cleanups): Remove.
4375         (record_full_save): Use gdb::unlinker.
4376         * gcore.c (do_bfd_delete_cleanup): Remove.
4377         (gcore_command): Use gdb::unlinker, unique_xmalloc_ptr.  Remove
4378         cleanups.
4379         * dwarf2read.c (unlink_if_set): Remove.
4380         (write_psymtabs_to_index): Use gdb::unlinker.
4381         * common/gdb_unlinker.h: New file.
4382
4383 2017-01-10  Tom Tromey  <tom@tromey.com>
4384
4385         * windows-tdep.c (windows_xfer_shared_library): Update.
4386         * windows-nat.c (windows_make_so): Update.
4387         * utils.h (make_cleanup_bfd_unref): Remove.
4388         * utils.c (do_bfd_close_cleanup, make_cleanup_bfd_unref): Remove.
4389         * symfile.h (symfile_bfd_open)
4390         (find_separate_debug_file_in_section): Return gdb_bfd_ref_ptr.
4391         * symfile.c (read_symbols, symbol_file_add)
4392         (separate_debug_file_exists): Update.
4393         (symfile_bfd_open): Return gdb_bfd_ref_ptr.
4394         (generic_load, reread_symbols): Update.
4395         * symfile-mem.c (symbol_file_add_from_memory): Update.
4396         * spu-linux-nat.c (spu_bfd_open): Return gdb_bfd_ref_ptr.
4397         (spu_symbol_file_add_from_memory): Update.
4398         * solist.h (struct target_so_ops) <bfd_open>: Return
4399         gdb_bfd_ref_ptr.
4400         (solib_bfd_fopen, solib_bfd_open): Return gdb_bfd_ref_ptr.
4401         * solib.c (solib_bfd_fopen, solib_bfd_open): Return
4402         gdb_bfd_ref_ptr.
4403         (solib_map_sections, reload_shared_libraries_1): Update.
4404         * solib-svr4.c (enable_break): Update.
4405         * solib-spu.c (spu_bfd_fopen): Return gdb_bfd_ref_ptr.
4406         * solib-frv.c (enable_break2): Update.
4407         * solib-dsbt.c (enable_break): Update.
4408         * solib-darwin.c (gdb_bfd_mach_o_fat_extract): Return
4409         gdb_bfd_ref_ptr.
4410         (darwin_solib_get_all_image_info_addr_at_init): Update.
4411         (darwin_bfd_open): Return gdb_bfd_ref_ptr.
4412         * solib-aix.c (solib_aix_bfd_open): Return gdb_bfd_ref_ptr.
4413         * record-full.c (record_full_save): Update.
4414         * python/py-objfile.c (objfpy_add_separate_debug_file): Update.
4415         * procfs.c (insert_dbx_link_bpt_in_file): Update.
4416         * minidebug.c (find_separate_debug_file_in_section): Return
4417         gdb_bfd_ref_ptr.
4418         * machoread.c (macho_add_oso_symfile): Change abfd to
4419         gdb_bfd_ref_ptr.
4420         (macho_symfile_read_all_oso): Update.
4421         (macho_check_dsym): Return gdb_bfd_ref_ptr.
4422         (macho_symfile_read): Update.
4423         * jit.c (bfd_open_from_target_memory): Return gdb_bfd_ref_ptr.
4424         (jit_bfd_try_read_symtab): Update.
4425         * gdb_bfd.h (gdb_bfd_open, gdb_bfd_fopen, gdb_bfd_openr)
4426         (gdb_bfd_openw, gdb_bfd_openr_iovec)
4427         (gdb_bfd_openr_next_archived_file, gdb_bfd_fdopenr): Return
4428         gdb_bfd_ref_ptr.
4429         (gdb_bfd_ref_policy): New struct.
4430         (gdb_bfd_ref_ptr): New typedef.
4431         * gdb_bfd.c (gdb_bfd_open, gdb_bfd_fopen, gdb_bfd_openr)
4432         (gdb_bfd_openw, gdb_bfd_openr_iovec)
4433         (gdb_bfd_openr_next_archived_file, gdb_bfd_fdopenr): Return
4434         gdb_bfd_ref_ptr.
4435         * gcore.h (create_gcore_bfd): Return gdb_bfd_ref_ptr.
4436         * gcore.c (create_gcore_bfd): Return gdb_bfd_ref_ptr.
4437         (gcore_command): Update.
4438         * exec.c (exec_file_attach): Update.
4439         * elfread.c (elf_symfile_read): Update.
4440         * dwarf2read.c (dwarf2_get_dwz_file): Update.
4441         (try_open_dwop_file, open_dwo_file): Return gdb_bfd_ref_ptr.
4442         (open_and_init_dwo_file): Update.
4443         (open_dwp_file): Return gdb_bfd_ref_ptr.
4444         (open_and_init_dwp_file): Update.
4445         * corelow.c (core_open): Update.
4446         * compile/compile-object-load.c (compile_object_load): Update.
4447         * common/gdb_ref_ptr.h (ref_ptr::operator->): New operator.
4448         * coffread.c (coff_symfile_read): Update.
4449         * cli/cli-dump.c (bfd_openr_or_error, bfd_openw_or_error): Return
4450         gdb_bfd_ref_ptr.  Rename.
4451         (dump_bfd_file, restore_command): Update.
4452         * build-id.h (build_id_to_debug_bfd): Return gdb_bfd_ref_ptr.
4453         * build-id.c (build_id_to_debug_bfd): Return gdb_bfd_ref_ptr.
4454         (find_separate_debug_file_by_buildid): Update.
4455
4456 2017-01-10  Tom Tromey  <tom@tromey.com>
4457
4458         * common/gdb_ref_ptr.h: New file.
4459         * python/py-ref.h (struct gdbpy_ref_policy): New.
4460         (gdbpy_ref): Now a typedef.
4461
4462 2017-01-10  Tom Tromey  <tom@tromey.com>
4463
4464         * utils.h (make_cleanup_htab_delete): Don't declare.
4465         * utils.c (do_htab_delete_cleanup, make_cleanup_htab_delete):
4466         Remove.
4467         * linespec.c (decode_compound_collector): Add constructor,
4468         destructor.
4469         (lookup_prefix_sym): Remove cleanup.
4470         (symtab_collector): Add constructor, destructor.
4471         (collect_symtabs_from_filename): Remove cleanup.
4472         * disasm.c (do_mixed_source_and_assembly): Use htab_up.
4473         * compile/compile-c-symbols.c (generate_c_for_variable_locations):
4474         Use htab_up.
4475         * gnu-v3-abi.c (gnuv3_print_vtable): Use htab_up.
4476         * dwarf2read.c (dw2_expand_symtabs_matching)
4477         (dw2_map_symbol_filenames, dwarf_decode_macros)
4478         (write_psymtabs_to_index): Use htab_up.
4479         * dwarf2loc.c (func_verify_no_selftailcall)
4480         (call_site_find_chain_1, func_verify_no_selftailcall)
4481         (chain_candidate, call_site_find_chain_1): Use std::unordered_set,
4482         std::vector, gdb::unique_xmalloc_ptr.
4483         (call_sitep): Remove typedef.
4484         (dwarf2_locexpr_baton_eval): Remove unused variable.
4485
4486 2017-01-10  Tom Tromey  <tom@tromey.com>
4487
4488         * python/python-internal.h (make_cleanup_py_decref)
4489         (make_cleanup_py_xdecref): Don't declare.
4490         * python/py-utils.c (py_decref, make_cleanup_py_decref)
4491         (py_xdecref, make_cleanup_py_xdecref): Remove.
4492
4493 2017-01-10  Tom Tromey  <tom@tromey.com>
4494
4495         * python/py-framefilter.c (py_mi_print_variables): Use gdbpy_ref.
4496         (py_print_locals, enumerate_locals, py_print_args): Use gdbpy_ref.
4497
4498 2017-01-10  Tom Tromey  <tom@tromey.com>
4499
4500         * python/py-framefilter.c (enumerate_args): Use gdbpy_ref.
4501
4502 2017-01-10  Tom Tromey  <tom@tromey.com>
4503
4504         * python/py-utils.c (unicode_to_encoded_string)
4505         (python_string_to_target_string)
4506         (python_string_to_target_python_string)
4507         (python_string_to_host_string, gdbpy_obj_to_string)
4508         (get_addr_from_python): Use gdbpy_ref.
4509
4510 2017-01-10  Tom Tromey  <tom@tromey.com>
4511
4512         * python/py-unwind.c (pyuw_object_attribute_to_pointer): Use
4513         gdbpy_ref.
4514
4515 2017-01-10  Tom Tromey  <tom@tromey.com>
4516
4517         * python/python.c (eval_python_command, gdbpy_decode_line)
4518         (gdbpy_run_events, gdbpy_start_type_printers)
4519         (gdbpy_apply_type_printers): Use gdbpy_ref.
4520
4521 2017-01-10  Tom Tromey  <tom@tromey.com>
4522
4523         * python/py-param.c (get_doc_string, compute_enum_values): Use
4524         gdbpy_ref.
4525
4526 2017-01-10  Tom Tromey  <tom@tromey.com>
4527
4528         * python/py-inferior.c (find_thread_object, build_inferior_list):
4529         Use gdbpy_ref.
4530
4531 2017-01-10  Tom Tromey  <tom@tromey.com>
4532
4533         * python/py-framefilter.c (py_print_frame): Use gdbpy_ref.
4534
4535 2017-01-10  Tom Tromey  <tom@tromey.com>
4536
4537         * python/py-finishbreakpoint.c (bpfinishpy_out_of_scope): Use
4538         gdbpy_ref.
4539
4540 2017-01-10  Tom Tromey  <tom@tromey.com>
4541
4542         * python/py-cmd.c (cmdpy_completer_helper): Use gdbpy_ref.  Remove
4543         extra incref.
4544         (cmdpy_completer_handle_brkchars, cmdpy_completer, cmdpy_init):
4545         Use gdbpy_ref.
4546
4547 2017-01-10  Tom Tromey  <tom@tromey.com>
4548
4549         * python/py-breakpoint.c (gdbpy_breakpoint_cond_says_stop): Use
4550         gdbpy_ref.
4551
4552 2017-01-10  Tom Tromey  <tom@tromey.com>
4553
4554         * python/py-arch.c (archpy_disassemble): Use gdbpy_ref.  Don't
4555         decref results of PyArg_ParseTupleAndKeywords.
4556
4557 2017-01-10  Tom Tromey  <tom@tromey.com>
4558
4559         * python/python.c (python_run_simple_file): Use
4560         unique_xmalloc_ptr, gdbpy_ref.
4561
4562 2017-01-10  Tom Tromey  <tom@tromey.com>
4563
4564         * python/py-prettyprint.c (print_stack_unless_memory_error)
4565         (print_string_repr, print_children): Use gdbpy_ref.
4566         (dummy_python_frame): New class.
4567         (dummy_python_frame::dummy_python_frame): Rename from
4568         push_dummy_python_frame.
4569         (py_restore_tstate): Remove.
4570
4571 2017-01-10  Tom Tromey  <tom@tromey.com>
4572
4573         * python/py-framefilter.c (py_print_frame): Use gdbpy_ref.
4574
4575 2017-01-10  Tom Tromey  <tom@tromey.com>
4576
4577         * python/python.c (ensure_python_env, restore_python_env):
4578         Remove.
4579         * python/python-internal.h (ensure_python_env): Don't declare.
4580         * varobj.h (varobj_ensure_python_env): Don't declare.
4581         * varobj.c (varobj_ensure_python_env): Remove.
4582
4583 2017-01-10  Tom Tromey  <tom@tromey.com>
4584
4585         * varobj.c (varobj_value_get_print_value): Use
4586         gdbpy_enter_varobj.
4587
4588 2017-01-10  Tom Tromey  <tom@tromey.com>
4589
4590         * python/py-prettyprint.c (print_string_repr, print_children):
4591         Update.
4592         * python/py-lazy-string.c (gdbpy_extract_lazy_string): Change type
4593         of "encoding".
4594         * varobj.c (varobj_value_get_print_value): Update.
4595         * python/python-internal.h (gdbpy_extract_lazy_string): Update.
4596
4597 2017-01-10  Tom Tromey  <tom@tromey.com>
4598
4599         * varobj.c (varobj_get_display_hint)
4600         (dynamic_varobj_has_child_method, install_new_value_visualizer)
4601         (varobj_set_visualizer, free_variable): Use
4602         gdbpy_enter_varobj.
4603
4604 2017-01-10  Tom Tromey  <tom@tromey.com>
4605
4606         * python/python.c (python_command): Use gdbpy_enter, gdbpy_ref.
4607         (do_finish_initialization): New function.  Use gdbpy_ref.
4608         (gdbpy_finish_initialization): Use gdbpy_enter.  Call
4609         do_finish_initialization.
4610
4611 2017-01-10  Tom Tromey  <tom@tromey.com>
4612
4613         * python/py-param.c (get_set_value, get_show_value): Use
4614         gdbpy_enter, gdbpy_ref.
4615
4616 2017-01-10  Tom Tromey  <tom@tromey.com>
4617
4618         * python/py-function.c (fnpy_call): Use gdbpy_enter, gdbpy_ref.
4619
4620 2017-01-10  Tom Tromey  <tom@tromey.com>
4621
4622         * python/py-cmd.c (cmdpy_function): Use gdbpy_enter, gdbpy_ref.
4623
4624 2017-01-10  Tom Tromey  <tom@tromey.com>
4625
4626         * python/py-varobj.c (py_varobj_iter_dtor, py_varobj_iter_next):
4627         Use gdbpy_enter_varobj.
4628
4629 2017-01-10  Tom Tromey  <tom@tromey.com>
4630
4631         * varobj.c (gdbpy_enter_varobj): New constructor.
4632         * python/python-internal.h (gdbpy_enter_varobj): New class.
4633         * python/py-varobj.c (py_varobj_get_iterator): Use
4634         gdbpy_enter_varobj.
4635
4636 2017-01-10  Tom Tromey  <tom@tromey.com>
4637
4638         * python/py-xmethods.c (gdbpy_get_xmethod_result_type): Use
4639         gdbpy_enter, gdbpy_ref, unique_xmalloc_ptr.
4640         (gdbpy_invoke_xmethod): Use gdbpy_ref, gdbpy_enter.
4641         (gdbpy_get_xmethod_arg_types): Use gdbpy_ref,
4642         unique_xmalloc_ptr.
4643         (gdbpy_get_xmethod_arg_types): Use gdbpy_ref, gdbpy_enter.
4644
4645 2017-01-10  Tom Tromey  <tom@tromey.com>
4646
4647         * python/py-xmethods.c (invoke_match_method): Use
4648         gdbpy_ref.
4649
4650 2017-01-10  Tom Tromey  <tom@tromey.com>
4651
4652         * python/py-xmethods.c (gdbpy_get_matching_xmethod_workers): use
4653         gdbpy_enter, gdbpy_ref.
4654
4655 2017-01-10  Tom Tromey  <tom@tromey.com>
4656
4657         * python/python.c (python_interactive_command): Use gdbpy_enter.
4658
4659 2017-01-10  Tom Tromey  <tom@tromey.com>
4660
4661         * python/python.c (gdbpy_before_prompt_hook): Use gdbpy_enter,
4662         gdbpy_ref.
4663
4664 2017-01-10  Tom Tromey  <tom@tromey.com>
4665
4666         * python/py-prettyprint.c (gdbpy_apply_val_pretty_printer): Use
4667         gdbpy_enter, gdbpy_ref, unique_xmalloc_ptr.
4668
4669 2017-01-10  Tom Tromey  <tom@tromey.com>
4670
4671         * utils.h (htab_deleter): New struct.
4672         (htab_up): New typedef.
4673         * python/py-framefilter.c (gdbpy_apply_frame_filter): Use
4674         gdbpy_enter, gdbpy_ref, htab_up.
4675
4676 2017-01-10  Tom Tromey  <tom@tromey.com>
4677
4678         * python/py-unwind.c (pending_frame_invalidate): Remove.
4679         (pyuw_sniffer): Use gdbpy_enter and gdbpy_ref.
4680
4681 2017-01-10  Tom Tromey  <tom@tromey.com>
4682
4683         * python/py-xmethods.c (gdbpy_free_xmethod_worker_data)
4684         (gdbpy_clone_xmethod_worker_data): Use gdbpy_enter.
4685
4686 2017-01-10  Tom Tromey  <tom@tromey.com>
4687
4688         * python/py-type.c (save_objfile_types): Use gdbpy_enter.
4689
4690 2017-01-10  Tom Tromey  <tom@tromey.com>
4691
4692         * python/python.c (gdbpy_eval_from_control_command)
4693         (gdbpy_source_script, gdbpy_run_events)
4694         (gdbpy_source_objfile_script, gdbpy_execute_objfile_script)
4695         (gdbpy_free_type_printers, gdbpy_finish_initialization): Use
4696         gdbpy_enter.
4697
4698 2017-01-10  Tom Tromey  <tom@tromey.com>
4699
4700         * python/py-progspace.c (py_free_pspace): Use gdbpy_enter.
4701
4702 2017-01-10  Tom Tromey  <tom@tromey.com>
4703
4704         * python/py-objfile.c (py_free_objfile): Use gdbpy_enter.
4705
4706 2017-01-10  Tom Tromey  <tom@tromey.com>
4707
4708         * python/py-inferior.c (python_on_normal_stop, python_on_resume)
4709         (python_on_inferior_call_pre, python_on_inferior_call_post)
4710         (python_on_memory_change, python_on_register_change)
4711         (python_inferior_exit, python_new_objfile, add_thread_object)
4712         (delete_thread_object, py_free_inferior): Use gdbpy_enter.
4713
4714 2017-01-10  Tom Tromey  <tom@tromey.com>
4715
4716         * python/py-finishbreakpoint.c (bpfinishpy_handle_stop)
4717         (bpfinishpy_handle_exit): Use gdbpy_enter.
4718
4719 2017-01-10  Tom Tromey  <tom@tromey.com>
4720
4721         * python/py-cmd.c (cmdpy_destroyer)
4722         (cmdpy_completer_handle_brkchars, cmdpy_completer): Use
4723         gdbpy_enter.
4724
4725 2017-01-10  Tom Tromey  <tom@tromey.com>
4726
4727         * python/py-breakpoint.c (gdbpy_breakpoint_cond_says_stop): Use
4728         gdbpy_enter.
4729         (gdbpy_breakpoint_has_cond): Likewise.
4730
4731 2017-01-10  Tom Tromey  <tom@tromey.com>
4732
4733         * python/python.c (gdbpy_enter): New constructor.
4734         (~gdbpy_enter): New destructor.
4735         (restore_python_env, ensure_python_env): Rewrite.
4736         * python/python-internal.h (gdbpy_enter): New class.
4737
4738 2017-01-10  Tom Tromey  <tom@tromey.com>
4739
4740         * python/py-symbol.c (gdbpy_lookup_symbol): Use gdbpy_ref.
4741
4742 2017-01-10  Tom Tromey  <tom@tromey.com>
4743
4744         * python/py-value.c (value_has_field, get_field_flag)
4745         (get_field_type, valpy_getitem, convert_value_from_python): Use
4746         gdbpy_ref.
4747
4748 2017-01-10  Tom Tromey  <tom@tromey.com>
4749
4750         * python/python.c (gdbpy_progspaces, gdbpy_objfiles): Use
4751         gdbpy_ref.
4752
4753 2017-01-10  Tom Tromey  <tom@tromey.com>
4754
4755         * python/py-prettyprint.c (search_pp_list)
4756         (find_pretty_printer_from_objfiles)
4757         (find_pretty_printer_from_progspace)
4758         (find_pretty_printer_from_gdb, find_pretty_printer)
4759         (gdbpy_get_display_hint, gdbpy_get_varobj_pretty_printer): Use
4760         gdbpy_ref.
4761
4762 2017-01-10  Tom Tromey  <tom@tromey.com>
4763
4764         * python/py-param.c (call_doc_function): Use gdbpy_ref.
4765
4766 2017-01-10  Tom Tromey  <tom@tromey.com>
4767
4768         * python/py-linetable.c (build_line_table_tuple_from_pcs)
4769         (ltpy_get_all_source_lines): Use gdbpy_ref.
4770
4771 2017-01-10  Tom Tromey  <tom@tromey.com>
4772
4773         * python/py-framefilter.c (extract_sym, extract_value)
4774         (get_py_iter_from_func, bootstrap_python_frame_filters): Use
4775         gdbpy_ref.
4776
4777 2017-01-10  Tom Tromey  <tom@tromey.com>
4778
4779         * python/py-breakpoint.c (gdbpy_breakpoints): Use gdbpy_ref.
4780
4781 2017-01-10  Tom Tromey  <tom@tromey.com>
4782
4783         * python/py-inferior.c (gdbpy_inferiors): Use gdbpy_ref.
4784
4785 2017-01-10  Tom Tromey  <tom@tromey.com>
4786
4787         * python/py-function.c (convert_values_to_python, fnpy_init): Use
4788         gdbpy_ref.
4789
4790 2017-01-10  Tom Tromey  <tom@tromey.com>
4791
4792         * python/py-cmd.c (gdbpy_string_to_argv): Use gdbpy_ref.
4793
4794 2017-01-10  Tom Tromey  <tom@tromey.com>
4795
4796         * python/py-type.c (convert_field, make_fielditem, typy_fields)
4797         (typy_range): Use gdbpy_ref.
4798
4799 2017-01-10  Tom Tromey  <tom@tromey.com>
4800
4801         * python/py-threadevent.c (create_thread_event_object): Use
4802         gdbpy_ref.
4803         * python/py-stopevent.c (create_stop_event_object): Simplify.
4804         (emit_stop_event): Use gdbpy_ref.
4805         * python/py-signalevent.c (create_signal_event_object): Use
4806         gdbpy_ref.
4807         * python/py-newobjfileevent.c (create_new_objfile_event_object)
4808         (emit_new_objfile_event, create_clear_objfiles_event_object)
4809         (emit_clear_objfiles_event): Use gdbpy_ref.
4810         * python/py-infevents.c (create_inferior_call_event_object)
4811         (create_register_changed_event_object)
4812         (create_memory_changed_event_object, emit_inferior_call_event)
4813         (emit_memory_changed_event, emit_register_changed_event): Use
4814         gdbpy_ref.
4815         * python/py-exitedevent.c (create_exited_event_object)
4816         (emit_exited_event): Use gdbpy_ref.
4817         * python/py-event.h (evpy_emit_event): Remove
4818         CPYCHECKER_STEALS_REFERENCE_TO_ARG annotation.
4819         * python/py-event.c (evpy_emit_event): Use gdbpy_ref.
4820         * python/py-continueevent.c (emit_continue_event): Use
4821         gdbpy_ref.
4822         * python/py-breakpoint.c (gdbpy_breakpoint_created)
4823         (gdbpy_breakpoint_deleted, gdbpy_breakpoint_modified): Use
4824         gdbpy_ref.
4825         * python/py-bpevent.c (create_breakpoint_event_object): Use
4826         gdbpy_ref.
4827
4828 2017-01-10  Tom Tromey  <tom@tromey.com>
4829
4830         * python/py-ref.h: New file.
4831
4832 2017-01-10  Simon Marchi  <simon.marchi@ericsson.com>
4833
4834         * cli-out.c (cli_ui_out::do_redirect): Change return type to
4835         void.
4836         * cli-out.h (cli_ui_out::do_redirect): Likewise.
4837         * mi/mi-out.c (mi_ui_out::do_redirect): Likewise.
4838         * mi/mi-out.h (mi_ui_out::do_redirect): Likewise.
4839         * ui-out.c (ui_out::redirect): Likewise.
4840         * ui-out.h (ui_out::redirect, ui_out::do_redirect): Likewise.
4841         * cli/cli-logging.c (set_logging_redirect): Update call site of
4842         ui_out::redirect.
4843         (handle_redirections): Likewise.
4844         * scm-ports.c (ioscm_with_output_to_port_worker): Likewise.
4845         * top.c (execute_command_to_string): Likewise.
4846         * utils.c (do_ui_out_redirect_pop): Likewise.
4847
4848 2017-01-10  Simon Marchi  <simon.marchi@ericsson.com>
4849
4850         * stack.c (_initialize_stack): Update "frame" command help message.
4851
4852 2017-01-08  Iain Buclaw  <ibuclaw@gdcproject.org>
4853
4854         * d-exp.y (CastExpression): Emit UNOP_CAST_TYPE.
4855
4856 2017-01-06  Yao Qi  <yao.qi@linaro.org>
4857
4858         * x86-linux-nat.h: Include gdb_proc_service.h.
4859
4860 2017-01-06  Yao Qi  <yao.qi@linaro.org>
4861
4862         * ser-base.h: Include serial.h.
4863
4864 2017-01-06  Yao Qi  <yao.qi@linaro.org>
4865
4866         * ppc-linux-tdep.h: Include ppc-tdep.h.
4867
4868 2017-01-06  Yao Qi  <yao.qi@linaro.org>
4869
4870         * nat/amd64-linux-siginfo.h: Include signal.h.
4871
4872 2017-01-06  Yao Qi  <yao.qi@linaro.org>
4873
4874         * nat/aarch64-linux-hw-point.h: Include break-common.h.
4875
4876 2017-01-06  Yao Qi  <yao.qi@linaro.org>
4877
4878         * mi/mi-parse.h: Include mi-cmds.h.
4879
4880 2017-01-06  Yao Qi  <yao.qi@linaro.org>
4881
4882         * inf-loop.c: Don't include "target.h".
4883         * inf-loop.h: Include it here.
4884
4885 2017-01-06  Yao Qi  <yao.qi@linaro.org>
4886
4887         * dfp.h: Include "dboulest.h" and "expression.h".
4888
4889 2017-01-06  Yao Qi  <yao.qi@linaro.org>
4890
4891         * ax-gdb.h: Include "ax.h".
4892
4893 2017-01-06  Yao Qi  <yao.qi@linaro.org>
4894
4895         * Makefile.in (HFILES_NO_SRCDIR): Replace gdb_ptrace.h
4896         with nat/gdb_ptrace.h.
4897
4898 2017-01-05  Yao Qi  <yao.qi@linaro.org>
4899
4900         * mips-fbsd-tdep.c (mips_fbsd_sigframe_init): Move && to
4901         new line.
4902         (mips64_fbsd_sigframe_init): Likewise.
4903
4904 2017-01-04  John Baldwin  <jhb@FreeBSD.org>
4905
4906         * mips-fbsd-tdep.c (_initialize_mips_fbsd_tdep): Use
4907         GDB_OSABI_FREEBSD instead of GDB_OSABI_FREEBSD_ELF.
4908
4909 2017-01-04  John Baldwin  <jhb@FreeBSD.org>
4910
4911         * Makefile.in (ALLDEPFILES): Add mips-fbsd-nat.c.
4912         * NEWS: Mention new FreeBSD/mips native configuration.
4913         * config/mips/fbsd.mh: New file.
4914         * configure.host: Add mips*-*-freebsd*.
4915         * mips-fbsd-nat.c: New file.
4916
4917 2017-01-04  John Baldwin  <jhb@FreeBSD.org>
4918
4919         * Makefile.in (ALL_TARGET_OBS): Add mips-fbsd-tdep.o.
4920         (ALLDEPFILES): Add mips-fbsd-tdep.c.
4921         * NEWS: Mention new FreeBSD/mips target.
4922         * configure.tgt: Add mips*-*-freebsd*.
4923         * mips-fbsd-tdep.c: New file.
4924         * mips-fbsd-tdep.h: New file.
4925
4926 2017-01-04  Yao Qi  <yao.qi@linaro.org>
4927
4928         * dwarf2loc.c (write_pieced_value): Don't use VALUE_FRAME_ID (to),
4929         use c->frame_id when the piece location is DWARF_VALUE_REGISTER.
4930
4931 2017-01-01  Joel Brobecker  <brobecker@adacore.com>
4932
4933         Update copyright year range in all GDB files.
4934
4935 2017-01-01  Joel Brobecker  <brobecker@adacore.com>
4936
4937         * config/djgpp/fnchange.lst: Add entry for gdb/ChangeLog-2016.
4938
4939 For older changes see ChangeLog-2016.
4940 \f
4941 Local Variables:
4942 mode: change-log
4943 left-margin: 8
4944 fill-column: 74
4945 version-control: never
4946 coding: utf-8
4947 End: