mirror of
https://github.com/ValveSoftware/Proton.git
synced 2025-01-28 22:48:18 +03:00
proton: Dump a few different debugging utilities
This commit is contained in:
parent
434ed0476c
commit
5cef7459dc
25
proton
25
proton
@ -235,12 +235,10 @@ def determine_architecture(path):
|
|||||||
return ARCH_I386
|
return ARCH_I386
|
||||||
return ARCH_UNKNOWN
|
return ARCH_UNKNOWN
|
||||||
|
|
||||||
#determine mode
|
def dump_dbg_script(path, cmd, descr):
|
||||||
if sys.argv[1] == "run":
|
f = open(path, "w")
|
||||||
#start target app
|
f.write("#!/bin/bash\n")
|
||||||
if "PROTON_DUMP_DEBUG_COMMAND" in env:
|
f.write("#" + descr + "\n\n")
|
||||||
f = open("/tmp/proton_dbg_cmd", "w")
|
|
||||||
f.write("#!/bin/bash\n\n")
|
|
||||||
f.write("cd \"" + os.getcwd() + "\"\n")
|
f.write("cd \"" + os.getcwd() + "\"\n")
|
||||||
f.write("SteamGameId=\"" + env["SteamGameId"] + "\" \\\n")
|
f.write("SteamGameId=\"" + env["SteamGameId"] + "\" \\\n")
|
||||||
f.write("\tSteamAppId=\"" + env["SteamAppId"] + "\" \\\n")
|
f.write("\tSteamAppId=\"" + env["SteamAppId"] + "\" \\\n")
|
||||||
@ -255,13 +253,22 @@ if sys.argv[1] == "run":
|
|||||||
f.write("\tWINEDLLOVERRIDES=\"" + env["WINEDLLOVERRIDES"] + "\" \\\n")
|
f.write("\tWINEDLLOVERRIDES=\"" + env["WINEDLLOVERRIDES"] + "\" \\\n")
|
||||||
arch = determine_architecture(sys.argv[2])
|
arch = determine_architecture(sys.argv[2])
|
||||||
if arch == ARCH_X86_64:
|
if arch == ARCH_X86_64:
|
||||||
f.write("\t\"" + bindir + "wine64\" winedbg")
|
f.write("\t\"" + bindir + "wine64\"")
|
||||||
else:
|
else:
|
||||||
f.write("\t\"" + bindir + "wine\" winedbg")
|
f.write("\t\"" + bindir + "wine\"")
|
||||||
for arg in sys.argv[2:]:
|
for arg in cmd:
|
||||||
f.write(" \"" + arg + "\"")
|
f.write(" \"" + arg + "\"")
|
||||||
f.write("\n")
|
f.write("\n")
|
||||||
f.close()
|
f.close()
|
||||||
|
os.chmod(path, 0755)
|
||||||
|
|
||||||
|
#determine mode
|
||||||
|
if sys.argv[1] == "run":
|
||||||
|
#start target app
|
||||||
|
if "PROTON_DUMP_DEBUG_COMMAND" in env:
|
||||||
|
dump_dbg_script("/tmp/proton_dbg", ["winedbg", "$@"], "Run winedbg (with args)")
|
||||||
|
dump_dbg_script("/tmp/proton_dbg_run", ["winedbg"] + sys.argv[2:], "Run winedbg with the game loaded")
|
||||||
|
dump_dbg_script("/tmp/proton_run", ["$@"], "Run an arbitrary command")
|
||||||
else:
|
else:
|
||||||
run_wine([wine_path] + sys.argv[2:])
|
run_wine([wine_path] + sys.argv[2:])
|
||||||
elif sys.argv[1] == "translatepath":
|
elif sys.argv[1] == "translatepath":
|
||||||
|
Loading…
x
Reference in New Issue
Block a user