Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(568)

Unified Diff: util/mach/exc_server_variants.cc

Issue 1049023003: Add ExcServerCopyState() (Closed) Base URL: https://chromium.googlesource.com/crashpad/crashpad@master
Patch Set: Address review feedback Created 5 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « util/mach/exc_server_variants.h ('k') | util/mach/exc_server_variants_test.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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
« no previous file with comments | « util/mach/exc_server_variants.h ('k') | util/mach/exc_server_variants_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698