xref: /inferno-os/utils/libmach/4db.c (revision 74a4d8c26dd3c1e9febcb717cfd6cb6512991a7a)
1*74a4d8c2SCharles.Forsyth #include <lib9.h>
2*74a4d8c2SCharles.Forsyth #include <bio.h>
3*74a4d8c2SCharles.Forsyth #include "mach.h"
4*74a4d8c2SCharles.Forsyth /*
5*74a4d8c2SCharles.Forsyth  * Mips-specific debugger interface
6*74a4d8c2SCharles.Forsyth  */
7*74a4d8c2SCharles.Forsyth 
8*74a4d8c2SCharles.Forsyth char	*mipsexcep(Map*, Rgetter);
9*74a4d8c2SCharles.Forsyth int	mipsfoll(Map*, ulong, Rgetter, ulong*);
10*74a4d8c2SCharles.Forsyth int	mipsinst(Map*, ulong, char, char*, int);
11*74a4d8c2SCharles.Forsyth int	mipsdas(Map*, ulong, char*, int);
12*74a4d8c2SCharles.Forsyth int	mipsinstlen(Map*, ulong);
13*74a4d8c2SCharles.Forsyth /*
14*74a4d8c2SCharles.Forsyth  *	Debugger interface
15*74a4d8c2SCharles.Forsyth  */
16*74a4d8c2SCharles.Forsyth Machdata mipsmach2be =
17*74a4d8c2SCharles.Forsyth {
18*74a4d8c2SCharles.Forsyth 	{0, 0, 0, 0xD},		/* break point */
19*74a4d8c2SCharles.Forsyth 	4,			/* break point size */
20*74a4d8c2SCharles.Forsyth 
21*74a4d8c2SCharles.Forsyth 	beswab,			/* short to local byte order */
22*74a4d8c2SCharles.Forsyth 	beswal,			/* long to local byte order */
23*74a4d8c2SCharles.Forsyth 	beswav,			/* vlong to local byte order */
24*74a4d8c2SCharles.Forsyth 	risctrace,		/* C traceback */
25*74a4d8c2SCharles.Forsyth 	riscframe,		/* Frame finder */
26*74a4d8c2SCharles.Forsyth 	mipsexcep,		/* print exception */
27*74a4d8c2SCharles.Forsyth 	0,			/* breakpoint fixup */
28*74a4d8c2SCharles.Forsyth 	beieeesftos,		/* single precision float printer */
29*74a4d8c2SCharles.Forsyth 	beieeedftos,		/* double precisioin float printer */
30*74a4d8c2SCharles.Forsyth 	mipsfoll,		/* following addresses */
31*74a4d8c2SCharles.Forsyth 	mipsinst,		/* print instruction */
32*74a4d8c2SCharles.Forsyth 	mipsdas,		/* dissembler */
33*74a4d8c2SCharles.Forsyth 	mipsinstlen,		/* instruction size */
34*74a4d8c2SCharles.Forsyth };
35*74a4d8c2SCharles.Forsyth 
36*74a4d8c2SCharles.Forsyth /*
37*74a4d8c2SCharles.Forsyth  *	Debugger interface
38*74a4d8c2SCharles.Forsyth  */
39*74a4d8c2SCharles.Forsyth Machdata mipsmach2le =
40*74a4d8c2SCharles.Forsyth {
41*74a4d8c2SCharles.Forsyth 	{0, 0, 0, 0xD},		/* break point */
42*74a4d8c2SCharles.Forsyth 	4,			/* break point size */
43*74a4d8c2SCharles.Forsyth 
44*74a4d8c2SCharles.Forsyth 	leswab,			/* short to local byte order */
45*74a4d8c2SCharles.Forsyth 	leswal,			/* long to local byte order */
46*74a4d8c2SCharles.Forsyth 	leswav,			/* vlong to local byte order */
47*74a4d8c2SCharles.Forsyth 	risctrace,		/* C traceback */
48*74a4d8c2SCharles.Forsyth 	riscframe,		/* Frame finder */
49*74a4d8c2SCharles.Forsyth 	mipsexcep,		/* print exception */
50*74a4d8c2SCharles.Forsyth 	0,			/* breakpoint fixup */
51*74a4d8c2SCharles.Forsyth 	leieeesftos,		/* single precision float printer */
52*74a4d8c2SCharles.Forsyth 	leieeedftos,		/* double precisioin float printer */
53*74a4d8c2SCharles.Forsyth 	mipsfoll,		/* following addresses */
54*74a4d8c2SCharles.Forsyth 	mipsinst,		/* print instruction */
55*74a4d8c2SCharles.Forsyth 	mipsdas,		/* dissembler */
56*74a4d8c2SCharles.Forsyth 	mipsinstlen,		/* instruction size */
57*74a4d8c2SCharles.Forsyth };
58