This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: RFA: fix gdb_assert caused by 'catch signal ...' and fork


Hi Philippe,

(Please mark newer posts/revisions of patches in new threads
with v2, v3, etc. in the subject line.)

> Index: gdb/testsuite/gdb.base/catch-signal-fork.c
> ===================================================================
> RCS file: gdb/testsuite/gdb.base/catch-signal-fork.c
> diff -N gdb/testsuite/gdb.base/catch-signal-fork.c
> --- /dev/null	1 Jan 1970 00:00:00 -0000
> +++ gdb/testsuite/gdb.base/catch-signal-fork.c	9 May 2013 21:46:36 -0000
> @@ -0,0 +1,58 @@
> +/* This testcase is part of GDB, the GNU debugger.
> +
> +   Copyright 2013-2013 Free Software Foundation, Inc.

Write only "2013" when we only have a single year.
But, if  the file is based on another existing file, we should
preserve the existing file's copyright years in the new file.

> +int
> +main ()
> +{
> +  int i;
> +  signal (SIGHUP, handle);
> +
> +  raise (SIGHUP);		/* first HUP */
> +
> +  signal (SIGCHLD, handle);
> +  for (i = 0; i < 3; i++)	/* fork loop */
> +    {
> +      switch (fork())
> +	{
> +	case -1:
> +	  perror ("fork");
> +	  exit (1);
> +	case 0:
> +	  exit (0);
> +	}
> +      (void) wait(NULL);

Missing space before parens.  (do you really need the cast?)

> Index: gdb/testsuite/gdb.base/catch-signal-fork.exp
> ===================================================================
> RCS file: gdb/testsuite/gdb.base/catch-signal-fork.exp
> diff -N gdb/testsuite/gdb.base/catch-signal-fork.exp
> --- /dev/null	1 Jan 1970 00:00:00 -0000
> +++ gdb/testsuite/gdb.base/catch-signal-fork.exp	9 May 2013 21:46:36 -0000
> @@ -0,0 +1,43 @@
> +# Copyright 2013-2013 Free Software Foundation, Inc.

2013-2013 again.

-- 
Pedro Alves


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]