Delphi XE7 Debugger Always Stops on CPU Window - delphi

In one of my projects, I can't get breakpoints to work as expected.
The problem is that the CPU window opens when the breakpoint is reached. The Event Log correctly indicates the source line number with the breakpoint and the name of the file with the breakpoint indicated in the Event log matches the name and path of the source file open in the editor (the one where I placed the breakpoint).
However, when I try to inspect variables or view watches, I am told that the variable is undeclared. After the first breakpoint is reached, I can't set any additional breakpoints (the breakpoint is displayed as invalid -- a red dot with an X), even if it is the next line after the breakpoint (with a green arrow displayed). The Event Log indicates that the module has debug info.
I have tried the following:
deleting the DPROJ file and letting Delphi recreate it
"Cleaning the project"
verifying that the debugging settings for the project are consistent with those for other projects that do debug correctly
deleted all the dcus for the project and verified that Building the project put them in the expected location (which is the same folder as the EXE).
I tried the solutions here: Delphi2010-IDE keeps stoping on CPU debug window
I have verified that Debug Information and Local Symbols are enabled.
I tried the suggestions here: Delphi: why breakpoints from time to time are not usable (green highlighted line on IDE)?
Please offer suggestions regarding how to get the standard debugging functionality.

Try add source files to the debugger source path in project options under debugger.
Try disable runtime packages and add sources from runtime packages to project.

Related

debug spyder using breakpoints in editor and code calling from console

My impression is that in Spyder breakpoints are triggered when calling execution with debugging. My normal workflow is to write some code and then type a line or two to test that code in the console. Doing so fails to trigger the breakpoint. Instead to debug I am constantly typing import pdb; pdb.set_trace() in the editor where I want the breakpoint to be triggered. Is there a way of getting the console to respect breakpoints (ideally by default) so that I can just type a line or two to run my code and then get the editor breakpoints to be respected? I guess the alternative is to create a temporary file for placing my temporary code, although that is not ideal. Often I have the code in the library I am writing as an example in the comments, and I'm simply selecting that code snippet and asking the selection to be executed.
I'm using Spyder 4.2 on Windows for reference.

Delphi XE7: Debug points not appearing, Breakpoints not getting hit on debugging and CPU window opens up

On building my code i cannot see the debug points in the pages.Only the page which is open while building shows the debug points.Also, The breakpoint is not getting hit and CPU window is opening by default where debug is set. I searched for the same and found this following statement on Embarcadero page (http://docwiki.embarcadero.com/RADStudio/Tokyo/en/CPU_Windows_Index):
The CPU window also opens automatically whenever program execution stops at a location for which source code is unavailable. For example, the debugger cannot open the source file if you link a DLL (Windows) built with debug information but do not include its source file in your project, or if you place the source file in a directory not specified in your project.
I also tried following things:
When I create a new project, put a breakpoint, it hits (no CPU
window opens up in this case).
When I modify the original code (like just put ShowMessage('Hello World');) where debug point is not
hitting, message dialog appears but debug is not hitting.
I
uninstalled and installed XE7 again, but problem persists.
Tried
cleaning the project, but did not work.
Please help me in fixing this problem. Thanks in advance!
As i also had a lot of problems with getting my debugger to work, so i made myself a list of what has to be checked. So here are some things you could try:
use the "debug" buildconfiguration of your project, which should be configured like this
searchpath matches your actual sources
"local symbols" is true
"with debug dcus" is true
"debug-information" is debug-information
"optimization" is false
one time i also had to check "remote debugging symbols"
try to close the ide and reopen it with just one project
if you use devextension, go to devextensions options
under compilation -> check "release compiler unit cache of other projects before compiling"
under extended ide settings -> check "disable package cache"
in delphi options under "debugger options", "integrated debugging" has to be true
(but sometimes it helps to uncheck this, close the ide, reopen and check again)
I hope, this also helps you

Breakpoint not working on specific classes on Xcode

[![enter image description here][1]][1]I Tried all possible setting manipulation of xcode, even i cleaned xcode app from my mac and then reinstalled too, but still no luck, But Breakpoints works on almost all calsses except some , later on breakpoint navigator i noticed classes on which breakpoint not working are marked RED. I am wondering what is the actual cause ?
Update : After i removed ad added that specific file the red mark are gone, but result is not improved !
I see red text color labels so probably you have deleted files.
If your files exist and you dont see any breakpoint stopped in your class simply it's because your project probably crash before arriving in this class or by-pass it. Check who call DriveCreateAccountVC in your code and put some breakpoints before this class is called in the code, Im pretty sure you find your mistake.
It's a good attitude use the debug console by printing your flow in your code like this line for example: (you can put in viewDidAppear or viewDidLoad)
print("∙ \(NSStringFromClass(self.dynamicType))")
it's a little help but print the class name where are your flow in this moment. You can go also on the debug console and writing for example:
po myStringArray.description
po myStringArray.count
Another useful thing is to add these two options in your editing settings (it's not in defaults settings) : (line numbers and code folding ribbon)
A class becomes Red, when it has lost its path(Xcode can't locate the class)
This may happen because you maybe you copied flies from one project to another or something like that:
There are 2 solutions:
Before anything, locate the files in your Finder
Solution 1) Find the files and put them in your project directory.
Solution 2) Click the file in red in your Project Navigator
Then click on the button (showed in the image link above, to the right of tweetCell.swift)
Once you click it, you will get a chance to locate the file, do it.

Delphi 7 not able to debug using break points

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..
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.
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.
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.
Go to menu Project | Options...
Go to Tab Compiler
check all flags in Debugging frame

The CLR cannot set a break point

Sometimes when I try to set a break point I get an error message saying that the Common Language Runtime could not set the break point.
Even though the code was compiled as a "release" build (I don't want\can't build it again as debug) -
I add an ini file directing to the JIT compiler not to optimize it (and also generate tacking info)
When I see the loaded module in the modules window I see that it is indeed NOT optimized
Under "User Code" (in the modules window) it says N/A. Symbols are loaded and the source code is found automatically.
Some breakpoint ARE considered valid and execution does stop there when they're reached

Resources