mirror of
https://github.com/KytyPS5/KytyPS5.git
synced 2026-10-27 16:02:37 +00:00
libc: isolate guest setenv from host environment. Fix linux debugging
This commit is contained in:
1 parent
b870a77176
commit
e559771a08
2 files changed
+18
-20
No files matched your search
Vendored
+17
-2
@@ -37,8 +37,16 @@
|
|||||||
"type": "cppdbg",
|
"type": "cppdbg",
|
||||||
"program": "${workspaceFolder}/_Build/vscode-clang/kyty_emulator",
|
"program": "${workspaceFolder}/_Build/vscode-clang/kyty_emulator",
|
||||||
"cwd": "${workspaceFolder}/_Build/vscode-clang",
|
"cwd": "${workspaceFolder}/_Build/vscode-clang",
|
||||||
|
"externalConsole": false,
|
||||||
"MIMode": "gdb",
|
"MIMode": "gdb",
|
||||||
"miDebuggerPath": "/usr/bin/gdb"
|
"miDebuggerPath": "/usr/bin/gdb",
|
||||||
|
"setupCommands": [
|
||||||
|
{
|
||||||
|
"description": "Pass Kyty's internal signals to its handlers",
|
||||||
|
"text": "handle SIG37 SIGSEGV SIGBUS SIGILL nostop noprint pass",
|
||||||
|
"ignoreFailures": false
|
||||||
|
}
|
||||||
|
]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -49,7 +57,14 @@
|
|||||||
"linux": {
|
"linux": {
|
||||||
"type": "cppdbg",
|
"type": "cppdbg",
|
||||||
"MIMode": "gdb",
|
"MIMode": "gdb",
|
||||||
"miDebuggerPath": "/usr/bin/gdb"
|
"miDebuggerPath": "/usr/bin/gdb",
|
||||||
|
"setupCommands": [
|
||||||
|
{
|
||||||
|
"description": "Pass Kyty's internal signals to its handlers",
|
||||||
|
"text": "handle SIG37 SIGSEGV SIGBUS SIGILL nostop noprint pass",
|
||||||
|
"ignoreFailures": false
|
||||||
|
}
|
||||||
|
]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
|||||||
+1
-18
@@ -327,25 +327,8 @@ static KYTY_SYSV_ABI int setenv(const char* name, const char* value, int overwri
|
|||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (overwrite == 0 && std::getenv(name) != nullptr) {
|
// Guest environment changes must not leak into emulator host libraries.
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
#if KYTY_PLATFORM == KYTY_PLATFORM_WINDOWS
|
|
||||||
const auto ret = ::_putenv_s(name, value);
|
|
||||||
if (ret != 0) {
|
|
||||||
*Posix::GetErrorAddr() = ret;
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
return 0;
|
return 0;
|
||||||
#else
|
|
||||||
const auto ret = ::setenv(name, value, overwrite);
|
|
||||||
if (ret != 0) {
|
|
||||||
*Posix::GetErrorAddr() = errno;
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
return 0;
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static KYTY_SYSV_ABI int64_t libc_time(int64_t* timer) {
|
static KYTY_SYSV_ABI int64_t libc_time(int64_t* timer) {
|
||||||
|
|||||||
Reference in new issue
Block a user