0

Delphi 7 i am not able to debug my application as half the code in my delphi 7 form unit,as it is not showing blue dots on the left hand side gutter,not able to reach any of the break points when i run my application..

9
  • Please add a screenshot or something more. Commented Jul 4, 2015 at 10:34
  • Working fine here. What's different about your scenario? Commented Jul 4, 2015 at 10:51
  • If you add breakpoints from breakpoint manager - do they work? Have you checked a files for CRLF bug? Commented Jul 4, 2015 at 11:03
  • 1
    You might try deleting (or renaming, if you are worried) the dsk file for the project and then reload the project. Commented Jul 4, 2015 at 11:18
  • 1
    Are you saying that some lines of code have blue dots, but some do not? If that's the case, this indicates that the code without dots cannot be reached, and the linker has removed it from the executable. For example, if you have a method, but that method is never called. Commented Jul 4, 2015 at 13:12

4 Answers 4

1

Go to menu Project | Options...

Go to Tab Compiler

check all flags in Debugging frame

Sign up to request clarification or add additional context in comments.

Comments

0

The way you explain it - if one unit has some breakpoints available, but others not, then it sounds like that code is unreachable / unused. The Delphi compiler is smart enough to the point where it does not compile any code which it detects is never used. And if it doesn't compile, then there is no way to use breakpoints there.

1 Comment

YES MartynA only for this particular project i am stuck you have got my point where i am stuck.. do you have any solutions for this kind of issue as
0

This is sort of a workaround but it works.

  • Build your app;
  • Delete the exe file generated just to be sure it will be created again;
  • Select all your code and paste it into notepad;
  • Save your "Blank" file into Delphi;
  • Select all the text from notepad;
  • Paste it again into Delphi file and save it;
  • Build your app again;

I had this same problem with a special character pasted into my source code.

If after doing this you still can´t compile just paste your code for us to review it.

Comments

0

Not sure if this is the problem, but Optimisation is turned on by default. The compiler could be removing code. When you debug, can see the code in the editor, but the breakpoint won't hit the lines that have been optimised out.

You can turn off optimisation in Project Options > Compiler > Optimization, but a better technique is:

* Project Options > Directories/Conditionals
* In the Conditional defines box, add "DEBUG" and click Ok
* Return and add "NDEBUG" and click Ok
* Now at the top of the file which you want to debug add this code:
{$IF Defined(DEBUG)}
    {$O-}       // Debug build
{$ELSEIF Defined(NDEBUG)}
    {$O+}       // Non-debug (ie. release) build
{$IFEND}

Then you can simply define the type of build as "DEBUG" when you want to debug. Set as "NDEBUG" just before release. Not sure if its your problem, but hope that helps.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.