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