Posts

Post not yet marked as solved
0 Replies
80 Views
In some particular situation, Xcode debugger or lldb cli cannot correctly extract some value that returned by a async throw function and handled by guard let try?. Here is the minimum example: import Dispatch func test() async throws -> [Int] {   return [369] } let group = DispatchGroup() group.enter() let task = Task {   guard let res = try? await test() else { return }   print(res)   group.leave() } group.wait() If added a break point at print(res), the debugger cannot show the value of res. Due to forum limitation, I cannot paste a screenshot here... if use p res or po res at lldb cli, it shows: (lldb) p res error: expression failed to parse: error: <EXPR>:3:1: error: cannot find 'res' in scope res ^~~ (lldb) po res error: expression failed to parse: error: <EXPR>:3:1: error: cannot find 'res' in scope res ^~~ If test() returns a dict, or a costom struct, the issue retains. But if returned a trivial value like Int, it acts normally. Also, if remove the guard statement, make res a optional value(use let res = try? await test()), debugger can extract the value. Above results are compiled and run in this environment: Swift 5.6.1 Xcode 13.4.1 (13F100) lldb-1316.0.9.46 macOS 12.4 x86_64 arch
Posted
by yh0x13f.
Last updated
.
Post not yet marked as solved
0 Replies
80 Views
I'm trying to use Network Extension to develop a VPN tool for iOS devices. I used a NETunnelProviderManager to create VPN configuration and created extension target conaining a subclass of NEPacketTunnelProvider. But when I use NETunnelProviderManager.connection.startVPNTunnel() to enable the extension, I got a error output: "Failed to fetch info with type 2: Connection interrupted". I checked my entitlements for both app and extension and they both contains PacketTunnel capability. And the info.plist for extension is correct with a principal class $(PRODUCT_MODULE_NAME).PacketTunnelProvider (which is identical to my provider class). I want to know which configuration could cause the problem and how can I fix it. Thank for any helping.
Posted
by yh0x13f.
Last updated
.