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