* [PATCH] s390-nat.c: Fix missing prototypes
@ 2012-03-05 17:39 Andreas Arnez
2012-03-05 19:07 ` Joel Brobecker
0 siblings, 1 reply; 9+ messages in thread
From: Andreas Arnez @ 2012-03-05 17:39 UTC (permalink / raw)
To: gdb-patches
Fix missing prototypes for supply_gregset and friends in "s390-nat.c".
Tested on s390x-ibm-linux with no regressions, fixes a
-Wmissing-prototypes build failure.
gdb/
2012-03-05 Andreas Arnez <arnez@linux.vnet.ibm.com>
* s390-nat.c: Include "gregset.h".
---
diff --git a/gdb/s390-nat.c b/gdb/s390-nat.c
index 2755e58..aff967e 100644
--- a/gdb/s390-nat.c
+++ b/gdb/s390-nat.c
@@ -37,6 +37,9 @@
#include <sys/ucontext.h>
#include <elf.h>
+/* Prototypes for supply_gregset etc. */
+#include "gregset.h"
+
#ifndef HWCAP_S390_HIGH_GPRS
#define HWCAP_S390_HIGH_GPRS 512
#endif
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH] s390-nat.c: Fix missing prototypes
2012-03-05 17:39 [PATCH] s390-nat.c: Fix missing prototypes Andreas Arnez
@ 2012-03-05 19:07 ` Joel Brobecker
2012-03-06 9:49 ` Andreas Arnez
0 siblings, 1 reply; 9+ messages in thread
From: Joel Brobecker @ 2012-03-05 19:07 UTC (permalink / raw)
To: Andreas Arnez; +Cc: gdb-patches
[-- Attachment #1: Type: text/plain, Size: 324 bytes --]
> Tested on s390x-ibm-linux with no regressions, fixes a
> -Wmissing-prototypes build failure.
>
> gdb/
> 2012-03-05 Andreas Arnez <arnez@linux.vnet.ibm.com>
>
> * s390-nat.c: Include "gregset.h".
Thanks! Attached is what I committed for you. I dropped the comment,
since I felt it was completely redundant.
--
Joel
[-- Attachment #2: 0001-Include-gregset.h-in-s390-nat.c-Wmissing-prototypes.patch --]
[-- Type: text/x-diff, Size: 1067 bytes --]
From 1063f42f816c3877e5e0ebdcd4500a7ec0c2820f Mon Sep 17 00:00:00 2001
From: Joel Brobecker <brobecker@adacore.com>
Date: Mon, 5 Mar 2012 11:04:04 -0800
Subject: [PATCH] Include "gregset.h" in s390-nat.c (-Wmissing-prototypes).
gdb/ChangeLog:
* s390-nat.c: Include "gregset.h".
---
gdb/ChangeLog | 5 +++++
gdb/s390-nat.c | 1 +
2 files changed, 6 insertions(+), 0 deletions(-)
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 2da944d..c2d0c59 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,8 @@
+2012-03-05 Joel Brobecker <brobecker@adacore.com>
+
+ From Andreas Arnez <arnez@linux.vnet.ibm.com>:
+ * s390-nat.c: Include "gregset.h".
+
2012-03-05 Jan Kratochvil <jan.kratochvil@redhat.com>
* libunwind-frame.c (LIBUNWIND_SO): Change .7 to .8.
diff --git a/gdb/s390-nat.c b/gdb/s390-nat.c
index 2755e58..bad1b43 100644
--- a/gdb/s390-nat.c
+++ b/gdb/s390-nat.c
@@ -26,6 +26,7 @@
#include "target.h"
#include "linux-nat.h"
#include "auxv.h"
+#include "gregset.h"
#include "s390-tdep.h"
#include "elf/common.h"
--
1.7.1
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH] s390-nat.c: Fix missing prototypes
2012-03-05 19:07 ` Joel Brobecker
@ 2012-03-06 9:49 ` Andreas Arnez
2012-03-06 10:26 ` Pedro Alves
0 siblings, 1 reply; 9+ messages in thread
From: Andreas Arnez @ 2012-03-06 9:49 UTC (permalink / raw)
To: Joel Brobecker; +Cc: gdb-patches
Joel Brobecker <brobecker@adacore.com> writes:
>> Tested on s390x-ibm-linux with no regressions, fixes a
>> -Wmissing-prototypes build failure.
>>
>> gdb/
>> 2012-03-05 Andreas Arnez <arnez@linux.vnet.ibm.com>
>>
>> * s390-nat.c: Include "gregset.h".
>
> Thanks! Attached is what I committed for you. I dropped the comment,
> since I felt it was completely redundant.
Thanks! Dropping the comment is OK. However, you also relocated the
include statement. This doesn't work, because "gregset.h" uses a
typedef from the system header file <sys/ucontext.h>. The order of
inclusion matters, and any other than my original patch may not work
either.
-- Andreas
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH] s390-nat.c: Fix missing prototypes
2012-03-06 9:49 ` Andreas Arnez
@ 2012-03-06 10:26 ` Pedro Alves
2012-03-06 11:35 ` Andreas Arnez
0 siblings, 1 reply; 9+ messages in thread
From: Pedro Alves @ 2012-03-06 10:26 UTC (permalink / raw)
To: Andreas Arnez; +Cc: Joel Brobecker, gdb-patches
On 03/06/2012 09:49 AM, Andreas Arnez wrote:
> Joel Brobecker <brobecker@adacore.com> writes:
>
>>> Tested on s390x-ibm-linux with no regressions, fixes a
>>> -Wmissing-prototypes build failure.
>>>
>>> gdb/
>>> 2012-03-05 Andreas Arnez <arnez@linux.vnet.ibm.com>
>>>
>>> * s390-nat.c: Include "gregset.h".
>>
>> Thanks! Attached is what I committed for you. I dropped the comment,
>> since I felt it was completely redundant.
>
> Thanks! Dropping the comment is OK. However, you also relocated the
> include statement. This doesn't work, because "gregset.h" uses a
> typedef from the system header file <sys/ucontext.h>. The order of
> inclusion matters, and any other than my original patch may not work
> either.
Every other linux arch I looked at included <sys/procfs.h> before gregset.h
instead (or gdb_proc_service.h, which pulls sys/procfs.h).
Even core-regset.c does:
#ifdef HAVE_SYS_PROCFS_H
#include <sys/procfs.h>
#endif
/* Prototypes for supply_gregset etc. */
#include "gregset.h"
...
Are s390's headers different in this regard?
I think we should consider putting
#ifdef HAVE_SYS_PROCFS_H
#include <sys/procfs.h>
#endif
in gregset.h itself.
--
Pedro Alves
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH] s390-nat.c: Fix missing prototypes
2012-03-06 10:26 ` Pedro Alves
@ 2012-03-06 11:35 ` Andreas Arnez
2012-03-06 11:52 ` Pedro Alves
0 siblings, 1 reply; 9+ messages in thread
From: Andreas Arnez @ 2012-03-06 11:35 UTC (permalink / raw)
To: Pedro Alves; +Cc: Joel Brobecker, gdb-patches
Pedro Alves <palves@redhat.com> writes:
> Every other linux arch I looked at included <sys/procfs.h> before
> gregset.h instead (or gdb_proc_service.h, which pulls sys/procfs.h).
> Even core-regset.c does:
>
> #ifdef HAVE_SYS_PROCFS_H
> #include <sys/procfs.h>
> #endif
>
> /* Prototypes for supply_gregset etc. */
> #include "gregset.h"
> ...
>
> Are s390's headers different in this regard?
Including <sys/procfs.h> would work for s390 as well. Except for
pulling in some more declarations than <sys/ucontext.h>, there should be
no difference.
> I think we should consider putting
>
> #ifdef HAVE_SYS_PROCFS_H
> #include <sys/procfs.h>
> #endif
>
> in gregset.h itself.
Right, that sounds OK. Then Joel's commit for s390-nat.c could be left
as is.
-- Andreas
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH] s390-nat.c: Fix missing prototypes
2012-03-06 11:35 ` Andreas Arnez
@ 2012-03-06 11:52 ` Pedro Alves
2012-03-06 12:15 ` Andreas Arnez
0 siblings, 1 reply; 9+ messages in thread
From: Pedro Alves @ 2012-03-06 11:52 UTC (permalink / raw)
To: Andreas Arnez; +Cc: Joel Brobecker, gdb-patches
On 03/06/2012 11:35 AM, Andreas Arnez wrote:
>> I think we should consider putting
>>
>> #ifdef HAVE_SYS_PROCFS_H
>> #include <sys/procfs.h>
>> #endif
>>
>> in gregset.h itself.
>
> Right, that sounds OK. Then Joel's commit for s390-nat.c could be left
> as is.
Builds fine on x64-64 Fedora, even when I move the gregset.h include in
amd64-linux-nat.c to the top, right below defs.h, like:
--- c/gdb/amd64-linux-nat.c
+++ w/gdb/amd64-linux-nat.c
@@ -19,6 +19,7 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "defs.h"
+#include "gregset.h"
#include "inferior.h"
#include "gdbcore.h"
#include "regcache.h"
@@ -46,9 +47,6 @@
#include <sys/reg.h>
#include "gdb_proc_service.h"
-/* Prototypes for supply_gregset etc. */
-#include "gregset.h"
-
#include "amd64-tdep.h"
#include "i386-linux-tdep.h"
#include "amd64-nat.h"
(which fails to build without the patch below)
Comments, anyone?
2012-03-06 Pedro Alves <palves@redhat.com>
* gregset.h [HAVE_SYS_PROCFS_H]: Include <sys/procfs.h>.
---
gdb/gregset.h | 4 ++++
1 files changed, 4 insertions(+), 0 deletions(-)
diff --git a/gdb/gregset.h b/gdb/gregset.h
index 4f34788..d73b5b8 100644
--- a/gdb/gregset.h
+++ b/gdb/gregset.h
@@ -19,6 +19,10 @@
#ifndef GREGSET_H
#define GREGSET_H
+#ifdef HAVE_SYS_PROCFS_H
+#include <sys/procfs.h>
+#endif
+
#ifndef GDB_GREGSET_T
#define GDB_GREGSET_T gregset_t
#endif
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH] s390-nat.c: Fix missing prototypes
2012-03-06 11:52 ` Pedro Alves
@ 2012-03-06 12:15 ` Andreas Arnez
2012-03-06 16:30 ` Joel Brobecker
0 siblings, 1 reply; 9+ messages in thread
From: Andreas Arnez @ 2012-03-06 12:15 UTC (permalink / raw)
To: Pedro Alves; +Cc: Joel Brobecker, gdb-patches
Pedro Alves <palves@redhat.com> writes:
> Builds fine on x64-64 Fedora, [...]
> Comments, anyone?
Builds fine on s390x.
>
> 2012-03-06 Pedro Alves <palves@redhat.com>
>
> * gregset.h [HAVE_SYS_PROCFS_H]: Include <sys/procfs.h>.
>
> ---
>
> gdb/gregset.h | 4 ++++
> 1 files changed, 4 insertions(+), 0 deletions(-)
>
> diff --git a/gdb/gregset.h b/gdb/gregset.h
> index 4f34788..d73b5b8 100644
> --- a/gdb/gregset.h
> +++ b/gdb/gregset.h
> @@ -19,6 +19,10 @@
> #ifndef GREGSET_H
> #define GREGSET_H
>
> +#ifdef HAVE_SYS_PROCFS_H
> +#include <sys/procfs.h>
> +#endif
> +
> #ifndef GDB_GREGSET_T
> #define GDB_GREGSET_T gregset_t
> #endif
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH] s390-nat.c: Fix missing prototypes
2012-03-06 12:15 ` Andreas Arnez
@ 2012-03-06 16:30 ` Joel Brobecker
2012-03-06 17:18 ` Pedro Alves
0 siblings, 1 reply; 9+ messages in thread
From: Joel Brobecker @ 2012-03-06 16:30 UTC (permalink / raw)
To: Andreas Arnez; +Cc: Pedro Alves, gdb-patches
> Builds fine on s390x.
>
> >
> > 2012-03-06 Pedro Alves <palves@redhat.com>
> >
> > * gregset.h [HAVE_SYS_PROCFS_H]: Include <sys/procfs.h>.
No further comment on my end.
Sorry about this, guys.
--
Joel
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH] s390-nat.c: Fix missing prototypes
2012-03-06 16:30 ` Joel Brobecker
@ 2012-03-06 17:18 ` Pedro Alves
0 siblings, 0 replies; 9+ messages in thread
From: Pedro Alves @ 2012-03-06 17:18 UTC (permalink / raw)
To: Joel Brobecker; +Cc: Andreas Arnez, gdb-patches
On 03/06/2012 04:30 PM, Joel Brobecker wrote:
>> Builds fine on s390x.
>>
>>>
>>> 2012-03-06 Pedro Alves <palves@redhat.com>
>>>
>>> * gregset.h [HAVE_SYS_PROCFS_H]: Include <sys/procfs.h>.
>
> No further comment on my end.
Alright, checked in then.
> Sorry about this, guys.
It's all for the better :-)
--
Pedro Alves
^ permalink raw reply [flat|nested] 9+ messages in thread
end of thread, other threads:[~2012-03-06 17:18 UTC | newest]
Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-03-05 17:39 [PATCH] s390-nat.c: Fix missing prototypes Andreas Arnez
2012-03-05 19:07 ` Joel Brobecker
2012-03-06 9:49 ` Andreas Arnez
2012-03-06 10:26 ` Pedro Alves
2012-03-06 11:35 ` Andreas Arnez
2012-03-06 11:52 ` Pedro Alves
2012-03-06 12:15 ` Andreas Arnez
2012-03-06 16:30 ` Joel Brobecker
2012-03-06 17:18 ` Pedro Alves
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox