summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* Use dlsym to check if libdl is needed for pluginusers/hjl/pr22318H.J. Lu2017-10-186-61/+61
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | config/plugins.m4 has if test "$plugins" = "yes"; then AC_SEARCH_LIBS([dlopen], [dl]) fi Plugin uses dlsym, but libasan.so only intercepts dlopen, not dlsym: [hjl@gnu-tools-1 binutils-text]$ nm -D /lib64/libasan.so.4| grep " dl" 0000000000038580 W dlclose U dl_iterate_phdr 000000000004dc50 W dlopen U dlsym U dlvsym [hjl@gnu-tools-1 binutils-text]$ Testing dlopen for libdl leads to false negative when -fsanitize=address is used. It results in link failure: ../bfd/.libs/libbfd.a(plugin.o): undefined reference to symbol 'dlsym@@GLIBC_2.16' dlsym should be used to check if libdl is needed for plugin. bfd/ PR gas/22318 * configure: Regenerated. binutils/ PR gas/22318 * configure: Regenerated. config/ * plugins.m4 (AC_PLUGINS): Use dlsym to check if libdl is needed. gas/ PR gas/22318 * configure: Regenerated. gprof/ PR gas/22318 * configure: Regenerated. ld/ PR gas/22318 * configure: Regenerated.
* tile: Mark __tls_get_addr in gc_mark_hookH.J. Lu2017-10-183-4/+26
| | | | | | | | | | | TLS_GD_CALL relocations implicitly reference __tls_get_addr. Since elf_gc_mark_hook is called before check_relocs now, we need to call _bfd_generic_link_add_one_symbol to mark __tls_get_addr for garbage collection. * elf32-tilepro.c (tilepro_elf_gc_mark_hook): Call _bfd_generic_link_add_one_symbol to mark __tls_get_addr. * elfxx-tilegx.c (tilegx_elf_gc_mark_hook): Likewise.
* RISC-V: Mark unsupported gas testcasesPalmer Dabbelt2017-10-189-1/+38
| | | | | | | | | | | | | | | | | | There are individual comments that explain why each test isn't supported, but the vast majority of them are due to RISC-V's aggressive linker relaxation. The SLEB test cases should eventually be supported, but the remaining ones probably won't ever be. 2017-10-18 Palmer Dabbelt <palmer@dabbelt.com> * testsuite/gas/all/align.d: Mark as unsupported on RISC-V. testsuite/gas/all/relax.d: Likewise. testsuite/gas/all/sleb128-2.d: Likewise. testsuite/gas/all/sleb128-4.d: Likewise. testsuite/gas/all/sleb128-5.d: Likewise. testsuite/gas/all/sleb128-7.d: Likewise. testsuite/gas/elf/section11.d: Likewise. testsuite/gas/all/gas.exp (diff1.s): Likewise.
* Canonicalize conversion operatorsKeith Seitz2017-10-185-2/+40
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Consider a conversion operator such as: operator foo const* const* (); There are two small parser problems, highlighted by this test: (gdb) p operator foo const* const* There is no field named operatorfoo const* const * GDB is looking up the symbol "operatorfoo const* const*" -- it is missing a space between the keyword "operator" and the type name "foo const* const*". Additionally, this input of the user-defined type needs to be canonicalized so that different "spellings" of the type are recognized: (gdb) p operator const foo* const * There is no field named operator const foo* const * gdb/ChangeLog: * c-exp.y (oper): Canonicalize conversion operators of user-defined types. Add whitespace to front of type name. gdb/testsuite/ChangeLog: * gdb.cp/cpexprs.cc (base) <operator fluff const* const*>: New method. (main): Call it. * gdb.cp/cpexprs.exp: Add new conversion operator to test matrix. Add additional user-defined conversion operator tests.
* Issue complaint instead of assert for invalid/unhandled DW_AT_accessibilityKeith Seitz2017-10-182-1/+7
| | | | | | | | | | | | | A previous patch called gdb_assert_not_reached whenever reading the accessibility of a nested typedef definition. Wisely, Pedro has asked me not do this. This patch changes the previous one so that it issues a complaint instead. gdb/ChangeLog: * dwarf2read.c (dwarf2_add_typedef): Issue a complaint on unhandled DW_AT_accessibility.
* [Visium] Disassemble the operands of the stop instruction.Eric Botcazou2017-10-184-1/+10
| | | | | | | binutils/ * MAINTAINERS: Add myself as Visium maintainer. opcodes/ * visium-dis.c (disassem_class1) <case 0>: Print the operands.
* Update Cris assembler tests for checks that now pass where they used to fail.Nick Clifton2017-10-183-6/+9
| | | | | | PR gas/22304 * testsuite/gas/cris/range-err-1.s: Remove spurious xfails. * testsuite/gas/cris/cris.exp: Expect the shexpr-1 test to pass.
* Update the Swedish translation in the GAS subdirectory.Nick Clifton2017-10-182-4238/+6054
| | | | * po/sv.po: Updated Swedish translation.
* Add a warning to the how-to-make-a-release notes to check the permissions on ↵Nick Clifton2017-10-182-5/+17
| | | | | | | the files in the tarball. * README-how-to-make-a-release: A note about checking file and directory permissions.
* Move Svein Seldal to Past Maintainers section.Nick Clifton2017-10-182-1/+5
| | | | * MAINTAINERS: Move Svein Seldal to Past Maintainers section.
* Remove features/tic6x-c62x-linux.cYao Qi2017-10-182-56/+4
| | | | | | | | | | | c40c7bf (Remove features/tic6x-*.c files) doesn't remove features/tic6x-c62x-linux.c. This patch removes it. gdb: 2017-10-18 Yao Qi <yao.qi@linaro.org> * features/tic6x-c62x-linux.c: Remove.
* PR22303, print_core_note out of bounds readAlan Modra2017-10-182-27/+35
| | | | | | | | | | | | | | The print_core_note change here fixes the PR, the rest is making readelf a little more bombproof against maliciously crafted binaries. PR 22303 * readelf.c (print_core_note): Ensure "count" sanity check calculation doesn't overflow. (process_notes_at): Perform note namesz and descsz checks using unsigned comparisons against data remaining. Catch alignment overflow of namesz and descsz too. Don't allocate a temp for terminating "name" when there is space available before descdata.
* microblaze: Check for indirect and warning symbolsH.J. Lu2017-10-172-0/+8
| | | | | | | | Relocations against indirect and warning symbols should be applied to real symbols. * elf32-microblaze.c (microblaze_elf_check_relocs): Check for indirect and warning symbols.
* Automatic date update in version.inGDB Administrator2017-10-181-1/+1
|
* [GOLD] Fix powerpc64 optimization of TOC accessesAlan Modra2017-10-182-2/+9
| | | | | | | | | | | Fixes a thinko. Given code that puts variables into the TOC (a bad idea, but some see the TOC as a small data section) this bug could result in an attempt to optimize a sequence that should not be optimized. * powerpc.cc (Target_powerpc::Scan::local): Correct dst_off calculation for TOC16 relocs. (Target_powerpc::Scan::global): Likewise.
* Really make the native-stdio-gdbserver board non-remotePedro Alves2017-10-172-0/+5
| | | | | | | | | | | I've noticed now that due to a last-minute change, commit 739b3f1d8ff7 ("Make native gdbserver boards no longer be "remote" (in DejaGnu terms)") managed to miss loading "local-board" in the native-stdio-gdbserver board... gdb/testsuite/ChangeLog: 2017-10-17 Pedro Alves <palves@redhat.com> * boards/native-stdio-gdbserver.exp: Load "local-board".
* Add myself as dwarf-mode.el maintainerTom Tromey2017-10-172-0/+5
| | | | | | | | | | In https://sourceware.org/ml/binutils/2017-10/msg00160.html, Nick said I should update MAINTAINERS to mention that I'm the dwarf-mode.el maintainer. So, I'm checking this in. 2017-10-17 Tom Tromey <tom@tromey.com> * MAINTAINERS: Add myself as dwarf-mode.el maintainer.
* Add several "quit with live inferior" testsPedro Alves2017-10-173-0/+210
| | | | | | | | | | | | | | | | | | | | | | | | | | In my multi-target branch, I had managed to break GDB exiting successfuly in response to "quit" or SIGHUP/SIGTERM when: - you're debugging with "target extended-remote", - have more than one inferior loaded in gdb, some running, and at least one not running, and, - quit gdb with the inferior that is not running yet selected. The testsuite still passed cleanly anyway. I only noticed because I was left with a bunch of core dumps in the gdb/testsuite/ directory -- the testsuite infrastructure closes GDB's pty after running each testcase, which results in GDB getting a SIGHUP and should make GDB exit gracefully. If GDB crashes at that point though, there's no indication about it in gdb.sum/gdb.log. This commit adds a multitude of tests exercising quitting GDB with live inferiors, some of which would have caught the problem. gdb/testsuite/ChangeLog: 2017-10-17 Pedro Alves <palves@redhat.com> * gdb.base/quit-live.c: New file. * gdb.base/quit-live.exp: New file.
* Remove cleanups from disasm.cTom Tromey2017-10-172-53/+35
| | | | | | | | | | | | This changes the remaining spots in disasm.c to use the RAII ui-out emitters, removing a few cleanups. This also fixes a regression that Simon pointed out. 2017-10-17 Tom Tromey <tom@tromey.com> * disasm.c (do_mixed_source_and_assembly_deprecated): Use gdb::optional, ui_out_emit_list, ui_out_emit_tuple. (do_mixed_source_and_assembly): Likewise.
* Remove obsolete assertion from regcache.cTom Tromey2017-10-172-1/+4
| | | | | | | | | | | | | | | | When building I got: ../../binutils-gdb/gdb/regcache.c:935:24: error: the address of ‘ssize_t read(int, void*, size_t)’ will never be NULL [-Werror=address] This happens because "read" used to be a parameter to this function, which was then removed; but the assertion wasn't updated. I don't think the assertion is relevant any more, to this removes it. I'm checking it in as obvious. 2017-10-17 Tom Tromey <tom@tromey.com> * regcache.c (regcache::xfer_part): Remove assertion.
* PR22307, Heap out of bounds read in _bfd_elf_parse_gnu_propertiesAlan Modra2017-10-172-9/+15
| | | | | | | | | | | | When adding an unbounded increment to a pointer, you can't just check against the end of the buffer but also must check that overflow doesn't result in "negative" pointer movement. Pointer comparisons are signed. Better, check the increment against the space left using an unsigned comparison. PR 22307 * elf-properties.c (_bfd_elf_parse_gnu_properties): Compare datasz against size left rather than comparing pointers. Reorganise loop.
* Fix double-free corruptionPedro Alves2017-10-172-1/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fixes a double-free regression introduced by commit b7b030adc405 ("Return unique_xmalloc_ptr from target_read_stralloc"): gdb.sum: Running src/gdb/testsuite/gdb.base/catch-syscall.exp ... ERROR: Process no longer exists Valgrind shows: (gdb) catch syscall ==3687== Thread 1: ==3687== Invalid free() / delete / delete[] / realloc() ==3687== at 0x4C29CF0: free (vg_replace_malloc.c:530) ==3687== by 0x610862: xfree(void*) (common-utils.c:101) ==3687== by 0x440D5D: gdb::xfree_deleter<char>::operator()(char*) const (gdb_unique_ptr.h:34) ==3687== by 0x446CC6: std::unique_ptr<char, gdb::xfree_deleter<char> >::reset(char*) (unique_ptr.h:344) ==3687== by 0x81BE50: xml_fetch_content_from_file(char const*, void*) (xml-support.c:1042) ==3687== by 0x81DA86: xml_init_syscalls_info(char const*) (xml-syscall.c:366) ==3687== by 0x81DBDD: init_syscalls_info(gdbarch*) (xml-syscall.c:398) ==3687== by 0x81E131: get_syscall_by_number(gdbarch*, int, syscall*) (xml-syscall.c:599) ==3687== by 0x5BE86F: catch_syscall_command_1(char*, int, cmd_list_element*) (break-catch-syscall.c:481) ==3687== by 0x4B46B1: do_sfunc(cmd_list_element*, char*, int) (cli-decode.c:138) ==3687== by 0x4B76B8: cmd_func(cmd_list_element*, char*, int) (cli-decode.c:1952) ==3687== by 0x7E91C7: execute_command(char*, int) (top.c:615) ==3687== Address 0x14332ae0 is 0 bytes inside a block of size 4,096 free'd ==3687== at 0x4C2AB8B: realloc (vg_replace_malloc.c:785) ==3687== by 0x610792: xrealloc (common-utils.c:62) ==3687== by 0x81BE3E: xml_fetch_content_from_file(char const*, void*) (xml-support.c:1042) ==3687== by 0x81DA86: xml_init_syscalls_info(char const*) (xml-syscall.c:366) ==3687== by 0x81DBDD: init_syscalls_info(gdbarch*) (xml-syscall.c:398) ==3687== by 0x81E131: get_syscall_by_number(gdbarch*, int, syscall*) (xml-syscall.c:599) ==3687== by 0x5BE86F: catch_syscall_command_1(char*, int, cmd_list_element*) (break-catch-syscall.c:481) ==3687== by 0x4B46B1: do_sfunc(cmd_list_element*, char*, int) (cli-decode.c:138) ==3687== by 0x4B76B8: cmd_func(cmd_list_element*, char*, int) (cli-decode.c:1952) ==3687== by 0x7E91C7: execute_command(char*, int) (top.c:615) ==3687== by 0x6A422D: command_handler(char*) (event-top.c:583) ==3687== by 0x6A45F2: command_line_handler(char*) (event-top.c:773) [...] The problem is that if xrealloc decides it needs a new memory block, it frees the previous block/pointer, and then text.reset() frees it again. gdb/ChangeLog: 2017-10-17 Pedro Alves <palves@redhat.com> * xml-support.c (xml_fetch_content_from_file): Call unique_ptr::release() instead unique_ptr::get() when passing through xrealloc.
* Simplify regcache::xfer_partYao Qi2017-10-173-20/+19
| | | | | | | | | | | | | | Since xfer_part is already a class method, and only {raw,cooked}_{read,write} are passed to it. We can remove these two arguments, but add a bool argument is_raw, indicating raw registers or cooked registers are accessed. gdb: 2017-10-17 Yao Qi <yao.qi@linaro.org> * regcache.c (regcache::xfer_part): Remove parameters read and write, add parameter is_raw. All callers are updated.
* [GDBserver] Move aarch64-insn.o to arch/ and remove one Makefile ruleYao Qi2017-10-173-5/+6
| | | | | | | | | gdb/gdbserver: 2017-10-17 Yao Qi <yao.qi@linaro.org> * Makefile.in: Remove one rule. * configure.srv: Rename aarch64-insn.o with arch/aarch64-insn.o.
* [GDBserver] Move arm-linux.o and arm-get-next-pcs.o to arch/Yao Qi2017-10-172-2/+7
| | | | | | | | | gdb/gdbserver: 2017-10-17 Yao Qi <yao.qi@linaro.org> * configure.srv: Rename arm-linux.o with arch/arm-linux.o. Rename arm-get-next-pcs.o with arch/arm-get-next-pcs.o.
* [GDBserver] Move arm.o to arch/arm.oYao Qi2017-10-172-2/+6
| | | | | | | | gdb/gdbserver: 2017-10-17 Yao Qi <yao.qi@linaro.org> * configure.srv: Rename arm.o with arch/arm.o.
* [GDBserver] Replicate src dir in build dirYao Qi2017-10-175-18/+64
| | | | | | | | | | | | | | | | | | | | Similar to f38307f5 (Replicate src dir in build dir), this patch change configure and Makefile to generate object files in arch/ directory. gdb/gdbserver: 2017-10-17 Yao Qi <yao.qi@linaro.org> * Makefile.in (CONFIG_SRC_SUBDIR): New variable. (clean): Remove .o files in CONFIG_SRC_SUBDIR. (distclean): Remove DEPDIR in CONFIG_SRC_SUBDIR. (arch-i386.o, arch-amd64.o): Remove rules. (arch/%.o): New rule. Update POSTCOMPILE and COMPILE.pre. * configure.ac: Invoke AC_CONFIG_COMMANDS. * configure: Re-generated. * configure.srv: Replace arch-i386.o with arch/i386.o. Replace arch-amd64.o with arch/amd64.o.
* PR22306, Invalid free() in slurp_symtab()Alan Modra2017-10-172-15/+36
| | | | | | PR 22306 * aoutx.h (aout_get_external_symbols): Handle stringsize of zero, and error for any other size that doesn't cover the header word.
* Correct -z text and other -z documentationAlan Modra2017-10-172-95/+94
| | | | | | | | | | | -z text applies to all dynamic binaries, not just shared libraries. A lot of the other options needed attention too. * ld.texinfo (-z): Combine negative options with corresponding positive option. Sort the table. Expand and correct "combreloc", "common", "common-page-size", "interpose", "loadfltr", "max-page-size", "muldefs", "nodefaultlib", "nodelete", "nodlopen", "nodump", "noextern-protected-data", "now", "origin", and "text".
* Add missing ChangeLog entries.Keith Seitz2017-10-162-0/+24
|
* Fix segfault processing nios2 pseudo-instructions with too few arguments.Sandra Loosemore2017-10-165-30/+145
| | | | | | | | | | | | | 2017-10-16 Sandra Loosemore <sandra@codesourcery.com> Henry Wong <henry@stuffedcow.net> gas/ * config/tc-nios2.c (nios2_translate_pseudo_insn): Check for correct number of arguments. (md_assemble): Handle failure of nios2_translate_pseudo_insn. * testsuite/gas/nios2/illegal_pseudoinst.l: New file. * testsuite/gas/nios2/illegal_pseudoinst.s: New file. * testsuite/gas/nios2/nios2.exp: Add illegal_pseudoinst test.
* Record and output access specifiers for nested typedefsKeith Seitz2017-10-165-59/+264
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We currently do not record access information for typedefs defined inside classes. Consider: struct foo { typedef int PUBLIC; private: typedef int PRIVATE; PRIVATE b; }; (gdb) ptype foo type = struct foo { private: PRIVATE b; typedef int PRIVATE; typedef int PUBLIC; } This patch fixes this: (gdb) ptype foo type = struct foo { private: PRIVATE b; typedef int PRIVATE; public: typedef int PUBLIC; } gdb/ChangeLog: * c-typeprint.c (enum access_specifier): Moved here from c_type_print_base. (output_access_specifier): New function. (c_type_print_base): Consider typedefs when assessing whether access labels are needed. Use output_access_specifier as needed. Output access specifier for typedefs, if needed. * dwarf2read.c (dwarf2_add_typedef): Record DW_AT_accessibility. * gdbtypes.h (struct typedef_field) <is_protected, is_private>: New fields. (TYPE_TYPEDEF_FIELD_PROTECTED, TYPE_TYPEDEF_FIELD_PRIVATE): New accessor macros. gdb/testsuite/ChangeLog: * gdb.cp/classes.cc (class_with_typedefs, class_with_public_typedef) (class_with_protected_typedef, class_with_private_typedef) (struct_with_public_typedef, struct_with_protected_typedef) (struct_with_private_typedef): New classes/structs. * gdb.cp/classes.exp (test_ptype_class_objects): Add tests for typedefs and access specifiers.
* Automatic date update in version.inGDB Administrator2017-10-171-1/+1
|
* Return unique_xmalloc_ptr from target_fileio_read_strallocTom Tromey2017-10-165-86/+64
| | | | | | | | | | | | | | | Change target_fileio_read_stralloc to return unique_xmalloc_ptr and fix up the callers. This removes a number of cleanups. ChangeLog 2017-10-16 Tom Tromey <tom@tromey.com> * linux-tdep.c (linux_info_proc, linux_find_memory_regions_full) (linux_fill_prpsinfo, linux_vsyscall_range_raw): Update. * target.c (target_fileio_read_stralloc): Update. * sparc64-tdep.c (adi_is_addr_mapped): Update. * target.h (target_fileio_read_stralloc): Return unique_xmalloc_ptr.
* Return unique_xmalloc_ptr from target_read_strallocTom Tromey2017-10-1612-168/+102
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This changes target_read_stralloc to return a unique_xmalloc_ptr, and then fixes all the callers. unique_xmalloc_ptr is used, rather than std::string, because target_read_stralloc gives a special meaning to a NULL return. ChangeLog 2017-10-16 Tom Tromey <tom@tromey.com> * xml-syscall.c (xml_init_syscalls_info): Update. * xml-support.c (xinclude_start_include): Update. (xml_fetch_content_from_file): Return unique_xmalloc_ptr. * xml-support.h (xml_fetch_another): Return unique_xmalloc_ptr. (xml_fetch_content_from_file): Likewise. * osdata.c (get_osdata): Update. * target.h (target_read_stralloc, target_get_osdata): Return unique_xmalloc_ptr. * solib-aix.c (solib_aix_get_library_list): Update. * solib-target.c (solib_target_current_sos): Update. * solib-svr4.c (svr4_current_sos_via_xfer_libraries): Update. * xml-tdesc.c (fetch_available_features_from_target): Update. (target_fetch_description_xml): Update. (file_read_description_xml): Update. * remote.c (remote_get_threads_with_qxfer, remote_memory_map) (remote_traceframe_info, btrace_read_config, remote_read_btrace) (remote_pid_to_exec_file): Update. * target.c (target_read_stralloc): Return unique_xmalloc_ptr. (target_get_osdata): Likewise.
* Simple cleanup removals in remote.cTom Tromey2017-10-162-43/+35
| | | | | | | | | | | | | This removes a few cleanups in remote.c using the usual techniques: std::vector, unique_xmalloc_ptr, and gdb::def_vector. ChangeLog 2017-10-16 Tom Tromey <tom@tromey.com> * remote.c (remote_register_number_and_offset): Use std::vector. (remote_set_syscall_catchpoint): Use gdb::unique_xmalloc_ptr. (putpkt_binary): Use gdb::def_vector. (compare_sections_command): Use gdb::byte_vector.
* Remove cleanup from ppc-linux-nat.cTom Tromey2017-10-162-8/+8
| | | | | | | | | | | | This removes a cleanup from ppc-linux-nat.c, by using unique_xmalloc_ptr. It also slightly simplifies the code by using XDUP rather than XNEW and memcpy. ChangeLog 2017-10-16 Tom Tromey <tom@tromey.com> * ppc-linux-nat.c (hwdebug_insert_point): Use gdb::unique_xmalloc_ptr, XDUP.
* Remove some cleanups from probe.cTom Tromey2017-10-162-20/+10
| | | | | | | | | | | | This removes some cleanups from parse_probes by using std::string; and removes some unnecessary cleanups from elsewhere in probe.c. ChangeLog 2017-10-16 Tom Tromey <tom@tromey.com> * probe.c (parse_probes): Use std::string. (info_probes_for_ops, enable_probes_command) (disable_probes_command): Remove cleanups.
* Use std::vector in end_symtab_get_static_blockTom Tromey2017-10-162-28/+16
| | | | | | | | | | | Change end_symtab_get_static_block to use std::vector. This removes a cleanup. ChangeLog 2017-10-16 Tom Tromey <tom@tromey.com> * buildsym.c (block_compar): Remove. (end_symtab_get_static_block): Use std::vector.
* Make native gdbserver boards no longer be "remote" (in DejaGnu terms)Pedro Alves2017-10-168-124/+157
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This commit finally clears the "isremote" flag in the native-gdbserver and native-stdio-gdbserver boards. The goal is to make all "native" boards be considered not remote in DejaGnu terms, like the native-extended-gdbserver board is too. DejaGnu automatically considers boards remote if their names don't match the local hostname. That means that native-gdbserver and native-extended-gdbserver are considered remote by default by DejaGnu, even though they run locally. native-extended-gdbserver, however, overrides its isremote flag to force it to be not remote. So we are in that weird state where native-gdbserver is considered remote, and native-extended-gdbserver is considered not remote. A recent set of commits fixed all the problems (and some more) exposed by testing with --target_board=native-gdbserver and --target_board=native-stdio-gdbserver with isremote forced off on x86-64 GNU/Linux. I believe we're good to go now. The native-stdio-gdbserver.exp/remote-stdio-gdbserver.exp boards required deep non-obvious modifications unfortunately... The problem is that if a board is not remote, then DejaGnu doesn't call ${board}_spawn / ${board}_exec at all, and the native-stdio-gdbserver.exp board relies on those procedures being called. To fix that, this commit redesigns how the stdio boards hook into the testing framework to spawn gdbserver. IMO, this is a good change anyway, because the way its done currently is a bit of a hack, and the result turns out to be simpler, even. With this commit, they now no longer load the "gdbserver" generic config, and hook at the mi_gdb_target_load/gdb_reload level instead, making them more like traditional board files. To share code between native-stdio-gdbserver.exp and remote-stdio-gdbserver.exp, a new shared stdio-gdbserver-base.exp file is created. Instead of having each native board clear isremote manually, boards source the new "local-board.exp" file. This also adds a new section to testsuite/README file discussing local/remote/native, so that we can easily refer to it. gdb/testsuite/ChangeLog: 2017-10-16 Pedro Alves <palves@redhat.com> Simon Marchi <simon.marchi@polymtl.ca> * README (Local vs Remote vs Native): New section. * boards/local-board.exp: New file, with bits factored out from ... * boards/native-extended-gdbserver.exp: ... here. Load "local-board". * boards/native-gdbserver.exp: Load "local-board". (${board}_spawn, ${board}_exec): Delete. * boards/native-stdio-gdbserver.exp: Most contents factored out to ... * boards/stdio-gdbserver-base.exp: ... this new file. * boards/native-stdio-gdbserver.exp: Reimplement, by loading "stdio-gdbserver-base" and defining a get_target_remote_pipe_cmd procedure. * boards/remote-stdio-gdbserver.exp: Load stdio-gdbserver-base instead of native-stdio-gdbserver. Don't set gdb_server_prog nor stdio_gdbserver_command. (${board}_get_remote_address, ${board}_get_comm_port) (${board}_download, ${board}_upload): Delete. (get_target_remote_pipe_cmd): New.
* Use proc_with_prefix in py-breakpoint.expSimon Marchi2017-10-162-394/+387
| | | | | | | | | | | | | | Use proc_with_prefix to avoid having to call with_test_prefix with a duplicate of the proc name. The diff is mostly lines being re-indented. gdb/testsuite/ChangeLog: * gdb.python/py-breakpoint.exp (test_bkpt_basic, test_bkpt_deletion, test_bkpt_cond_and_cmds, test_bkpt_invisible, test_watchpoints, test_bkpt_internal, test_bkpt_eval_funcs, test_bkpt_temporary, test_bkpt_address, test_bkpt_pending, test_bkpt_events): Use proc_with_prefix, remove with_test_prefix.
* Get rid of VEC(mem_range_s)Simon Marchi2017-10-1610-110/+205
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch replaces the last usages of VEC(mem_range_s) with std::vector<mem_range>. This allows getting rid of a few cleanups and of the DEF_VEC_O(mem_range_s). I added a test for normalize_mem_ranges to make sure I didn't break anything there. Regtested on the buildbot. gdb/ChangeLog: * memrange.h (struct mem_range): Define operator< and operator==. (mem_range_s): Remove. (DEF_VEC_O (mem_range_s)): Remove. (normalize_mem_ranges): Change parameter type to std::vector. * memrange.c (compare_mem_ranges): Remove. (normalize_mem_ranges): Change parameter type to std::vector, adjust to vector change. * exec.c (section_table_available_memory): Return vector, remove parameter. (section_table_read_available_memory): Adjust to std::vector change. * remote.c (remote_read_bytes): Adjust to std::vector change. * tracepoint.h (traceframe_available_memory): Change parameter type to std::vector. * tracepoint.c (traceframe_available_memory): Change parameter type to std::vector, adjust. * gdb/mi/mi-main.c (mi_cmd_trace_frame_collected): Adjust to std::vector change. * gdb/Makefile.in (SUBDIR_UNITTESTS_SRCS): Add unittests/memrange-selftests.c. (SUBDIR_UNITTESTS_OBS): Add memrange-selftests.o. * gdb/unittests/memrange-selftests.c: New file.
* Work around GCC 6.3.1 bugPedro Alves2017-10-163-20/+26
| | | | | | | | | | | | | | | | | | | | | | This commit works around a GCC 6.3.1 bug several people are hitting: https://sourceware.org/ml/gdb-patches/2017-09/msg00270.html https://sourceware.org/ml/gdb-patches/2017-10/msg00418.html It manifests like this: ../../../binutils-gdb/gdb/probe.c:68:12: error: types may not be defined in a for-range-declaration [-Werror] for (struct probe *probe : probes) ^~~~~~ Fix it by renaming the range-for named variables to something different from their type's name. gdb/ChangeLog: 2017-10-16 Pedro Alves <palves@redhat.com> * elfread.c (probe_key_free): Rename range-for variable. * probe.c (parse_probes_in_pspace, find_probes_in_objfile) (find_probe_by_pc, collect_probes): Rename range-for variable.
* ELF: Call check_relocs after opening all inputsH.J. Lu2017-10-1697-3644/+277
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | For all ELF targers, call check_relocs after opening all inputs and garbage collection. Since the symbol resolution is known, check_relocs can be simplified. Also garbage collection doesn't need to undo what check_relocs has done for symbols which have been garbage collected. Since ELF targets never see the removed sections, gc_sweep_hook can be removed from elf_backend_data and we can avoid GOT/PLT with garbage collection now. Set link_info.check_relocs_after_open_input to TRUE for all linker targets which use ELF linker and update garbage collection tests to remove unused GOT section. ldemul_after_check_relocs is added for powerpc to support --secure-plt, --bss-plt and --sdata-got. Tested natively without regressions on i686, x86-64 and x32. Tested cross binutils on x86-64 without regressions for aarch64-linux, alpha-linux, arm-linux, bfin-elf, cr16-elf, cris-elf, crx-elf, frv-linux, hppa64-linux, hppa-linux, ia64-linux, lm32-elf, m32r-elf, m68k-linux, mcore-elf, metag-elf, microblaze-linux, mips-linux, mmix, mn10300-elf, nds32le-linux, nios2-linux, or1k-elf, powerpc64-linux, powerpc-linux, riscv32-linux, riscv64-linux, s390-linux, s390x-linux, score-elf, sh3-linux, sparc64-linux, sparc-linux, tic6x-elf, tilegx-linux, tilepro-linux, vax-linux, x86_64-mingw32 and xtensa-linux. bfd/ * elf-bfd.h (elf_backend_data): Remove gc_sweep_hook. * elf32-arm.c (elf32_arm_gc_sweep_hook): Removed. (elf_backend_gc_sweep_hook): Likewise. * elf32-bfin.c (bfin_gc_sweep_hook): Likewise. (bfinfdpic_gc_sweep_hook): Likewise. (elf_backend_gc_sweep_hook): Likewise. * elf32-cr16.c (elf32_cr16_gc_sweep_hook): Likewise. (elf_backend_gc_sweep_hook): Likewise. * elf32-cris.c (cris_elf_gc_sweep_hook): Likewise. (elf_backend_gc_sweep_hook): Likewise. * elf32-hppa.c (elf32_hppa_gc_sweep_hook): Likewise. (elf_backend_gc_sweep_hook): Likewise. * elf32-lm32.c (lm32_elf_gc_sweep_hook): Likewise. (elf_backend_gc_sweep_hook): Likewise. * elf32-m32r.c (m32r_elf_gc_sweep_hook): Likewise. (elf_backend_gc_sweep_hook): Likewise. * elf32-m68k.c (elf_m68k_got_entry): Remove elf_m68k_gc_sweep_hook from comments. (elf_m68k_remove_got_entry_type): Removed. (elf_m68k_find_got_entry_ptr): Likewise. (elf_m68k_remove_got_entry): Likewise. (elf_m68k_gc_sweep_hook): Likewise. (elf_backend_gc_sweep_hook): Likewise. * elf32-mcore.c (mcore_elf_gc_sweep_hook): Likewise. (elf_backend_gc_sweep_hook): Likewise. * elf32-metag.c (elf_metag_gc_sweep_hook): Likewise. (elf_backend_gc_sweep_hook): Likewise. * elf32-microblaze.c (elf_backend_gc_sweep_hook): Likewise. (elf_backend_gc_sweep_hook): Likewise. * elf32-mips.c (elf_backend_gc_sweep_hook): Likewise. (elf_backend_gc_sweep_hook): Likewise. * elf32-nds32.c (nds32_elf_gc_sweep_hook): Likewise. (elf_backend_gc_sweep_hook): Likewise. * elf32-nios2.c (nios2_elf32_gc_sweep_hook): Likewise. (elf_backend_gc_sweep_hook): Likewise. * elf32-or1k.c (or1k_elf_gc_sweep_hook): Likewise. (elf_backend_gc_sweep_hook): Likewise. * elf32-ppc.c (ppc_elf_gc_sweep_hook): Likewise. (elf_backend_gc_sweep_hook): Likewise. * elf32-s390.c (elf_s390_gc_sweep_hook): Likewise. (elf_backend_gc_sweep_hook): Likewise. * elf32-sparc.c (elf_backend_gc_sweep_hook): Likewise. * elf32-tic6x.c (elf32_tic6x_gc_sweep_hook): Likewise. (elf_backend_gc_sweep_hook): Likewise. * elf32-tilegx.c (elf_backend_gc_sweep_hook): Likewise. * elf32-tilepro.c (tilepro_elf_gc_sweep_hook): Likewise. (elf_backend_gc_sweep_hook): Likewise. * elf32-vax.c (elf_vax_gc_sweep_hook): Likewise. (elf_backend_gc_sweep_hook): Likewise. * elf32-xtensa.c (elf_xtensa_gc_sweep_hook): Likewise. (elf_backend_gc_sweep_hook): Likewise. * elf64-alpha.c (elf64_alpha_gc_sweep_hook): Likewise. (elf_backend_gc_sweep_hook): Likewise. * elf64-mips.c (elf_backend_gc_sweep_hook): Likewise. * elf64-mmix.c (mmix_elf_gc_sweep_hook): Likewise. (elf_backend_gc_sweep_hook): Likewise. * elf64-ppc.c (elf_backend_gc_sweep_hook): Likewise. (ppc64_elf_gc_sweep_hook): Likewise. * elf64-s390.c (elf_s390_gc_sweep_hook): Likewise. (elf_backend_gc_sweep_hook): Likewise. * elf64-sparc.c (elf_backend_gc_sweep_hook): Likewise. * elf64-tilegx.c (elf_backend_gc_sweep_hook): Likewise. * elflink.c (elf_link_add_object_symbols): Don't call _bfd_elf_link_check_relocs here. (gc_sweep_hook_fn): Removed. (elf_gc_sweep): Remove gc_sweep_hook. * elfnn-aarch64.c (elfNN_aarch64_gc_sweep_hook): Removed. (elf_backend_gc_sweep_hook): Likewise. * elfnn-riscv.c (riscv_elf_gc_sweep_hook): Likewise. (elf_backend_gc_sweep_hook): Likewise. * elfxx-mips.c (_bfd_mips_elf_gc_sweep_hook): Likewise. * elfxx-mips.h (_bfd_mips_elf_gc_sweep_hook): Likewise. (elf_backend_gc_sweep_hook): Likewise. * elfxx-sparc.c (_bfd_sparc_elf_gc_sweep_hook): Likewise. * elfxx-sparc.h (_bfd_sparc_elf_gc_sweep_hook): Likewise. * elfxx-target.h (elf_backend_gc_sweep_hook): Likewise. (elfNN_bed): Remove elf_backend_gc_sweep_hook. * elfxx-tilegx.c (tilegx_elf_gc_sweep_hook): Removed. * elfxx-tilegx.h (tilegx_elf_gc_sweep_hook): Likewise. ld/ * emulparams/elf32_x86_64.sh (CHECK_RELOCS_AFTER_OPEN_INPUT): Removed. * emulparams/elf_i386_be.sh (CHECK_RELOCS_AFTER_OPEN_INPUT): Likewise. * emulparams/elf_i386_chaos.sh (CHECK_RELOCS_AFTER_OPEN_INPUT): Likewise. * emulparams/elf_i386_ldso.sh (CHECK_RELOCS_AFTER_OPEN_INPUT): Likewise. * emulparams/elf_i386_vxworks.sh (CHECK_RELOCS_AFTER_OPEN_INPUT): Likewise. * emulparams/elf_iamcu.sh (CHECK_RELOCS_AFTER_OPEN_INPUT): Likewise. * emulparams/elf_k1om.sh (CHECK_RELOCS_AFTER_OPEN_INPUT): Likewise. * emulparams/elf_l1om.sh (CHECK_RELOCS_AFTER_OPEN_INPUT): Likewise. * emulparams/elf_x86_64.sh (CHECK_RELOCS_AFTER_OPEN_INPUT): Likewise. * emulparams/i386lynx.sh (CHECK_RELOCS_AFTER_OPEN_INPUT): Likewise. * emulparams/i386moss.sh (CHECK_RELOCS_AFTER_OPEN_INPUT): Likewise. * emulparams/i386nto.sh (CHECK_RELOCS_AFTER_OPEN_INPUT): Likewise. * emulparams/i386nw.sh (CHECK_RELOCS_AFTER_OPEN_INPUT): Likewise. * emulparams/shelf.sh (CHECK_RELOCS_AFTER_OPEN_INPUT): Likewise. * emulparams/shelf32.sh (CHECK_RELOCS_AFTER_OPEN_INPUT): Likewise. * emulparams/shelf_nto.sh (CHECK_RELOCS_AFTER_OPEN_INPUT): Likewise. * emulparams/shelf_vxworks.sh (CHECK_RELOCS_AFTER_OPEN_INPUT): Likewise. * emulparams/shlelf32_linux.sh (CHECK_RELOCS_AFTER_OPEN_INPUT): Likewise. * emulparams/shlelf_linux.sh (CHECK_RELOCS_AFTER_OPEN_INPUT): Likewise. * emulparams/shlelf_nto.sh (CHECK_RELOCS_AFTER_OPEN_INPUT): Likewise. * emultempl/aarch64elf.em (gld${EMULATION_NAME}_before_parse): Set link_info.check_relocs_after_open_input to TRUE. * emultempl/armelf.em (gld${EMULATION_NAME}_before_parse): Likewise. * emultempl/scoreelf.em (gld${EMULATION_NAME}_before_parse): Likewise. * emultempl/aix.em (ld_${EMULATION_NAME}_emulation): Add after_parse_default. * emultempl/armcoff.em (ld_${EMULATION_NAME}_emulation): Likewise. * emultempl/beos.em (ld_${EMULATION_NAME}_emulation): Likewise. * emultempl/generic.em (ld_${EMULATION_NAME}_emulation): Likewise. * emultempl/gld960.em (ld_${EMULATION_NAME}_emulation): Likewise. * emultempl/gld960c.em (ld_${EMULATION_NAME}_emulation): Likewise. * emultempl/lnk960.em (ld_${EMULATION_NAME}_emulation): Likewise. * emultempl/m68kcoff.em (ld_${EMULATION_NAME}_emulation): Likewise. * emultempl/msp430.em (ld_${EMULATION_NAME}_emulation): Likewise. * emultempl/pe.em (ld_${EMULATION_NAME}_emulation): Likewise. * emultempl/pep.em (ld_${EMULATION_NAME}_emulation): Likewise. * emultempl/sunos.em (ld_${EMULATION_NAME}_emulation): Likewise. * emultempl/ticoff.em (ld_${EMULATION_NAME}_emulation): Likewise. * emultempl/vanilla.em (ld_${EMULATION_NAME}_emulation): Likewise. * emultempl/elf32.em (gld${EMULATION_NAME}_before_parse): Always set link_info.check_relocs_after_open_input to TRUE. (ld_${EMULATION_NAME}_emulation): Add $LDEMUL_AFTER_CHECK_RELOCS. * emultempl/linux.em (gld${EMULATION_NAME}_before_parse): Set link_info.check_relocs_after_open_input to TRUE. (ld_${EMULATION_NAME}_emulation): Add after_check_relocs_default. * emultempl/mmix-elfnmmo.em (mmix_before_parse): New function. (LDEMUL_BEFORE_PARSE): New. * emultempl/mmixelf.em (elfmmix_before_parse): Replace gld${EMULATION_NAME}_before_parse with mmix_before_parse. * emultempl/ppc32elf.em (ppc_after_open): Renamed to ... (ppc_after_check_relocs): This. Call after_check_relocs_default instead of gld${EMULATION_NAME}_after_open. (LDEMUL_AFTER_OPEN): Removed. (LDEMUL_AFTER_CHECK_RELOCS): New. * ldemul.c (ldemul_after_check_relocs): New. (after_check_relocs_default): Likewise. * ldemul.h (ldemul_after_check_relocs): Likewise. (after_check_relocs_default): Likewise. (ld_emulation_xfer_struct): Add after_check_relocs. * ldlang.c (lang_process): Call ldemul_after_check_relocs after lang_check_relocs. * testsuite/ld-aarch64/gc-got-relocs.d: Don't expect GOT section. * testsuite/ld-aarch64/gc-tls-relocs.d: Likewise. * testsuite/ld-cris/tls-gc-68.d: Likewise. * testsuite/ld-cris/tls-gc-69.d: Likewise. * testsuite/ld-cris/tls-gc-70.d: Likewise. * testsuite/ld-cris/tls-gc-75.d: Likewise. * testsuite/ld-cris/tls-gc-79.d: Likewise. * testsuite/ld-mmix/bpo-10.d: Don't expect .MMIX.reg_contents section.
* Regenerate gdbserver/configureYao Qi2017-10-162-3/+14
| | | | | | | | | | | 4fa7574 (Fix gdb 8.1 Solaris compilation) changes warning.m4 and updates configure, but gdbserver/configure is not updated. gdb/gdbserver: 2017-10-16 Yao Qi <yao.qi@linaro.org> * configure: Regenerated.
* Remove features/tic6x-*.c filesYao Qi2017-10-169-443/+14
| | | | | | | | | | | | | | | | | | | | | | features/*.c are generated from *.xml files, in order to get pre-defined target descriptions, (for native debugging, for example). However, these pre-generated tdesc_tic6x_* are not used in GDB at all. This patch removes features/tic6x-*.c files. gdb: 2017-10-16 Yao Qi <yao.qi@linaro.org> * features/Makefile (XMLTOC): Remove tic6x-*.xml. * features/tic6x-c62x.c: Remove. * features/tic6x-c64x-linux.c: Remove. * features/tic6x-c64x.c: Remove. * features/tic6x-c64xp-linux.c: Remove. * features/tic6x-c64xp.c: Remove. * tic6x-linux-tdep.c (_initialize_tic6x_linux_tdep): Don't call initialize_tdesc_tic6x_*_linux functions. * tic6x-tdep.c (_initialize_tic6x_tdep): Don't call initialize_tdesc_tic6x_* functions.
* Remove regformats/tic6x-{c62x,c64x,c64xp}.datYao Qi2017-10-165-185/+8
| | | | | | | | | | | | | | | tic6x-uclinux GDBserver uses linux target descriptions, instead of these non-linux target descriptions. So we can remove these *.dat files. gdb: 2017-10-16 Yao Qi <yao.qi@linaro.org> * features/Makefile (WHICH): Remove tic6x-c64xp, tic6x-c64x tic6x-c62x. * regformats/tic6x-c62x.dat: Remove. * regformats/tic6x-c64x.dat: Remove. * regformats/tic6x-c64xp.dat: Remove.
* Fix GDB build without expatSimon Marchi2017-10-152-1/+6
| | | | | | | | | | | An earlier patch of mine changed parse_traceframe_info to make it return a unique_ptr. I forgot to update the version of the function used in an expat-less build, this patch fixes it. gdb/ChangeLog: * tracepoint.c (parse_traceframe_info): Return a unique_ptr (the !HAVE_LIBEXPAT version).
* Automatic date update in version.inGDB Administrator2017-10-161-1/+1
|
* Automatic date update in version.inGDB Administrator2017-10-151-1/+1
|