Bug 1481009 Part 4 - Add redirection for crash reporter code, r=froydnj.
authorBrian Hackett <bhackett1024@gmail.com>
Mon, 13 Aug 2018 20:47:05 +0000
changeset 431342 d605332894bff2a8eee8667463e35b76e0f2f791
parent 431341 7927150efaa6b6ea07e56d2b1e144171e2150046
child 431343 305a6de8a4579c3a2546d693a927f143e4c4e906
push id34437
push userebalazs@mozilla.com
push dateTue, 14 Aug 2018 09:31:09 +0000
treeherdermozilla-central@914b3b370ad0 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersfroydnj
bugs1481009
milestone63.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1481009 Part 4 - Add redirection for crash reporter code, r=froydnj.
toolkit/recordreplay/ProcessRedirectDarwin.cpp
--- a/toolkit/recordreplay/ProcessRedirectDarwin.cpp
+++ b/toolkit/recordreplay/ProcessRedirectDarwin.cpp
@@ -145,16 +145,17 @@ namespace recordreplay {
   MACRO(mach_msg)                               \
   MACRO(mach_timebase_info)                     \
   MACRO(mach_vm_allocate)                       \
   MACRO(mach_vm_deallocate)                     \
   MACRO(mach_vm_protect)                        \
   MACRO(sandbox_free_error)                     \
   MACRO(sandbox_init)                           \
   MACRO(sandbox_init_with_parameters)           \
+  MACRO(task_threads)                           \
   MACRO(vm_copy)                                \
   MACRO(vm_purgable_control)                    \
   MACRO(tzset)                                  \
   /* NSPR functions */                          \
   MACRO(PL_NewHashTable)                        \
   MACRO(PL_HashTableDestroy)                    \
   /* Objective C functions */                   \
   MACRO(class_getClassMethod)                   \
@@ -1506,16 +1507,26 @@ RR_sandbox_init_with_parameters(const ch
 {
   // As for sandbox_init, call this function even while replaying.
   AutoEnsurePassThroughThreadEvents pt;
   return OriginalCall(sandbox_init_with_parameters, ssize_t,
                       aProfile, aFlags, aParameters, aErrorBuf);
 }
 
 static kern_return_t
+RR_task_threads(mach_port_t aTask, thread_act_array_t *aThreads,
+                mach_msg_type_number_t *aNumThreads)
+{
+  // Make sure events are passed through here so that replaying processes can
+  // inspect their own threads.
+  AutoEnsurePassThroughThreadEvents pt;
+  return OriginalCall(task_threads, kern_return_t, aTask, aThreads, aNumThreads);
+}
+
+static kern_return_t
 RR_mach_vm_allocate(vm_map_t aTarget, mach_vm_address_t* aAddress,
                     mach_vm_size_t aSize, int aFlags)
 {
   *aAddress = (mach_vm_address_t) AllocateMemory(aSize, MemoryKind::Tracked);
   return KERN_SUCCESS;
 }
 
 static kern_return_t