{"id":513756,"date":"2024-09-24T17:26:01","date_gmt":"2024-09-24T16:26:01","guid":{"rendered":"https:\/\/blog.jetbrains.com\/?post_type=dotnet&#038;p=513756"},"modified":"2026-05-04T13:40:09","modified_gmt":"2026-05-04T12:40:09","slug":"hot-reloading-cplusplus-with-liveplusplus-and-jetbrains-rider","status":"publish","type":"dotnet","link":"https:\/\/blog.jetbrains.com\/zh-hans\/dotnet\/2024\/09\/24\/hot-reloading-cplusplus-with-liveplusplus-and-jetbrains-rider","title":{"rendered":"Hot-Reloading C++ with Live++ and JetBrains Rider"},"content":{"rendered":"\n<p>We&#8217;ve been working with Stefan Reinalter and the team at Molecular Matters to make the industry-leading <a href=\"https:\/\/liveplusplus.tech\/index.html\" target=\"_blank\" rel=\"noopener\">Live++<\/a> binary patching tool work seamlessly with C++ projects in JetBrains Rider!<\/p>\n\n\n\n<p>This is a great productivity boost for both Unreal Engine developers and those working on custom C++ engines. Live++ support works with all C and C++ projects in Rider and reduces iteration time by reloading changes to your code while the application is running, even when paused at a breakpoint.<\/p>\n\n\n\n<p>While Live++ works with any editor, we&#8217;ve been working on Rider integration to improve your experience of working with Live++ and Rider. This doesn&#8217;t introduce any new UI features, but it does make the workflow a lot smoother. For example, Live++ will navigate to compile errors in Rider, automatically reattach the debugger when your application hot-restarts, and will hot-deoptimize the current file when using the Live++ hotkey.<\/p>\n\n\n<div class=\"buttons\">\n<div class=\"buttons__row\"><a class=\"btn\" href=\"https:\/\/www.jetbrains.com\/rider\/nextversion\/\" target=\"\" rel=\"noopener\">Download Rider 2024.3 EAP<\/a><\/div>\n<\/div>\n\n\n<p>Read on for more details!<\/p>\n\n\n\n<!--more-->\n\n\n\n<h2 class=\"wp-block-heading\">What is Live++?<\/h2>\n\n\n\n<p>For those not familiar with <a href=\"https:\/\/liveplusplus.tech\/index.html\" target=\"_blank\" rel=\"noopener\">Live++<\/a>, it&#8217;s a great technology for reducing iteration time while building, running, and debugging your C and C++ applications. Conceptually, it&#8217;s very similar to <em>Edit and Continue<\/em>, or to the <em>Hot Reload<\/em> and <em>Live Coding<\/em> features of Unreal Engine, although it is more advanced and feature-rich. There are three main features we&#8217;ll look at today \u2013 Hot-Reload, Hot-Restart, and Hot-Deoptimize.<\/p>\n\n\n\n<p>Getting started requires downloading the Live++ SDK, adding some APIs and libraries to your application, and checking some compiler flags. You can find out more in the <a href=\"https:\/\/liveplusplus.tech\/docs\/documentation.html\" target=\"_blank\" rel=\"noopener\">Quickstart guide<\/a>, as well as download the trial and some examples. There&#8217;s also a great overview of the product&#8217;s architecture.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Hot-Reload<\/h2>\n\n\n\n<p>The whole point of debugging is to find problems in your code so that you can fix them. But once you&#8217;ve made your changes and fixed the issue, you need to stop debugging, recompile, and start the process all over again, losing your current state and progress. Wouldn&#8217;t it be great if you could just keep going with the new changes applied?<\/p>\n\n\n\n<p>That&#8217;s exactly the problem that <a href=\"https:\/\/liveplusplus.tech\/docs\/documentation.html#tools_hot_reload\" target=\"_blank\" rel=\"noopener\">Hot-Reload<\/a> solves. Edit your code and use the global <kbd>Ctrl<\/kbd>+<kbd>Alt<\/kbd>+<kbd>F11<\/kbd> shortcut, and Live++ will compile your changes and apply them to the running application. If you&#8217;re paused at a breakpoint, Rider will update, showing any new values you might have changed.<\/p>\n\n\n\n<figure class=\"wp-block-image is-resized is-style-default aligncenter\">\n    <img\n        src=\"https:\/\/blog.jetbrains.com\/wp-content\/uploads\/2024\/09\/changing-a-const-value-in-code-and-invoking-the-global-shortcut-and-rider-updates-debugger-state.jpg\"\n        data-gif-src=\"https:\/\/blog.jetbrains.com\/wp-content\/uploads\/2024\/09\/changing-a-const-value-in-code-and-invoking-the-global-shortcut-and-rider-updates-debugger-state.gif\"\n        alt=\"Changing a const value in code and invoking the global shortcut, and Rider updates debugger state\"\n        width=\"660\"\/>\n    <figcaption class=\"wp-element-caption\">Changing a const value in code and invoking the global shortcut, and Rider updates debugger state<\/figcaption>\n<\/figure>\n\n\n\n<p>If you made a mistake in your updated code that causes a compilation error, the error will be reported in the Live++ Broker app&#8217;s main window. Double-clicking the error will navigate to the file in Rider.<\/p>\n\n\n\n<figure class=\"wp-block-image is-resized is-style-default aligncenter\">\n    <img\n        src=\"https:\/\/blog.jetbrains.com\/wp-content\/uploads\/2024\/09\/double-clicking-an-error-in-the-live-broker-will-open-the-file-at-the-correct-line-in-rider.jpg\"\n        data-gif-src=\"https:\/\/blog.jetbrains.com\/wp-content\/uploads\/2024\/09\/double-clicking-an-error-in-the-live-broker-will-open-the-file-at-the-correct-line-in-rider.gif\"\n        alt=\"Double-clicking an error in the Live++ Broker will open the file at the correct line in Rider\"\n        width=\"660\"\/>\n    <figcaption class=\"wp-element-caption\">Double-clicking an error in the Live++ Broker will open the file at the correct line in Rider<\/figcaption>\n<\/figure>\n\n\n\n<h2 class=\"wp-block-heading\">Hot-Restart<\/h2>\n\n\n\n<p>The <a href=\"https:\/\/liveplusplus.tech\/docs\/documentation.html#tools_hot_restart\" target=\"_blank\" rel=\"noopener\">Hot-Restart<\/a> feature is a great way to restart your application after making changes. Typically this would involve relinking the application, which can take extra time. The Live++ Broker application also has to load the application and process the PDB debug files to build internal caches. With Hot-Restart, these steps are skipped \u2013 the application doesn&#8217;t need to be linked because Live++ already has the changes ready to go. Similarly, it doesn&#8217;t need to reload the PDB files or rebuild caches because they&#8217;re already in memory. This can greatly decrease the iteration times when you want or need to restart your application.<\/p>\n\n\n\n<p>If Rider was debugging your application when Live++ restarts it, Rider will automatically attach to the new process. It&#8217;s a small but very welcome quality of life improvement. Rider works alongside Live++ to keep you in the debugging flow without unnecessary roadblocks.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Hot-Deoptimize<\/h2>\n\n\n\n<p>Rider has a great debugger for stepping through code and examining values. <a href=\"https:\/\/blog.jetbrains.com\/dotnet\/2024\/08\/12\/unreal-debugging-improvements-in-rider-2024-2\/\">Recent changes<\/a> have also improved the situation for optimized code by showing as much data as possible from objects that have been partially optimized away. But sometimes that&#8217;s not enough, and you need to disable all optimizations and debug code like it was compiled in debug mode.<\/p>\n\n\n\n<p>The <a href=\"https:\/\/liveplusplus.tech\/docs\/documentation.html#tools_hot_restart\" target=\"_blank\" rel=\"noopener\">Hot-Deoptimize<\/a> feature can help here. In the Live++ Broker app, you can right-click on a <code>.obj<\/code> file to toggle optimizations. To save you from having to switch to the <em>Compilands<\/em> view, find the matching <code>.obj<\/code> and select a menu item, use the global Live++ <kbd>Ctrl<\/kbd>+<kbd>Alt<\/kbd>+<kbd>O<\/kbd> shortcut while the file is open in Rider, and Live++ will toggle optimizations for the matching <code>.obj<\/code> file. Rider will then immediately be able to<b> <\/b>debug the file as though it was initially compiled in debug mode.<\/p>\n\n\n\n<figure class=\"wp-block-image is-resized is-style-default aligncenter\">\n    <img\n        src=\"https:\/\/blog.jetbrains.com\/wp-content\/uploads\/2024\/09\/local-variables-are-not-available-in-a-file-compiled-with-optimisations-the-global-shortcut-will-toggle-optimisations-and-rider-will-automatically-refresh-the-debugger.png\"\n        data-gif-src=\"https:\/\/blog.jetbrains.com\/wp-content\/uploads\/2024\/09\/local-variables-are-not-available-in-a-file-compiled-with-optimisations-the-global-shortcut-will-toggle-optimisations-and-rider-will-automatically-refresh-the-debugger.gif\"\n        alt=\"Local variables are not available in a file compiled with optimisations. The global shortcut will toggle optimisations and Rider will automatically refresh the debugger\"\n        width=\"660\"\/>\n    <figcaption class=\"wp-element-caption\">Local variables are not available in a file compiled with optimisations. The global shortcut will toggle optimisations and Rider will automatically refresh the debugger<\/figcaption>\n<\/figure>\n\n\n\n<p>When you&#8217;re done, press <kbd>Ctrl<\/kbd>+<kbd>Alt<\/kbd>+<kbd>O<\/kbd> again to restore optimizations to the current file.<\/p>\n\n\n\n<p>Lots of people are using Live++ to improve their debugging experience with better iteration times. It&#8217;s been a pleasure working with Stefan to bring Rider support to Live++ and make our users&#8217; workflows even smoother.<\/p>\n\n\n\n<p>Stefan told us:<\/p>\n\n\n\n<blockquote class=\"wp-block-quote\">\n<p>\u201cRider is a great IDE to work with.It easily supports huge AAA codebases, code navigation is smooth even on excessively large source files, <em>Find in Files<\/em> is instant, and it supports version control systems such as Perforce and Git out of the box, which is a huge boon. With its built-in support for Visual Studio solutions and projects, there&#8217;s no reason not to switch.JetBrains and their tools are well-known and respected in the industry.<\/p>\n\n\n\n<p>It&#8217;s been a pleasure and honor working with their team to bring dedicated Rider support to Live++.<\/p>\n\n\n\n<p>While Live++ itself is IDE-agnostic, having dedicated support for JetBrains Rider lets you be in the flow without any kind of interruption or manual intervention, making room for a much more seamless workflow. Not having to manually resume the debugger or switch to the Live++ UI to deoptimize a file or reattach the debugger after a hot-restart are all great quality-of-life improvements.\u201d<\/p>\n<\/blockquote>\n\n\n<div class=\"buttons\">\n<div class=\"buttons__row\"><a class=\"btn\" href=\"https:\/\/www.jetbrains.com\/rider\/nextversion\/\" target=\"\" rel=\"noopener\">Download Rider 2024.3 EAP<\/a><\/div>\n<\/div>\n\n\n<p>These updates are available in the Early Access Preview builds of Rider 2024.3 and require the latest version of Live++. We hope you&#8217;ll try it for yourself on your own projects. Please let us know how it works for you!<\/p>\n\n\n\n<p>A valid license for Live++ is still required \u2013 a free 30-day trial can be <a href=\"https:\/\/liveplusplus.tech\/docs\/documentation.html#licensing_trial\" target=\"_blank\" rel=\"noopener\">activated directly in the Live++ Broker<\/a> app.<\/p>\n","protected":false},"author":96,"featured_media":513745,"comment_status":"closed","ping_status":"closed","template":"","categories":[4992,1401],"tags":[9105,2095],"cross-post-tag":[],"acf":[],"_links":{"self":[{"href":"https:\/\/blog.jetbrains.com\/zh-hans\/wp-json\/wp\/v2\/dotnet\/513756"}],"collection":[{"href":"https:\/\/blog.jetbrains.com\/zh-hans\/wp-json\/wp\/v2\/dotnet"}],"about":[{"href":"https:\/\/blog.jetbrains.com\/zh-hans\/wp-json\/wp\/v2\/types\/dotnet"}],"author":[{"embeddable":true,"href":"https:\/\/blog.jetbrains.com\/zh-hans\/wp-json\/wp\/v2\/users\/96"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.jetbrains.com\/zh-hans\/wp-json\/wp\/v2\/comments?post=513756"}],"version-history":[{"count":10,"href":"https:\/\/blog.jetbrains.com\/zh-hans\/wp-json\/wp\/v2\/dotnet\/513756\/revisions"}],"predecessor-version":[{"id":514270,"href":"https:\/\/blog.jetbrains.com\/zh-hans\/wp-json\/wp\/v2\/dotnet\/513756\/revisions\/514270"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/blog.jetbrains.com\/zh-hans\/wp-json\/wp\/v2\/media\/513745"}],"wp:attachment":[{"href":"https:\/\/blog.jetbrains.com\/zh-hans\/wp-json\/wp\/v2\/media?parent=513756"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.jetbrains.com\/zh-hans\/wp-json\/wp\/v2\/categories?post=513756"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.jetbrains.com\/zh-hans\/wp-json\/wp\/v2\/tags?post=513756"},{"taxonomy":"cross-post-tag","embeddable":true,"href":"https:\/\/blog.jetbrains.com\/zh-hans\/wp-json\/wp\/v2\/cross-post-tag?post=513756"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}