jjjjj
jjjjj

Reputation: 61

How can I debug .a libs(c++ and I have source code) in a Xamarin.forms project?

I have a Xamarin.Forms project and there are also some .a libs(C++) referenced in Xamarin.iOS project.

Xamarin.Forms project

  ------codes

Xamarin.iOS project

  ------codes

  ------.a libs(c++)

I do have the source code of those .a C++ libs.

The question is that is there a way that I can debug the C++ source code when running the Xamarin.forms project?

Update:

I just followed this document and the Xcode does not attach to the Xamarin app when it launches. Any idea?

Upvotes: 6

Views: 441

Answers (2)

MD. RAKIB HASAN
MD. RAKIB HASAN

Reputation: 3956

Xamarin.iOS applications can be debugged with the built-in debugger in Visual Studio for Mac or Visual Studio.

Xamarin.iOS will generate slower and much larger applications as every line of code must be instrumented when you compile applications in Debug mode. Make sure that you do a Release build before releasing.

Use Visual Studio for Mac's native debugging support for debugging C# and other managed languages code and use LLDB when you need to debug C, C++ or Objective C codethat you might be linking with your Xamarin.iOS project.

The Xamarin.iOS debugger uses the Mono Soft Debugger, which means that the generated code and the Mono runtime cooperate with the IDE to provide a debugging experience. This is different than hard debuggers like LLDB or MDB which control a program without the knowledge or cooperation from the debugged program.

Xamarin.iOS ships with the source code for Mono's class libraries, and you can use this to single step from the debugger to see how things are working under the hood.

enter image description hereTo debug the class libraries in Visual Studio, you must disable Just My Code under the Debug > Options menu. In the Debugging > General node, clear the Enable Just My Code checkbox:

Please check this link for full debug tutorial: Link

Upvotes: 0

Barr J
Barr J

Reputation: 10927

You cannot debug C++ in a xamarin.ios project, it is not supported and was confirmed by Microsoft's dev team.

Possible solution will be to mix objectiv-C and C++ code together in your xcode application.

Otherwise you will not be able to debug native code.

reference for help:

Using native libraries in xamarin

Upvotes: 1

Related Questions