简体   繁体   中英

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?

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.

在此处输入图片说明 To 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

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM