aboutsummaryrefslogtreecommitdiff
path: root/gdb/testsuite/gdb.base/longjmp.c
AgeCommit message (Collapse)AuthorFilesLines
2022-12-06[gdb/testsuite] Make gdb.base/longjmp.exp FAIL more stable across archsTom de Vries1-4/+4
When running test-case gdb.base/longjmp.exp on x86_64-linux, the master longjmp breakpoint is set using probes and the test-case passes: ... (gdb) PASS: gdb.base/longjmp.exp: next to longjmp (1) next^M 0x00000000004005cc 49 if (setjmp (env) == 0) /* patt1 */^M (gdb) PASS: gdb.base/longjmp.exp: next over longjmp(1) next^M 56 resumes++;^M (gdb) PASS: gdb.base/longjmp.exp: next into else block (1) ... However, if I disable create_longjmp_master_breakpoint_probe, we have instead: ... (gdb) PASS: gdb.base/longjmp.exp: next to longjmp (1) next^M 56 resumes++;^M (gdb) FAIL: gdb.base/longjmp.exp: next over longjmp(1) ... At first glance, the failure mode doesn't look too bad: we stop a few insns later than the passing scenario. For contrast, if we do the same on powerpc64le, the failure mode is: ... (gdb) PASS: gdb.base/longjmp.exp: next to longjmp (1) next^M ^M Breakpoint 3, main () at longjmp.c:59^M 59 i = 1; /* miss_step_1 */^M (gdb) FAIL: gdb.base/longjmp.exp: next over longjmp(1) ... Here we only stop because of running into the safety net breakpoint at miss_step_1. So, how does this happen on x86_64? Let's look at the code: ... 4005c7: e8 94 fe ff ff call 400460 <_setjmp@plt> 4005cc: 85 c0 test %eax,%eax 4005ce: 75 1e jne 4005ee <main+0x3b> 4005d0: 8b 05 8e 0a 20 00 mov 0x200a8e(%rip),%eax # 601064 <longjmps> 4005d6: 83 c0 01 add $0x1,%eax 4005d9: 89 05 85 0a 20 00 mov %eax,0x200a85(%rip) # 601064 <longjmps> 4005df: be 01 00 00 00 mov $0x1,%esi 4005e4: bf 80 10 60 00 mov $0x601080,%edi 4005e9: e8 82 fe ff ff call 400470 <longjmp@plt> 4005ee: 8b 05 74 0a 20 00 mov 0x200a74(%rip),%eax # 601068 <resumes> ... The next over the longjmp call at 4005e9 is supposed to stop at the longjmp target at 4005cc, but instead we stop at 4005ee, where we have the step-resume breakpoint inserted by the next. In other words, we accidentally "return" from the longjmp call to the insn immediately after it (even though a longjmp is a noreturn function). Try to avoid this accident and make the failure mode on x86_64 the same as on powerpc64le, by switching the then and else branch. Tested on x86_64-linux.
2022-01-01Automatic Copyright Year update after running gdb/copyright.pyJoel Brobecker1-1/+1
This commit brings all the changes made by running gdb/copyright.py as per GDB's Start of New Year Procedure. For the avoidance of doubt, all changes in this commits were performed by the script.
2021-01-01Update copyright year range in all GDB filesJoel Brobecker1-1/+1
This commits the result of running gdb/copyright.py as per our Start of New Year procedure... gdb/ChangeLog Update copyright year range in copyright header of all GDB files.
2020-01-01Update copyright year range in all GDB files.Joel Brobecker1-1/+1
gdb/ChangeLog: Update copyright year range in all GDB files.
2019-01-01Update copyright year range in all GDB files.Joel Brobecker1-1/+1
This commit applies all changes made after running the gdb/copyright.py script. Note that one file was flagged by the script, due to an invalid copyright header (gdb/unittests/basic_string_view/element_access/char/empty.cc). As the file was copied from GCC's libstdc++-v3 testsuite, this commit leaves this file untouched for the time being; a patch to fix the header was sent to gcc-patches first. gdb/ChangeLog: Update copyright year range in all GDB files.
2018-01-02Update copyright year range in all GDB filesJoel Brobecker1-1/+1
gdb/ChangeLog: Update copyright year range in all GDB files
2017-01-01update copyright year range in GDB filesJoel Brobecker1-1/+1
This applies the second part of GDB's End of Year Procedure, which updates the copyright year range in all of GDB's files. gdb/ChangeLog: Update copyright year range in all GDB files.
2016-01-01GDB copyright headers update after running GDB's copyright.py script.Joel Brobecker1-1/+1
gdb/ChangeLog: Update year range in copyright notice of all files.
2015-01-01Update year range in copyright notice of all files owned by the GDB project.Joel Brobecker1-1/+1
gdb/ChangeLog: Update year range in copyright notice of all files.
2014-01-01Update Copyright year range in all files maintained by GDB.Joel Brobecker1-1/+1
2013-06-07Fix formating in copyright headers.Pedro Alves1-2/+1
File list found with: $ grep "along with this program" * -A 1 -rn \ | grep "*/" \ | grep -v "along with this program" \ | sed 's,-[0-9]\+-.*,,g' Tested on x86_64 Fedora 17. gdb/ 2013-06-07 Pedro Alves <palves@redhat.com> * darwin-nat.c: Fix formating in copyright header. * darwin-nat.h: Likewise. * gnu-nat.c: Likewise. * machoread.c: Likewise. gdb/testsuite/ 2013-06-07 Pedro Alves <palves@redhat.com> * gdb.ada/info_types.c: Fix formating in copyright header. * gdb.base/break-on-linker-gcd-function.cc: Likewise. * gdb.base/float.c: Likewise. * gdb.base/inferior-died.c: Likewise. * gdb.base/interp.c: Likewise. * gdb.base/jit-main.c: Likewise. * gdb.base/jit-solib.c: Likewise. * gdb.base/long_long.c: Likewise. * gdb.base/longjmp.c: Likewise. * gdb.base/nextoverexit.c: Likewise. * gdb.base/pr11022.c: Likewise. * gdb.base/prelink-lib.c: Likewise. * gdb.base/prelink.c: Likewise. * gdb.base/prologue.c: Likewise. * gdb.base/restore.c: Likewise. * gdb.base/sigchld.c: Likewise. * gdb.base/solib-search-lib1.c: Likewise. * gdb.base/solib-search-lib2.c: Likewise. * gdb.base/solib-search.c: Likewise. * gdb.base/solib-search.h: Likewise. * gdb.base/whatis.c: Likewise. * gdb.cp/abstract-origin.cc: Likewise. * gdb.cp/anon-struct.cc: Likewise. * gdb.cp/baseenum.cc: Likewise. * gdb.cp/bs15503.cc: Likewise. * gdb.cp/call-c-1.c: Likewise. * gdb.cp/call-c.cc: Likewise. * gdb.cp/class2.cc: Likewise. * gdb.cp/classes.cc: Likewise. * gdb.cp/cttiadd.cc: Likewise. * gdb.cp/cttiadd1.cc: Likewise. * gdb.cp/cttiadd2.cc: Likewise. * gdb.cp/cttiadd3.cc: Likewise. * gdb.cp/derivation.cc: Likewise. * gdb.cp/derivation2.cc: Likewise. * gdb.cp/dispcxx.cc: Likewise. * gdb.cp/exception.cc: Likewise. * gdb.cp/gdb2384-base.cc: Likewise. * gdb.cp/gdb2384-base.h: Likewise. * gdb.cp/gdb2384.cc: Likewise. * gdb.cp/gdb2495.cc: Likewise. * gdb.cp/mb-inline.h: Likewise. * gdb.cp/mb-inline1.cc: Likewise. * gdb.cp/mb-inline2.cc: Likewise. * gdb.cp/member-name.cc: Likewise. * gdb.cp/member-ptr.cc: Likewise. * gdb.cp/misc.cc: Likewise. * gdb.cp/namespace1.cc: Likewise. * gdb.cp/nextoverthrow.cc: Likewise. * gdb.cp/pr-574.cc: Likewise. * gdb.cp/pr9631.cc: Likewise. * gdb.cp/printmethod.cc: Likewise. * gdb.cp/psmang1.cc: Likewise. * gdb.cp/psmang2.cc: Likewise. * gdb.cp/psymtab-parameter.cc: Likewise. * gdb.cp/ptype-flags.cc: Likewise. * gdb.cp/ref-params.cc: Likewise. * gdb.cp/ref-types.cc: Likewise. * gdb.cp/smartp.cc: Likewise. * gdb.cp/try_catch.cc: Likewise. * gdb.cp/userdef.cc: Likewise. * gdb.cp/using-crash.cc: Likewise. * gdb.cp/virtfunc.cc: Likewise. * gdb.cp/virtfunc2.cc: Likewise. * gdb.dwarf2/callframecfa.S: Likewise. * gdb.dwarf2/dw2-ranges.c: Likewise. * gdb.dwarf2/dw2-ranges2.c: Likewise. * gdb.dwarf2/dw2-ranges3.c: Likewise. * gdb.dwarf2/dw2-restore.S: Likewise. * gdb.dwarf2/pieces.S: Likewise. * gdb.dwarf2/valop.S: Likewise. * gdb.java/jnpe.java: Likewise. * gdb.mi/mi-stepn.c: Likewise. * gdb.mi/mi-var-cp.cc: Likewise. * gdb.mi/mi-var-rtti.cc: Likewise. * gdb.mi/ns-stale-regcache.c: Likewise. * gdb.mi/pr11022.c: Likewise. * gdb.mi/solib-lib.c: Likewise. * gdb.mi/solib-main.c: Likewise. * gdb.python/py-arch.c: Likewise. * gdb.python/py-block.c: Likewise. * gdb.python/py-breakpoint.c: Likewise. * gdb.python/py-events.c: Likewise. * gdb.python/py-evthreads.c: Likewise. * gdb.python/py-explore.c: Likewise. * gdb.python/py-explore.cc: Likewise. * gdb.python/py-finish-breakpoint.c: Likewise. * gdb.python/py-finish-breakpoint2.cc: Likewise. * gdb.python/py-symbol.c: Likewise. * gdb.threads/execl.c: Likewise. * gdb.threads/execl1.c: Likewise.
2013-01-01Update years in copyright notice for the GDB files.Joel Brobecker1-1/+1
Two modifications: 1. The addition of 2013 to the copyright year range for every file; 2. The use of a single year range, instead of potentially multiple year ranges, as approved by the FSF.
2012-06-11 * infrun.c (handle_inferior_event)Tom Tromey1-1/+3
<BPSTAT_WHAT_SET_LONGJMP_RESUME>: Don't delete the step-resume breakpoint. <BPSTAT_WHAT_CLEAR_LONGJMP_RESUME>: Remove longjmp logic; use exception logic in all cases. Update comments. (insert_longjmp_resume_breakpoint): Set the exception resume breakpoint. testsuite * gdb.base/longjmp.c (hidden_longjmp): Move expected catch location... (main): ...here.
2012-01-04Copyright year update in most files of the GDB Project.Joel Brobecker1-1/+1
gdb/ChangeLog: Copyright year update in most files of the GDB Project.
2011-01-01run copyright.sh for 2011.Joel Brobecker1-1/+1
2010-01-01Update copyright year in most headers.Joel Brobecker1-1/+1
Automatic update by copyright.sh.
2009-01-03 Updated copyright notices for most files.Joel Brobecker1-1/+1
2008-05-04 * gdb.base/longjmp.c, gdb.base/longjmp.exp: New files.Pedro Alves1-0/+81