shithub: loong

ref: 8287e0cd29d9afdb41efa029705644f8427cf53a
dir: /sys/src/libmach/zdb.c/

View raw version
#include <u.h>
#include <libc.h>
#include <bio.h>
#include <mach.h>

/*
 * LoongArch-specific debugger interface
 */
static	char*	loongexcep(Map*, Rgetter);
static	int	loongfoll(Map*, uvlong, Rgetter, uvlong*);
static	int	loonginst(Map*, uvlong, char, char*, int);
static	int	loongdas(Map*, uvlong, char*, int);
static	int	loonginstlen(Map*, uvlong);

/*
 *	Debugger interface
 */
Machdata loongmach =
{
	{0x00, 0x2A, 0x20, 0x00},	/* break point 0x002A0000 */
	4,		/* break point size */
	leswab,		/* short to local byte order */
	leswal,		/* long to local byte order */
	leswav,		/* long to local byte order */
	risctrace,	/* C traceback */
	riscframe,	/* Frame finder */
	loongexcep,	/* print exception */
	0,		/* breakpoint fixup */
	leieeesftos,		/* single precision float printer */
	leieeedftos,		/* double precision float printer */
	loongfoll,	/* following addresses */
	loonginst,	/* print instruction */
	loongdas,	/* dissembler */
	loonginstlen,	/* instruction size */
};

static char*
loongexcep(Map *, Rgetter)
{
	return "???";
}

static int
loonginst(Map *, uvlong, char, char *, int)
{
	return -1;
}

static int
loongdas(Map *, uvlong, char *, int)
{
	return -1;
}

static int
loonginstlen(Map*, uvlong)
{
	return 4;
}

static int
loongfoll(Map *, uvlong, Rgetter, uvlong *)
{
	return -1;
}