You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
On my Mac M1 with Sequoia 15.3.1, I'm using VS Code and I'm trying to test a NLI stack with a NET MAUI project but I'm having trouble with an embedded native library that I built, that doesn't execute properly. If I run my unit test from XCode, I can step into my Swift wrapper and then into my native call into my C library, which in turn calls another native library successfully. But if I instead hit that same call by my .NET MAUI app by way of my binding project, that same method executes but the call into my native wrapper fails somehow. I have verified that all libraries are loaded in the MAUI process. I have built everything with DWARF so that debugging symbols are included. The binding project's reference includes the Debug option. In Visual Studio Code, the point I want to debug says External Code, no symbols loaded. I can't figure out how to set "justMyCode" to false in the MAUI lanch.json - I don't think it's supported. On the XCode side I'm using developer signing/automatically sign.
So to illustrate, here is the swift wrapper method:
import Foundation
@objc(DotnetABCDevice)
public class DotnetABCDevice : NSObject
{
@objc
public static func sendRequest(request: String) -> String {
let param = UnsafePointer<Int8>((request as NSString).utf8String)
send_request(param) //this line seems to get skipped
return "Request received: " + request //TODO return response
}
}
The method send_request which is a call into C code apparently gets skipped or otherwise fails somehow and I need to understand why. The parameter request is set as an UnsafePointer because on the other side it's a const char*. I can see that the return statement does execute properly in the VS Code debugger.
That method send_request makes another call to an external native library that I built from source.
To better illustrate the chain of calls, it looks like this:
MAUI -> Binding project -> xcode built framework (where the excerpted code lies) -> embedded Frameworks folder -> external library
So, I want to step in and see what's going on, but I'm blocked from doing that from the top of the stack from a MAUI app. How do I set up VS Code to let me step in to where the problem lies?
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
On my Mac M1 with Sequoia 15.3.1, I'm using VS Code and I'm trying to test a NLI stack with a NET MAUI project but I'm having trouble with an embedded native library that I built, that doesn't execute properly. If I run my unit test from XCode, I can step into my Swift wrapper and then into my native call into my C library, which in turn calls another native library successfully. But if I instead hit that same call by my .NET MAUI app by way of my binding project, that same method executes but the call into my native wrapper fails somehow. I have verified that all libraries are loaded in the MAUI process. I have built everything with DWARF so that debugging symbols are included. The binding project's reference includes the Debug option. In Visual Studio Code, the point I want to debug says External Code, no symbols loaded. I can't figure out how to set "justMyCode" to false in the MAUI lanch.json - I don't think it's supported. On the XCode side I'm using developer signing/automatically sign.
So to illustrate, here is the swift wrapper method:
import Foundation
@objc(DotnetABCDevice)
public class DotnetABCDevice : NSObject
{
}
The method send_request which is a call into C code apparently gets skipped or otherwise fails somehow and I need to understand why. The parameter request is set as an UnsafePointer because on the other side it's a const char*. I can see that the return statement does execute properly in the VS Code debugger.
That method send_request makes another call to an external native library that I built from source.
To better illustrate the chain of calls, it looks like this:
MAUI -> Binding project -> xcode built framework (where the excerpted code lies) -> embedded Frameworks folder -> external library
So, I want to step in and see what's going on, but I'm blocked from doing that from the top of the stack from a MAUI app. How do I set up VS Code to let me step in to where the problem lies?
Beta Was this translation helpful? Give feedback.
All reactions