diff --git a/gdb-testsuite-handle-sigill-in-two-gdb.arch-powerpc-test-cases.patch b/gdb-testsuite-handle-sigill-in-two-gdb.arch-powerpc-test-cases.patch new file mode 100644 index 0000000..7976e67 --- /dev/null +++ b/gdb-testsuite-handle-sigill-in-two-gdb.arch-powerpc-test-cases.patch @@ -0,0 +1,73 @@ +[gdb/testsuite] Handle SIGILL in two gdb.arch powerpc test-cases + +On powerpc64le-linux, with test-case gdb.arch/powerpc-addpcis.exp I run into +SIGILL: +... +(gdb) PASS: gdb.arch/powerpc-addpcis.exp: get hexadecimal valueof "$r3" +stepi^M +^M +Program terminated with signal SIGILL, Illegal instruction.^M +The program no longer exists.^M +(gdb) PASS: gdb.arch/powerpc-addpcis.exp: set r4 +... +because it's a power9 insn, and I'm running on a power8 machine. + +Fix this by handling the SIGILL. Likewise in gdb.arch/powerpc-lnia.exp. + +Tested on powerpc64le-linux. + +--- + gdb/testsuite/gdb.arch/powerpc-addpcis.exp | 14 +++++++++++++- + gdb/testsuite/gdb.arch/powerpc-lnia.exp | 14 +++++++++++++- + 2 files changed, 26 insertions(+), 2 deletions(-) + +diff --git a/gdb/testsuite/gdb.arch/powerpc-addpcis.exp b/gdb/testsuite/gdb.arch/powerpc-addpcis.exp +index d1bc7f49ce6..ff7052ce475 100644 +--- a/gdb/testsuite/gdb.arch/powerpc-addpcis.exp ++++ b/gdb/testsuite/gdb.arch/powerpc-addpcis.exp +@@ -50,7 +50,19 @@ gdb_breakpoint $bp1 + gdb_breakpoint $bp2 + gdb_breakpoint $bp3 + +-gdb_test "stepi" "" "set r3 " ++set insn_supported 1 ++gdb_test_multiple "stepi" "set r3" { ++ -re "Program received signal SIGILL, Illegal instruction\\..*" { ++ set insn_supported 0 ++ } ++ -re -wrap "" { ++ pass $gdb_test_name ++ } ++} ++if { ! $insn_supported } { ++ unsupported "illegal instruction" ++ return ++} + set check_r3 [get_hexadecimal_valueof "\$r3" "default0"] + gdb_test "stepi" "" "set r4" + set check_r4 [get_hexadecimal_valueof "\$r4" "default0"] +diff --git a/gdb/testsuite/gdb.arch/powerpc-lnia.exp b/gdb/testsuite/gdb.arch/powerpc-lnia.exp +index 0f56d834046..4ab4f8d92be 100644 +--- a/gdb/testsuite/gdb.arch/powerpc-lnia.exp ++++ b/gdb/testsuite/gdb.arch/powerpc-lnia.exp +@@ -54,7 +54,19 @@ gdb_breakpoint $bp3 + + # single-step through the lnia instructions, and retrieve the + # register values as we proceed. +-gdb_test "stepi" "" "set r3" ++set insn_supported 1 ++gdb_test_multiple "stepi" "set r3" { ++ -re "Program received signal SIGILL, Illegal instruction\\..*" { ++ set insn_supported 0 ++ } ++ -re -wrap "" { ++ pass $gdb_test_name ++ } ++} ++if { ! $insn_supported } { ++ unsupported "illegal instruction" ++ return ++} + set check_r3 [get_hexadecimal_valueof "\$r3" "default0"] + gdb_test "stepi" "" "set r4" + set check_r4 [get_hexadecimal_valueof "\$r4" "default0"] diff --git a/gdb-testsuite-work-around-skip_prologue-problems-in-gdb.threads-process-dies-while-detaching.exp.patch b/gdb-testsuite-work-around-skip_prologue-problems-in-gdb.threads-process-dies-while-detaching.exp.patch new file mode 100644 index 0000000..1517176 --- /dev/null +++ b/gdb-testsuite-work-around-skip_prologue-problems-in-gdb.threads-process-dies-while-detaching.exp.patch @@ -0,0 +1,80 @@ +[gdb/testsuite] Work around skip_prologue problems in gdb.threads/process-dies-while-detaching.exp + +On powerpc64le-linux, I run into: +... +[Inferior 1 (process 5156) exited normally]^M +(gdb) FAIL: gdb.threads/process-dies-while-detaching.exp: single-process: \ + detach: detach: continue to breakpoint: _exit (the program exited) +... + +What happens is the following: +- a breakpoint is set on _exit, +- a continue is issued +- the continue is supposed to hit the breakpoint, but instead + the program exits. + +I traced this down to the breakpoint on _exit being set too far from function +entry. This is caused by the skip_prologue function (in rs6000-tdep.c) +optimistically ignoring insns it doesn't recognize. In particular, it walks +past the system call instruction "sc" which initiates the actual exit. + +While this needs fixing, we don't want to be testing this behaviour in this +test-case. + +[ Initially I tried to fix it by setting a breakpoint on "*_exit" instead, but +that one only sets one location. The breakpoint on "_exit" sets two +locations, one in /lib64/libc.so.6 and one in /lib64/ld64.so.2. I tried on +x86_64 and there the breakpoint on "*_exit" mapped to the /lib64/libc.so.6 +location, and the test-case passed. But on powerpc it mapped to the +/lib64/ld64.so.2 location and I still got the same failures. ] + +Fix this by setting two breakpoints on the calls to _exit and exit instead. + +Tested on x86_64-linux and powerpc64le-linux. + +--- + gdb/testsuite/gdb.threads/process-dies-while-detaching.c | 4 ++-- + gdb/testsuite/gdb.threads/process-dies-while-detaching.exp | 8 ++++++-- + 2 files changed, 8 insertions(+), 4 deletions(-) + +diff --git a/gdb/testsuite/gdb.threads/process-dies-while-detaching.c b/gdb/testsuite/gdb.threads/process-dies-while-detaching.c +index 502b4622614..c4c0b0a648b 100644 +--- a/gdb/testsuite/gdb.threads/process-dies-while-detaching.c ++++ b/gdb/testsuite/gdb.threads/process-dies-while-detaching.c +@@ -46,7 +46,7 @@ void * + thread_function (void *arg) + { + pthread_barrier_wait (&start_threads_barrier); +- _exit (0); ++ _exit (0); /* Exit in thread. */ + } + + /* The fork child's entry point. */ +@@ -63,7 +63,7 @@ child_function (void) + pthread_create (&threads[i], NULL, thread_function, NULL); + pthread_barrier_wait (&start_threads_barrier); + +- exit (0); ++ exit (0); /* Exit in child. */ + } + + /* This is defined by the .exp file if testing the multi-process +diff --git a/gdb/testsuite/gdb.threads/process-dies-while-detaching.exp b/gdb/testsuite/gdb.threads/process-dies-while-detaching.exp +index ac1aad26ec5..458d3bbeb56 100644 +--- a/gdb/testsuite/gdb.threads/process-dies-while-detaching.exp ++++ b/gdb/testsuite/gdb.threads/process-dies-while-detaching.exp +@@ -126,8 +126,12 @@ proc detach_and_expect_exit {inf_output_re test} { + # Run to _exit in the child. + + proc continue_to_exit_bp {} { +- gdb_breakpoint "_exit" temporary +- gdb_continue_to_breakpoint "_exit" ".*_exit.*" ++ set line [gdb_get_line_number "Exit in child"] ++ gdb_breakpoint $line temporary ++ set line [gdb_get_line_number "Exit in thread"] ++ gdb_breakpoint $line temporary ++ gdb_continue_to_breakpoint "exit" ".*exit.*" ++ delete_breakpoints + } + + # If testing single-process, simply detach from the process. diff --git a/gdb.changes b/gdb.changes index 313f866..4a23a6e 100644 --- a/gdb.changes +++ b/gdb.changes @@ -1,3 +1,37 @@ +------------------------------------------------------------------- +Thu Oct 28 13:40:28 UTC 2021 - Tom de Vries + +- Mention removed fedora patches: + * gdb-6.3-test-self-20050110.patch + * gdb-bz1219747-attach-kills.patch + * gdb-6.6-buildid-locate-core-as-arg.patch + * gdb-attach-fail-reasons-5of5.patch + * gdb-archer-pie-addons.patch + * gdb-jit-reader-multilib.patch + * gdb-6.5-bz218379-solib-trampoline-lookup-lock-fix.patch + * gdb-archer.patch + * gdb-config.patch + * gdb-6.8-quit-never-aborts.patch +- Mention removed patches: + * gdb-breakpoint-fix-assert-in-jit_event_handler.patch + * gdb-fix-section-matching-in-find_pc_sect_compunit.patch + * gdb-fortran-fix-print-dynamic-array.patch + * gdb-build-hardcode-with-included-regex.patch + * gdb-handle-no-upper-bound-in-value-subscript.patch + * gdb-fix-internal-error-in-process_event_stop_test.patch + * gdb-don-t-return-non-existing-path-in-debuginfod-source-query.patch + * gdb-archer-pie-addons-keep-disabled.patch + * gdb-fix-filename-in-not-in-executable-format-error.patch + * gdb-fix-use-of-invalid-pointer-in-remote-async-inferior-event-handler.patch + * gdb-breakpoints-handle-glibc-with-debuginfo-in-create_exception_master_breakpoint.patch +- Maintenance scripts: + * Add KFAILs in qa.sh. + * Add missing '-a' in gdb.log greps in qa.sh. + * Fix error handling in qa.sh. +- Patches added: + * gdb-testsuite-handle-sigill-in-two-gdb.arch-powerpc-test-cases.patch + * gdb-testsuite-work-around-skip_prologue-problems-in-gdb.threads-process-dies-while-detaching.exp.patch + ------------------------------------------------------------------- Fri Oct 22 07:03:55 UTC 2021 - Tom de Vries diff --git a/gdb.spec b/gdb.spec index b46106e..d8dfadd 100644 --- a/gdb.spec +++ b/gdb.spec @@ -354,6 +354,10 @@ Patch2108: gdb-testsuite-fix-port-detection-in-gdb.debuginfod-fetch_src_and Patch2109: gdb-testsuite-add-checks-to-gdb.arch-i386-sse.exp.patch # https://sourceware.org/pipermail/gdb-patches/2021-October/182868.html Patch2110: gdb-testsuite-Fix-gdb.threads-thread-specific-bp.exp.patch +#https://sourceware.org/pipermail/gdb-patches/2021-October/182919.html +Patch2111: gdb-testsuite-work-around-skip_prologue-problems-in-gdb.threads-process-dies-while-detaching.exp.patch +#https://sourceware.org/pipermail/gdb-patches/2021-October/182921.html +Patch2112: gdb-testsuite-handle-sigill-in-two-gdb.arch-powerpc-test-cases.patch BuildRequires: bison BuildRequires: flex @@ -766,6 +770,8 @@ find -name "*.info*"|xargs rm -f %patch2108 -p1 %patch2109 -p1 %patch2110 -p1 +%patch2111 -p1 +%patch2112 -p1 #unpack libipt %if 0%{have_libipt} diff --git a/qa.sh b/qa.sh index b288a29..1fba067 100644 --- a/qa.sh +++ b/qa.sh @@ -17,7 +17,7 @@ fi n="$1" shift -if [ "$n" -eq 5 ]; then +if [ "$n" = "5" ]; then dir="$1" shift fi @@ -90,6 +90,7 @@ kfail=( "FAIL: gdb.threads/signal-while-stepping-over-bp-other-thread.exp: step \(pattern 3\)" # https://sourceware.org/bugzilla/show_bug.cgi?id=26915 "FAIL: gdb.threads/schedlock.exp: schedlock=off: cmd=next: call_function=0: other threads ran - unlocked" + "FAIL: gdb.threads/schedlock.exp: schedlock=off: cmd=step: other threads ran - unlocked" # https://sourceware.org/bugzilla/show_bug.cgi?id=28479 "FAIL: gdb.mi/mi-nonstop.exp: wait for thread exit \(timeout\)" @@ -138,6 +139,9 @@ kfail_factory=( "FAIL: gdb.gdb/selftest.exp: backtrace through signal handler" # https://sourceware.org/bugzilla/show_bug.cgi?id=26867 "FAIL: gdb.threads/signal-sigtrap.exp: sigtrap thread 1: signal SIGTRAP reaches handler" + # https://sourceware.org/bugzilla/show_bug.cgi?id=28510 + FAIL: gdb.debuginfod/fetch_src_and_symbols.exp: local_url: br main + FAIL: gdb.debuginfod/fetch_src_and_symbols.exp: local_url: l ) case $n in @@ -182,9 +186,9 @@ case $n in ) kfail_re=$(join "|" "${kfail[@]}") - grep -aH internal-error: binaries-testsuite.*/gdb-testresults/*.log \ - | grep -v "maint.c:[0-9]" \ - | grep -E -v "$kfail_re" + grep -a -H internal-error: binaries-testsuite.*/gdb-testresults/*.log \ + | grep -a -v "maint.c:[0-9]" \ + | grep -a -E -v "$kfail_re" ;; 4)