aboutsummaryrefslogtreecommitdiff
path: root/gdb/gdbserver
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:14 +0100
commitdb3cb7cb3e51e5eb834412adbf90e81bb76846c6 (patch)
tree7523d968e5775db256e5ccf76ee193fbe48c40bf /gdb/gdbserver
parentf6011a1c84b1bd616617bfde84dca63f250c950d (diff)
downloadgdb-db3cb7cb3e51e5eb834412adbf90e81bb76846c6.zip
gdb-db3cb7cb3e51e5eb834412adbf90e81bb76846c6.tar.gz
gdb-db3cb7cb3e51e5eb834412adbf90e81bb76846c6.tar.bz2
Move aarch64_linux_prepare_to_resume to nat/aarch64-linux.c
gdb: 2015-08-25 Yao Qi <yao.qi@linaro.org> * Makefile.in (aarch64-liunx.o): New rule. (HFILES_NO_SRCDIR): Add aarch64-linux.h. * config/aarch64/linux.mh (NAT_FILE): Add aarch64-linux.o. * aarch64-linux-nat.c: Include nat/aarch64-linux.h. * aarch64-linux-nat.c (aarch64_get_debug_reg_state): Make it extern. (aarch64_linux_prepare_to_resume): Move it nat/aarch64-linux.c. * nat/aarch64-linux-hw-point.h (aarch64_debug_reg_state): Declare * nat/aarch64-linux.c: New file. * nat/aarch64-linux.h: New file. gdb/gdbserver: 2015-08-25 Yao Qi <yao.qi@linaro.org> * Makefile.in (aarch64-linux.o): New rule. * configure.srv (aarch64*-*-linux*): Append aarch64-linux.o to srv_tgtobj. * linux-aarch64-low.c: Include nat/aarch64-linux.h. (aarch64_init_debug_reg_state): Make it extern. (aarch64_linux_prepare_to_resume): Remove.
Diffstat (limited to 'gdb/gdbserver')
-rw-r--r--gdb/gdbserver/ChangeLog9
-rw-r--r--gdb/gdbserver/Makefile.in3
-rw-r--r--gdb/gdbserver/configure.srv1
-rw-r--r--gdb/gdbserver/linux-aarch64-low.c39
4 files changed, 15 insertions, 37 deletions
diff --git a/gdb/gdbserver/ChangeLog b/gdb/gdbserver/ChangeLog
index 6fdc29c..274f850 100644
--- a/gdb/gdbserver/ChangeLog
+++ b/gdb/gdbserver/ChangeLog
@@ -1,5 +1,14 @@
2015-08-25 Yao Qi <yao.qi@linaro.org>
+ * Makefile.in (aarch64-linux.o): New rule.
+ * configure.srv (aarch64*-*-linux*): Append aarch64-linux.o to
+ srv_tgtobj.
+ * linux-aarch64-low.c: Include nat/aarch64-linux.h.
+ (aarch64_init_debug_reg_state): Make it extern.
+ (aarch64_linux_prepare_to_resume): Remove.
+
+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.
diff --git a/gdb/gdbserver/Makefile.in b/gdb/gdbserver/Makefile.in
index 5e04e530..b715a32 100644
--- a/gdb/gdbserver/Makefile.in
+++ b/gdb/gdbserver/Makefile.in
@@ -609,6 +609,9 @@ linux-personality.o: ../nat/linux-personality.c
aarch64-linux-hw-point.o: ../nat/aarch64-linux-hw-point.c
$(COMPILE) $<
$(POSTCOMPILE)
+aarch64-linux.o: ../nat/aarch64-linux.c
+ $(COMPILE) $<
+ $(POSTCOMPILE)
btrace-common.o: ../common/btrace-common.c
$(COMPILE) $<
$(POSTCOMPILE)
diff --git a/gdb/gdbserver/configure.srv b/gdb/gdbserver/configure.srv
index 320c26a..aa232f8 100644
--- a/gdb/gdbserver/configure.srv
+++ b/gdb/gdbserver/configure.srv
@@ -52,6 +52,7 @@ case "${target}" in
srv_regobj="${srv_regobj} arm-with-neon.o"
srv_tgtobj="linux-aarch64-low.o aarch64-linux-hw-point.o"
srv_tgtobj="$srv_tgtobj linux-aarch32-low.o"
+ srv_tgtobj="$srv_tgtobj aarch64-linux.o"
srv_tgtobj="${srv_tgtobj} $srv_linux_obj"
srv_xmlfiles="aarch64.xml"
srv_xmlfiles="${srv_xmlfiles} aarch64-core.xml"
diff --git a/gdb/gdbserver/linux-aarch64-low.c b/gdb/gdbserver/linux-aarch64-low.c
index 4b1d7d5..d35d4e9 100644
--- a/gdb/gdbserver/linux-aarch64-low.c
+++ b/gdb/gdbserver/linux-aarch64-low.c
@@ -21,6 +21,7 @@
#include "server.h"
#include "linux-low.h"
+#include "nat/aarch64-linux.h"
#include "nat/aarch64-linux-hw-point.h"
#include "linux-aarch32-low.h"
#include "elf/common.h"
@@ -237,7 +238,7 @@ aarch64_init_debug_reg_state (struct aarch64_debug_reg_state *state)
/* Return the pointer to the debug register state structure in the
current process' arch-specific data area. */
-static struct aarch64_debug_reg_state *
+struct aarch64_debug_reg_state *
aarch64_get_debug_reg_state (pid_t pid)
{
struct process_info *proc = find_process_pid (pid);
@@ -482,42 +483,6 @@ aarch64_linux_new_fork (struct process_info *parent,
*child->priv->arch_private = *parent->priv->arch_private;
}
-/* Implementation of linux_target_ops method "linux_prepare_to_resume".
-
- If the debug regs have changed, update the thread's copies. */
-
-static void
-aarch64_linux_prepare_to_resume (struct lwp_info *lwp)
-{
- 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 aarch64_debug_reg_state *state
- = aarch64_get_debug_reg_state (ptid_get_pid (ptid));
-
- if (show_debug_regs)
- fprintf (stderr, "prepare_to_resume thread %d\n", tid);
-
- /* Watchpoints. */
- if (DR_HAS_CHANGED (info->dr_changed_wp))
- {
- aarch64_linux_set_debug_regs (state, tid, 1);
- DR_CLEAR_CHANGED (info->dr_changed_wp);
- }
-
- /* Breakpoints. */
- if (DR_HAS_CHANGED (info->dr_changed_bp))
- {
- aarch64_linux_set_debug_regs (state, tid, 0);
- DR_CLEAR_CHANGED (info->dr_changed_bp);
- }
- }
-}
-
/* Return the right target description according to the ELF file of
current thread. */