use USER_CPPFLAGS
[AROS.git] / arch / m68k-all / debug / debug_gdb.c
blob7dd1cc077a807beae1ecef1880d4d9cc4b41f030
1 /*
2 Copyright © 2011, The AROS Development Team. All rights reserved.
3 $Id$
5 Desc: Initialize the debug interface
6 Lang: english
7 */
9 #include <aros/symbolsets.h>
11 #include <proto/exec.h>
13 #ifdef AROS_MODULES_DEBUG
14 /* 'malloc' and 'free' are needed for GDB's strcmp(), which is
15 * used by the 'loadseg' method of the .gdbinit of AROS
17 void *malloc(ULONG size)
19 size_t *mem;
21 size = (size + sizeof(size_t) - 1) & ~(sizeof(size_t) - 1);
23 mem = AllocMem(size, -1);
24 *(mem++) = size;
25 return mem;
28 void free(void *ptr)
30 size_t *mem = ptr;
32 mem--;
33 FreeMem(mem, mem[0]);
35 #endif