2 Copyright © 2010-2012, The AROS Development Team. All rights reserved.
5 Desc: CPU context parsing routines. Dummy nonfunctional template.
6 See code in arch/i386/all/exec/alert_cpu.c for working example.
12 #include <exec/rawfmt.h>
14 #include "exec_intern.h"
15 #include "exec_util.h"
17 AROS_UFP3(UBYTE
*, SegTrack
,
18 AROS_UFPA(ULONG
, Address
, A0
),
19 AROS_UFPA(ULONG
*, SegNum
, A1
),
20 AROS_UFPA(ULONG
*, Offset
, A2
));
24 struct SignalSemaphore seg_Semaphore
;
27 #define SEG_SEM "SegTracker"
29 char *FormatCPUContext(char *buffer
, struct ExceptionContext
*ctx
, struct ExecBase
*SysBase
)
31 struct SegSem
*segSem
;
32 VOID_FUNC dest
= buffer
? RAWFMTFUNC_STRING
: RAWFMTFUNC_SERIAL
;
35 RawDoFmt("D0: %08lx %08lx %08lx %08lx\n"
36 "D4: %08lx %08lx %08lx %08lx\n"
37 "A0: %08lx %08lx %08lx %08lx\n"
38 "A4: %08lx %08lx %08lx %08lx\n"
40 "PC: %08lx", ctx
, dest
, buffer
);
41 buf
= buffer
+ strlen(buffer
);
43 segSem
= (struct SegSem
*)FindSemaphore(SEG_SEM
);
45 ULONG SegNum
, SegOffset
, SegList
;
47 UBYTE
*name
= AROS_UFC3(UBYTE
*, segSem
->seg_Find
,
48 AROS_UFCA(ULONG
, ctx
->pc
, A0
),
49 AROS_UFCA(ULONG
*, &SegNum
, A1
),
50 AROS_UFCA(ULONG
*, &SegOffset
, A2
));
52 AROS_UFC3(UBYTE
*, segSem
->seg_Find
,
53 AROS_UFCA(ULONG
, ctx
->pc
, A0
),
54 AROS_UFCA(ULONG
*, &SegList
, A1
),
55 AROS_UFCA(ULONG
*, &SegList
, A2
));
56 buf
= NewRawDoFmt("\nSegTracker: %s\nHunk %ld, Offset $%08lx, SegList $%08lx\n", dest
, buf
, name
, SegNum
, SegOffset
, SegList
);
63 /* Unwind a single stack frame */
64 APTR
UnwindFrame(APTR fp
, APTR
*caller
)