aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYao Qi <yao.qi@linaro.org>2015-08-25 11:38:29 +0100
committerYao Qi <yao.qi@linaro.org>2015-08-25 11:39:13 +0100
commitf6011a1c84b1bd616617bfde84dca63f250c950d (patch)
treec32e0a6757429f462f2fe10b169f15563bc1d702
parent88e2cf7ee25c72bce35ebe59b13c9701abce9fee (diff)
downloadgdb-f6011a1c84b1bd616617bfde84dca63f250c950d.zip
gdb-f6011a1c84b1bd616617bfde84dca63f250c950d.tar.gz
gdb-f6011a1c84b1bd616617bfde84dca63f250c950d.tar.bz2
Make aarch64_linux_prepare_to_resume the same on GDB and GDBserver
gdb: 2015-08-25 Yao Qi <yao.qi@linaro.org> * aarch64-linux-nat.c (aarch64_linux_prepare_to_resume): Use lwp_arch_private_info and ptid_of_lwp. gdb/gdbserver: 2015-08-25 Yao Qi <yao.qi@linaro.org> * linux-aarch64-low.c (aarch64_linux_prepare_to_resume): Use lwp_arch_private_info and ptid_of_lwp.
-rw-r--r--gdb/ChangeLog5
-rw-r--r--gdb/aarch64-linux-nat.c7
-rw-r--r--gdb/gdbserver/ChangeLog5
-rw-r--r--gdb/gdbserver/linux-aarch64-low.c10
4 files changed, 18 insertions, 9 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 4945f77..6ffaaca 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,5 +1,10 @@
2015-08-25 Yao Qi <yao.qi@linaro.org>
+ * aarch64-linux-nat.c (aarch64_linux_prepare_to_resume): Use
+ lwp_arch_private_info and ptid_of_lwp.
+
+2015-08-25 Yao Qi <yao.qi@linaro.org>
+
* aarch64-linux-nat.c (struct arch64_dr_update_callback_param):
Move it to nat/aarch64-linux-hw-point.c.
(debug_reg_change_callback): Likewise.
diff --git a/gdb/aarch64-linux-nat.c b/gdb/aarch64-linux-nat.c
index 9bae9ce..b23026a 100644
--- a/gdb/aarch64-linux-nat.c
+++ b/gdb/aarch64-linux-nat.c
@@ -431,7 +431,7 @@ supply_fpregset (struct regcache *regcache, const gdb_fpregset_t *fpregsetp)
static void
aarch64_linux_prepare_to_resume (struct lwp_info *lwp)
{
- struct arch_lwp_info *info = lwp->arch_private;
+ struct arch_lwp_info *info = lwp_arch_private_info (lwp);
/* NULL means this is the main thread still going through the shell,
or, no watchpoint has been set yet. In that case, there's
@@ -442,9 +442,10 @@ aarch64_linux_prepare_to_resume (struct lwp_info *lwp)
if (DR_HAS_CHANGED (info->dr_changed_bp)
|| DR_HAS_CHANGED (info->dr_changed_wp))
{
- int tid = ptid_get_lwp (lwp->ptid);
+ ptid_t ptid = ptid_of_lwp (lwp);
+ int tid = ptid_get_lwp (ptid);
struct aarch64_debug_reg_state *state
- = aarch64_get_debug_reg_state (ptid_get_pid (lwp->ptid));
+ = aarch64_get_debug_reg_state (ptid_get_pid (ptid));
if (show_debug_regs)
fprintf_unfiltered (gdb_stdlog, "prepare_to_resume thread %d\n", tid);
diff --git a/gdb/gdbserver/ChangeLog b/gdb/gdbserver/ChangeLog
index 39966b8..6fdc29c 100644
--- a/gdb/gdbserver/ChangeLog
+++ b/gdb/gdbserver/ChangeLog
@@ -1,5 +1,10 @@
2015-08-25 Yao Qi <yao.qi@linaro.org>
+ * linux-aarch64-low.c (aarch64_linux_prepare_to_resume): Use
+ lwp_arch_private_info and ptid_of_lwp.
+
+2015-08-25 Yao Qi <yao.qi@linaro.org>
+
* linux-aarch64-low.c (aarch64_get_debug_reg_state): Add argument pid.
Find proc_info by find_process_pid. All callers updated.
diff --git a/gdb/gdbserver/linux-aarch64-low.c b/gdb/gdbserver/linux-aarch64-low.c
index 421dcb9..4b1d7d5 100644
--- a/gdb/gdbserver/linux-aarch64-low.c
+++ b/gdb/gdbserver/linux-aarch64-low.c
@@ -489,20 +489,18 @@ aarch64_linux_new_fork (struct process_info *parent,
static void
aarch64_linux_prepare_to_resume (struct lwp_info *lwp)
{
- struct thread_info *thread = get_lwp_thread (lwp);
- ptid_t ptid = ptid_of (thread);
- struct arch_lwp_info *info = lwp->arch_private;
+ struct arch_lwp_info *info = lwp_arch_private_info (lwp);
if (DR_HAS_CHANGED (info->dr_changed_bp)
|| DR_HAS_CHANGED (info->dr_changed_wp))
{
+ ptid_t ptid = ptid_of_lwp (lwp);
int tid = ptid_get_lwp (ptid);
- struct process_info *proc = find_process_pid (ptid_get_pid (ptid));
struct aarch64_debug_reg_state *state
- = &proc->priv->arch_private->debug_reg_state;
+ = aarch64_get_debug_reg_state (ptid_get_pid (ptid));
if (show_debug_regs)
- fprintf (stderr, "prepare_to_resume thread %ld\n", lwpid_of (thread));
+ fprintf (stderr, "prepare_to_resume thread %d\n", tid);
/* Watchpoints. */
if (DR_HAS_CHANGED (info->dr_changed_wp))