Wine compilation on ARM
Vijay Kiran Kamuju
infyquest at gmail.com
Thu Jul 27 17:05:14 CDT 2006
Hi,
I have made a small patch has put in some basic framework for winedbg
and wineserver for compiling on ARM (i think so). See WineHQ #285
(http://www.winehq.com/?issue=285#Cross-Compiling%20Wine).
I donot have an ARM based machine and linux installed on it.
And havent test it thorughly, I need someone to test this one.
This patch may contain some bugs, use at your own risk.
Please send me your comments
Thanks,
VJ
-------------- next part --------------
--- programs/winedbg/Makefile.in_bkp 2006-07-28 03:05:14.000000000 +0530
+++ programs/winedbg/Makefile.in 2006-07-28 03:00:56.000000000 +0530
@@ -9,6 +9,7 @@
C_SRCS = \
be_alpha.c \
+ be_arm.c \
be_i386.c \
be_ppc.c \
be_x86_64.c \
--- /dev/null 2006-05-02 17:48:25.285177368 +0530
+++ programs/winedbg/be_arm.c 2006-07-28 03:01:20.000000000 +0530
@@ -0,0 +1,154 @@
+/*
+ * Debugger ARM specific functions
+ *
+ * Copyright 2006 Vijay Kiran Kamuju
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library 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
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+#include "debugger.h"
+
+#if defined(__arm__)
+
+static unsigned be_arm_get_addr(HANDLE hThread, const CONTEXT* ctx,
+ enum be_cpu_addr bca, ADDRESS* addr)
+{
+ dbg_printf("not done\n");
+ return FALSE;
+}
+
+static void be_arm_single_step(CONTEXT* ctx, unsigned enable)
+{
+ dbg_printf("not done\n");
+}
+
+static void be_arm_print_context(HANDLE hThread, const CONTEXT* ctx, int all_regs)
+{
+ dbg_printf("Context printing for ARM not done yet\n");
+}
+
+static void be_arm_print_segment_info(HANDLE hThread, const CONTEXT* ctx)
+{
+}
+
+static struct dbg_internal_var be_arm_ctx[] =
+{
+ {0, NULL, 0, dbg_itype_none}
+};
+
+static const struct dbg_internal_var* be_arm_init_registers(CONTEXT* ctx)
+{
+ dbg_printf("not done\n");
+ return be_arm_ctx;
+}
+
+static unsigned be_arm_is_step_over_insn(void* insn)
+{
+ dbg_printf("not done\n");
+ return FALSE;
+}
+
+static unsigned be_arm_is_function_return(void* insn)
+{
+ dbg_printf("not done\n");
+ return FALSE;
+}
+
+static unsigned be_arm_is_break_insn(void* insn)
+{
+ dbg_printf("not done\n");
+ return FALSE;
+}
+
+static unsigned be_arm_is_func_call(void* insn, void** insn_callee)
+{
+ return FALSE;
+}
+
+static void be_arm_disasm_one_insn(ADDRESS* addr, int display)
+{
+ dbg_printf("Disasm NIY\n");
+}
+
+static unsigned be_arm_insert_Xpoint(HANDLE hProcess, const struct be_process_io* pio,
+ CONTEXT* ctx, enum be_xpoint_type type,
+ void* addr, unsigned long* val, unsigned size)
+{
+ dbg_printf("not done\n");
+ return FALSE;
+}
+
+static unsigned be_arm_remove_Xpoint(HANDLE hProcess, const struct be_process_io* pio,
+ CONTEXT* ctx, enum be_xpoint_type type,
+ void* addr, unsigned long val, unsigned size)
+{
+ dbg_printf("not done\n");
+ return FALSE;
+}
+
+static unsigned be_arm_is_watchpoint_set(const CONTEXT* ctx, unsigned idx)
+{
+ dbg_printf("not done\n");
+ return FALSE;
+}
+
+static void be_arm_clear_watchpoint(CONTEXT* ctx, unsigned idx)
+{
+ dbg_printf("not done\n");
+}
+
+static int be_arm_adjust_pc_for_break(CONTEXT* ctx, BOOL way)
+{
+ dbg_printf("not done\n");
+ return 0;
+}
+
+static int be_arm_fetch_integer(const struct dbg_lvalue* lvalue, unsigned size,
+ unsigned ext_sign, LONGLONG* ret)
+{
+ dbg_printf("not done\n");
+ return FALSE;
+}
+
+static int be_arm_fetch_float(const struct dbg_lvalue* lvalue, unsigned size,
+ long double* ret)
+{
+ dbg_printf("not done\n");
+ return FALSE;
+}
+
+struct backend_cpu be_arm =
+{
+ be_cpu_linearize,
+ be_cpu_build_addr,
+ be_arm_get_addr,
+ be_arm_single_step,
+ be_arm_print_context,
+ be_arm_print_segment_info,
+ be_arm_init_registers,
+ be_arm_is_step_over_insn,
+ be_arm_is_function_return,
+ be_arm_is_break_insn,
+ be_arm_is_func_call,
+ be_arm_disasm_one_insn,
+ be_arm_insert_Xpoint,
+ be_arm_remove_Xpoint,
+ be_arm_is_watchpoint_set,
+ be_arm_clear_watchpoint,
+ be_arm_adjust_pc_for_break,
+ be_arm_fetch_integer,
+ be_arm_fetch_float,
+};
+#endif
--- server/Makefile.in_bkp 2006-07-28 03:05:40.000000000 +0530
+++ server/Makefile.in 2006-07-28 03:00:12.000000000 +0530
@@ -12,6 +12,7 @@
clipboard.c \
console.c \
context_alpha.c \
+ context_arm.c \
context_i386.c \
context_powerpc.c \
context_sparc.c \
--- /dev/null 2006-05-02 17:48:25.285177368 +0530
+++ server/context_arm.c 2006-07-28 02:27:48.000000000 +0530
@@ -0,0 +1,89 @@
+/*
+ * ARM register context support
+ *
+ * Copyright (C) 2006 Vijay Kiran Kamuju
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library 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
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+#include "config.h"
+
+#ifdef __arm__
+
+#include <assert.h>
+#include <errno.h>
+#ifdef HAVE_SYS_REG_H
+# include <sys/reg.h>
+#endif
+#include <stdarg.h>
+#include <unistd.h>
+#ifdef HAVE_SYS_PTRACE_H
+# include <sys/ptrace.h>
+#endif
+
+#include "file.h"
+#include "thread.h"
+#include "request.h"
+
+/* copy a context structure according to the flags */
+void copy_context( CONTEXT *to, const CONTEXT *from, unsigned int flags )
+{
+ flags &= ~CONTEXT_ARM; /* get rid of CPU id */
+ if (flags & CONTEXT_CONTROL)
+ {
+ to->Sp = from->Sp;
+ to->Lr = from->Lr;
+ to->Pc = from->Pc;
+ to->Psr = from->Psr;
+ }
+ if (flags & CONTEXT_INTEGER)
+ {
+ to->R0 = from->R0;
+ to->R1 = from->R1;
+ to->R2 = from->R2;
+ to->R3 = from->R3;
+ to->R4 = from->R4;
+ to->R5 = from->R5;
+ to->R6 = from->R6;
+ to->R7 = from->R7;
+ to->R8 = from->R8;
+ to->R9 = from->R9;
+ to->R10 = from->R10;
+ to->R11 = from->R11;
+ to->R12 = from->R12;
+ }
+ to->ContextFlags |= flags;
+}
+
+/* retrieve the current instruction pointer of a context */
+void *get_context_ip( const CONTEXT *context )
+{
+ return (void *)context->Pc;
+}
+
+/* return the context flag that contains the CPU id */
+unsigned int get_context_cpu_flag(void)
+{
+ return CONTEXT_ARM;
+}
+
+/* return only the context flags that correspond to system regs */
+/* (system regs are the ones we can't access on the client side) */
+unsigned int get_context_system_regs( unsigned int flags )
+{
+ return 0; /* FIXME: implement client-side handling */
+}
+
+#endif /* __arm__ */
More information about the wine-devel
mailing list