aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2017-10-03Update my email address.Jim Wilson2-1/+5
sim/ * MAINTAINERS (aarch64): Update my email address.
2017-10-03Fix incorrect string_printf use in utils.cTom Tromey2-1/+5
I made a mistake earlier and used string_printf where I should have used string_vprintf. I'm checking this in as obvious. 2017-10-03 Tom Tromey <tom@tromey.com> * utils.c (internal_vproblem): Use string_vprintf.
2017-10-03Use std::string in info_symbol_commandTom Tromey2-9/+11
This removes a cleanup by using std::string in info_symbol_command. 2017-10-03 Tom Tromey <tom@tromey.com> * printcmd.c (info_symbol_command): Use std::string.
2017-10-03Use std::string in gdb_safe_append_historyTom Tromey2-14/+14
This removes a cleanup by using std::string in gdb_safe_append_history. 2017-10-03 Tom Tromey <tom@tromey.com> * top.c (gdb_safe_append_history): Use std::string.
2017-10-03Remove make_delete_ui_cleanupTom Tromey5-75/+57
This removes new_ui and delete_ui in favor of ordinary 'new' and 'delete', and then removes make_delete_ui_cleanup in favor of std::unique_ptr. 2017-10-03 Tom Tromey <tom@tromey.com> * event-top.c (stdin_event_handler): Update. * main.c (captured_main_1): Update. * top.h (make_delete_ui_cleanup): Remove. (struct ui): Add constructor and destructor. (new_ui, delete_ui): Remove. * top.c (make_delete_ui_cleanup): Remove. (new_ui_command): Use std::unique_ptr. (delete_ui_cleanup): Remove. (ui::ui): Rename from new_ui. Update. (free_ui): Remove. (ui::~ui): Rename from delete_ui. Update.
2017-10-03Use gdb::byte_vector in load_progressTom Tromey2-5/+8
This changes load_progress to use gdb::byte_vector, removing a cleanup. 2017-10-03 Tom Tromey <tom@tromey.com> * symfile.c (load_progress): Use gdb::byte_vector.
2017-10-03Remove unused declarationsTom Tromey4-3/+7
This removes some unused cleanup declarations. 2017-10-03 Tom Tromey <tom@tromey.com> * mi/mi-main.c (mi_cmd_trace_frame_collected): Remove unused declaration. * printcmd.c (x_command): Remove unused declaration. * symfile.c (symbol_file_command): Remove unused declaration.
2017-10-03Use std::string in utils.cTom Tromey2-29/+26
This converts internal_vproblem and defaulted_query to use std::string. 2017-10-03 Tom Tromey <tom@tromey.com> * utils.c (internal_vproblem): Use std::string. (defaulted_query): Likewise.
2017-10-03Remove set_batch_flag_and_make_cleanup_restore_page_infoTom Tromey5-84/+57
This removes set_batch_flag_and_make_cleanup_restore_page_info and make_cleanup_restore_page_info in favor of a new RAII class. This then allows for the removal of make_cleanup_restore_uinteger and make_cleanup_restore_integer ChangeLog 2017-10-03 Tom Tromey <tom@tromey.com> * guile/scm-ports.c (ioscm_with_output_to_port_worker): Update. * top.c (execute_command_to_string): Update. * utils.c (make_cleanup_restore_page_info): Remove. (do_restore_page_info_cleanup): Remove. (set_batch_flag_and_restore_page_info): New. (make_cleanup_restore_page_info): Remove. (set_batch_flag_and_make_cleanup_restore_page_info): Remove. (~set_batch_flag_and_restore_page_info): New (make_cleanup_restore_uinteger): Remove. (make_cleanup_restore_integer): Remove. (struct restore_integer_closure): Remove. (restore_integer): Remove. * utils.h (struct set_batch_flag_and_restore_page_info): New class. (set_batch_flag_and_make_cleanup_restore_page_info): Remove. (make_cleanup_restore_page_info): Remove. (make_cleanup_restore_uinteger) Remove. (make_cleanup_restore_integer) Remove.
2017-10-03Change record_full_gdb_operation_disable_set not to return a cleanupTom Tromey4-31/+32
This changes record_full_gdb_operation_disable_set to return a scoped_restore rather than a cleanup, and fixes all the users. ChangeLog 2017-10-03 Tom Tromey <tom@tromey.com> * record-full.h (record_full_gdb_operation_disable_set): Return scoped_restore_tmpl<int>. * infrun.c (adjust_pc_after_break): Update. (handle_signal_stop): Update. * record-full.c (record_full_gdb_operation_disable_set): Return scoped_restore_tmpl<int>. (record_full_wait_1, record_full_insert_breakpoint) (record_full_remove_breakpoint, record_full_save) (record_full_goto_insn): Update.
2017-10-03PR21294, Binary size regression on PPC embeddedAlan Modra2-1/+8
PR 21294 * NEWS: Note that defaulting to -z relro results in increased memory and disk size.
2017-10-03Automatic date update in version.inGDB Administrator1-1/+1
2017-10-03ld -z relro documentationAlan Modra2-6/+18
* ld.texinfo (-z relro): Expand description. (DATA_SEGMENT_ALIGN): Note that -z relro is not effective when running with system page size larger than commonpagesize. (DATA_SEGMENT_RELRO_END): Be explicit about the alignment.
2017-10-02Fix &str printing in RustTom Tromey5-8/+48
Printing a string slice ("&str") in Rust would print until the terminating \0; but that is incorrect because a slice has a length. This fixes &str printing, and arranges to preserve the type name when slicing a slice, so that printing a slice of an "&str" works as well. This is PR rust/22236. 2017-10-02 Tom Tromey <tom@tromey.com> PR rust/22236: * rust-lang.c (rust_val_print_str): New function. (val_print_struct): Call it. (rust_subscript): Preserve name of slice type. 2017-10-02 Tom Tromey <tom@tromey.com> PR rust/22236: * gdb.rust/simple.rs (main): New variable "fslice". * gdb.rust/simple.exp: Add slice tests. Update string tests.
2017-10-02Fix ptype of Rust slicesTom Tromey4-3/+67
Something like "ptype &x[..]" (where "x" was a slice) would crash gdb. rust_subscript wasn't handling slicing in the EVAL_AVOID_SIDE_EFFECTS case. 2017-10-02 Tom Tromey <tom@tromey.com> * rust-lang.c (rust_subscript): Handle slices in EVAL_AVOID_SIDE_EFFECTS case. 2017-10-02 Tom Tromey <tom@tromey.com> * gdb.rust/simple.exp: Test ptype of a slice.
2017-10-02Allow indexing of &str in RustTom Tromey4-1/+12
rust_slice_type_p was not recognizing &str as a slice type, so indexing into (or making a slice of) a slice was not working. 2017-10-02 Tom Tromey <tom@tromey.com> * rust-lang.c (rust_slice_type_p): Recognize &str as a slice type. 2017-10-02 Tom Tromey <tom@tromey.com> * gdb.rust/simple.exp: Test index of slice.
2017-10-02Add missing "extern" in rust-lang.hTom Tromey2-2/+6
I noticed that one function in rust-lang.h was not declared using "extern". In the interested of uniformity, this patch adds it. Tested by rebuilding. 2017-10-02 Tom Tromey <tom@tromey.com> * rust-lang.h (rust_slice_type): Add "extern".
2017-10-02Fix GDB build with G++ 4.8Pedro Alves3-4/+12
G++ 4.8 trips on: In file included from /opt/gcc-4.8/include/c++/4.8.5/algorithm:62:0, from ../../src/gdb/ada-lang.c:65: /opt/gcc-4.8/include/c++/4.8.5/bits/stl_algo.h: In instantiation of ‘_RandomAccessIterator std::__unguarded_partition(_RandomAccessIterator, _RandomAccessIterator, const _Tp&) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator<ada_exc_info*, std::vector<ada_exc_info> >; _Tp = ada_exc_info]’: /opt/gcc-4.8/include/c++/4.8.5/bits/stl_algo.h:2283:70: required from ‘_RandomAccessIterator std::__unguarded_partition_pivot(_RandomAccessIterator, _RandomAccessIterator) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator<ada_exc_info*, std::vector<ada_exc_info> >]’ /opt/gcc-4.8/include/c++/4.8.5/bits/stl_algo.h:2315:54: required from ‘void std::__introsort_loop(_RandomAccessIterator, _RandomAccessIterator, _Size) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator<ada_exc_info*, std::vector<ada_exc_info> >; _Size = long int]’ /opt/gcc-4.8/include/c++/4.8.5/bits/stl_algo.h:5461:36: required from ‘void std::sort(_RAIter, _RAIter) [with _RAIter = __gnu_cxx::__normal_iterator<ada_exc_info*, std::vector<ada_exc_info> >]’ ../../src/gdb/ada-lang.c:13153:61: required from here /opt/gcc-4.8/include/c++/4.8.5/bits/stl_algo.h:2245:19: error: passing ‘const ada_exc_info’ as ‘this’ argument of ‘bool ada_exc_info::operator<(const ada_exc_info&)’ discards qualifiers [-fpermissive] while (__pivot < *__last) ^ Seems to be a libstdc++ bug meanwhile fixed by: https://gcc.gnu.org/ml/libstdc++/2012-04/msg00074. In any case, there's no reason these methods can't be const. gdb/ChangeLog: 2017-10-02 Tom Tromey <tom@tromey.com> Pedro Alves <palves@redhat.com> * ada-lang.h (ada_exc_info::operator<): Make const. (ada_exc_info::operator==): Make const. * ada-lang.c (ada_exc_info::operator<, ada_exc_info::operator==): Make const.
2017-10-02nto & lynx x86: call init_target_descSimon Marchi3-2/+17
In gdbserver, target descriptions need to be initialized by calling init_target_desc. Because i386_create_target_description is shared with GDB, it doesn't do that, the callers must take care of it. These two platforms currently don't. I am not able to build them, so I couldn't test. gdb/gdbserver/ChangeLog: * lynx-i386-low.c (lynx_i386_arch_setup): Call init_target_desc. * nto-x86-low.c (nto_x86_arch_setup): Likewise.
2017-10-02Fix powerpc comment typoAlan Modra3-2/+7
* elf32-ppc.c (ppc_elf_relocate_section): Fix comment typo. * elf64-ppc.c (ppc64_elf_relocate_section): Likewise.
2017-10-02Automatic date update in version.inGDB Administrator1-1/+1
2017-10-01PR22232, NULL pointer dereference in load_specific_debug_sectionAlan Modra2-2/+10
PR 22232 PR 22230 * objdump.c (load_specific_debug_section): Introduce a temp to stop bfd_get_full_section_contents NULLing out section->start.
2017-10-01PR21970, assertion failed when more than one overlay has subalign specifiedAlan Modra2-0/+6
PR 21970 * ldlang.c (lang_leave_overlay): Reset overlay_subalign.
2017-10-01PR21957, addr2line incorrectly handles non-increasing sequences in line tableAlan Modra2-4/+9
PR 21957 * dwarf2.c (new_line_sorts_after): Remove end_sequence comparison. (add_line_info): Always put end_sequence last.
2017-10-01Add new mnemonics for VLE multiple load instructionsAlexander Fedotov6-0/+86
opcodes/ * ppc-opc.c (vle_opcodes): Add e_lmvsprw, e_lmvgprw, e_lmvsrrw, e_lmvcsrrw and e_lmvcsrrw as official mnemonics for VLE multimple load/store instructions. Old e_ldm* variants are kept as aliases. Add missing e_lmvmcsrrw and e_stmvmcsrrw. gas/ * testsuite/gas/ppc/vle-mult-ld-st-insns.s: New file: Tests the support for the VLE multiple load/store instructions. * testsuite/gas/ppc/vle-mult-ld-st-insns.d: New file: Test driver. * testsuite/gas/ppc/ppc.exp: Run it.
2017-10-01PR22047, Heap out of bounds read in parse_comp_unitAlan Modra2-38/+22
Like the PR22230 fix, we can allocate a buffer with an extra byte rather than letting bfd_simple_get_relocated_section_contents malloc and return a buffer. Much better than allocating another buffer afterwards. PR 22047 * dwarf2.c (read_section): Allocate buffer with extra byte for bfd_simple_get_relocated_section_contents rather than copying afterwards.
2017-10-01PR22230, buffer overflow in display_debug_macroAlan Modra2-4/+11
PR 22230 * objdump.c (load_specific_debug_section): Allocate an extra byte for a terminating NUL.
2017-10-01Automatic date update in version.inGDB Administrator1-1/+1
2017-09-30Add a test for PR binutils/21978H.J. Lu5-0/+20
PR binutils/21978 * testsuite/ld-elf/pr21978.od: New file. * testsuite/ld-elf/pr21978a.c: Likewise. * testsuite/ld-elf/pr21978b.c: Likewise. * testsuite/ld-elf/shared.exp: Run PR binutils/21978 test.
2017-09-29Remove free_memory_read_result_vectorTom Tromey4-96/+66
This changes read_memory_robust to return a std::vector, allowing the removal of free_memory_read_result_vector and associated cleanups. This patch also changes the functions it touches to be a bit more robust with regards to deallocation; it's perhaps possible that read_memory_robust could have leaked in some situations. This patch is based on my earlier series to remove some MI cleanups. Regression tested by the buildbot. gdb/ChangeLog 2017-09-29 Tom Tromey <tom@tromey.com> * target.c (read_whatever_is_readable): Change type of "result". Update. (free_memory_read_result_vector): Remove. (read_memory_robust): Change return type. Update. * mi/mi-main.c (mi_cmd_data_read_memory_bytes): Update. Use bin2hex, std::string. * target.h (memory_read_result_s): Remove typedef. (free_memory_read_result_vector): Remove. (read_memory_robust): Return std::vector.
2017-09-29Change captured_mi_execute_command to use scoped_restoreTom Tromey2-6/+7
Change captured_mi_execute_command to use a scoped_restore, removing a cleanup. The old code copied the current token, but I don't believe that is necessary. gdb/ChangeLog 2017-09-29 Tom Tromey <tom@tromey.com> * mi/mi-main.c (captured_mi_execute_command): Use scope_restore.
2017-09-29Use a std::vector for ada_exceptions_listTom Tromey4-71/+61
Change ada_exceptions_list to return a std::vector and fix up the users. This allows removing a cleanup in MI. gdb/ChangeLog 2017-09-29 Tom Tromey <tom@tromey.com> * mi/mi-cmd-info.c (mi_cmd_info_ada_exceptions): Update. * ada-lang.h (struct ada_exc_info): Remove typedef. Declare operator< and operator==. (ada_exceptions_list): Return a std::vector. * ada-lang.c (ada_exc_info::operator<): Rename from compare_ada_exception_info. (ada_exc_info::operator==): New. (sort_remove_dups_ada_exceptions_list): Change type of "exceptions". (ada_add_standard_exceptions, ada_add_exceptions_from_frame) (ada_add_global_exceptions): Likewise. (ada_exceptions_list_1): Return a std::vector. (ada_exceptions_list): Likewise.
2017-09-29Use std::set in mi-main.cTom Tromey2-59/+31
Change a couple of spots in mi-main.c to use std::set. This simplifies the code and removes some cleanups. gdb/ChangeLog 2017-09-29 Tom Tromey <tom@tromey.com> * mi/mi-main.c (struct print_one_inferior_data) <inferiors>: Now a 'std::set *'. (print_one_inferior): Update. (free_vector_of_ints): Remove. (list_available_thread_groups): Change "ids" to std::set. (mi_cmd_list_thread_groups): Update. (struct collect_cores_data) <core>: Now a std::set. (collect_cores): Update. (unique): Remove. (print_one_inferior): Update.
2017-09-29Use std::string in mi-main.cTom Tromey2-31/+16
Change a couple of spots in mi-main.c to use std::string, and change one place to use field_fmt. This removes some cleanups. gdb/ChangeLog 2017-09-29 Tom Tromey <tom@tromey.com> * mi/mi-main.c (mi_execute_cli_command): Use std::string. (mi_execute_async_cli_command): Likewise. (mi_cmd_trace_frame_collected): Use field_fmt.
2017-09-29Use gdb::byte_vector in mi_cmd_data_write_memory_bytesTom Tromey2-13/+12
This changes mi_cmd_data_write_memory_bytes to use gdb::byte_vector, removing some cleanups. gdb/ChangeLog 2017-09-29 Tom Tromey <tom@tromey.com> * mi/mi-main.c (mi_cmd_data_write_memory_bytes): Use gdb::byte_vector.
2017-09-29Remove unused declarationTom Tromey2-1/+4
There was a leftover cleanup declaration in mi_parse. Remove it. gdb/ChangeLog 2017-09-29 Tom Tromey <tom@tromey.com> * mi/mi-parse.c (mi_parse): Remove unused declaration.
2017-09-29Don't copy a string in mi_cmd_disassembleTom Tromey2-5/+5
This string copy in mi_cmd_disassemble seems not to be needed, so don't do it. gdb/ChangeLog 2017-09-29 Tom Tromey <tom@tromey.com> * mi/mi-cmd-disas.c (mi_cmd_disassemble): Don't copy "oarg".
2017-09-29Remove cleanups from mi-cmd-var.cTom Tromey4-34/+20
This removes some cleanups from mi-cmd-var.c. varobj_gen_name now returns a string, simplifying mi_cmd_var_create. In mi_cmd_var_delete, a string copy is apparently unnecessary, so it's simply removed. gdb/ChangeLog 2017-09-29 Tom Tromey <tom@tromey.com> * varobj.h (varobj_gen_name): Return std::string. * varobj.c (varobj_gen_name): Return std::string. * mi/mi-cmd-var.c (mi_cmd_var_create): Use std::string. (mi_cmd_var_delete): Don't copy "name".
2017-09-29Remove cleanups from mi_cmd_break_insert_1Tom Tromey2-30/+25
This changes mi_argv_to_format to return a string, allowing the removal of some cleanups. gdb/ChangeLog 2017-09-29 Tom Tromey <tom@tromey.com> * mi/mi-cmd-break.c (mi_argv_to_format): Return std::string. (mi_cmd_break_insert_1): Update.
2017-09-29Remove make_cleanup_defer_target_commit_resumeTom Tromey4-40/+44
This removes make_cleanup_defer_target_commit_resume in favor of using scoped_restore. gdb/ChangeLog 2017-09-29 Tom Tromey <tom@tromey.com> * target.h (make_scoped_defer_target_commit_resume): Update. * target.c (make_scoped_defer_target_commit_resume): Rename from make_cleanup_defer_target_commit_resume. Return a scoped_restore. * infrun.c (proceed): Use make_scoped_defer_target_commit_resume.
2017-09-29Remove some unused declarationsTom Tromey3-3/+5
This removes a couple of unused cleanup-related declarations. gdb/ChangeLog 2017-09-29 Tom Tromey <tom@tromey.com> * main.c (captured_main_1): Remove unused declaration. * spu-multiarch.c (parse_spufs_run): Remove unused declaration.
2017-09-29Remove a cleanup from symtab.cTom Tromey2-8/+6
This removes an unused outer cleanup from symtab.c, and an unused cleanup declaration as well. gdb/ChangeLog 2017-09-29 Tom Tromey <tom@tromey.com> * symtab.c (search_symbols): Remove unused outer cleanup. (make_source_files_completion_list): Remove unused declaration.
2017-09-29Remove cleanup from mt-tdep.cTom Tromey2-8/+9
Remove a cleanup from mt-tdep.c, using gdb::byte_vector. gdb/ChangeLog 2017-09-29 Tom Tromey <tom@tromey.com> * mt-tdep.c (mt_push_dummy_call): Use gdb::byte_vector.
2017-09-29Remove cleanup from xstormy16-tdep.cTom Tromey2-8/+10
This removes a cleanup from xstormy16-tdep.c, using gdb::byte_vector. gdb/ChangeLog 2017-09-29 Tom Tromey <tom@tromey.com> * xstormy16-tdep.c (xstormy16_push_dummy_call): Use gdb::byte_vector.
2017-09-29Remove cleanup from complaints.cTom Tromey2-6/+7
This removes a cleanup from complaints.c by using std::string. gdb/ChangeLog 2017-09-29 Tom Tromey <tom@tromey.com> * complaints.c (vcomplaint): Use std::string.
2017-09-29Remove some cleanups from tracepoint.cTom Tromey2-30/+18
This removes some cleanups from tracepoint.c by using std::string. It also removes some unused cleanup declarations. gdb/ChangeLog 2017-09-29 Tom Tromey <tom@tromey.com> * tracepoint.c (trace_variable_command): Use std::string. (encode_actions_1): Remove unused declarations. (create_tsv_from_upload): Use std::string.
2017-09-29Remove cleanups from cp-support.cTom Tromey2-15/+14
This removes some cleanups from cp-support.c, using std::string. gdb/ChangeLog 2017-09-29 Tom Tromey <tom@tromey.com> * cp-support.c (gdb_demangle): Use std::string.
2017-09-29Remove some cleanups from stack.cTom Tromey2-15/+10
This removes some cleanups from stack.c by using std::string or gdb::unique_xmalloc_ptr. One cleanup remains in this file; I did not remove it here because it is handled in another patch series that has yet to be resolved. gdb/ChangeLog 2017-09-29 Tom Tromey <tom@tromey.com> * stack.c (parse_frame_specification): Use std::string (info_frame_command): Use gdb::unique_xmalloc_ptr.
2017-09-29Remove cleanup from tilegx-tdep.cTom Tromey2-8/+9
This removes a cleanup from tilegx-tdep.c, by using gdb::byte_vector. gdb/ChangeLog 2017-09-29 Tom Tromey <tom@tromey.com> * tilegx-tdep.c (tilegx_push_dummy_call): Use gdb::byte_vector.
2017-09-29Remove cleanups from utils.cTom Tromey2-16/+12
This removes a couple of cleanups from utils.c through the use of std::string. gdb/ChangeLog 2017-09-29 Tom Tromey <tom@tromey.com> * utils.c (vfprintf_maybe_filtered): Use std::string. (vfprintf_unfiltered): Likewise.