[1/2] gdb: Fix ia64 defining TRAP_HWBKPT before including gdb_wait.h

Message ID 20171215000434.47315-1-jrtc27@jrtc27.com
State New, archived
Headers

Commit Message

Jessica Clarke Dec. 15, 2017, 12:04 a.m. UTC
  On ia64, gdb_wait.h eventually includes siginfo-consts-arch.h, which
contains an enum with TRAP_HWBKPT, along with a #define. Thus we cannot
define TRAP_HWBKPT to 4 beforehand, and so gdb_wait.h must be included
earlier; include it from linux-ptrace.h so it can never come afterwards.

gdb/ChangeLog:

	* nat/linux-ptrace.c: Remove unnecessary reinclusion of
	gdb_ptrace.h, and move including gdb_wait.h ...
	* nat/linux-ptrace.h: ... to here.
---
[Originally erroneously sent to the binutils mailing list]

 gdb/nat/linux-ptrace.c |    2 --
 gdb/nat/linux-ptrace.h |    1 +
 2 files changed, 1 insertion(+), 2 deletions(-)

--
1.7.10.4
  

Comments

Jessica Clarke Jan. 19, 2018, 4:33 p.m. UTC | #1
On 15 Dec 2017, at 00:04, James Clarke <jrtc27@jrtc27.com> wrote:
> 
> On ia64, gdb_wait.h eventually includes siginfo-consts-arch.h, which
> contains an enum with TRAP_HWBKPT, along with a #define. Thus we cannot
> define TRAP_HWBKPT to 4 beforehand, and so gdb_wait.h must be included
> earlier; include it from linux-ptrace.h so it can never come afterwards.
> 
> gdb/ChangeLog:
> 
> 	* nat/linux-ptrace.c: Remove unnecessary reinclusion of
> 	gdb_ptrace.h, and move including gdb_wait.h ...
> 	* nat/linux-ptrace.h: ... to here.

Ping (for the series).

James

> ---
> [Originally erroneously sent to the binutils mailing list]
> 
> gdb/nat/linux-ptrace.c |    2 --
> gdb/nat/linux-ptrace.h |    1 +
> 2 files changed, 1 insertion(+), 2 deletions(-)
> 
> diff --git a/gdb/nat/linux-ptrace.c b/gdb/nat/linux-ptrace.c
> index 438177f..1240eea 100644
> --- a/gdb/nat/linux-ptrace.c
> +++ b/gdb/nat/linux-ptrace.c
> @@ -21,8 +21,6 @@
> #include "linux-procfs.h"
> #include "linux-waitpid.h"
> #include "buffer.h"
> -#include "gdb_wait.h"
> -#include "gdb_ptrace.h"
> #ifdef HAVE_SYS_PROCFS_H
> #include <sys/procfs.h>
> #endif
> diff --git a/gdb/nat/linux-ptrace.h b/gdb/nat/linux-ptrace.h
> index 5954945..6faa89b 100644
> --- a/gdb/nat/linux-ptrace.h
> +++ b/gdb/nat/linux-ptrace.h
> @@ -21,6 +21,7 @@
> struct buffer;
> 
> #include "nat/gdb_ptrace.h"
> +#include "gdb_wait.h"
> 
> #ifdef __UCLIBC__
> #if !(defined(__UCLIBC_HAS_MMU__) || defined(__ARCH_HAS_MMU__))
> --
> 1.7.10.4
>
  
Pedro Alves Jan. 19, 2018, 4:43 p.m. UTC | #2
On 12/15/2017 12:04 AM, James Clarke wrote:
> On ia64, gdb_wait.h eventually includes siginfo-consts-arch.h, which
> contains an enum with TRAP_HWBKPT, along with a #define. Thus we cannot
> define TRAP_HWBKPT to 4 beforehand, and so gdb_wait.h must be included
> earlier; include it from linux-ptrace.h so it can never come afterwards.

OK.

This allows moving the linux-specific __WCLONE from
gdb_wait.h > linux-ptrace.h, to have it live near where its
sibling __WALL is defined, I think.  (not sure we still support
any system where those two are missing, though.  Maybe we could
just zap them too.)

Thanks,
Pedro Alves
  

Patch

diff --git a/gdb/nat/linux-ptrace.c b/gdb/nat/linux-ptrace.c
index 438177f..1240eea 100644
--- a/gdb/nat/linux-ptrace.c
+++ b/gdb/nat/linux-ptrace.c
@@ -21,8 +21,6 @@ 
 #include "linux-procfs.h"
 #include "linux-waitpid.h"
 #include "buffer.h"
-#include "gdb_wait.h"
-#include "gdb_ptrace.h"
 #ifdef HAVE_SYS_PROCFS_H
 #include <sys/procfs.h>
 #endif
diff --git a/gdb/nat/linux-ptrace.h b/gdb/nat/linux-ptrace.h
index 5954945..6faa89b 100644
--- a/gdb/nat/linux-ptrace.h
+++ b/gdb/nat/linux-ptrace.h
@@ -21,6 +21,7 @@ 
 struct buffer;

 #include "nat/gdb_ptrace.h"
+#include "gdb_wait.h"

 #ifdef __UCLIBC__
 #if !(defined(__UCLIBC_HAS_MMU__) || defined(__ARCH_HAS_MMU__))