Skip to content
Snippets Groups Projects
Commit e986fe9a authored by an7s's avatar an7s
Browse files

Better error reporting

parent 2bd03623
No related branches found
No related tags found
No related merge requests found
...@@ -66,8 +66,9 @@ void fptr_shadow_check_64(int p_shadowIndex, int p_policy, void **p_shadow) ...@@ -66,8 +66,9 @@ void fptr_shadow_check_64(int p_shadowIndex, int p_policy, void **p_shadow)
switch (p_policy) { switch (p_policy) {
case SHADOW_CONTINUE: case SHADOW_CONTINUE:
#ifdef DEBUG #ifdef DEBUG
my_strcpy(msg, "Warning: overwrite of function pointer detected -- restoring saved value: 0x"); my_strcpy(msg, "Warning: overwrite of function pointer detected -- restoring saved value: shadow: 0x");
itox(*p_shadow, &msg[strlen(msg)]); itox(*p_shadow, &msg[strlen(msg)]);
my_strcpy(&msg[strlen(msg)], " \n"); my_strcpy(&msg[strlen(msg)], " \n");
write(2, msg, strlen(msg)); write(2, msg, strlen(msg));
#endif #endif
...@@ -76,7 +77,11 @@ void fptr_shadow_check_64(int p_shadowIndex, int p_policy, void **p_shadow) ...@@ -76,7 +77,11 @@ void fptr_shadow_check_64(int p_shadowIndex, int p_policy, void **p_shadow)
default: default:
{ {
char msg[MAX_DIAGNOSTIC_SIZE]; char msg[MAX_DIAGNOSTIC_SIZE];
my_strcpy(msg, "Warning: overwrite of function pointer detected -- induce segfault\n"); my_strcpy(msg, "shadow value: 0x");
itox(*p_shadow, &msg[strlen(msg)]);
my_strcpy(&msg[strlen(msg)], " shadow idx: 0x");
itox(p_shadowIndex, &msg[strlen(msg)]);
my_strcpy(&msg[strlen(msg)], " : Warning: overwrite of function pointer or critical detected -- induce segfault\n");
write(2, msg, strlen(msg)); write(2, msg, strlen(msg));
my_strcpy(0,""); // induce crash my_strcpy(0,""); // induce crash
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment