debug messages: implement dynamic debug
Heavily inspired off linux kernel's dynamic debug: * add a /sys/kernel/debug/dynamic_debug/control file (accessible from linux side in /sys/class/mcos/mcos0/sys/kernel/debug/dynamic_debug/control) * read from file to list debug statements (currently limited to 4k in size) * write to file with '[file foo ][func bar ][line [x][-[y]]] [+-]p' to change values Side effects: * reindented all linker scripts, there is a new __verbose section * added string function strpbrk Change-Id: I36d7707274dcc3ecaf200075a31a2f0f76021059
This commit is contained in:
@ -23,6 +23,7 @@ char *strncpy(char *dest, const char *src, size_t maxlen);
|
||||
int strcmp(const char *s1, const char *s2);
|
||||
int strncmp(const char *s1, const char *s2, size_t n);
|
||||
char *strstr(const char *haystack, const char *needle);
|
||||
char *strpbrk(const char *haystack, const char *accept);
|
||||
char *strchr(const char *s, int n);
|
||||
char *strrchr(const char *s, int n);
|
||||
void *memcpy(void *dest, const void *src, size_t n);
|
||||
|
||||
13
lib/string.c
13
lib/string.c
@ -112,6 +112,19 @@ strrchr(const char *s, int c)
|
||||
return (char *)last;
|
||||
} /* strrchr() */
|
||||
|
||||
char *strpbrk(const char *s, const char *accept)
|
||||
{
|
||||
const char *a;
|
||||
|
||||
do {
|
||||
for (a = accept; *a; a++)
|
||||
if (*s == *a)
|
||||
return (char *)s;
|
||||
} while (*(s++));
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
char *strstr(const char *haystack, const char *needle)
|
||||
{
|
||||
int len = strlen(needle);
|
||||
|
||||
Reference in New Issue
Block a user