[SPARC] Add missing include in test program gdb.arch/sparc-sysstep.c

Message ID 877flegdud.fsf@oracle.com
State New, archived
Headers

Commit Message

Jose E. Marchesi Nov. 19, 2015, 4:20 p.m. UTC
  Ok to commit?

commit fbe1572b5ad640e67fa1dec4ef9d3f95feb8079c
Author: Jose E. Marchesi <jose.marchesi@oracle.com>
Date:   Thu Nov 19 11:22:31 2015 -0500

    sparc: fix build of gdb/testsuite/gdb.arch/sparc-sysstep.c
    
    This patch adds a missing include that makes the test program to not be
    built (--Wimplicit-function-declaration).
    
    gdb/testsuite/ChangeLog:
    
    2015-11-19  Jose E. Marchesi  <jose.marchesi@oracle.com>
    
    	* gdb.arch/sparc-sysstep.c: Include unistd.h for getpid.
  

Comments

Pedro Alves Nov. 19, 2015, 4:20 p.m. UTC | #1
On 11/19/2015 04:20 PM, Jose E. Marchesi wrote:

> diff --git a/gdb/testsuite/gdb.arch/sparc-sysstep.c b/gdb/testsuite/gdb.arch/sparc-sysstep.c
> index 79e344b..a29174f 100644
> --- a/gdb/testsuite/gdb.arch/sparc-sysstep.c
> +++ b/gdb/testsuite/gdb.arch/sparc-sysstep.c
> @@ -1,3 +1,4 @@
> +
>  /* Test single-stepping system call instructions in sparc.

Spurious change above?  Otherwise OK.

Thanks,
Pedro Alves
  
Jose E. Marchesi Nov. 20, 2015, 9:51 a.m. UTC | #2
> diff --git a/gdb/testsuite/gdb.arch/sparc-sysstep.c b/gdb/testsuite/gdb.arch/sparc-sysstep.c
    > index 79e344b..a29174f 100644
    > --- a/gdb/testsuite/gdb.arch/sparc-sysstep.c
    > +++ b/gdb/testsuite/gdb.arch/sparc-sysstep.c
    > @@ -1,3 +1,4 @@
    > +
    >  /* Test single-stepping system call instructions in sparc.
    
    Spurious change above?  Otherwise OK.
    
Pushed, modulus the chunk above.
Thanks.
  

Patch

diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog
index e712bc5..d7dee9b 100644
--- a/gdb/testsuite/ChangeLog
+++ b/gdb/testsuite/ChangeLog
@@ -1,5 +1,9 @@ 
 2015-11-19  Jose E. Marchesi  <jose.marchesi@oracle.com>
 
+	* gdb.arch/sparc-sysstep.c: Include unistd.h for getpid.
+
+2015-11-19  Jose E. Marchesi  <jose.marchesi@oracle.com>
+
 	* gdb.base/callfuncs.exp (fetch_all_registers): Filter out the
 	pstate register when comparing registers values in
 	sparc64-*-linux-gnu targets to avoid spurious differences.
diff --git a/gdb/testsuite/gdb.arch/sparc-sysstep.c b/gdb/testsuite/gdb.arch/sparc-sysstep.c
index 79e344b..a29174f 100644
--- a/gdb/testsuite/gdb.arch/sparc-sysstep.c
+++ b/gdb/testsuite/gdb.arch/sparc-sysstep.c
@@ -1,3 +1,4 @@ 
+
 /* Test single-stepping system call instructions in sparc.
 
    Copyright 2014-2015 Free Software Foundation, Inc.
@@ -18,6 +19,7 @@ 
    along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
 
 #include <signal.h>
+#include <unistd.h>
 
 int global;