Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(605)

Unified Diff: gdb/testsuite/gdb.base/attach-twice.c

Issue 11969036: Merge GDB 7.5.1 (Closed) Base URL: http://git.chromium.org/native_client/nacl-gdb.git@master
Patch Set: Created 7 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « gdb/testsuite/gdb.base/attach-pie-misread.exp ('k') | gdb/testsuite/gdb.base/attach-twice.exp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gdb/testsuite/gdb.base/attach-twice.c
diff --git a/gdb/testsuite/gdb.base/kill-after-signal.c b/gdb/testsuite/gdb.base/attach-twice.c
similarity index 73%
copy from gdb/testsuite/gdb.base/kill-after-signal.c
copy to gdb/testsuite/gdb.base/attach-twice.c
index 2a6ceb7f4cb47b71950c7d9c07c1e241d277506a..cff221551923119c8cd1978d49f812883f870dfb 100644
--- a/gdb/testsuite/gdb.base/kill-after-signal.c
+++ b/gdb/testsuite/gdb.base/attach-twice.c
@@ -15,23 +15,28 @@
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
-#include <signal.h>
-#include <assert.h>
+#include <stdlib.h>
#include <unistd.h>
-#include <stdio.h>
-
-void
-handler (int signo)
-{
- sleep (600);
- assert (0);
-}
+#include <sys/ptrace.h>
+#include <errno.h>
int
main (void)
{
- signal (SIGUSR1, handler);
- raise (SIGUSR1);
- assert (0);
+ long l;
+
+ switch (fork ())
+ {
+ case -1:
+ perror ("fork");
+ exit (1);
+ case 0:
+ errno = 0;
+ ptrace (PTRACE_ATTACH, getppid (), NULL, NULL);
+ if (errno != 0)
+ perror ("PTRACE_ATTACH");
+ break;
+ }
+ sleep (600);
return 0;
}
« no previous file with comments | « gdb/testsuite/gdb.base/attach-pie-misread.exp ('k') | gdb/testsuite/gdb.base/attach-twice.exp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698