public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
* [rpms/gdb] gdb-17.2-rebase-f44: - New test for step-resume breakpoint placed in multiple threads at once.
@ 2026-06-27 23:54 Jan Kratochvil
  0 siblings, 0 replies; only message in thread
From: Jan Kratochvil @ 2026-06-27 23:54 UTC (permalink / raw)
  To: git-commits

A new commit has been pushed.

Repo   : rpms/gdb
Branch : gdb-17.2-rebase-f44
Commit : 40f8d2fd9b8360fd932f28cea7138502f362e18c
Author : Jan Kratochvil <jkratoch@fedoraproject.org>
Date   : 2009-09-27T15:51:46+00:00
Stats  : +158/-1 in 2 file(s)
URL    : https://src.fedoraproject.org/rpms/gdb/c/40f8d2fd9b8360fd932f28cea7138502f362e18c?branch=gdb-17.2-rebase-f44

Log:
- New test for step-resume breakpoint placed in multiple threads at once.

---
diff --git a/gdb-simultaneous-step-resume-breakpoint-test.patch b/gdb-simultaneous-step-resume-breakpoint-test.patch
new file mode 100644
index 0000000..e6e53bb
--- /dev/null
+++ b/gdb-simultaneous-step-resume-breakpoint-test.patch
@@ -0,0 +1,150 @@
+--- /dev/null	2009-09-25 12:44:54.497650251 +0200
++++ ./gdb/testsuite/gdb.threads/simultaneous-step-resume-breakpoint.exp	2009-09-25 17:27:12.000000000 +0200
+@@ -0,0 +1,65 @@
++# Copyright (C) 2009 Free Software Foundation, Inc.
++
++# This program is free software; you can redistribute it and/or modify
++# it under the terms of the GNU General Public License as published by
++# the Free Software Foundation; either version 3 of the License, or
++# (at your option) any later version.
++#
++# This program is distributed in the hope that it will be useful,
++# but WITHOUT ANY WARRANTY; without even the implied warranty of
++# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
++# GNU General Public License for more details.
++#
++# You should have received a copy of the GNU General Public License
++# along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
++
++# Test multiple threads stepping into a .debug_line-less function with
++# a breakpoint placed on its return-to-caller point.
++
++set testfile simultaneous-step-resume-breakpoint
++set srcfile ${testfile}.c
++set binfile ${objdir}/${subdir}/${testfile}
++
++if {[gdb_compile_pthreads "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug}] != "" } {
++    return -1
++}
++
++gdb_exit
++gdb_start
++gdb_reinitialize_dir $srcdir/$subdir
++
++# Ensure we have no debuginfo for the `sleep' call itself (=for libc).
++gdb_test "set debug-file-directory /DoesNotExist"
++
++gdb_load ${binfile}
++if ![runto_main] {
++   return -1
++}
++
++# Red Hat vendor patch does set it to "step" by default.
++gdb_test "set scheduler-locking off"
++
++gdb_breakpoint [gdb_get_line_number "final-exit"]
++
++gdb_breakpoint [gdb_get_line_number "sleep-call"]
++gdb_continue_to_breakpoint "sleep-call"
++
++gdb_test "step" "sleep-call.*" "step thread 1"
++gdb_test "step" "sleep-call.*" "step thread 2"
++gdb_test "step" "sleep-after.*" "step thread 3"
++
++set test "first continue"
++gdb_test_multiple "continue" $test {
++    -re "final-exit.*$gdb_prompt $" {
++	# gdb-7.0.
++	pass $test
++	return
++    }
++    -re "sleep-after.*$gdb_prompt $" {
++	# Fedora/RHEL branch.
++	pass $test
++    }
++}
++
++gdb_test "continue" "sleep-after.*" "second continue"
++gdb_test "continue" "final-exit.*" "third continue"
+--- /dev/null	2009-09-25 12:44:54.497650251 +0200
++++ ./gdb/testsuite/gdb.threads/simultaneous-step-resume-breakpoint.c	2009-09-25 17:29:42.000000000 +0200
+@@ -0,0 +1,79 @@
++/* Copyright 2009 Free Software Foundation, Inc.
++
++   Written by Fred Fish of Cygnus Support
++   Contributed by Cygnus Support
++
++   This file is part of GDB.
++
++   This program is free software; you can redistribute it and/or modify
++   it under the terms of the GNU General Public License as published by
++   the Free Software Foundation; either version 3 of the License, or
++   (at your option) any later version.
++
++   This program is distributed in the hope that it will be useful,
++   but WITHOUT ANY WARRANTY; without even the implied warranty of
++   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
++   GNU General Public License for more details.
++
++   You should have received a copy of the GNU General Public License
++   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
++
++/* Test multiple threads stepping into a .debug_line-less function with
++   a breakpoint placed on its return-to-caller point.  */
++
++#include <pthread.h>
++#include <assert.h>
++#include <unistd.h>
++#include <errno.h>
++#include <stdio.h>
++
++#define THREADS 3
++
++static void *
++func (void *unused)
++{
++  int i;
++
++  errno = 0;
++  i = 0xdeadf00d;
++  i = sleep (THREADS);	/* sleep-call */
++  if (errno != 0)	/* sleep-after */
++    perror ("sleep");
++
++  /* The GDB bug with forgotten step-resume breakpoint could leave stale
++     breakpoint on the I assignment making it a nop.  */
++  if (i == 0xdeadf00d)
++    assert (0);
++
++  assert (i == 0);
++
++  pthread_exit (NULL);
++}
++
++int
++main (void)
++{
++  pthread_t threads[THREADS];
++  int threadi;
++
++  for (threadi = 0; threadi < THREADS; threadi++)
++    {
++      int i;
++
++      i = pthread_create (&threads[threadi], NULL, func, NULL);
++      assert (i == 0);
++
++      i = sleep (1);
++      assert (i == 0);
++    }
++
++  for (threadi = 0; threadi < THREADS; threadi++)
++    {
++      int i;
++
++      i = pthread_join (threads[threadi], NULL);
++      assert (i == 0);
++    }
++
++  return 0;	/* final-exit */
++}

diff --git a/gdb.spec b/gdb.spec
index 70b7c37..824a39c 100644
--- a/gdb.spec
+++ b/gdb.spec
@@ -14,7 +14,7 @@ Version: 6.8.91.20090925
 
 # The release always contains a leading reserved number, start it at 1.
 # `upstream' is not a part of `name' to stay fully rpm dependencies compatible for the testing.
-Release: 2%{?_with_upstream:.upstream}%{?dist}
+Release: 3%{?_with_upstream:.upstream}%{?dist}
 
 License: GPLv3+
 Group: Development/Debuggers
@@ -364,6 +364,9 @@ Patch375: gdb-readline-6.0.patch
 # Fix python pretty printers lookup on x86_64.
 Patch376: libstdc++-v3-python-common-prefix.patch
 
+# New test for step-resume breakpoint placed in multiple threads at once.
+Patch381: gdb-simultaneous-step-resume-breakpoint-test.patch
+
 BuildRequires: ncurses-devel texinfo gettext flex bison expat-devel
 Requires: readline
 BuildRequires: readline-devel
@@ -557,6 +560,7 @@ rm -f gdb/jv-exp.c gdb/m2-exp.c gdb/objc-exp.c gdb/p-exp.c
 %patch360 -p1
 %patch375 -p1
 %patch376 -p1
+%patch381 -p1
 %patch124 -p1
 
 find -name "*.orig" | xargs rm -f
@@ -847,6 +851,9 @@ fi
 %endif
 
 %changelog
+* Sun Sep 27 2009 Jan Kratochvil <jan.kratochvil@redhat.com> - 6.8.91.20090925-3
+- New test for step-resume breakpoint placed in multiple threads at once.
+
 * Fri Sep 25 2009 Jan Kratochvil <jan.kratochvil@redhat.com> - 6.8.91.20090925-2
 - Fix buildid-loading libs w/matching name but different build-id (BZ 524572).
 

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2026-06-27 23:54 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-06-27 23:54 [rpms/gdb] gdb-17.2-rebase-f44: - New test for step-resume breakpoint placed in multiple threads at once Jan Kratochvil

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox