mirror of
https://github.com/ValveSoftware/Proton.git
synced 2025-03-13 14:00:34 +03:00
steam_helper: Add PROTON_WAIT_ATTACH for debuggers to attach to game process at startup
This commit is contained in:
parent
0d8ab95d90
commit
801e195cfe
@ -308,6 +308,7 @@ the Wine prefix. Removing the option will revert to the previous behavior.
|
||||
| | <tt>PROTON_LOG_DIR</tt> | Output log files into the directory specified. Defaults to your home directory. |
|
||||
| | <tt>PROTON_DUMP_DEBUG_COMMANDS</tt> | When running a game, Proton will write some useful debug scripts for that game into `$PROTON_DEBUG_DIR/proton_$USER/`. |
|
||||
| | <tt>PROTON_DEBUG_DIR</tt> | Root directory for the Proton debug scripts, `/tmp` by default. |
|
||||
| | <tt>PROTON_WAIT_ATTACH</tt> | Wait for a debugger to attach to steam.exe before launching the game process. To attach to the game process at startup, debuggers should be set to follow child processes. |
|
||||
| | <tt>PROTON_CRASH_REPORT_DIR</tt> | Write crash logs into this directory. Does not clean up old logs, so may eat all your disk space eventually. |
|
||||
| <tt>wined3d</tt> | <tt>PROTON_USE_WINED3D</tt> | Use OpenGL-based wined3d instead of Vulkan-based DXVK for d3d11, d3d10, and d3d9. |
|
||||
| <tt>nod3d11</tt> | <tt>PROTON_NO_D3D11</tt> | Disable <tt>d3d11.dll</tt>, for d3d11 games which can fall back to and run better with d3d9. |
|
||||
|
@ -62,6 +62,12 @@ EXTERN_C HANDLE CDECL __wine_make_process_system(void);
|
||||
|
||||
#define ARRAY_SIZE(a) (sizeof(a) / sizeof(*a))
|
||||
|
||||
static bool env_nonzero(const char *env)
|
||||
{
|
||||
const char *v = getenv(env);
|
||||
return v != NULL && *v && v[0] != '0';
|
||||
}
|
||||
|
||||
static void set_active_process_pid(void)
|
||||
{
|
||||
DWORD pid = GetCurrentProcessId();
|
||||
@ -1177,6 +1183,22 @@ int main(int argc, char *argv[])
|
||||
setup_steam_registry();
|
||||
setup_steam_files();
|
||||
|
||||
if (env_nonzero("PROTON_WAIT_ATTACH"))
|
||||
{
|
||||
unsigned int sleep_count = 0;
|
||||
WINE_TRACE("PROTON_WAIT_ATTACH is set, waiting for debugger...\n");
|
||||
while (!IsDebuggerPresent())
|
||||
{
|
||||
Sleep(100);
|
||||
++sleep_count;
|
||||
if (sleep_count >= 10)
|
||||
{
|
||||
WINE_TRACE("still waiting for debugger...\n");
|
||||
sleep_count = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
wait_handle = __wine_make_process_system();
|
||||
game_process = TRUE;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user