alsa.audio: add debug logs
[AROS.git] / test / clib / jmpbuf.c
blob781604a3145434449f5a985f27f669cc170cae8e
1 /*
2 Copyright © 1995-2014, The AROS Development Team. All rights reserved.
3 $Id$
4 */
6 #include <exec/tasks.h>
7 #include <proto/exec.h>
9 #include <setjmp.h>
10 #include <stdio.h>
12 jmp_buf buf;
14 static void HexDump(const UBYTE *data, ULONG count)
16 ULONG t, end;
18 end = (count + 15) & -16;
20 for (t=0; t<end; t++)
22 if ((t&15) == 0)
23 printf("0x%08X:", (unsigned)t);
25 if ((t&3) == 0)
26 printf(" ");
28 if (t < count)
29 printf("%02x", ((UBYTE *)data)[t]);
30 else
31 printf(" ");
33 if ((t&15) == 15)
35 printf("\n");
38 } /* hexdump */
40 int main(void)
42 struct Task *me;
44 setjmp(buf);
46 me = FindTask(NULL);
47 printf("Task 0x%p (%s), stack 0x%p - 0x%p\n", me, me->tc_Node.ln_Name, me->tc_SPLower, me->tc_SPUpper);
48 printf("Function at 0x%p\n", main);
49 printf("Buffer at 0x%p (%u bytes)\n", buf, (unsigned int)sizeof(buf));
51 HexDump((const UBYTE *)buf, sizeof(buf));
53 return 0;