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