summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFelix Arends <edx@rockbox.org>2002-06-24 16:00:06 +0000
committerFelix Arends <edx@rockbox.org>2002-06-24 16:00:06 +0000
commitdce52c790124ff8f89f63f5d4b449cab986e5c99 (patch)
tree6afdc9f5d34193a12b411de6600068bba4409ed0
parent3bce07ff62864cccfa195efe11bb042e4c11fbf2 (diff)
downloadrockbox-dce52c790124ff8f89f63f5d4b449cab986e5c99.tar.gz
rockbox-dce52c790124ff8f89f63f5d4b449cab986e5c99.zip
added debug function header file.
it defines macros that can be used for debugging purposes. IS_FUNCTION checks whether a function pointer is inside the memory (not in ROM). git-svn-id: svn://svn.rockbox.org/rockbox/trunk@1159 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r--firmware/include/dbgcheck.h24
1 files changed, 24 insertions, 0 deletions
diff --git a/firmware/include/dbgcheck.h b/firmware/include/dbgcheck.h
new file mode 100644
index 0000000000..e1f7aefbdb
--- /dev/null
+++ b/firmware/include/dbgcheck.h
@@ -0,0 +1,24 @@
1#ifndef __DBGCHECK_H__
2#define __DBGCHECK_H__
3
4#include <stdbool.h>
5
6#ifdef DEBUG
7 #ifndef SIMULATOR
8 /* check whether a function is inside the valid memory location */
9 #define IS_FUNCPTR(fp) ({/
10 extern char _text[];/
11 extern char _etext[];/
12 ((((char *)(fp)) >= _text) && (((char *)(fp)) < _etext)/
13 })
14 #else
15 /* check whether a function is inside the valid memory location */
16 #define IS_FUNCPTR(fp) (((char*)(fp)) != NULL)
17 #endif
18#else
19 /* check whether a function is inside the valid memory location */
20 #define IS_FUNCPRT (fp) true
21#endif
22
23
24#endif // #ifndef __DBGCHECK_H__ \ No newline at end of file