Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* [PATCH] Fix compilation of gdb/arm-linux-nat.c on Raspbian GNU/Linux 7
@ 2015-06-15 12:43 Martin Simmons
  2015-06-15 13:00 ` Yao Qi
  0 siblings, 1 reply; 4+ messages in thread
From: Martin Simmons @ 2015-06-15 12:43 UTC (permalink / raw)
  To: gdb-patches

Revision 1e5338b6e7405acdd1e1d0eab46682bd1af007d5 fails to compile on Raspbian
GNU/Linux 7 because PTRACE_GETREGSET and PTRACE_SETREGSET are not defined in
sys/ptrace.h.

gcc -g -O2   -I. -I. -I./common -I./config -DLOCALEDIR="\"/usr/local/share/locale\"" -DHAVE_CONFIG_H -I./../include/opcode -I./../opcodes/.. -I./../readline/.. -I./../zlib -I../bfd -I./../bfd -I./../include -I../libdecnumber -I./../libdecnumber  -I./gnulib/import -Ibuild-gnulib/import   -DTUI=1  -Wall -Wpointer-arith -Wno-unused -Wunused-value -Wunused-function -Wno-switch -Wno-char-subscripts -Wempty-body -Wpointer-sign -Wmissing-prototypes -Wdeclaration-after-statement -Wmissing-parameter-type -Wold-style-declaration -Wold-style-definition -Wformat-nonliteral -Werror -c -o arm-linux-nat.o -MT arm-linux-nat.o -MMD -MP -MF .deps/arm-linux-nat.Tpo arm-linux-nat.c
arm-linux-nat.c: In function ‘fetch_fpregister’:
arm-linux-nat.c:103:21: error: ‘PTRACE_GETREGSET’ undeclared (first use in this function)
arm-linux-nat.c:103:21: note: each undeclared identifier is reported only once for each function it appears in
arm-linux-nat.c: In function ‘fetch_fpregs’:
arm-linux-nat.c:144:21: error: ‘PTRACE_GETREGSET’ undeclared (first use in this function)
arm-linux-nat.c: In function ‘store_fpregister’:
arm-linux-nat.c:184:21: error: ‘PTRACE_GETREGSET’ undeclared (first use in this function)
arm-linux-nat.c:211:21: error: ‘PTRACE_SETREGSET’ undeclared (first use in this function)
...

This patch includes the gdb header file nat/linux-ptrace.h, which provides
fallback definitions.

gdb/ChangeLog

	* arm-linux-nat.c (nat/linux-ptrace.h): New include for
          PTRACE_GETREGSET et al in case of old system header files.

diff --git a/gdb/arm-linux-nat.c b/gdb/arm-linux-nat.c
index b18d443..10aea07 100644
--- a/gdb/arm-linux-nat.c
+++ b/gdb/arm-linux-nat.c
@@ -36,6 +36,8 @@
 #include <sys/utsname.h>
 #include <sys/procfs.h>
 
+#include "nat/linux-ptrace.h"
+
 /* Prototypes for supply_gregset etc.  */
 #include "gregset.h"
 


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] Fix compilation of gdb/arm-linux-nat.c on Raspbian GNU/Linux 7
  2015-06-15 12:43 [PATCH] Fix compilation of gdb/arm-linux-nat.c on Raspbian GNU/Linux 7 Martin Simmons
@ 2015-06-15 13:00 ` Yao Qi
  2015-06-15 16:32   ` Martin Simmons
  0 siblings, 1 reply; 4+ messages in thread
From: Yao Qi @ 2015-06-15 13:00 UTC (permalink / raw)
  To: Martin Simmons, gdb-patches

This patch is OK, except for the ChangeLog entry, it can be rewritten like

On 15/06/15 13:43, Martin Simmons wrote:
> gdb/ChangeLog
>
> 	* arm-linux-nat.c (nat/linux-ptrace.h): New include for
>            PTRACE_GETREGSET et al in case of old system header files.

	* arm-linux-nat.c: Include nat/linux-ptrace.h.

because we put what do we change in the changelog rather than "why".
Do you have the commit access to gdb git repository?

-- 
Yao (齐尧)


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] Fix compilation of gdb/arm-linux-nat.c on Raspbian GNU/Linux 7
  2015-06-15 13:00 ` Yao Qi
@ 2015-06-15 16:32   ` Martin Simmons
  2015-06-16  8:42     ` Yao Qi
  0 siblings, 1 reply; 4+ messages in thread
From: Martin Simmons @ 2015-06-15 16:32 UTC (permalink / raw)
  To: Yao Qi; +Cc: gdb-patches

