2 Copyright © 2010-2018, The AROS Development Team. All rights reserved.
5 Desc: CPU context parsing routines.
11 #include <exec/rawfmt.h>
13 #include "exec_intern.h"
14 #include "exec_util.h"
16 AROS_UFP3(UBYTE
*, SegTrack
,
17 AROS_UFPA(ULONG
, Address
, A0
),
18 AROS_UFPA(ULONG
*, SegNum
, A1
),
19 AROS_UFPA(ULONG
*, Offset
, A2
));
23 struct SignalSemaphore seg_Semaphore
;
26 #define SEG_SEM "SegTracker"
28 char *FormatCPUContext(char *buffer
, struct ExceptionContext
*ctx
, struct ExecBase
*SysBase
)
30 struct SegSem
*segSem
;
31 VOID_FUNC dest
= buffer
? RAWFMTFUNC_STRING
: RAWFMTFUNC_SERIAL
;
34 RawDoFmt("D0: %08lx %08lx %08lx %08lx\n"
35 "D4: %08lx %08lx %08lx %08lx\n"
36 "A0: %08lx %08lx %08lx %08lx\n"
37 "A4: %08lx %08lx %08lx %08lx\n"
39 "PC: %08lx", (RAWARG
)ctx
, dest
, buffer
);
40 buf
= buffer
+ strlen(buffer
);
42 segSem
= (struct SegSem
*)FindSemaphore(SEG_SEM
);
44 ULONG SegNum
, SegOffset
, SegList
;
46 UBYTE
*name
= AROS_UFC3(UBYTE
*, segSem
->seg_Find
,
47 AROS_UFCA(ULONG
, ctx
->pc
, A0
),
48 AROS_UFCA(ULONG
*, &SegNum
, A1
),
49 AROS_UFCA(ULONG
*, &SegOffset
, A2
));
51 AROS_UFC3(UBYTE
*, segSem
->seg_Find
,
52 AROS_UFCA(ULONG
, ctx
->pc
, A0
),
53 AROS_UFCA(ULONG
*, &SegList
, A1
),
54 AROS_UFCA(ULONG
*, &SegList
, A2
));
55 buf
= NewRawDoFmt("\nSegTracker: %s\nHunk %ld, Offset $%08lx, SegList $%08lx\n", dest
, buf
, name
, SegNum
, SegOffset
, SegList
);
62 /* Unwind a single stack frame */
63 APTR
UnwindFrame(APTR fp
, APTR
*caller
)