{"id":5722,"date":"2020-03-22T20:41:16","date_gmt":"2020-03-23T03:41:16","guid":{"rendered":"https:\/\/visualgdb.com\/w\/?p=5722"},"modified":"2020-03-22T20:41:16","modified_gmt":"2020-03-23T03:41:16","slug":"automatic-source-file-downloading","status":"publish","type":"post","link":"https:\/\/visualgdb.com\/documentation\/autodownload\/","title":{"rendered":"Automatic Source File Downloading"},"content":{"rendered":"<p>When you debug Linux applications with VisualGDB some source files may be not a part of your project, e.g. third-party libraries, system include files. Starting from VisualGDB 2.8 those files will be automatically downloaded to a folder inside <strong>%LOCALAPPDATA%<\/strong> and will be displayed in Visual Studio automatically.<\/p>\n<p>The download process is one-way. You cannot change the files on the Windows machine and get them uploaded back. To prevent accidental editing VisualGDB flags those files as read-only:<\/p>\n<p><a href=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2020\/03\/readonly.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-5723\" src=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2020\/03\/readonly.png\" alt=\"\" width=\"1054\" height=\"592\" \/><\/a>The files are always downloaded into the following directory:<\/p>\n<pre class=\"\">%LOCALAPPDATA%\\VisualGDB\\AutoDownloadedSources\\&lt;Hostname&gt;\\&lt;File name&gt;<\/pre>\n<p>If multiple source files with the same name exist in different locations, the local directories will be suffixed with <strong>\\0000<\/strong>, <strong>\\0001<\/strong> and so on. Each directory contains the source file itself and a text file called <strong>$remote_path<\/strong> containing the path on the Linux machine of the downloaded file.<\/p>\n<p>To clean the auto-downloaded files you can safely delete the <strong>AutoDownloadedSources<\/strong> directory or any subdirectories inside it.<\/p>\n<p>The file downloading is triggered by one of the following events:<\/p>\n<ul>\n<li>A breakpoint is hit inside a file that has not been downloaded yet<\/li>\n<li>You have stepped into a file that has not been downloaded yet<\/li>\n<li>You have selected a frame in the call stack window that refers to a file that has not been downloaded yet<\/li>\n<li>You have opened a remote file from the VisualGDB Source Browser.<\/li>\n<\/ul>\n<p>Note that if a source file changes while the debugging session is in progress, VisualGDB will not re-fetch it until the next session is started.<\/p>\n<p>You can browse all files reported by GDB using the VisualGDB Source Browser window. To open it, click on the source list icon in the VisualGDB session pane:<a href=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2020\/03\/showfiles-1.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-5726\" src=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2020\/03\/showfiles-1.png\" alt=\"\" width=\"582\" height=\"246\" \/><\/a><\/p>\n<p>The Source File Manager allows browsing through all source files in either plain list or hierarchical mode. Each file can be opened in Visual Studio by double-clicking on it or pressing the <strong>Open<\/strong> button:<\/p>\n<p><a href=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2020\/03\/files-1.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-5725\" src=\"https:\/\/visualgdb.com\/w\/wp-content\/uploads\/2020\/03\/files-1.png\" alt=\"\" width=\"735\" height=\"389\" \/><\/a>Missing files from the remote machine will be automatically downloaded when you open them.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>When you debug Linux applications with VisualGDB some source files may be not a part of your project, e.g. third-party<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[198],"tags":[],"_links":{"self":[{"href":"https:\/\/visualgdb.com\/w\/wp-json\/wp\/v2\/posts\/5722"}],"collection":[{"href":"https:\/\/visualgdb.com\/w\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/visualgdb.com\/w\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/visualgdb.com\/w\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/visualgdb.com\/w\/wp-json\/wp\/v2\/comments?post=5722"}],"version-history":[{"count":1,"href":"https:\/\/visualgdb.com\/w\/wp-json\/wp\/v2\/posts\/5722\/revisions"}],"predecessor-version":[{"id":5727,"href":"https:\/\/visualgdb.com\/w\/wp-json\/wp\/v2\/posts\/5722\/revisions\/5727"}],"wp:attachment":[{"href":"https:\/\/visualgdb.com\/w\/wp-json\/wp\/v2\/media?parent=5722"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/visualgdb.com\/w\/wp-json\/wp\/v2\/categories?post=5722"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/visualgdb.com\/w\/wp-json\/wp\/v2\/tags?post=5722"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}