Chris’ CodeGear Debugger Blog

Source has been modified. Rebuild?

One of the questions that was asked during my CodeRage session yesterday was:  “Is there a way in Delphi 2007 to disable the ’Source has been modified. Rebuild?’ prompt that appears when you edit source code during a debug session?”

My answer to this question was “No, not yet”, but it turns out I lied.  It wasn’t an intentional lie, however.  Early on in the development cycle for Delphi 2007, I added a way that you can disable this prompt.  However, that was over a year ago, and I had completely forgotten that I had done that (wow, I must be getting old….).

Here’s how you will be able to disable this prompt in Delphi 2007 (when it is available):

  1. After installing, run the IDE.
  2. Go to Tools | Options and press OK
  3. Shut down the IDE
  4. Using regedit, change the “HKEY_CURRENT_USERSoftwareBorlandBDS5.0DebuggingPromptToRebuildDuringDebugging” registry key’s value from it’s default value of “1“ to “0“:
  5. Restart the IDE

If you’ve already run the IDE and accessed the Tools | Options dialog at least once, you can skip the first two steps, as they are only needed to populate the registry with the key that you will be changing.

Now, when you modify source code during a debug session, the IDE will not prompt you to rebuild your project.  To turn the prompt back on again, simply edit the registry again and change the value back to “1”.  I should probably mention the standard caveats that go along with editing your registry directly: make a backup first, be careful, don’t do this unless you are comfortable mucking with the registry, etc….

The goal is to eventually make this a “real” feature by adding a “Don’t ask me this again” checkbox to the “Source has been modified. Rebuild?” dialog box, and then providing an easy way to turn it back on (probably on the main Debugger Options page in the Tools | Options dialog), but for now, with Delphi 2007, you will at least have the option to make this dialog box never show up.

Posted by Chris Hesik on March 13th, 2007 under CodeGear Debugger |



8 Responses to “Source has been modified. Rebuild?”

  1. Andreas Hausladen Says:

    That is really great. One feature less in DDevExtensions that I must maintain.

  2. Yusuf Celik Says:

    Thanks for the hint Chris.

    Hidden.

    Why not putting in Tools | Options as a checkbox?

    Regards

  3. Mark Says:

    I’d really like that in Delphi 7.

  4. Brad White Says:

    But what does it do?

    Recompile or not?

  5. Chris Hesik Says:

    Brad,

    Good question…. I guess I should have specified. If you use set the registry key, the debugger will not rebuild. It is the equivalent of saying "No" to the rebuild prompt. The logic being if you want to rebuild while debugging after setting the registry key, you will manually rebuild.

  6. Brendan McLaughlin Says:

    What shits me is it comes up even when you HAVENT changed your source code.

  7. Scott Hollows Says:

    I could not get this to work in Delphi 2009

    I used this key

    HKEY_LOCAL_MACHINE\SOFTWARE\CodeGear\BDS\6.0\Debugging\PromptToRebuildDuringDebugging

    I tried dword and string values

    I tried "PromptToRebuildDuringDebugging" and also with spaces "Prompt To Rebuild During Debugging"

    Am I doing something wrong ?

  8. Chris Hesik Says:

    @Scott:

    You need to change that key under HKEY_CURRENT_USER rather than HKEY_LOCAL_MACHINE.

Leave a Comment



Server Response from: blog1.codegear.com