summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
...
* Update plugin_maybe_claimH.J. Lu2015-02-075-57/+83
| | | | | | | | | | | | | | | | | This patch removes the argument of pointer to struct ld_plugin_input_file. This is the first step to extract a plugin_object_p out of plugin_maybe_claim for BFD. * plugin.c: Include "libbfd.h". (plugin_strdup): New. (plugin_maybe_claim): Remove the argument of pointer to struct ld_plugin_input_file. Open and handle input entry. * plugin.h (plugin_maybe_claim): Updated. * ldfile.c (ldfile_try_open_bfd): Call plugin_maybe_claim directly without passing a pointer to struct ld_plugin_input_file. * ldmain.c: Don't include "libbfd.h". (add_archive_element): Call plugin_maybe_claim directly without passing a pointer to struct ld_plugin_input_file.
* Issue relocation in RO section warning for -z textH.J. Lu2015-02-0714-8/+78
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch changes linker to issue a warning for relocation in readonly section for -z text. bfd/ PR ld/17935 * elf32-i386.c (elf_i386_readonly_dynrelocs): Also issue a warning for relocation in readonly section for -z text. (elf_i386_size_dynamic_sections): Likewise. * elf64-x86-64.c (elf_x86_64_readonly_dynrelocs): Likewise. (elf_x86_64_size_dynamic_sections): Likewise. ld/testsuite/ PR ld/17935 * ld-i386/i386.exp: Run pr17935-1 and pr17935-2. * ld-x86-64/x86-64.exp: Likewise. * ld-i386/pr17935-1.d: New file. * ld-i386/pr17935-1.s: Likewise. * ld-i386/pr17935-2.d: Likewise. * ld-i386/pr17935-2.s: Likewise. * ld-x86-64/pr17935-1.d: Likewise. * ld-x86-64/pr17935-1.s: Likewise. * ld-x86-64/pr17935-2.d: Likewise. * ld-x86-64/pr17935-2.s: Likewise.
* Automatic date update in version.inGDB Administrator2015-02-071-1/+1
|
* remote-m32r-sdi.c: Include symfile.h.Doug Evans2015-02-062-1/+5
| | | | | | gdb/ChangeLog: * remote-m32r-sdi.c: Include symfile.h.
* Move clear_symtab_users, deduce_language_from_filename decls to better place.Doug Evans2015-02-063-7/+11
| | | | | | | | gdb/ChangeLog: * symtab.h (clear_symtab_users, deduce_language_from_filename): Move * symfile.h (clear_symtab_users, deduce_language_from_filename): ... to here.
* Document -z text, -z notext and -z textoffH.J. Lu2015-02-063-0/+21
| | | | | | * ld.texinfo: Document -z text, -z notext and -z textoff. * emultempl/elf32.em (gld${EMULATION_NAME}_list_options): Add -z text, -z notext and -z textoff.
* Use mmap and cache the view buffer for get_viewH.J. Lu2015-02-065-19/+275
| | | | | | | | | | | | | | | | | This patch uses mmap if it is available and works. It also caches the view buffer for get_view. * configure.ac: Add AC_FUNC_MMAP. * config.in: Regenerated. * configure: Likewise. * plugin.c: Include <sys/mman.h>. (MAP_FAILED): New. Defined if not defined. (PROT_READ): Likewise. (MAP_PRIVATE): Likewise. (view_buffer_t): New. (plugin_input_file_t): Add view_buffer. (get_view): Try mmap and cache the view buffer. (plugin_maybe_claim): Initialize view_buffer.
* libthread_db: attaching to terminated/joined threads, debug outputPedro Alves2015-02-064-0/+15
| | | | | | | | | | | | | Add a bit of debug output that made things a bit easier for me before. gdb/ 2015-02-06 Pedro Alves <palves@redhat.com> * linux-thread-db.c (find_new_threads_callback): Add debug output. gdb/gdbserver/ 2015-02-06 Pedro Alves <palves@redhat.com> * thread-db.c (find_new_threads_callback): Add debug output.
* "enable count" user input error handling (PR gdb/15678)Simon Marchi2015-02-064-2/+26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Typing "enable count" by itself crashes GDB. Also, if you omit the breakpoint number/range, the error message is not very clear: (gdb) enable count 2 warning: bad breakpoint number at or near '' (gdb) enable count Segmentation fault (core dumped) With this patch, the error messages are slightly more helpful: (gdb) enable count 2 Argument required (one or more breakpoint numbers). (gdb) enable count Argument required (hit count). gdb/ChangeLog: PR gdb/15678 * breakpoint.c (map_breakpoint_numbers): Check for empty args string. (enable_count_command): Check args for NULL value. gdb/testsuite/ChangeLog: PR gdb/15678 * gdb.base/ena-dis-br.exp: Test "enable count" for bad user input.
* Fix an invalid memory access triggered by running readelf on a fuzzed binary.Nick Clifton2015-02-062-3/+4
| | | | | | PR binutils/17531 * readelf.c (process_mips_specific): Fail if an option has an invalid size.
* Properly mark the plugin symbol undefinedH.J. Lu2015-02-066-22/+53
| | | | | | | | | | | | | | | | | | | | | Mark the unused plugin defined symbol in elf_link_input_bfd instead of _bfd_elf_fix_symbol_flags. Limit the PR ld/12365 test to x86 targets. bfd/ PR ld/12365 PR ld/14272 * elflink.c (_bfd_elf_fix_symbol_flags): Revert the last change. (elf_link_input_bfd): Mark the plugin symbol undefined if it is referenced from a non-IR file. ld/testsuite/ PR ld/12365 PR ld/14272 * ld-plugin/lto.exp: Run the PR ld/12365 test only for x86 targets. * ld-plugin/plugin-7.d: Updated. * ld-plugin/plugin-8.d: Likewise.
* Improve gdb.threads/attach-many-short-lived-threads.exp timeout handlingPedro Alves2015-02-063-4/+51
| | | | | | | | | | | | | | | | | | | | | | | | | | | The buildbot shows that this test is still racy, and occasionally fails with time outs on some machines. I'd like to get major issues with load out of the way. The test currently exits after 180s, which is just a random number, that has no relation to what the .exp file considers a time out. This commit makes the program wait a bit longer than what the .exp file considers a time out, and, resets the timer for each iteration. Tested on x86_64 Fedora 20, native and extended-remote gdbserver. gdb/testsuite/ 2015-02-06 Pedro Alves <palves@redhat.com> * gdb.threads/attach-many-short-lived-threads.c (SECONDS): New macro. (seconds_left, again): New globals. (main): Wait seconds_left in a 1-second sleep loop instead of sleeping 180 seconds. If 'again' is set, reset the seconds counter. * gdb.threads/attach-many-short-lived-threads.exp (test): Set 'again' in the inferior before detaching. Print the seconds left. (options): New global. (top level): Build program with -DTIMEOUT=$timeout.
* Fix memory access violations triggered by processing fuzzed binaries with a ↵Nick Clifton2015-02-062-3/+23
| | | | | | | | | 32-bit version of readelf, compiled on a 64-bit host. PR binutils/17531 * dwarf.c (xcmalloc): Fail if the arguments are too big. (xcrealloc): Likewise. (xcalloc2): Likewise.
* Fixes illegal memory accesses triggereb by running a 32-bit binary version ↵Nick Clifton2015-02-064-14/+39
| | | | | | | | | | | | of objdump compiled on a 64-bit host. PR binutils/17512 * dwarf.c (display_debug_frames): Fix range checks to work on 32-bit binaries complied on a 64-bit host. * peXXigen.c (rsrc_print_resource_entries): Add range check for addresses that wrap around the address space. (rsrc_parse_entry): Likewise.
* gdb.base/gdb-sigterm.exp: Fix spurious FAILsPedro Alves2015-02-063-16/+42
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The buildbot shows that some machines FAIL this test frequently. E.g.: https://sourceware.org/ml/gdb-testers/2015-q1/msg00997.html If I stress my machine, I can sometimes see it fail too. Bumping the 200 limit and tweaking the test to show the step count, I get: ... PASS: gdb.base/gdb-sigterm.exp: SIGTERM stepped 12 times PASS: gdb.base/gdb-sigterm.exp: SIGTERM stepped 8 times PASS: gdb.base/gdb-sigterm.exp: SIGTERM stepped 13 times PASS: gdb.base/gdb-sigterm.exp: SIGTERM stepped 7 times --> FAIL: gdb.base/gdb-sigterm.exp: SIGTERM stepped 228 times <-- PASS: gdb.base/gdb-sigterm.exp: SIGTERM stepped 11 times PASS: gdb.base/gdb-sigterm.exp: SIGTERM stepped 13 times PASS: gdb.base/gdb-sigterm.exp: SIGTERM stepped 12 times PASS: gdb.base/gdb-sigterm.exp: SIGTERM stepped 8 times PASS: gdb.base/gdb-sigterm.exp: SIGTERM stepped 9 times PASS: gdb.base/gdb-sigterm.exp: SIGTERM stepped 7 times PASS: gdb.base/gdb-sigterm.exp: SIGTERM stepped 11 times PASS: gdb.base/gdb-sigterm.exp: SIGTERM stepped 8 times ... Thinking that this might be a problem of SIGTERM reaching GDB, but then the event loop taking too long to handle it, I hacked GDB to print a debug log whenever the SIGTERM handler was called, and, whenever the event loop finally calls the async SIGTERM handler. Here's what I see: infrun: 30011 [Thread 30011], infrun: status->kind = stopped, signal = GDB_SIGNAL_TRAP infrun: TARGET_WAITKIND_STOPPED infrun: stop_pc = 0x4005de --> infrun: got SIGTERM <-- infrun: stepping inside range [0x4005de-0x4005e0] infrun: resume (step=1, signal=GDB_SIGNAL_0), ... infrun: prepare_to_wait --> infrun: handling async SIGTERM <-- Cannot execute this command while the target is running. Use the "interrupt" command to stop the target and then try again. gdb.base/gdb-sigterm.exp: expect eof #27 FAIL: gdb.base/gdb-sigterm.exp: SIGTERM stepped 228 times So, no delay on the GDB side. It just happens that occasionally it takes more than 200 single-steps before SIGTERM even reaches GDB. This just looks like a kernel/scheduling issue --- some extra usage spike in the system (e.g., an I/O spike) might cause it for me. For the build slaves, I'm guessing they're frequently busy enough to trip on this often. Particularly more so now that we're having them run tests in parallel mode. The fix is to detect failure by timeout instead of counting single steps. This should be more reliable. Indeed for me, after this commit, I couldn't trigger a FAIL anymore, even after letting the test run for an hour. By timeout is also nicer in that a board file for a slow host/target can increase it (like, e.g., an embedded GNU/Linux board). Tested on x86_64 Fedora 20, native, gdbserver, and extended-remote gdbserver. gdb/testsuite/ 2015-02-06 Pedro Alves <palves@redhat.com> * gdb.base/gdb-sigterm.c (main): Use the TIMEOUT define to determine how many seconds to pass to 'alarm'. * gdb.base/gdb-sigterm.exp (top level): Build program with -DTIMEOUT=$timeout. (do_test): Return success/failure indication. Add more verbose logging. Don't fail if 200 single steps are seen. Instead, fail when the test times out. (passes): New global. (top level): Break the testing loop if testing fails on any iteration. Use gdb_assert.
* gas: fix a few omissions in .cfi_label handlingJan Beulich2015-02-062-1/+12
| | | | | | | | | | | | | While actually starting to use that new directive, I noticed a few oversights of the original commit. gas/ 2015-02-06 Jan Beulich <jbeulich@suse.com> * dw2gencfi.c (select_cie_for_fde): Also bail on CFI_label. (cfi_change_reg_numbers): Also do nothing for CFI_label. (cfi_pseudo_table): Also handle .cfi_label when not supporting CFI directives.
* guile/scm-frame.c: Fix spelling errors in a comment.Doug Evans2015-02-052-3/+8
| | | | | | gdb/ChangeLog: * guile/scm-frame.c: Fix spelling errors in a comment.
* Close fd only if fd != -1H.J. Lu2015-02-052-3/+11
| | | | | | | This patch closes fd only if fd != -1. * plugin.c (release_input_file): Set fd to -1 after closing it. (plugin_maybe_claim): Close fd only if fd != -1.
* Automatic date update in version.inGDB Administrator2015-02-061-1/+1
|
* Add plugin_input_file_tH.J. Lu2015-02-052-16/+119
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patchs adds plugin_input_file_t to implement get_input_file, get_view and release_input_file. The maximum memeory overhead per IR input file are about 40 bytes for plugin_input_file_t plus the memory to store input IR filename. According to http://gcc.gnu.org/wiki/whopr/driver RELEASE_INPUT_FILE: Function pointer to the linker interface that releases a file descriptor for a claimed input file. The plug-in library must call this interface for each file descriptor obtained by the "get input file" interface. It must release all such file descriptors before returning from the WPA phase. However, GCC plug-in library doesn't use the "get input file" interface. It processed the IR input in the claim file handler. Since the the file descriptor opened for the IR input was unused after the claim file handler returns and GCC plug-in library before GCC 5 doesn't call the RELEASE_INPUT_FILE function pointer, ld closed the file descriptor to avoid leaking file descriptor. But this approach doesn't work with other plug-in libraries which uses the "get input file", "get view" and "release input file" interfaces. To avoid file descriptor leak with GCC prior to GCC 5 and support other plug-in libraries at the same time, we close the file descriptor only if the input IR file is a bfd_object file. This scheme doesn't work when a plug-in library needs the file descriptor and its IR is stored in bfd_object file. PR ld/17878 * plugin.c: Include <errno.h>. (errno): New. Declare if needed. (plugin_input_file_t): New. (get_input_file): Implemented. (get_view): Likewise. (release_input_file): Likewise. (add_symbols): Updated. (get_symbols): Likewise. (plugin_maybe_claim): Allocate a plugin_input_file_t. Close fd only for a bfd_object input.
* Don't refer to optarg in dwarf.c functionAlan Modra2015-02-052-1/+6
| | | | | | | This one is passed in optarg as its argument. PR binutils/17926 * dwarf.c (dwarf_select_sections_by_letters): Don't refer to optarg.
* Automatic date update in version.inGDB Administrator2015-02-051-1/+1
|
* Fix msp430 build with gcc-5Alan Modra2015-02-052-2/+7
| | | | | | | | | | | | gcc-5 correctly complains "loop exit may only be reached after undefined behavior". I was going to correct this by checking the index before dereferencing the array rather than the other way around, but then I noticed it is possible for extract_cmd to write the terminating zero one past the end of "cmd". Fixing that means no index check is needed in md_assemble. * config/tc-msp430.c (md_assemble): Correct size passed to extract_cmd. Remove index check.
* Combine loop epilogue into main loop body to reduce duplication.Rafael Ávila de Espíndola2015-02-042-13/+7
|
* Clean up System V IPC objects allocated by test.Don Breazeal2015-02-042-4/+26
| | | | | | | | | | | | | | | | | | | | | | This commit modifies the test program gdb.base/info-os.c so that it cleans up all allocated System V IPC objects when a fatal error occurs. Without this, it was possible for the program to leave IPC objects on the system, and such objects persist until they are manually deleted or the system reboots. I looked at changing the SysV IPC key for allocating the IPC objects to IPC_PRIVATE. That would prevent errors due to namespace conflicts with the key. However, the test needs to read the actual key number from the 'info os' command output, and IPC_PRIVATE won't work for that. gdb/testsuite/ChangeLog: 2015-02-04 Don Breazeal <donb@codesourcery.com> * gdb.base/info-os.c (shmid, semid, msqid): Make variables static and initialize them. (ipc_cleanup): New function. (main): Don't declare shmid, semid, and msqid. Add a call to atexit so that we call ipc_cleanup on exit.
* Fix Python 3 build error on 32-bit hostsJan Kratochvil2015-02-043-2/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | on Fedora Rawhide (==22) i686 using --with-python=/usr/bin/python3 one gets: ./python/py-value.c:1696:3: error: initialization from incompatible pointer type [-Werror] valpy_hash, /*tp_hash*/ ^ ./python/py-value.c:1696:3: error: (near initialization for ‘value_object_type.tp_hash’) [-Werror] cc1: all warnings being treated as errors Makefile:2628: recipe for target 'py-value.o' failed This is because in Python 2 tp_hash was: typedef long (*hashfunc)(PyObject *); while in Python 3 tp_hash is: typedef Py_hash_t (*hashfunc)(PyObject *); Py_hash_t is int for 32-bit hosts and long for 64-bit hosts. While on 32-bit hosts sizeof(long)==sizeof(int) still the hashfunc type is formally incompatible. As this patch should have no compiled code change it is not really necessary for gdb-7.9, it would fix there just this non-fatal compilation warning: ./python/py-value.c:1696:3: warning: initialization from incompatible pointer type valpy_hash, /*tp_hash*/ ^ ./python/py-value.c:1696:3: warning: (near initialization for ‘value_object_type.tp_hash’) gdb/ChangeLog 2015-02-04 Jan Kratochvil <jan.kratochvil@redhat.com> * python/python-internal.h (Py_hash_t): Define it for Python <3.2. * python/py-value.c (valpy_fetch_lazy): Use it. Remove cast to the return type.
* [AArch64] Add support for Cortex-A72Jiong Wang2015-02-043-0/+8
| | | | | | | 2015-02-04 Matthew Wahab <matthew.wahab@arm.com> * config/tc-aarch64.c (aarch64_cpus): Add support for Cortex-A72. * doc/c-aarch64.texi (-mcpu=): Add "cortex-a72".
* Add missing ChangeLog entry.Cary Coutant2015-02-041-0/+7
|
* Linux: don't resume new LWPs until we've pulled all events out of the kernelPedro Alves2015-02-044-53/+63
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Since the starvation avoidance series (https://sourceware.org/ml/gdb-patches/2014-12/msg00631.html), both GDB and GDBserver pull all events out of ptrace before deciding which event to process. There's one problem with that though. Because we resume new threads immediately when we see a PTRACE_EVENT_CLONE event, if the program constantly spawns threads fast enough, new threads can spawn threads faster we can pull events out of the kernel, and thus we'd get stuck in an infinite loop, never returning any event to the core to process. I occasionally see this happen with the attach-many-short-lived-threads.exp test against gdbserver. The fix is to delay resuming new threads until we've pulled out all events out of the kernel. On native, we already have the resume_stopped_resumed_lwps function that knows to resume LWPs that are stopped with no event to report to the core. So the patch just adds another use. GDBserver didn't have the equivalent yet, so the patch adds one. Tested on x86_64 Fedora 20, native and gdbserver (remote and extended-remote). gdb/gdbserver/ChangeLog: 2015-02-04 Pedro Alves <palves@redhat.com> * linux-low.c (handle_extended_wait): Don't resume LWPs here. (resume_stopped_resumed_lwps): New function. (linux_wait_for_event_filtered): Use it. gdb/ChangeLog: 2015-02-04 Pedro Alves <palves@redhat.com> * linux-nat.c (handle_extended_wait): Don't resume LWPs here. (wait_lwp): Don't call wait_lwp if linux_handle_extended_wait returns true. (resume_stopped_resumed_lwps): Don't check whether the thread is marked as executing. (linux_nat_wait_1): Use resume_stopped_resumed_lwps.
* Resolve forwarding symbols in plugins.Peter Collingbourne2015-02-042-6/+18
| | | | | | | 2015-02-04 Peter Collingbourne <pcc@google.com> * plugin.cc (Pluginobj::get_symbol_resolution_info): Resolve forwarding symbols when computing symbol resolution info for plugins.
* Fix '--target_board=native-extended-gdbserver/-m32'Pedro Alves2015-02-042-1/+9
| | | | | | | | | | | | | | | | | | | | | | | | Running the testsuite with the native-extended-gdbserver.exp board and passing a variant spec, like make check RUNTESTFLAGS="--target_board=native-extended-gdbserver/-m32" results in dejagnu trying to open a rsh connection to "native-extended-gdbserver", which of course is wrong. The point of this board is running things locally. The issue is that the native-extended-gdbserver board does not clear the "isremote" flag properly. Reported by Sergio at: https://sourceware.org/ml/gdb-patches/2015-02/msg00067.html testsuite/ 2015-02-04 Pedro Alves <palves@redhat.com> * boards/native-extended-gdbserver.exp: Remove any target variant specifications from the board name before clearing the isremote flag from board_info.
* Warn if core file register section is larger than expectedAndreas Arnez2015-02-049-6/+45
| | | | | | | | | | | | | | | | | | | | | | | | When reading a core file register section which is larger than expected, emit a warning. Assume that a register section usually has exactly the size specified by the regset section iterator. In some special cases this assumption is wrong, or at least does not match the regset supply function's logic. Thus also add a way to suppress the warning in those cases, using a new flag REGSET_VARIABLE_SIZE. gdb/ChangeLog: * regset.h (struct regset): Add flags field. (REGSET_VARIABLE_SIZE): New value for a regset's flags field. * corelow.c (get_core_register_section): Add warning if the size exceeds the requested size and the regset does not have the REGSET_VARIABLE_SIZE flag set. * alphanbsd-tdep.c (alphanbsd_gregset): Add REGSET_VARIABLE_SIZE flag. * armbsd-tdep.c (armbsd_gregset): Likewise. * hppa-hpux-tdep.c (hppa_hpux_regset): Likewise. * hppaobsd-tdep.c (hppaobsd_gregset): Likewise. * m68kbsd-tdep.c (m68kbsd_gregset): Likewise. * mipsnbsd-tdep.c (mipsnbsd_gregset): Likewise.
* x86: Use correct .reg-xstate section sizeAndreas Arnez2015-02-043-3/+11
| | | | | | | | | | | | | | | | | | | | | | | | When reading the XSAVE extended state from an i386 or AMD64 core file, the respective regset iterator requests a minimum section size of zero. Since the respective regset supply function does not check the size either, this may lead to accessing data out of range if the section is too short. In write mode, the iterator always uses the maximum supported size for the XSAVE extended state. This is now changed such that the iterator always requests the expected size of this section based on xcr0, both for reading and writing. gdb/ChangeLog: * amd64-linux-tdep.c (amd64_linux_iterate_over_regset_sections): For ".reg-xstate", explicitly specify the requested section size via X86_XSTATE_SIZE instead of just 0 on input and X86_XSTATE_MAX_SIZE on output. * i386-linux-tdep.c (i386_linux_iterate_over_regset_sections): Likewise.
* Fix internal error when core file section is too bigAndreas Arnez2015-02-047-18/+56
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | As reported in PR 17808, a test case with a forged (invalid) core file can crash GDB with an assertion failure. In that particular case the prstatus of an i386 core file looks like that from an AMD64 core file. Consequently the respective regset supply function i386_supply_gregset is invoked with a larger buffer than usual. But i386_supply_gregset asserts a specific buffer size, and this assertion fails. The patch relaxes all buffer size assertions in regset supply functions such that they merely check for a sufficiently large buffer. For consistency the regset collect functions are adjusted as well. gdb/ChangeLog: PR corefiles/17808: * gdbarch.sh (iterate_over_regset_sections_cb): Document this function type, particularly its SIZE parameter. * gdbarch.h: Regenerate. * amd64-tdep.c (amd64_supply_fpregset): In gdb_assert, compare actual against required size using ">=" instead of "==". (amd64_collect_fpregset): Likewise. * i386-tdep.c (i386_supply_gregset): Likewise. (i386_collect_gregset): Likewise. (i386_supply_fpregset): Likewise. (i386_collect_fpregset): Likewise. * mips-linux-tdep.c (mips_supply_gregset_wrapper): Likewise. (mips_fill_gregset_wrapper): Likewise. (mips_supply_fpregset_wrapper): Likewise. (mips_fill_fpregset_wrapper): Likewise. (mips64_supply_gregset_wrapper): Likewise. (mips64_fill_gregset_wrapper): Likewise. (mips64_supply_fpregset_wrapper): Likewise. (mips64_fill_fpregset_wrapper): Likewise. * mn10300-linux-tdep.c (am33_supply_gregset_method): Likewise. (am33_supply_fpregset_method): Likewise. (am33_collect_gregset_method): Likewise. (am33_collect_fpregset_method): Likewise.
* Pass -flto-partition=none to the PR ld/12365 testH.J. Lu2015-02-042-1/+6
| | | | | * ld-plugin/lto.exp: Pass -flto-partition=none to the PR ld/12365 test.
* Fix encoding of "addw ax, [hl]" and "subw ax, [hl]".Nick Clifton2015-02-042-1/+6
| | | | | * config/rl78-parse.y (addsubw): Fix encoding of [HL] variant of these instructions.
* Speed up GDB's TUI outputDoug Evans2015-02-045-6/+43
| | | | | | | | | | | | | | | | | | | In the TUI mode, we call wrefresh after outputting every single character. This results in the I/O becoming very slow. Fix this by delaying refreshing the console window until an explicit flush of gdb_stdout is requested, or a write to any other (unbuffered) file is done. 2015-02-04 Doug Evans <dje@google.com> Pedro Alves <palves@redhat.com> Eli Zaretskii <eliz@gnu.org> PR tui/17810 * tui/tui-command.c (tui_refresh_cmd_win): New function. * tui/tui-command.c (tui_refresh_cmd_win): Declare. * tui/tui-file.c: #include tui/tui-command.h. (tui_file_fputs): Refresh command window if stream is not gdb_stdout. (tui_file_flush): Refresh command window if stream is gdb_stdout. * tui/tui-io.c (tui_puts): Remove calls to wrefresh, fflush.
* More fixes for memory access violations triggered by running readelf on ↵Nick Clifton2015-02-042-10/+40
| | | | | | | | | | | | | | fuzzed binaries. PR binutils/17531 * dwarf.c (read_and_display_attr_value): Test for a block length being so long that it wraps around to before the start of the block. (process_debug_info): Test for section_begin wrapping around to before the start of the section. (display_gdb_index): Test for num_cus being so large that the end address wraps around to before the start of the section. (process_cu_tu_index): Test for j being so large that the section index pool wraps around to before the start of the section.
* Fix build breakage due to event loop simplificationPedro Alves2015-02-042-0/+9
| | | | | | | | | | | | | | | | | | | | | | commit 70b66289 (Simplify event-loop core, remove two-step event processing) causes a build failure when compiling GDB with gcc/-O2: gdb/event-loop.c: In function ‘gdb_do_one_event’: gdb/event-loop.c:296:10: error: ‘res’ may be used uninitialized in this function [-Werror=maybe-uninitialized] if (res > 0) ^ GCC isn't realizing that event_source_head can never be > 2 and that therefore 'res' is always initialized in all possible paths. Adding a default case that internal_error's makes GCC realize that. Tested on x86_64 Fedora 20. gdb/ChangeLog: 2015-02-04 Pedro Alves <palves@redhat.com> Fix build breakage. * event-loop.c (gdb_do_one_event): Add default switch case.
* Add missing ChangeLog entries.Cary Coutant2015-02-031-0/+39
|
* Fix a file descriptor leak in gold.Cary Coutant2015-02-0310-154/+321
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When an LTO linker plugin claims an external member of a thin archive, gold does not properly unlock the file and make its file descriptor available for reuse. This patch fixes the problem by modifying Archive::include_member to unlock the object file via an RAII class instance, ensuring that it will be unlocked no matter what path is taken through the function. gold/ PR gold/15660 * archive.cc (Thin_archive_object_unlocker): New class. (Archive::include_member): Unlock external members of thin archives. * testsuite/Makefile.am (plugin_test_1): Rename .syms files. (plugin_test_2): Likewise. (plugin_test_3): Likewise. (plugin_test_4): Likewise. (plugin_test_5): Likewise. (plugin_test_6): Likewise. (plugin_test_7): Likewise. (plugin_test_8): Likewise. (plugin_test_9): Likewise. (plugin_test_10): Likewise. (plugin_test_11): New test case. * testsuite/Makefile.in: Regenerate. * testsuite/plugin_test.c (claim_file_hook): Check for parallel .syms file to decide whether to claim file. (all_symbols_read_hook): Likewise. * testsuite/plugin_test_1.sh: Adjust expected output. * testsuite/plugin_test_2.sh: Likewise. * testsuite/plugin_test_3.sh: Likewise. * testsuite/plugin_test_6.sh: Likewise. * testsuite/plugin_test_tls.sh: Likewise. * testsuite/plugin_test_11.sh: New testcase.
* Add extra debugging output for files and descriptors.Cary Coutant2015-02-032-0/+19
| | | | | | | | | | | gold/ * descriptors.cc (Descriptors::open): Set artificially-low limit for file descriptors when debugging enabled. Add debug output. (Descriptors::release): Add debug output. (Descriptors::close_some_descriptor): Likewise. (Descriptors::close_all): Likewise. * fileread.cc (File_read::lock): Likewise. (File_read::unlock): Likewise.
* Automatic date update in version.inGDB Administrator2015-02-041-1/+1
|
* Fix memory access violations triggered by running readelf on fuzzed binaries.Nick Clifton2015-02-033-36/+114
| | | | | | | | | | | | | PR binutils/17531 * dwarf.c (process_debug_info): Add range check. (display_debug_pubnames_worker): Likewise. (display_gdb_index): Fix range check. (process_cu_tu_index): Add range check. * readelf.c (get_data): Change parameter types from size_t to bfd_size_type. Add checks for loss of accuracy when casting from bfd_size_type to size_t. (get_dynamic_data): Likewise. (process_section_groups): Limit number of error messages.
* compile: Filter out -fpreprocessedJan Kratochvil2015-02-032-0/+28
| | | | | | | | | | | | | | | | | | | | | | | | With global system gcc-5.0 if one also installs ccache (needing a different patch https://bugzilla.samba.org/show_bug.cgi?id=11060 for -fplugin=libcc1plugin) it breaks as GDB will read from inferior DW_AT_producer containing -fpreprocessed (due to ccache used to compile the inferior). <c> DW_AT_producer : (indirect string, offset: 0x52): GNU C11 5.0.0 20150114 (Red Hat 5.0.0-0.1) -fpreprocessed -mtune=generic - march=x86-64 -g It is wrong that gcc puts -fpreprocessed into DW_AT_producer - fixed it in trunk GCCs: https://gcc.gnu.org/ml/gcc-patches/2015-01/msg01495.html But even with that fix there are already built inferiors out there which GDB could be compatible (for the 'compile' mode) with. gdb/ChangeLog 2015-02-03 Jan Kratochvil <jan.kratochvil@redhat.com> Filter out inferior gcc option -fpreprocessed. * compile/compile.c (filter_args): New function. (get_args): Use it.
* Mark the plugin symbol undefinedH.J. Lu2015-02-037-0/+193
| | | | | | | | | | | | | | | | | | | | | | | | | LTO may optimize out a plugin symbol, which is also referenced by a non-IR file. When that happens, we should mark the plugin symbol undefined. It isn't the problem since LTO already determined the symbols in the non-IR file aren't used. bfd/ PR ld/12365 PR ld/14272 * elflink.c (_bfd_elf_fix_symbol_flags): Mark the plugin symbol undefined if it is referenced from a non-IR file. ld/testsuite/ PR ld/12365 * ld-plugin/pr12365a.c: New file. * ld-plugin/pr12365b.c: Likewise. * ld-plugin/pr12365c.c: Likewise. * ld-plugin/lto.exp (lto_link_tests): Prepare for the PR ld/12365 test. Run the PR ld/12365 test.
* Add a testcase for PR ld/14918H.J. Lu2015-02-034-0/+20
| | | | | | | | PR ld/14918 * ld-plugin/lto.exp (lto_link_elf_tests): Add PR ld/14918 test. * ld-plugin/pr14918.c: New file. * ld-plugin/pr14918.d: Likewise.
* Fix typo in previous delta for mach-o.c.Nick Clifton2015-02-031-1/+1
|
* Simplify event-loop core, remove two-step event processingPedro Alves2015-02-034-243/+119
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Even with the previous patch installed, we'll still see sigall-reverse.exp occasionally fail. The problem is that the event loop's event handling processing is done in two steps: #1 - poll all event sources, and push new event objects to the event queue, until all event sources are drained. #2 - go through the event queue, processing each event object at a time. For each event, call the associated callback, and deletes the event object from the queue. and then bad things happen if between #1 and #2 something decides that events from an event source that has already queued events shouldn't be processed yet. To do that, we either remove the event source from the list of event sources, or clear its "have events" flag. However, if an event for that source has meanwhile already been pushed in the event queue, #2 will still process it and call the associated callback... One way to fix it that I considered was to do something to the event objects already in the event queue when an event source is no longer interesting. But then I couldn't find any good reason for the two-step process in the first place. It's much simpler (and less code) to call the event source callbacks as we poll the sources and find events. Tested on x86-64 Fedora 20, native and gdbserver. gdb/ 2015-02-03 Pedro Alves <palves@redhat.com> * event-loop.c: Don't declare nor define a queue type for gdb_event_p. (event_queue): Delete. (create_event, create_file_event, gdb_event_xfree) (initialize_event_loop, process_event): Delete. (gdb_do_one_event): Return as soon as one event is handled. (handle_file_event): Change prototype. Used the passed in file_handler pointer and ready_mask instead of looping over all file handlers. (gdb_wait_for_event): Update the poll/select timeouts before blocking. Run event handlers directly instead of queueing events. Return as soon as one event is handled. (struct async_event_handler_data): Delete. (invoke_async_event_handler): Delete. (check_async_event_handlers): Change return type to int. Run event handlers directly instead of queueing events. Return as soon as one event is handled. (handle_timer_event): Delete. (update_wait_timeout): New function, factored out from poll_timers. (poll_timers): Reimplement. * event-loop.h (initialize_event_loop): Delete declaration. * top.c (gdb_init): Don't call initialize_event_loop.
* When disabling target async, remove all target event sources from the event loopPedro Alves2015-02-036-13/+72
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The sigall-reverse.exp test occasionally fails with something like this: (gdb) PASS: gdb.reverse/sigall-reverse.exp: send signal TERM continue Continuing. The next instruction is syscall exit_group. It will make the program exit. Do you want to stop the program?([y] or n) FAIL: gdb.reverse/sigall-reverse.exp: continue to signal exit (timeout) FAIL: gdb.reverse/sigall-reverse.exp: reverse to handler of TERM (timeout) FAIL: gdb.reverse/sigall-reverse.exp: reverse to gen_TERM (timeout) This is another event-loop/async related problem exposed by the patch that made 'query' use gdb_readline_wrapper (588dcc3edbde19f9). The problem is that even though gdb_readline_wrapper disables target-async while the secondary prompt is in progress, the record target's async event source is left marked. So when gdb_readline_wrapper nests an event loop to process input, it may happen that that event loop ends up processing a target event while GDB is not really ready for it. Here's the relevant part of the backtrace showing the root issue in action: ... #14 0x000000000061cb48 in fetch_inferior_event (client_data=0x0) at src/gdb/infrun.c:4158 #15 0x0000000000642917 in inferior_event_handler (event_type=INF_REG_EVENT, client_data=0x0) at src/gdb/inf-loop.c:57 #16 0x000000000077ca5c in record_full_async_inferior_event_handler (data=0x0) at src/gdb/record-full.c:791 #17 0x0000000000640fdf in invoke_async_event_handler (data=...) at src/gdb/event-loop.c:1067 #18 0x000000000063fb01 in process_event () at src/gdb/event-loop.c:339 #19 0x000000000063fb2a in gdb_do_one_event () at src/gdb/event-loop.c:360 #20 0x000000000074d607 in gdb_readline_wrapper (prompt=0x3588f40 "The next instruction is syscall exit_group. It will make the program exit. Do you want to stop the program?([y] or n) ") at src/gdb/top.c:842 #21 0x0000000000750bd9 in defaulted_query (ctlstr=0x8c6588 "The next instruction is syscall exit_group. It will make the program exit. Do you want to stop the program?", defchar=121 'y', args=0x7fff70524410) at src/gdb/utils.c:1279 #22 0x0000000000750e4c in yquery (ctlstr=0x8c6588 "The next instruction is syscall exit_group. It will make the program exit. Do you want to stop the program?") at src/gdb/utils.c:1358 #23 0x00000000004b020e in record_linux_system_call (syscall=gdb_sys_exit_group, regcache=0x3529450, tdep=0xd6c840 <amd64_linux_record_tdep>) at src/gdb/linux-record.c:1933 With my all-stop-on-top-of-non-stop series, I'm also seeing gdb.server/ext-attach.exp fail occasionally due to the same issue. The first part of the fix is for target_async implementations to make sure to remove/unmark all target-related event sources from the event loop. Tested on x86_64 Fedora 20, native and gdbserver. gdb/ 2015-02-03 Pedro Alves <palves@redhat.com> * event-loop.c (clear_async_event_handler): New function. * event-loop.h (clear_async_event_handler): New declaration. * record-btrace.c (record_btrace_async): New function. (init_record_btrace_ops): Install record_btrace_async. * record-full.c (record_full_async): New function. (record_full_resume): Don't mark the async event source here. (init_record_full_ops): Install record_full_async. (record_full_core_resume): Don't mark the async event source here. (init_record_full_core_ops): Install record_full_async. * remote.c (remote_async): Mark and clear the async stop reply queue event-loop token as appropriate.