Electrolysis/Debugging: Difference between revisions

→‎Debugging E10s: updated environment variables for debugging
(→‎Debugging E10s: updated environment variables for debugging)
Line 26: Line 26:
First, make sure you've got a DEBUG build. If that's the case, you're all set ! Just hit F5 in MSVC. You should see the program's console with the main process output in it.  
First, make sure you've got a DEBUG build. If that's the case, you're all set ! Just hit F5 in MSVC. You should see the program's console with the main process output in it.  


Now when the output stops updating, it means it's reached this code in nsEmbedFunctions.cpp :
If you have the MOZ_DEBUG_CHILD_PROCESS environment variable set, when the child process launches it should invoke the JIT debugger. (Note: to debug both processes in the same MSVC instance, you can attach to the child process from your MSVC instance and then hit Cancel.)


<pre>
You can instead set an environment variable MOZ_DEBUG_CHILD_PAUSE, which will pause the child process for 10 seconds when it starts, giving you time to attach:
  if (PR_GetEnv("MOZ_DEBUG_CHILD_PROCESS")) {
#ifdef OS_POSIX
      printf("\n\nCHILDCHILDCHILDCHILD\n  debug me @%d\n\n", getpid());
      sleep(30);
#elif defined(OS_WIN)
      Sleep(30000);
#endif
  }
</pre>
 
You now have 30 seconds to hook up to the newly created child process. Do the following :
*Hit CTRL-ALT-P to bring up the "attach to process" dialog
*Hit CTRL-ALT-P to bring up the "attach to process" dialog
*Double-click "plugin-container.exe" in the "Available Processes" listbox.
*Double-click "plugin-container.exe" in the "Available Processes" listbox.
284

edits