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