From 9a1103112e633b301b927e99fec70b7b475c968e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Hentschel?= Date: Sat, 18 Sep 2010 18:02:28 +0200 Subject: [PATCH] dbghelp: Add ARM support. --- dlls/dbghelp/Makefile.in | 1 + dlls/dbghelp/cpu_arm.c | 79 ++++++++++++++++++++++++++++++++++++++++ dlls/dbghelp/dbghelp.c | 6 ++- 3 files changed, 84 insertions(+), 2 deletions(-) create mode 100644 dlls/dbghelp/cpu_arm.c diff --git a/dlls/dbghelp/Makefile.in b/dlls/dbghelp/Makefile.in index 95ed2af083e..7c4f73ad980 100644 --- a/dlls/dbghelp/Makefile.in +++ b/dlls/dbghelp/Makefile.in @@ -6,6 +6,7 @@ DELAYIMPORTS = version C_SRCS = \ coff.c \ + cpu_arm.c \ cpu_i386.c \ cpu_ppc.c \ cpu_sparc.c \ diff --git a/dlls/dbghelp/cpu_arm.c b/dlls/dbghelp/cpu_arm.c new file mode 100644 index 00000000000..0bd8aadbae9 --- /dev/null +++ b/dlls/dbghelp/cpu_arm.c @@ -0,0 +1,79 @@ +/* + * File cpu_arm.c + * + * Copyright (C) 2009-2009, Eric Pouech + * Copyright (C) 2010, André Hentschel + * + * 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 + +#include "ntstatus.h" +#define WIN32_NO_STATUS +#include "dbghelp_private.h" +#include "winternl.h" +#include "wine/debug.h" + +WINE_DEFAULT_DEBUG_CHANNEL(dbghelp); + +static unsigned arm_get_addr(HANDLE hThread, const CONTEXT* ctx, + enum cpu_addr ca, ADDRESS64* addr) +{ + switch (ca) + { + case cpu_addr_pc: + case cpu_addr_stack: + case cpu_addr_frame: + default: + FIXME("not done for ARM\n"); + } + return FALSE; +} + +static BOOL arm_stack_walk(struct cpu_stack_walk* csw, LPSTACKFRAME64 frame, CONTEXT* context) +{ + FIXME("not done for ARM\n"); + return FALSE; +} + +static unsigned arm_map_dwarf_register(unsigned regno) +{ + FIXME("not done for ARM\n"); + return 0; +} + +static void* arm_fetch_context_reg(CONTEXT* ctx, unsigned regno, unsigned* size) +{ + FIXME("not done for ARM\n"); + return NULL; +} + +static const char* arm_fetch_regname(unsigned regno) +{ + FIXME("Unknown register %x\n", regno); + return NULL; +} + +struct cpu cpu_arm = { + IMAGE_FILE_MACHINE_ARM, + 4, + arm_get_addr, + arm_stack_walk, + NULL, + arm_map_dwarf_register, + arm_fetch_context_reg, + arm_fetch_regname, +}; diff --git a/dlls/dbghelp/dbghelp.c b/dlls/dbghelp/dbghelp.c index fe7d892ba1b..bd4a9cbfa59 100644 --- a/dlls/dbghelp/dbghelp.c +++ b/dlls/dbghelp/dbghelp.c @@ -151,9 +151,9 @@ const char* wine_dbgstr_addr(const ADDRESS64* addr) } } -extern struct cpu cpu_i386, cpu_x86_64, cpu_ppc, cpu_sparc; +extern struct cpu cpu_i386, cpu_x86_64, cpu_ppc, cpu_sparc, cpu_arm; -static struct cpu* dbghelp_cpus[] = {&cpu_i386, &cpu_x86_64, &cpu_ppc, &cpu_sparc, NULL}; +static struct cpu* dbghelp_cpus[] = {&cpu_i386, &cpu_x86_64, &cpu_ppc, &cpu_sparc, &cpu_arm, NULL}; struct cpu* dbghelp_current_cpu = #if defined(__i386__) &cpu_i386 @@ -163,6 +163,8 @@ struct cpu* dbghelp_current_cpu = &cpu_ppc #elif defined(__sparc__) &cpu_sparc +#elif defined(__arm__) + &cpu_arm #else #error define support for your CPU #endif