Add Support for Debugging NativeAOT #9855
Draft
+108
−0
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
NativeAOT Sample
This is the sample for using NativeAOT with .net Android
Debugging
In order to debug we need to use
lldb
. The following commands will install thelldb-server
for the application.The above commands are setup in a MSBuild Target which will run after the
Install
target has run. So thereis no need to do this manually if you are using
NativeAOT.csproj
.Once
lldb-server
is up and running, you will want to run up the app using the followingThe
-D
is important as it stops the app from running until the java debugger is attached.Now that the app is running we need to get the process id.
Grab the process id, then start VSCode
Debug NativeAOT
Task. And drop in the process id.Set your breakpoints as usual in the VSCode.
if you are using lldb from the command line use the following
Next you need to attach the java debugger to clear the dialog which is currently blocking the
application execution.
You will want to type
quit
to exit thejdb
terminal once it has connected.