Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Wanet Telecoms Ltd on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Annoying Debugger Option

Status
Not open for further replies.

lespaul

Programmer
Feb 4, 2002
7,083
US
For a while now I when debugging in Delphi I have to step through the Windows.pas.

I didn't use to have to do this, but I opened a project that another employee had worked on and my Delphi program just suddenly started showing these steps in the process. So I usually have to step through "LeaveCriticalSection" and "EnterCriticalSection" about 10 - 15 times before getting back to MY code.

I have looked in the Debugger Options but can't see anything obvious that should be checked or unchecked to stop this "feature". I don't really need to see the Windows.pas, I'm pretty sure that the information in there will compile and run just fine, it's finding the errors in MY code that I'm trying to accomplish.

Any suggestions for turning this off would be greatly appreciated!

Thanks,
Leslie
 
Click on the Compiler tab in the Project Options for the application.

Is the Debug DCUs checked? If yes then uncheck it.

Andrew
Hampshire, UK
 
I got so excited that someone had a fix! Unfortunately, that option is already unchecked. [sad]

Any other suggestions?

Leslie
 
Does this now happen in all projects?
Try 'close all' and then look at the compiler options, is the default box checked?


Steve [The sane]: Delphi a feersum engin indeed.
 
yes this happens in ALL projects! I Closed All and went back to check the Debug DCUs and it's still not checked.

In the Compiler tab of the Project Options I have:
Code generation
Optimization (checked)
Stack Frames
Pentium-safe FDIV
8 Record field alignment

Syntax options
Strict var-strings (checked)
Complete boolean eval
Extended syntax (checked)
typed @ operator
Open parameters (checked)
Huge strings (checked)
Assignable typed constants

Runtime errors
Range checking
I/O checking (checked)
Overflow checking

Debugging
Debug information (checked)
Local symbols (checked)
Reference info (checked)
Definitions only (checked)
Assertions (checked)
Use Debug DCUs

Messages
Show hints (checked)
Show warnings (checked)

Let me know if I need to detail any other project option tabs or any of the other multitude of option screens!

Leslie
 
What about the Debugger options under the Tools menu.

Debug DCU Path should only have Delphi/lib by default.

'Debug spawned proccess' might affect this (clutching at a straw here) its unchecked by default.


Steve [The sane]: Delphi a feersum engin indeed.
 
I am wondering if this is due to the Windows.pas module being compiled with the source present?
Normally if you hover over a windows.pas call Delphi tells you it cannot find the source.

I'm thinking that if Delphi can find the source code it will step throught it.

There is no windows.pas file in my D7 Install, but an old install of Delphi 3 does have it.



Steve [The sane]: Delphi a feersum engin indeed.
 
I'm using Delphi 6 and I find Windows.pas in

C:\Program Files\Borland\Delphi6\Source\Rtl\Win

The Debug DCU Path has:

$(DELPHI)\Lib\Debug;C:\PROGRA~1\JVCL32~1\jcl\lib\d6\debug

(The JCL is a component that one of my coworkers used and when he left I installed it...I didn't specifically add this here)

and debug spawned processes is NOT checked.

I'm good with straws, you keep clutching and I'll keep looking!

Les

 
What happens if you remove the Jedi (JVCL32) path from the Debug DCU?



Steve [The sane]: Delphi a feersum engin indeed.
 
I'm betting nothing, I JUST installed that component a few weeks ago and I've been having this issue with the Windows.pas for a LONG time. I've just been living with it and now I'm tired of it....I'd like it to stop!
 
try to delete all temp project files (try this with 1 project)

keep these files:

*.pas
*.dfm
*.dpr
*.res

so *.dof, *.dsk, *.dcu, *.cfg can be removed

/Daddy

-----------------------------------------------------
What You See Is What You Get
Never underestimate tha powah of tha google!
 
delete them, unless you use object modelling

-----------------------------------------------------
What You See Is What You Get
Never underestimate tha powah of tha google!
 
Ok, I'll try that this morning (left early yesterday!)

Les
 
Ok, good and bad news. I deleted those files from one of my projects. I opened the project from Windows Explorer by double clicking the project file. The project I opened uses an Indy component (see Thread102-1321692) which gave me a message that one of the properties was invalid (User instead of UserName). Fixed that and tried to run the program and received a message that the pas file for the Indy component couldn't be found. So I browsed to the new directory that was created by the Indy install program. Finally the program runs!

So, I put a break point and start stepping through the code and HOORAY, I'm not seeing the Windows.pas!!! However I AM seeing another component's code (which again, I'm pretty sure works JUST fine!). This component is one that we purchased because another state agency indicated we needed SFTP for a payment file process and I spent months trying to get the component to work before someone at the other agency said that they had been unable to implement the SFTP and to postpone sending in that format for the time being. For some reason, this component has a file, SBUtils.pas, that contains the function ExtractFileName. Now, when my code calls ExtractFileName, it calls the one in C:\Program Files\EldoS\SecureBlackBox\Sources\SBUtils.pas.

Any suggestions now? Thanks for your help so far, I feel lost without my co-worker. He had YEARS of Delphi experience and usually took care of all the required installations.

Leslie
 
I think this is the same as the 'CopyFile' problem.
Look for SBUtils in your uses clause.

If you don't need it and its in there take it out. If you do need it move it to the front of the uses list.

If two functions have the same name the compiler has to decide which to use AFAIK Delphi works backward through the uses list using the first it comes to.

Also check your files and directories lists. Remove any paths you don't need.




Steve [The sane]: Delphi a feersum engin indeed.
 
Ok, I moved SBUtils to the front of the uses list and now I'm stepping through the Windows.pas again. [sad]
 
Leslie,

I get the feeling something is wrong with your D6 installation.

is there a way I can contact you? (via a website or something else, don't leave your email as it is not allowed here)

-----------------------------------------------------
What You See Is What You Get
Never underestimate tha powah of tha google!
 
I think I'm just going to reinstall Delphi from scratch. I've copied all the components to a single location and I'll reinstall those after. I'll be sure to post back if I have any questions.

In the meantime can you explain the difference between New Component, Install Component and Install Packages?

Thanks!

leslie
 
new component:

this will give you the option to create a component based on an existing component.

install component:

install an existing component into the user package (dclusr.bpl)

install packages:

here you have the possibility to add or remove complete component packages. - this is the option you want to use for adding / removing components

-----------------------------------------------------
What You See Is What You Get
Never underestimate tha powah of tha google!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top