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