2009-12-22 14:21:37 +01:00
|
|
|
/*
|
|
|
|
* File cpu_ppc.c
|
|
|
|
*
|
|
|
|
* Copyright (C) 2009-2009, Eric Pouech.
|
|
|
|
*
|
|
|
|
* 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 <assert.h>
|
|
|
|
|
|
|
|
#include "ntstatus.h"
|
|
|
|
#define WIN32_NO_STATUS
|
|
|
|
#include "dbghelp_private.h"
|
|
|
|
#include "winternl.h"
|
|
|
|
#include "wine/debug.h"
|
|
|
|
|
|
|
|
WINE_DEFAULT_DEBUG_CHANNEL(dbghelp);
|
|
|
|
|
2013-11-12 01:16:36 +01:00
|
|
|
static BOOL ppc_get_addr(HANDLE hThread, const CONTEXT* ctx,
|
|
|
|
enum cpu_addr ca, ADDRESS64* addr)
|
2009-12-22 14:21:37 +01:00
|
|
|
{
|
|
|
|
switch (ca)
|
|
|
|
{
|
|
|
|
#if defined(__powerpc__)
|
|
|
|
case cpu_addr_pc:
|
|
|
|
addr->Mode = AddrModeFlat;
|
|
|
|
addr->Segment = 0; /* don't need segment */
|
|
|
|
addr->Offset = ctx->Iar;
|
|
|
|
return TRUE;
|
|
|
|
#endif
|
|
|
|
default:
|
|
|
|
case cpu_addr_stack:
|
|
|
|
case cpu_addr_frame:
|
|
|
|
FIXME("not done\n");
|
|
|
|
}
|
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
|
2018-07-31 18:17:34 +02:00
|
|
|
static BOOL ppc_stack_walk(struct cpu_stack_walk* csw, STACKFRAME64 *frame,
|
|
|
|
union ctx *ctx)
|
2009-12-22 14:21:37 +01:00
|
|
|
{
|
|
|
|
FIXME("not done\n");
|
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
|
2020-03-29 21:00:21 +02:00
|
|
|
static unsigned ppc_map_dwarf_register(unsigned regno, const struct module* module, BOOL eh_frame)
|
2010-03-24 22:04:18 +01:00
|
|
|
{
|
|
|
|
FIXME("not done\n");
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2018-07-31 18:17:34 +02:00
|
|
|
static void *ppc_fetch_context_reg(union ctx *ctx, unsigned regno, unsigned *size)
|
2010-03-27 09:07:56 +01:00
|
|
|
{
|
|
|
|
FIXME("NIY\n");
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static const char* ppc_fetch_regname(unsigned regno)
|
|
|
|
{
|
|
|
|
FIXME("Unknown register %x\n", regno);
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
2012-01-23 21:37:10 +01:00
|
|
|
static BOOL ppc_fetch_minidump_thread(struct dump_context* dc, unsigned index, unsigned flags, const CONTEXT* ctx)
|
|
|
|
{
|
|
|
|
FIXME("NIY\n");
|
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
|
2012-01-23 21:37:16 +01:00
|
|
|
static BOOL ppc_fetch_minidump_module(struct dump_context* dc, unsigned index, unsigned flags)
|
|
|
|
{
|
|
|
|
FIXME("NIY\n");
|
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
|
2011-04-28 13:46:11 +02:00
|
|
|
DECLSPEC_HIDDEN struct cpu cpu_ppc = {
|
2009-12-22 14:21:37 +01:00
|
|
|
IMAGE_FILE_MACHINE_POWERPC,
|
|
|
|
4,
|
2011-04-11 20:47:19 +02:00
|
|
|
CV_REG_NONE, /* FIXME */
|
2009-12-22 14:21:37 +01:00
|
|
|
ppc_get_addr,
|
|
|
|
ppc_stack_walk,
|
2010-03-20 09:47:24 +01:00
|
|
|
NULL,
|
2010-03-24 22:04:18 +01:00
|
|
|
ppc_map_dwarf_register,
|
2010-03-27 09:07:56 +01:00
|
|
|
ppc_fetch_context_reg,
|
|
|
|
ppc_fetch_regname,
|
2012-01-23 21:37:10 +01:00
|
|
|
ppc_fetch_minidump_thread,
|
2012-01-23 21:37:16 +01:00
|
|
|
ppc_fetch_minidump_module,
|
2009-12-22 14:21:37 +01:00
|
|
|
};
|