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