mirror of
https://github.com/Lakr233/vphone-cli.git
synced 2026-04-05 13:09:06 +08:00
Guard debug stub port query behind macOS 26+
The _configuration._debugStub private API causes SIGBUS on macOS 15. Only query it on macOS 26+ where the API exists. Closes #128
This commit is contained in:
@@ -298,11 +298,15 @@ class VPhoneVirtualMachine: NSObject, VZVirtualMachineDelegate {
|
||||
print("[vphone] VM started — booting normally")
|
||||
}
|
||||
|
||||
// Print auto-assigned debug stub port after VM starts
|
||||
if let debugStub = Dynamic(vm)._configuration._debugStub.asAnyObject {
|
||||
if let port = Dynamic(debugStub).port.asInt, port > 0 {
|
||||
print("[vphone] Kernel GDB debug stub listening on tcp://127.0.0.1:\(port)")
|
||||
// Print auto-assigned debug stub port after VM starts (private API, macOS 26+ only)
|
||||
if ProcessInfo.processInfo.operatingSystemVersion.majorVersion >= 26 {
|
||||
if let debugStub = Dynamic(vm)._configuration._debugStub.asAnyObject {
|
||||
if let port = Dynamic(debugStub).port.asInt, port > 0 {
|
||||
print("[vphone] Kernel GDB debug stub listening on tcp://127.0.0.1:\(port)")
|
||||
}
|
||||
}
|
||||
} else {
|
||||
print("[vphone] Kernel GDB debug stub port query requires macOS 26+, skipped")
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user