* Instead of faulting when trying to print an invalid string pointer,

print_demangled_call() will now use user_strlcpy() to copy the string
  first (if that fails, it will printf '???' to show this).


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@28386 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Axel Dörfler
2008-10-30 18:29:49 +00:00
parent 9cd2430ee0
commit 97ba3fb358
+6 -2
View File
@@ -218,8 +218,12 @@ print_demangled_call(const char* image, const char* symbol, addr_t args,
break; break;
} }
if (type == B_STRING_TYPE) if (type == B_STRING_TYPE) {
kprintf(" \"%s\"", (char*)value); if (user_strlcpy(buffer, (char*)value, sizeof(buffer)) < B_OK)
kprintf(" '???'");
else
kprintf(" \"%s\"", buffer);
}
if (addDebugVariables) if (addDebugVariables)
set_debug_argument_variable(i, value); set_debug_argument_variable(i, value);