+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.
+
2015-08-25 Yao Qi <yao.qi@linaro.org>
* aarch64-linux-nat.c (aarch64_linux_prepare_to_resume): Use
tui/tui-source.h sol2-tdep.h gregset.h sh-tdep.h sh64-tdep.h \
expression.h score-tdep.h gdb_select.h ser-tcp.h \
extension.h extension-priv.h nat/aarch64-linux-hw-point.h \
-build-id.h buildsym.h valprint.h \
+build-id.h buildsym.h valprint.h nat/aarch64-linux.h \
typeprint.h mi/mi-getopt.h mi/mi-parse.h mi/mi-console.h \
mi/mi-out.h mi/mi-main.h mi/mi-common.h mi/mi-cmds.h linux-nat.h \
complaints.h gdb_proc_service.h gdb_regex.h xtensa-tdep.h inf-loop.h \
$(COMPILE) $(srcdir)/nat/aarch64-linux-hw-point.c
$(POSTCOMPILE)
+aarch64-linux.o: ${srcdir}/nat/aarch64-linux.c
+ $(COMPILE) $(srcdir)/nat/aarch64-linux.c
+ $(POSTCOMPILE)
+
#
# gdb/tui/ dependencies
#
#include "aarch64-tdep.h"
#include "aarch64-linux-tdep.h"
#include "aarch32-linux-nat.h"
+#include "nat/aarch64-linux.h"
#include "nat/aarch64-linux-hw-point.h"
#include "elf/external.h"
/* Get debug registers state for process PID. */
-static struct aarch64_debug_reg_state *
+struct aarch64_debug_reg_state *
aarch64_get_debug_reg_state (pid_t pid)
{
return &aarch64_process_info_get (pid)->state;
AARCH64_LINUX_SIZEOF_FPREGSET);
}
-/* Called when resuming a thread.
- The hardware debug registers are updated when there is any change. */
-
-static void
-aarch64_linux_prepare_to_resume (struct lwp_info *lwp)
-{
- 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
- nothing to do. */
- if (info == NULL)
- return;
-
- 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_unfiltered (gdb_stdlog, "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);
- }
- }
-}
-
static void
aarch64_linux_new_thread (struct lwp_info *lp)
{
NATDEPFILES= inf-ptrace.o fork-child.o aarch64-linux-nat.o aarch32-linux-nat.o \
proc-service.o linux-thread-db.o linux-nat.o linux-fork.o \
linux-procfs.o linux-ptrace.o linux-osdata.o linux-waitpid.o \
- linux-personality.o linux-namespaces.o aarch64-linux-hw-point.o
+ linux-personality.o linux-namespaces.o aarch64-linux-hw-point.o \
+ aarch64-linux.o
NAT_CDEPS = $(srcdir)/proc-service.list
LOADLIBES= -ldl $(RDYNAMIC)
+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
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)
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"
#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"
/* 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);
*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. */
void aarch64_linux_get_debug_reg_capacity (int tid);
+struct aarch64_debug_reg_state *aarch64_get_debug_reg_state (pid_t pid);
+
#endif /* AARCH64_LINUX_HW_POINT_H */
--- /dev/null
+/* Copyright (C) 2009-2015 Free Software Foundation, Inc.
+ Contributed by ARM Ltd.
+
+ This file is part of GDB.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+#include "common-defs.h"
+#include "break-common.h"
+#include "nat/linux-nat.h"
+#include "nat/aarch64-linux-hw-point.h"
+#include "nat/aarch64-linux.h"
+
+/* Called when resuming a thread LWP.
+ The hardware debug registers are updated when there is any change. */
+
+void
+aarch64_linux_prepare_to_resume (struct lwp_info *lwp)
+{
+ 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
+ nothing to do. */
+ if (info == NULL)
+ return;
+
+ 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)
+ debug_printf ("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);
+ }
+ }
+}
--- /dev/null
+/* Copyright (C) 2009-2015 Free Software Foundation, Inc.
+ Contributed by ARM Ltd.
+
+ This file is part of GDB.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+#ifndef AARCH64_LINUX_H
+#define AARCH64_LINUX_H 1
+
+void aarch64_linux_prepare_to_resume (struct lwp_info *lwp);
+
+#endif /* AARCH64_LINUX_H */