Index: util/mach/exc_server_variants.cc |
diff --git a/util/mach/exc_server_variants.cc b/util/mach/exc_server_variants.cc |
index 6e5cd3f2ec6d0efd789f1bf6a3e8bd31d5db88a2..b6e046a4ab6118362f5e1d8f5be67f01774c9258 100644 |
--- a/util/mach/exc_server_variants.cc |
+++ b/util/mach/exc_server_variants.cc |
@@ -14,6 +14,8 @@ |
#include "util/mach/exc_server_variants.h" |
+#include <string.h> |
+ |
#include <algorithm> |
#include <vector> |
@@ -801,4 +803,15 @@ kern_return_t ExcServerSuccessfulReturnValue(exception_behavior_t behavior, |
return KERN_SUCCESS; |
} |
+void ExcServerCopyState(exception_behavior_t behavior, |
+ const natural_t* old_state, |
+ mach_msg_type_number_t old_state_count, |
+ thread_state_t new_state, |
+ mach_msg_type_number_t* new_state_count) { |
+ if (ExceptionBehaviorHasState(behavior)) { |
+ *new_state_count = std::min(old_state_count, *new_state_count); |
+ memcpy(new_state, old_state, *new_state_count * sizeof(old_state[0])); |
+ } |
+} |
+ |
} // namespace crashpad |