{"id":413,"date":"2014-11-12T07:32:00","date_gmt":"2014-11-12T07:32:00","guid":{"rendered":"https:\/\/blogs.msdn.microsoft.com\/visualstudioalm\/2014\/11\/12\/debugging-c-code-on-android-with-visual-studio-2015\/"},"modified":"2022-05-26T03:15:00","modified_gmt":"2022-05-26T11:15:00","slug":"debugging-c-code-on-android-with-visual-studio-2015","status":"publish","type":"post","link":"https:\/\/devblogs.microsoft.com\/devops\/debugging-c-code-on-android-with-visual-studio-2015\/","title":{"rendered":"Debugging C++ code on Android with Visual Studio 2015"},"content":{"rendered":"<p><em>This post has been updated to reflect the state of features in Visual Studio 2015 RTM.<\/em><\/p>\n<p>By now you will have heard the exciting news that <a href=\"http:\/\/blogs.msdn.com\/b\/vcblog\/archive\/2014\/11\/12\/cross-platform-mobile-development-with-visual-c.aspx\">Visual Studio 2015 supports C++ development on Android<\/a> (and that includes an <a href=\"http:\/\/blogs.msdn.com\/b\/visualstudioalm\/archive\/2014\/11\/12\/introducing-visual-studio-s-emulator-for-android.aspx\">Emulator for Android<\/a>).<\/p>\n<p>Obviously no development experience is complete without debugging support, so this means that Visual Studio 2015 supports debugging C++ code running on Android. With this new debug engine, the debugging experience you\u2019ll get includes (but is not limited to):<\/p>\n<p><a href=\"http:\/\/msdn.microsoft.com\/en-us\/library\/y740d9d3.aspx\">F5<\/a>,\u00a0<a href=\"http:\/\/blogs.msdn.com\/b\/vcblog\/archive\/2015\/07\/20\/what-s-new-with-visual-c-cross-platform-mobile-development.aspx\">attach to process and support for debugging existing .apk&#8217;s<\/a>,\u00a0<a href=\"http:\/\/msdn.microsoft.com\/en-us\/library\/bs4c1wda.aspx\">Output window<\/a>, <a href=\"http:\/\/msdn.microsoft.com\/en-us\/library\/5557y8b4.aspx\">Breakpoints<\/a>\u00a0(including <a href=\"http:\/\/blogs.msdn.com\/b\/vcblog\/archive\/2015\/07\/20\/what-s-new-with-visual-c-cross-platform-mobile-development.aspx\">conditional breakpoints)<\/a>, <a href=\"http:\/\/msdn.microsoft.com\/en-us\/library\/ek13f001(v=vs.100).aspx\">Step Into\/Over\/Out<\/a>, <a href=\"http:\/\/msdn.microsoft.com\/en-us\/library\/dbhfa1e0(v=vs.100).aspx\">Run To Cursor<\/a>, <a href=\"http:\/\/msdn.microsoft.com\/en-us\/library\/a3694ts5.aspx\">Call Stack<\/a>, <a href=\"http:\/\/msdn.microsoft.com\/en-us\/library\/esta7c62.aspx\">Data and Variable windows<\/a>\u00a0(including <a href=\"http:\/\/blogs.msdn.com\/b\/vcblog\/archive\/2015\/04\/29\/natvis-support-for-android-debugging.aspx\">support for using Natvis files)<\/a>, <a href=\"http:\/\/msdn.microsoft.com\/en-us\/library\/4c8f14c9.aspx\">Modules window<\/a>, Address level debugging (<a href=\"http:\/\/msdn.microsoft.com\/en-us\/library\/a3cwf295.aspx\">Disassembly<\/a>, <a href=\"http:\/\/msdn.microsoft.com\/en-us\/library\/s3aw423e.aspx\">Memory<\/a>, <a href=\"http:\/\/msdn.microsoft.com\/en-us\/library\/62680774.aspx\">Registers<\/a> windows), <a href=\"http:\/\/msdn.microsoft.com\/en-us\/library\/w15yf86f.aspx\">Threads window<\/a>, <a href=\"http:\/\/msdn.microsoft.com\/en-us\/library\/dd998398.aspx\">Parallel Stacks<\/a> and <a href=\"http:\/\/msdn.microsoft.com\/en-us\/library\/hh418499.aspx\">Parallel Watch<\/a> windows.<\/p>\n<p>Below is a screenshot showing Visual Studio stopped at a breakpoint in C++ code for an Android app. You can see in the processes window the \u201cDebugging\u201d column shows \u201cNative (GDB-based)\u201d indicating this is Visual Studio\u2019s GDB based debug engine for Android. <img decoding=\"async\" style=\"padding-top: 0px;padding-left: 0px;padding-right: 0px;border: 0px\" title=\"image\" src=\"https:\/\/devblogs.microsoft.com\/devops\/wp-content\/uploads\/sites\/6\/2014\/11\/8662.image_thumb_104D94B2.png\" alt=\"image\" width=\"644\" height=\"439\" border=\"0\" \/><\/p>\n<p>In Visual Studio 2015, it is worth noting the following current limitations for C++ debugging<\/p>\n<ul>\n<li>Debugging requires Android 4.2 or above (<a href=\"http:\/\/developer.android.com\/about\/versions\/android-4.2.html\">Jelly Bean\u2014API level 17<\/a>)<\/li>\n<li>Stop debugging does not kill the app (it remains running)<\/li>\n<\/ul>\n<p>Additionally the following debugger functionality is not supported:<\/p>\n<ul>\n<li><a href=\"http:\/\/blogs.msdn.com\/b\/visualstudioalm\/archive\/2015\/01\/16\/diagnostic-tools-debugger-window-in-visual-studio-2015.aspx\">Diagnostic Tools window<\/a><\/li>\n<li>64-bit processes<\/li>\n<li><a href=\"http:\/\/blogs.msdn.com\/b\/visualstudioalm\/archive\/2015\/01\/08\/understanding-exceptions-while-debugging-with-visual-studio.aspx\">Changing exception settings in the Exceptions window<\/a><\/li>\n<li><a href=\"http:\/\/msdn.microsoft.com\/en-us\/library\/56f3kd7d.aspx\">Hexadecimal display of integers<\/a><\/li>\n<li>Android thread names do not appear in the <a href=\"http:\/\/msdn.microsoft.com\/en-us\/library\/w15yf86f.aspx\">Threads window<\/a><\/li>\n<li>Autos window<\/li>\n<li><a href=\"http:\/\/msdn.microsoft.com\/en-us\/library\/vstudio\/7572ztz4(v=vs.120).aspx\">Return values<\/a><\/li>\n<li>Interop debugging with JIT\u2019d runtimes (e.g. Java or Xamarin)<\/li>\n<li><a href=\"http:\/\/msdn.microsoft.com\/en-us\/library\/dn457346.aspx\">Just My Code<\/a><\/li>\n<li><a href=\"http:\/\/msdn.microsoft.com\/en-us\/library\/bcew296c.aspx\">Edit and Continue<\/a><\/li>\n<li><a href=\"http:\/\/msdn.microsoft.com\/en-us\/library\/dd998369.aspx\">Tasks window<\/a> (including Tasks view in the <a href=\"http:\/\/msdn.microsoft.com\/en-us\/library\/dd998398.aspx\">Parallel Stacks window<\/a>)<\/li>\n<\/ul>\n<p>Please try debugging Visual Studio\u2019s debugging support for C++ on Android and let us know if you find any issues not already listed above.<\/p>\n<p>Lastly, please let us know how the debugging support works for you, and report any issues or overall feedback below, through the <a href=\"http:\/\/msdn.microsoft.com\/en-us\/library\/zzszcehe.aspx\">Send a Smile feature<\/a> in Visual Studio, or in our <a href=\"http:\/\/social.msdn.microsoft.com\/Forums\/en-US\/vsdebug\/threads\">MSDN forum<\/a>.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>This post has been updated to reflect the state of features in Visual Studio 2015 RTM. By now you will have heard the exciting news that Visual Studio 2015 supports C++ development on Android (and that includes an Emulator for Android). Obviously no development experience is complete without debugging support, so this means that Visual [&hellip;]<\/p>\n","protected":false},"author":68,"featured_media":45953,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[1,225],"tags":[],"class_list":["post-413","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-devops","category-git"],"acf":[],"blog_post_summary":"<p>This post has been updated to reflect the state of features in Visual Studio 2015 RTM. By now you will have heard the exciting news that Visual Studio 2015 supports C++ development on Android (and that includes an Emulator for Android). Obviously no development experience is complete without debugging support, so this means that Visual [&hellip;]<\/p>\n","_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/devops\/wp-json\/wp\/v2\/posts\/413","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/devblogs.microsoft.com\/devops\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/devblogs.microsoft.com\/devops\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/devops\/wp-json\/wp\/v2\/users\/68"}],"replies":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/devops\/wp-json\/wp\/v2\/comments?post=413"}],"version-history":[{"count":0,"href":"https:\/\/devblogs.microsoft.com\/devops\/wp-json\/wp\/v2\/posts\/413\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/devops\/wp-json\/wp\/v2\/media\/45953"}],"wp:attachment":[{"href":"https:\/\/devblogs.microsoft.com\/devops\/wp-json\/wp\/v2\/media?parent=413"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/devops\/wp-json\/wp\/v2\/categories?post=413"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/devops\/wp-json\/wp\/v2\/tags?post=413"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}