cpu_ppc.c 2.48 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30
/*
 * 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);

31 32
static BOOL ppc_get_addr(HANDLE hThread, const CONTEXT* ctx,
                         enum cpu_addr ca, ADDRESS64* addr)
33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50
{
   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;
}

51
static BOOL ppc_stack_walk(struct cpu_stack_walk* csw, LPSTACKFRAME64 frame, CONTEXT* context)
52 53 54 55 56
{
    FIXME("not done\n");
    return FALSE;
}

57
static unsigned ppc_map_dwarf_register(unsigned regno, BOOL eh_frame)
58 59 60 61 62
{
    FIXME("not done\n");
    return 0;
}

63 64 65 66 67 68 69 70 71 72 73 74
static void* ppc_fetch_context_reg(CONTEXT* ctx, unsigned regno, unsigned* size)
{
    FIXME("NIY\n");
    return NULL;
}

static const char* ppc_fetch_regname(unsigned regno)
{
    FIXME("Unknown register %x\n", regno);
    return NULL;
}

75 76 77 78 79 80
static BOOL ppc_fetch_minidump_thread(struct dump_context* dc, unsigned index, unsigned flags, const CONTEXT* ctx)
{
    FIXME("NIY\n");
    return FALSE;
}

81 82 83 84 85 86
static BOOL ppc_fetch_minidump_module(struct dump_context* dc, unsigned index, unsigned flags)
{
    FIXME("NIY\n");
    return FALSE;
}

87
DECLSPEC_HIDDEN struct cpu cpu_ppc = {
88 89
    IMAGE_FILE_MACHINE_POWERPC,
    4,
90
    CV_REG_NONE, /* FIXME */
91 92
    ppc_get_addr,
    ppc_stack_walk,
93
    NULL,
94
    ppc_map_dwarf_register,
95 96
    ppc_fetch_context_reg,
    ppc_fetch_regname,
97
    ppc_fetch_minidump_thread,
98
    ppc_fetch_minidump_module,
99
};