>>>>> On Mon, 15 Jun 2015 14:00:22 +0100, Yao Qi said:
> 
> This patch is OK, except for the ChangeLog entry, it can be rewritten like
> 
> On 15/06/15 13:43, Martin Simmons wrote:
> > gdb/ChangeLog
> >
> > 	* arm-linux-nat.c (nat/linux-ptrace.h): New include for
> >            PTRACE_GETREGSET et al in case of old system header files.
> 
> 	* arm-linux-nat.c: Include nat/linux-ptrace.h.
> 
> because we put what do we change in the changelog rather than "why".

OK.

> Do you have the commit access to gdb git repository?

No.

__Martin


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] Fix compilation of gdb/arm-linux-nat.c on Raspbian GNU/Linux 7
  2015-06-15 16:32   ` Martin Simmons
@ 2015-06-16  8:42     ` Yao Qi
  0 siblings, 0 replies; 4+ messages in thread
From: Yao Qi @ 2015-06-16  8:42 UTC (permalink / raw)
  To: Martin Simmons; +Cc: Yao Qi, gdb-patches

Martin Simmons <martin@lispworks.com> writes:

>> Do you have the commit access to gdb git repository?
>
> No.

I pushed the patch in for you.

-- 
Yao (齐尧)

From 60854bb5c14140a5060242376c8967920c99021c Mon Sep 17 00:00:00 2001
From: Martin Simmons <martin@lispworks.com>
Date: Tue, 16 Jun 2015 09:32:47 +0100
Subject: [PATCH] Fix compilation of gdb/arm-linux-nat.c on Raspbian GNU/Linux
 7

GDB trunk fails to compile on Raspbian GNU/Linux 7 because
PTRACE_GETREGSET and PTRACE_SETREGSET are not defined in sys/ptrace.h.

gcc -g -O2   -I. -I. -I./common -I./config -DLOCALEDIR="\"/usr/local/share/locale\"" -DHAVE_CONFIG_H -I./../include/opcode -I./../opcodes/.. -I./../readline/.. -I./../zlib -I../bfd -I./../bfd -I./../include -I../libdecnumber -I./../libdecnumber  -I./gnulib/import -Ibuild-gnulib/import   -DTUI=1  -Wall -Wpointer-arith -Wno-unused -Wunused-value -Wunused-function -Wno-switch -Wno-char-subscripts -Wempty-body -Wpointer-sign -Wmissing-prototypes -Wdeclaration-after-statement -Wmissing-parameter-type -Wold-style-declaration -Wold-style-definition -Wformat-nonliteral -Werror -c -o arm-linux-nat.o -MT arm-linux-nat.o -MMD -MP -MF .deps/arm-linux-nat.Tpo arm-linux-nat.c
arm-linux-nat.c: In function 'fetch_fpregister':
arm-linux-nat.c:103:21: error: 'PTRACE_GETREGSET' undeclared (first use in this function)
arm-linux-nat.c:103:21: note: each undeclared identifier is reported only once for each function it appears in
arm-linux-nat.c: In function 'fetch_fpregs':
arm-linux-nat.c:144:21: error: 'PTRACE_GETREGSET' undeclared (first use in this function)
arm-linux-nat.c: In function 'store_fpregister':
arm-linux-nat.c:184:21: error: 'PTRACE_GETREGSET' undeclared (first use in this function)
arm-linux-nat.c:211:21: error: 'PTRACE_SETREGSET' undeclared (first use in this function)
...

This patch includes the gdb header file nat/linux-ptrace.h, which provides
fallback definitions.

2015-06-16  Martin Simmons  <martin@lispworks.com>  (tiny patch)

	* arm-linux-nat.c: Include nat/linux-ptrace.h.

diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 1828ae6..556fbae 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,7 @@
+2015-06-16  Martin Simmons  <martin@lispworks.com>  (tiny patch)
+
+	* arm-linux-nat.c: Include nat/linux-ptrace.h.
+
 2015-06-15  Simon Marchi  <simon.marchi@ericsson.com>
 
 	* mi/mi-main.c (mi_cmd_data_read_memory_bytes): Consider addressable
diff --git a/gdb/arm-linux-nat.c b/gdb/arm-linux-nat.c
index b18d443..10aea07 100644
--- a/gdb/arm-linux-nat.c
+++ b/gdb/arm-linux-nat.c
@@ -36,6 +36,8 @@
 #include <sys/utsname.h>
 #include <sys/procfs.h>
 
+#include "nat/linux-ptrace.h"
+
 /* Prototypes for supply_gregset etc.  */
 #include "gregset.h"
 


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2015-06-16  8:42 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-06-15 12:43 [PATCH] Fix compilation of gdb/arm-linux-nat.c on Raspbian GNU/Linux 7 Martin Simmons
2015-06-15 13:00 ` Yao Qi
2015-06-15 16:32   ` Martin Simmons
2015-06-16  8:42     ` Yao Qi

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox