* [PATCH] Move ARM_CPSR_GREGNUM to arch/arm-linux.h
@ 2016-04-20 11:26 Yao Qi
2016-04-20 11:44 ` Yao Qi
2016-04-20 14:06 ` [PATCH] Include arch/arm-linux.h in aarch32-linux-nat.c Yao Qi
0 siblings, 2 replies; 3+ messages in thread
From: Yao Qi @ 2016-04-20 11:26 UTC (permalink / raw)
To: gdb-patches
This patch moves macro ARM_CPSR_GREGNUM to arch/arm-linux.h so that it
can be used in GDBserver side. I'll push it in.
gdb:
2016-04-20 Yao Qi <yao.qi@linaro.org>
* arm-linux-tdep.h (ARM_CPSR_GREGNUM): Move it to ...
* arch/arm-linux.h: ... here.
gdb/gdbserver:
2016-04-20 Yao Qi <yao.qi@linaro.org>
* linux-aarch32-low.c: Include "arch/arm-linux.h".
(arm_fill_gregset): Use ARM_CPSR_GREGNUM rather than magic
number 16.
* linux-aarch32-low.c (arm_store_gregset): Likewise.
---
gdb/arch/arm-linux.h | 3 +++
gdb/arm-linux-tdep.h | 3 ---
gdb/gdbserver/linux-aarch32-low.c | 5 +++--
3 files changed, 6 insertions(+), 5 deletions(-)
diff --git a/gdb/arch/arm-linux.h b/gdb/arch/arm-linux.h
index dfd634c..ed83da9 100644
--- a/gdb/arch/arm-linux.h
+++ b/gdb/arch/arm-linux.h
@@ -20,6 +20,9 @@
#ifndef ARM_LINUX_H
#define ARM_LINUX_H
+/* The index to access CSPR in user_regs defined in GLIBC. */
+#define ARM_CPSR_GREGNUM 16
+
/* There are a couple of different possible stack layouts that
we need to support.
diff --git a/gdb/arm-linux-tdep.h b/gdb/arm-linux-tdep.h
index 99f1777..be18a64 100644
--- a/gdb/arm-linux-tdep.h
+++ b/gdb/arm-linux-tdep.h
@@ -24,9 +24,6 @@ struct regcache;
+ 2 * INT_REGISTER_SIZE \
+ 8 + INT_REGISTER_SIZE)
-/* The index to access CSPR in user_regs defined in GLIBC. */
-#define ARM_CPSR_GREGNUM 16
-
/* Support for register format used by the NWFPE FPA emulator. Each
register takes three words, where either the first one, two, or
three hold a single, double, or extended precision value (depending
diff --git a/gdb/gdbserver/linux-aarch32-low.c b/gdb/gdbserver/linux-aarch32-low.c
index 2bbbb24..0c4b140 100644
--- a/gdb/gdbserver/linux-aarch32-low.c
+++ b/gdb/gdbserver/linux-aarch32-low.c
@@ -17,6 +17,7 @@
#include "server.h"
#include "arch/arm.h"
+#include "arch/arm-linux.h"
#include "linux-low.h"
#include "linux-aarch32-low.h"
@@ -65,7 +66,7 @@ arm_fill_gregset (struct regcache *regcache, void *buf)
for (i = ARM_A1_REGNUM; i <= ARM_PC_REGNUM; i++)
collect_register (regcache, i, ®s[i]);
- collect_register (regcache, ARM_PS_REGNUM, ®s[16]);
+ collect_register (regcache, ARM_PS_REGNUM, ®s[ARM_CPSR_GREGNUM]);
}
/* Supply GP registers contents, stored in BUF, to REGCACHE. */
@@ -84,7 +85,7 @@ arm_store_gregset (struct regcache *regcache, const void *buf)
for (; i < ARM_PS_REGNUM; i++)
supply_register (regcache, i, zerobuf);
- supply_register (regcache, ARM_PS_REGNUM, ®s[16]);
+ supply_register (regcache, ARM_PS_REGNUM, ®s[ARM_CPSR_GREGNUM]);
}
/* Collect NUM number of VFP registers from REGCACHE to buffer BUF. */
--
1.9.1
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] Move ARM_CPSR_GREGNUM to arch/arm-linux.h
2016-04-20 11:26 [PATCH] Move ARM_CPSR_GREGNUM to arch/arm-linux.h Yao Qi
@ 2016-04-20 11:44 ` Yao Qi
2016-04-20 14:06 ` [PATCH] Include arch/arm-linux.h in aarch32-linux-nat.c Yao Qi
1 sibling, 0 replies; 3+ messages in thread
From: Yao Qi @ 2016-04-20 11:44 UTC (permalink / raw)
To: Yao Qi; +Cc: gdb-patches
Yao Qi <qiyaoltc@gmail.com> writes:
> 2016-04-20 Yao Qi <yao.qi@linaro.org>
>
> * linux-aarch32-low.c: Include "arch/arm-linux.h".
> (arm_fill_gregset): Use ARM_CPSR_GREGNUM rather than magic
> number 16.
> * linux-aarch32-low.c (arm_store_gregset): Likewise.
^^^^^^^^^^^^^^^^^^^^^^
"linux-aarch32-low.c" is not needed. It is removed from the committed
version.
--
Yao (齐尧)
^ permalink raw reply [flat|nested] 3+ messages in thread
* [PATCH] Include arch/arm-linux.h in aarch32-linux-nat.c
2016-04-20 11:26 [PATCH] Move ARM_CPSR_GREGNUM to arch/arm-linux.h Yao Qi
2016-04-20 11:44 ` Yao Qi
@ 2016-04-20 14:06 ` Yao Qi
1 sibling, 0 replies; 3+ messages in thread
From: Yao Qi @ 2016-04-20 14:06 UTC (permalink / raw)
To: gdb-patches
Fix the compilation failure by including arch/arm-linux.h in
aarch32-linux-nat.c.
gdb:
2016-04-20 Yao Qi <yao.qi@linaro.org>
* aarch32-linux-nat.c: Include "arch/arm-linux.h".
---
gdb/ChangeLog | 4 ++++
gdb/aarch32-linux-nat.c | 1 +
2 files changed, 5 insertions(+)
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 10d5d2c..b2660dd 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,5 +1,9 @@
2016-04-20 Yao Qi <yao.qi@linaro.org>
+ * aarch32-linux-nat.c: Include "arch/arm-linux.h".
+
+2016-04-20 Yao Qi <yao.qi@linaro.org>
+
* arm-linux-tdep.h (ARM_CPSR_GREGNUM): Move it to ...
* arch/arm-linux.h: ... here.
diff --git a/gdb/aarch32-linux-nat.c b/gdb/aarch32-linux-nat.c
index 5d9babf..568dfa6 100644
--- a/gdb/aarch32-linux-nat.c
+++ b/gdb/aarch32-linux-nat.c
@@ -20,6 +20,7 @@
#include "regcache.h"
#include "arm-tdep.h"
#include "arm-linux-tdep.h"
+#include "arch/arm-linux.h"
#include "aarch32-linux-nat.h"
--
1.9.1
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2016-04-20 14:06 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-04-20 11:26 [PATCH] Move ARM_CPSR_GREGNUM to arch/arm-linux.h Yao Qi
2016-04-20 11:44 ` Yao Qi
2016-04-20 14:06 ` [PATCH] Include arch/arm-linux.h in aarch32-linux-nat.c Yao Qi
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).