aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2016-01-30Check reloc against IFUNC symbol only with dynamic symbolsH.J. Lu7-24/+57
There is no need to check relocation IFUNC symbol if there are no dynamic symbols. bfd/ PR ld/19539 * elf32-i386.c (elf_i386_reloc_type_class): Check relocation against STT_GNU_IFUNC symbol only with dynamic symbols. * elf64-x86-64.c (elf_x86_64_reloc_type_class): Likewise. ld/ PR ld/19539 * testsuite/ld-elf/pr19539.d: New file. * testsuite/ld-elf/pr19539.s: Likewise. * testsuite/ld-elf/pr19539.t: Likewise.
2016-01-31Automatic date update in version.inGDB Administrator1-1/+1
2016-01-30Automatic date update in version.inGDB Administrator1-1/+1
2016-01-29Fix two misleading indentation warningsSimon Marchi3-16/+23
Two small changes so everything builds with latest GCC and its -Wmisleading-indentation. In the aarch64-tdep.c case, the two misindented lines should actually be part of the for loop. It looks like the indentation is all done using spaces in that file though... I fixed it (changed for tabs + spaces) for the lines I touched. In the xcoffread.c case, we can simply remove the braces and fix the indentation. gdb/ChangeLog: * aarch64-tdep.c (aarch64_record_asimd_load_store): Add braces to for include additional lines. * xcoffread.c (scan_xcoff_symtab): Remove unnecessary braces.
2016-01-29Replace == with = in gas/configure.acH.J. Lu3-2/+8
PR gas/19532 * configure.ac (compressed_debug_sections): Replace == with =. * configure: Regenerated.
2016-01-29Replace == with = in ld/configure.acH.J. Lu3-2/+8
PR ld/19533 * configure.ac (compressed_debug_sections): Replace == with =. * configure: Regenerated.
2016-01-29Add testsuite/ to the last gas ChangeLog entryH.J. Lu1-6/+6
2016-01-29Add option -mfence-as-lock-add=[no|yes].Andrew Senkevich9-0/+131
With -mfence-as-lock-add=yes lfence, mfence and sfence will be encoded as lock addl $0x0, (%{r,e}sp). gas/: * config/tc-i386.c (avoid_fence): New. (output_insn): Encode as lock addl $0x0, (%{r,e}sp) if avoid_fence is true. (OPTION_FENCE_AS_LOCK_ADD): New. (md_longopts): Add -mfence-as-lock-add. (md_parse_option): Handle -mfence-as-lock-add. (md_show_usage): Add -mfence-as-lock-add=[no|yes]. * doc/c-i386.texi (-mfence-as-lock-add): Document. gas/testsuite/: * gas/i386/i386.exp: Run new tests. * gas/i386/fence-as-lock-add.s: New. * gas/i386/fence-as-lock-add-yes.d: Likewise. * gas/i386/fence-as-lock-add-no.d: Likewise. * gas/i386/x86-64-fence-as-lock-add-yes.d: Likewise. * gas/i386/x86-64-fence-as-lock-add-no.d: Likewise.
2016-01-29Automatic date update in version.inGDB Administrator1-1/+1
2016-01-28Set BFD_DECOMPRESS to decompress debug sectionsH.J. Lu6-2/+115
We should set BFD_DECOMPRESS to decompress debug sections when reading in DWARF debug sections. bfd/ PR binutils/19523 * dwarf2.c (_bfd_dwarf2_slurp_debug_info): Set BFD_DECOMPRESS to decompress debug sections. binutils/ PR binutils/19523 * Makefile.am (check-DEJAGNU): Pass CC and CC_FOR_BUILD to runtest. * Makefile.in: Regenerated. * testsuite/binutils-all/compress.exp (test_gnu_debuglink): New proc. Run test_gnu_debuglink for native ELF build.
2016-01-28Add ChangeLog entry for update to gdb.dlang demangle tests.Iain Buclaw1-0/+4
2016-01-28Align dlang demangle tests with libiberty.Iain Buclaw1-15/+18
gdb/testsuite/ChangeLog: * gdb.dlang/demangle.exp: Sync tests from libiberty testsuite.
2016-01-28Sync libiberty with GCC.Iain Buclaw3-30/+71
libiberty/ChangeLog: * d-demangle.c (dlang_call_convention): Handle extern Objective-C function calling convention. (dlang_call_convention_p): Likewise. (dlang_type): Likewise. * testsuite/d-demangle-expected: Add coverage tests. * d-demangle.c (dlang_function_args): Append ',' for variadic functions only if parameters were seen before the elipsis symbol. * testsuite/d-demangle-expected: Add coverage test for parameter-less variadic functions. * d-demangle.c (dlang_type): Handle function types only in the context of seeing a pointer type symbol. * testsuite/d-demangle-expected: Update function pointer tests.
2016-01-28Add rawmemchr to imported gnulib modulesSimon Marchi5-3/+12
rawmemchr is a dependency of strchrnul, so it should be explicitly listed. gdb/ChangeLog: * gnulib/import/Makefile.am: Regenerate. * gnulib/import/Makefile.in: Regenerate. * gnulib/import/m4/gnulib-cache.m4: Regenerate. * gnulib/update-gnulib.sh (IMPORTED_GNULIB_MODULES): Add rawmemchr.
2016-01-28Import strchrnul from gnulib and use itSimon Marchi18-42/+639
For a forthcoming patch, I need a "skip_to_colon" function. I noticed there are two skip_to_semicolon (one in gdb and one in gdbserver). I thought we could put it in common/, and generalize it for any character. It turns out that the strchrnul function does exactly that. I imported the corresponding module from gnulib, for those systems that do not have it. There are probably more places where this function can be used instead of doing the work by hand (I am looking at remote-utils.c::look_up_one_symbol). gdb/ChangeLog: * remote.c (skip_to_semicolon): Remove. (remote_parse_stop_reply): Use strchrnul instead of skip_to_semicolon. * gnulib/update-gnulib.sh (IMPORTED_GNULIB_MODULES): Add strchrnul. * gnulib/aclocal.m4: Regenerate. * gnulib/config.in: Regenerate. * gnulib/configure: Regenerate. * gnulib/import/Makefile.am: Regenerate. * gnulib/import/Makefile.in: Regenerate. * gnulib/import/m4/gnulib-cache.m4: Regenerate. * gnulib/import/m4/gnulib-comp.m4: Regenerate. * gnulib/import/m4/rawmemchr.m4: New file. * gnulib/import/m4/strchrnul.m4: New file. * gnulib/import/rawmemchr.c: New file. * gnulib/import/rawmemchr.valgrind: New file. * gnulib/import/strchrnul.c: New file. * gnulib/import/strchrnul.valgrind: New file. gdb/gdbserver/ChangeLog: * server.c (skip_to_semicolon): Remove. (process_point_options): Use strchrnul instead of skip_to_semicolon.
2016-01-28[testsuite] Fix tiemout fail in gdb.fortran/vla-value.expYao Qi2-3/+17
In vla.f90, this single line of source is compiled to many instructions, vla2(:, :, :) = 1311 ! vla2-allocated it is quite slow (about several minutes in my testing) to step over this source line without range stepping. This patch is to increase the timeout value by 15 times, which is a magic number to make sure timeout disappears in my testing with a slow arm-linux board. gdb/testsuite: 2016-01-28 Yao Qi <yao.qi@linaro.org> * gdb.fortran/vla-value.exp: Wrap test with with_timeout_factor.
2016-01-28Fix GDB crash in dprintf.expYao Qi2-9/+6
I see GDB crashes in dprintf.exp on aarch64-linux testing, (gdb) PASS: gdb.base/dprintf.exp: agent: break 29 set dprintf-style agent^M (gdb) PASS: gdb.base/dprintf.exp: agent: set dprintf style to agent continue^M Continuing. ASAN:SIGSEGV ================================================================= ==22475==ERROR: AddressSanitizer: SEGV on unknown address 0x000000000008 (pc 0x000000494820 sp 0x7fff389b83a0 bp 0x62d000082417 T0) #0 0x49481f in remote_add_target_side_commands /home/yao/SourceCode/gnu/gdb/git/gdb/remote.c:9190^M #1 0x49e576 in remote_add_target_side_commands /home/yao/SourceCode/gnu/gdb/git/gdb/remote.c:9174^M #2 0x49e576 in remote_insert_breakpoint /home/yao/SourceCode/gnu/gdb/git/gdb/remote.c:9240^M #3 0x5278b7 in insert_bp_location /home/yao/SourceCode/gnu/gdb/git/gdb/breakpoint.c:2734^M #4 0x52ac09 in insert_breakpoint_locations /home/yao/SourceCode/gnu/gdb/git/gdb/breakpoint.c:3159^M #5 0x52ac09 in update_global_location_list /home/yao/SourceCode/gnu/gdb/git/gdb/breakpoint.c:12686 the root cause of this problem in this case is about linespec and symtab which produces additional incorrect location and a NULL is added to bp_tgt->tcommands. I posted a patch https://sourceware.org/ml/gdb-patches/2015-12/msg00321.html to fix it in linespec (the fix causes regression), but GDB still shouldn't add NULL into bp_tgt->tcommands. The logic of build_target_command_list looks odd to me. If we get something wrong in parse_cmd_to_aexpr (it returns NULL), we shouldn't continue, instead we should set flag null_command_or_parse_error. This is what this patch does. In the meantime, we find build_target_condition_list has the same problem, so fix it too. gdb: 2016-01-28 Yao Qi <yao.qi@linaro.org> * breakpoint.c (build_target_command_list): Don't call continue if aexpr is NULL. (build_target_condition_list): Likewise.
2016-01-28Automatic date update in version.inGDB Administrator1-1/+1
2016-01-27rx: Treat scalars larger than 8 bytes as aggregates in rx_push_dummy_call.Kevin Buettner2-1/+7
This patch fixes the following failures (which are also GDB internal errors) for the -m64bit-doubles multilib: FAIL: gdb.base/callfuncs.exp: p t_double_complex_values(dc1, dc2) (GDB internal error) FAIL: gdb.base/callfuncs.exp: p t_double_complex_values(dc3, dc4) (GDB internal error) FAIL: gdb.base/callfuncs.exp: p t_double_complex_many_args(dc1, dc2, dc3, dc4, dc1, dc2, dc3, dc4, dc1, dc2, dc3, dc4, dc1, dc2, dc3, dc4) (GDB internal error) FAIL: gdb.base/callfuncs.exp: p t_double_complex_many_args(dc1, dc1, dc1, dc1, dc1, dc1, dc1, dc1, dc1, dc1, dc1, dc1, dc1, dc1, dc1, dc1) (GDB internal error) FAIL: gdb.base/callfuncs.exp: p t_long_double_complex_values(ldc1, ldc2) (GDB internal error) FAIL: gdb.base/callfuncs.exp: p t_long_double_complex_values(ldc3, ldc4) (GDB internal error) FAIL: gdb.base/callfuncs.exp: p t_long_double_complex_many_args(ldc1, ldc2, ldc3, ldc4, ldc1, ldc2, ldc3, ldc4, ldc1, ldc2, ldc3, ldc4, ldc1, ldc2, ldc3, ldc4) (GDB internal error) FAIL: gdb.base/callfuncs.exp: p t_long_double_complex_many_args(ldc1, ldc1, ldc1, ldc1, ldc1, ldc1, ldc1,ldc1, ldc1, ldc1, ldc1, ldc1, ldc1, ldc1, ldc1, ldc1) (GDB internal error) FAIL: gdb.base/callfuncs.exp: noproto: p t_double_complex_values(dc1, dc2) (GDB internal error) FAIL: gdb.base/callfuncs.exp: noproto: p t_double_complex_values(dc3, dc4) (GDB internal error) FAIL: gdb.base/callfuncs.exp: noproto: p t_double_complex_many_args(dc1, dc2, dc3, dc4, dc1, dc2, dc3, dc4, dc1, dc2, dc3, dc4, dc1, dc2, dc3, dc4) (GDB internal error) FAIL: gdb.base/callfuncs.exp: noproto: p t_double_complex_many_args(dc1, dc1, dc1, dc1, dc1, dc1, dc1, dc1, dc1, dc1, dc1, dc1, dc1, dc1, dc1, dc1) (GDB internal error) FAIL: gdb.base/callfuncs.exp: noproto: p t_long_double_complex_values(ldc1, ldc2) (GDB internal error) FAIL: gdb.base/callfuncs.exp: noproto: p t_long_double_complex_values(ldc3, ldc4) (GDB internal error) FAIL: gdb.base/callfuncs.exp: noproto: p t_long_double_complex_many_args(ldc1, ldc2, ldc3, ldc4, ldc1, ldc2, ldc3, ldc4, ldc1, ldc2, ldc3, ldc4, ldc1, ldc2, ldc3, ldc4) (GDB internal error) FAIL: gdb.base/callfuncs.exp: noproto: p t_long_double_complex_many_args(ldc1, ldc1, ldc1, ldc1, ldc1, ldc1, ldc1,ldc1, ldc1, ldc1, ldc1, ldc1, ldc1, ldc1, ldc1, ldc1) (GDB internal error) FAIL: gdb.base/varargs.exp: print find_max_double_real(4, dc1, dc2, dc3, dc4) (GDB internal error) FAIL: gdb.base/varargs.exp: print find_max_long_double_real(4, ldc1, ldc2, ldc3, ldc4) (GDB internal error) The assertion failure which is tripped is: gdb_assert (arg_size <= 4); While it may seem that the patch ought to disallow scalars larger than 4, scalars of size 8 are explicitly handled by the code elsewhere. This came up because gcc has a complex type that is 16 bytes in length when 64-bit doubles are used. gdb/ChangeLog: * rx-tdep.c (rx_push_dummy_call): Treat scalars larger than 8 bytes as aggregates.
2016-01-27Remove trailing `]' in --enable-compressed-debug-sectionsH.J. Lu3-2/+7
* configure.ac (compressed_debug_sections): Remove trailing `]'. * configure: Regenerated.
2016-01-27Add Keith Seitz as Linespec MaintainerJoel Brobecker2-0/+7
gdb/ChangeLog: * MAINTAINERS (Responsible Maintainers): Add Keith Seitz as Linespec Maintainers.
2016-01-27Automatic date update in version.inGDB Administrator1-1/+1
2016-01-26Fix function commentsSimon Marchi2-2/+7
Two obvious fixes. gdb/ChangeLog: * common/common-utils.c (skip_spaces): Fix comment. (skip_to_space_const): Likewise.
2016-01-26Fix subject verb agreement in the description of several debug settings.John Baldwin2-7/+11
gdb/doc/ChangeLog: * gdb.texinfo (Debugging Output): Fix subject verb disagreements.
2016-01-26Remove argument pc in get_next_pcsYao Qi9-21/+38
Nowadays, get_next_pcs in linux_target_ops has two parameters PC and REGCACHE. Parameter PC looks redundant because it can be go from REGCACHE. The patch is to remove PC from the arguments for various functions. gdb: 2016-01-26 Yao Qi <yao.qi@linaro.org> * arch/arm-get-next-pcs.c (thumb_deal_with_atomic_sequence_raw): Remove argument pc. Get pc by regcache_read_pc. Callers updated. (arm_deal_with_atomic_sequence_raw): Likewise. (thumb_get_next_pcs_raw): Likewise. (arm_get_next_pcs_raw): Likewise. (arm_get_next_pcs): Remove argument pc. Callers updated. * arch/arm-get-next-pcs.h (arm_get_next_pcs): Update declaration. gdb/gdbserver: 2016-01-26 Yao Qi <yao.qi@linaro.org> * linux-arm-low.c (arm_gdbserver_get_next_pcs): Remove argument pc. * linux-low.c (install_software_single_step_breakpoints): Don't call regcache_read_pc. * linux-low.h (struct linux_target_ops) <get_next_pcs>: Remove argument pc.
2016-01-26[GDBserver] Use regcache_read_pc in install_software_single_step_breakpointsYao Qi2-1/+7
In install_software_single_step_breakpoints, we've got the regcache of current_thread, so we don't have to bother get_pc to get pc, instead we can get pc from regcache directly. Note that the callers of install_software_single_step_breakpoints have already switched current_thread to LWP. Since the pc is got from regcache_read_pc, in the next patch, we can get pc inside the implementation of *the_low_target.get_next_pcs and stop passing pc to *the_low_target.get_next_pcs. gdb/gdbserver: 2016-01-26 Yao Qi <yao.qi@linaro.org> * linux-low.c (install_software_single_step_breakpoints): Call regcache_read_pc instead of get_pc.
2016-01-26[GDBserver] Block and unblock SIGIOYao Qi2-14/+30
Nowadays, GDBserver disables async io (by ignoring SIGIO) when process a serial event, and enables async io (by installing signal handler) when resume the inferior and wait. GDBserver may miss SIGIO (by interrupt) and doesn't process SIGIO in time, which is shown by gdb.base/interrupt-noterm.exp. In the test, GDB sends "continue &" and then "interrupt". if '\003' arrives at a period between GDBserver receives vCont;c and enables async io, SIGIO is ignored because signal handler isn't installed. GDBserver waits for the inferior and can not notice '\003' until it returns from wait. This patch changes the code to install SIGIO handler early, but block and unblock SIGIO as needed. In this way, we don't remove SIGIO handler, so SIGIO can't be ignored. However, GDBserver needs to remove the signal handler when connection is closed. gdb/gdbserver: 2016-01-26 Yao Qi <yao.qi@linaro.org> * remote-utils.c (remote_close) [!USE_WIN32API]: Ignore SIGIO. (unblock_async_io): Rename to ... (block_unblock_async_io): ... it. New function. (enable_async_io): Don't install SIGIO handler. Unblock it instead. (disable_async_io): Don't ignore SIGIO. Block it instead. (initialize_async_io): Install SIGIO handler. Don't call unblock_async_io.
2016-01-26[GDBserver] Check input interrupt after reading in a packetYao Qi2-0/+21
GDBserver may read some packet together with '\003' in one go. We've already checked '\003' first when reading packet by my patch, Check input interrupt first when reading packet https://sourceware.org/ml/gdb-patches/2016-01/msg00057.html but if we don't check '\003' *after* each packet, the interrupt will be processed next time GDBserver reads from the buffer, so that the interrupt isn't processed in time. For example, GDB sends vCont;c and interrupt (see gdb.base/interrupt-noterm.exp), we'll resume the inferior and wait once packet vCont;c is seen. If we don't check the interrupt character after vCont;c packet, interrupt character will stay in the buffer unattended until GDBserver returns from the wait, which may take a while. Note that since we've read '\003' from file descriptor, SIGIO signal handler input_interrupt doesn't help either. This issue can be exposed by hacking the end of getpkt like @@ -1041,6 +1050,9 @@ getpkt (char *buf) } } + if (readchar_bufcnt > 0) + gdb_assert (*readchar_bufp != '\003'); + return bp - buf; } and this can trigger internal error, (gdb) PASS: gdb.base/interrupt-noterm.exp: interrupt Remote connection closed^M (gdb) FAIL: gdb.base/interrupt-noterm.exp: inferior received SIGINT Remote debugging from host 10.2.206.40^M /home/yao/SourceCode/gnu/gdb/git/gdb/gdbserver/remote-utils.c:1054: A problem internal to GDBserver has been detected.^M getpkt: Assertion `*readchar_bufp != '\003'' failed.^M This patch is to peek the buffer, if it is '\003', consume it and call *the_target->request_interrupt. gdb/gdbserver: 2016-01-26 Yao Qi <yao.qi@linaro.org> * remote-utils.c (getpkt): If the buffer isn't empty, and the first character is '\003', call *the_target->request_interrupt.
2016-01-26Skip thumb2 conditional backward search test for PE based targets.Nick Clifton1-1/+1
* testsuite/gas/arm/thumb2_it_search.d: Skip for PE targets.
2016-01-25Rename OPTION_OMIT_LOCK_PREFIX to OPTION_MOMIT_LOCK_PREFIXH.J. Lu2-3/+10
Use OPTION_MXXX for -mxxx option in x86 assembler. * config/tc-i386.c (OPTION_OMIT_LOCK_PREFIX): Renamed to ... (OPTION_MOMIT_LOCK_PREFIX): This. (md_longopts): Updated. (md_parse_option): Likewise.
2016-01-26Automatic date update in version.inGDB Administrator1-1/+1
2016-01-26Fix GCC6 -Wmisleading-indentation issues.Mark Wielaard5-29/+42
GCC6 will warn about misleading indentation issues like: gdb/ada-lang.c: In function ‘ada_evaluate_subexp’: ada-lang.c:11423:9: error: statement is indented as if it were guarded by... arg1 = unwrap_value (arg1); ^~~~ gdb/ada-lang.c:11421:7: note: ...this ‘else’ clause, but it is not else ^~~~ In this case it would be a bug except for the fact the if clause already returned early. So this misindented statement really only got executed for the else case. But it could easily mislead a reader, so adding a proper else block is the correct solution. In case of c-typeprint.c (c_type_print_base) the if statement is indeed misleadingly indented, but not a bug. Just indent correctly. The inflow.c (terminal_ours_1) misindented block comes from the removal of an if clause in commit d9d2d8b which looks correct. Just introduce an else to fixup the indentation of the block. The linux-record.c misleadingly indented return statements are just that. Misleading to the reader, but not actual bugs. Just unindent them so they don't look like they fall under the wrong if clause.
2016-01-25Avoid the use of gp-relative addressing when abicalls are in effect.Catherine Moore5-0/+33
2016-01-25Prevent .noinit section from incorrect placement for AVR.Denis Chertykov3-2/+7
When .data and .bss sections are empty .noinit section is placed at data region's start. This will be incorrect for devices that has different data start address than data region start in linker script. The patch updates .noinit section's VMA to end of .bss section. So, .noinit section will be placed at .data section address (-Tdata=<address>) when .data and .bss sections are empty. ld/ * scripttempl/avr.sc (.noinit): Force .noinit VMA to end of .bss VMA. * scripttempl/avrtiny.sc (.noinit): Likewise.
2016-01-25Remove new_thread_notify and dead_thread_notifyYao Qi3-35/+7
They were added by PATCH: Multithreaded debugging for gdbserver https://sourceware.org/ml/gdb-patches/2002-06/msg00157.html but as a no-op, and the last usage of them was removed by [gdbserver/RFC/RFA] Implement multiprocess extensions, add linux multiproces support. https://sourceware.org/ml/gdb-patches/2009-03/msg00667.html This patch is to remove them. gdb/gdbserver: 2016-01-25 Yao Qi <yao.qi@linaro.org> * remote-utils.c (new_thread_notify): Remove. (dead_thread_notify): Likewise. * remote-utils.h (new_thread_notify): Remove declaration. (dead_thread_notify): Likewise.
2016-01-25ARC/BFD: Fix a build error from `index' shadowing a global declarationMaciej W. Rozycki2-5/+10
bfd/ * elf32-arc.c (elf_arc_finish_dynamic_symbol): Rename `index' to `dynindx'.
2016-01-25[PATCH[ARM]Check mapping symbol while backward searching for IT block.Renlin Li5-3/+108
opcodes/ * arm-dis.c (mapping_symbol_for_insn): New function. (find_ifthen_state): Call mapping_symbol_for_insn(). gas/ * testsuite/gas/arm/thumb2_it_search.d: New. * testsuite/gas/arm/thumb2_it_search.s: New.
2016-01-25Fix PR 19461: strange "info thread" behavior in non-stopPedro Alves5-0/+269
If you have "set follow-fork child" set, then if you do "info threads" right after a fork, and before the child reports any other event to GDB core, you'll see: (gdb) info threads Id Target Id Frame * 1.1 Thread 0x7ffff7fc1740 (LWP 31875) "fork-plus-threa" (running) 2.1 process 31879 "fork-plus-threa" Selected thread is running. (gdb) The "Selected thread is running." bit is a bogus error. That was GDB trying to fetch the current frame of thread 2.1, because the external runnning state is "stopped", and then throwing an error because the thread is actually running. This actually affects all-stop + schedule-multiple as well. The problem here is that on a fork event, GDB doesn't update the external parent/child running states. New comprehensive test included. The "kill inferior 1" / "kill inferior 2" bits also trip on PR gdb/19494 (hang killing unfollowed fork children), which was fixed by the previous patch. gdb/ChangeLog: 2016-01-25 Pedro Alves <palves@redhat.com> PR threads/19461 * infrun.c (handle_inferior_event_1) <fork/vfork>: Update parent/child running states. gdb/testsuite/ChangeLog: 2016-01-25 Pedro Alves <palves@redhat.com> PR threads/19461 * gdb.base/fork-running-state.c: New file. * gdb.base/fork-running-state.exp: New file.
2016-01-25Fix PR 19494: hang when killing unfollowed fork childrenPedro Alves5-35/+281
linux_nat_kill relies on get_last_target_status to determine whether the current inferior is stopped at a unfollowed fork/vfork event. This is bad because many things can happen ever since we caught the fork/vfork event... This commit rewrites that code to instead walk the thread list looking for unfollowed fork events, similarly to what was done for remote.c. New test included. The main idea of the test is make sure that when the program stops for a fork catchpoint, and the user kills the parent, gdb also kills the unfollowed fork child. Since the child hasn't been added as an inferior at that point, we need some other portable way to detect that the child is gone. The test uses a pipe for that. The program forks twice, so you have grandparent, child and grandchild. The grandchild inherits the write side of the pipe. The grandparent hangs reading from the pipe, since nothing ever writes to it. If, when GDB kills the child, it also kills the grandchild, then the grandparent's pipe read returns 0/EOF and the test passes. Otherwise, if GDB doesn't kill the grandchild, then the pipe read never returns and the test times out, like: FAIL: gdb.base/catch-fork-kill.exp: fork-kind=fork: exit-kind=kill: fork: kill parent (timeout) FAIL: gdb.base/catch-fork-kill.exp: fork-kind=vfork: exit-kind=kill: vfork: kill parent (timeout) No regressions on x86_64 Fedora 20. New test passes with gdbserver as well. gdb/ChangeLog: 2016-01-25 Pedro Alves <palves@redhat.com> PR gdb/19494 * linux-nat.c (kill_one_lwp): New, factored out from ... (kill_callback): ... this. (kill_wait_callback): New, factored out from ... (kill_wait_one_lwp): ... this. (kill_unfollowed_fork_children): New function. (linux_nat_kill): Use it. gdb/testsuite/ChangeLog: 2016-01-25 Pedro Alves <palves@redhat.com> PR gdb/19494 * gdb.base/catch-fork-kill.c: New file. * gdb.base/catch-fork-kill.exp: New file.
2016-01-25Move foreach_with_prefix to lib/gdb.expPedro Alves5-36/+22
gdb/testsuite/ChangeLog: 2016-01-25 Pedro Alves <palves@redhat.com> * gdb.base/step-sw-breakpoint-adjust-pc.exp (foreach_with_prefix): Delete, moved to lib/gdb.exp. * gdb.threads/forking-threads-plus-breakpoint.exp (foreach_with_prefix): Likewise. * gdb.threads/process-dies-while-handling-bp.exp (foreach_with_prefix): Likewise. * lib/gdb.exp (foreach_with_prefix): New procedure.
2016-01-25Delete ChangeLog entry from the wrong placePedro Alves1-63/+0
Missed actually removing this in 37e42b4fe92c...
2016-01-25gdb.trace/testsuite: Bump stack collection fudge factor.Marcin Kościelnicki3-2/+7
These two tests collect 64 words from $sp onwards, hoping that's enough to capture a few whole stack frames. Unfortunately, that's not enough for s390, which tends to have large frame sizes - minimum 24 words on s390, 20 on s390x (which just barely passes). Bump it to 128 words, let's hope no machine needs more. Tested on x86_64, s390, s390x. gdb/testsuite/ChangeLog: * gdb.trace/backtrace.exp: Bump stack collection fudge factor. * gdb.trace/entry-values.exp: Bump stack collection fudge factor.
2016-01-25Add missing end-of-comment marker to previous delta. (Doh!)Nick Clifton1-1/+1
2016-01-25Fix memory corruption on Mach-O systems by suppressing a memory tidy up.Nick Clifton2-0/+18
PR target/19435 * mach-o.c (bfd_mach_o_close_and_cleanup): Suppress code to free dsym filename buffer.
2016-01-25Automatic date update in version.inGDB Administrator1-1/+1
2016-01-24MIPS/BFD: Simplify register index calculation in BZ16_REG_FIELDMaciej W. Rozycki2-2/+5
Just mask higher bits off, which returns the same set of 3-bit register encodings of { 0, 1, 2, 3, 4, 5, 6, 7 } for the allowed 5-bit encodings of { 16, 17, 2, 3, 4, 5, 6, 7 }. Input has already been validated with OP16_VALID_REG. bfd/ * elfxx-mips.c (BZ16_REG_FIELD): Simplify calculation.
2016-01-24MIPS/BFD: Correct register index calculation in BZ16_REGMaciej W. Rozycki2-1/+5
For the 3-bit register encodings of { 0, 1, 2, 3, 4, 5, 6, 7 } return the 5-bit encodings of { 16, 17, 2, 3, 4, 5, 6, 7 } respectively rather than { 24, 25, 2, 3, 4, 5, 6, 7 }. bfd/ * elfxx-mips.c (BZ16_REG): Correct calculation.
2016-01-24Automatic date update in version.inGDB Administrator1-1/+1
2016-01-23gdb.trace: Fix unavailable-dwarf-piece.exp on big endian targetsMarcin Kościelnicki2-3/+22
The test constructs fake DWARF info for a C structure involving bitfields. DWARF bitfields are always counted from LSB, while the order in which bitfields are allocated in a C struct depends on the target endianness - thus the generated DWARF marks different bitfields as unavailable when target is big endian. Accordingly, we need different expected outputs. Tested on s390 and s390x, no regression on x86_64. gdb/testsuite/ChangeLog: * gdb.trace/unavailable-dwarf-piece.exp: Fix bitfield handling on big endian targets.
2016-01-23gdb.trace: Fix another expected message on continue.Marcin Kościelnicki2-1/+5
Missed one message in bd0a71fa16f668341a9361c695bc3ca44d27b322, since it didn't trigger on s390x or amd64 (fast tracepoint out of range due to shared library usage), noticed on s390. Pushed as obvious. gdb/testsuite/ChangeLog: * gdb.trace/pending.exp: Fix expected message on continue.