Solved

Debug not working

Posted on 2002-07-07
6
278 Views
Last Modified: 2010-04-04
Hi, all of a sudden for some reason, I can't debug anything. I compile my program as usual, and the little dots go to the left of the executable lines of code, that's fine. So I click a dot to set a breakpoint, which turns the line red, as normal. But when I run my program, it flies right past the breakpoint without stopping! I'm using D6, enterprise version, trial.

Any thoughts?

Thanks
   Shawn
0
Comment
Question by:aztec
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
6 Comments
 
LVL 7

Expert Comment

by:Cynna
ID: 7137090
aztec,

> ... I can't debug anything

Anything as "anything in my current app" or "any project at all" ?

If your answer is "only my current app" then try this:

1) delete any *.dcu, *.dsm, *.exe file in your project folder

2) Be sure *all* lines in your source files are terminated properly (CR/LF), especially if you copy/pasted some parts of the code from somewhere other then Delphi editor

3) Turn all debugging related options in your Project->Options->Compiler tab on

4) Recompile your app
0
 
LVL 8

Expert Comment

by:TOndrej
ID: 7137403
In addition to Cynna's advice:

If the breakpoint remains valid during execution (the line is still red) then it's possible that execution never reaches the line.
Sometimes it's as simple as this...

Another idea:
Make sure you have 'Integrated debugging' option turned on in Tools\Debugger options dialog.
0
 

Author Comment

by:aztec
ID: 7139010
Hello Cynna..
   I tried another of my apps (a small one) and the debugging worked fine within that on. It is just within this app that it doesn't. And get this: My app uses several different screens or tabs. Debugging will work fine in one tab/screen, but won't in another tab/screen!
  I followed your suggestions above (1) (3) and (4). For (2), I don't know how to check if there's a CR/LF at the end of each line. Just rename my .pas file to .txt and open in up in NotePad perhaps?

TOndrej: Yes, I am sure that execution reaches this point, but it still blows right by my breakpoint. And yes, "Integrated Debugging" was turned on.

Here's something else that's weird that might help you - you know how when you build your project, it puts all the little dots to the left of each line of executable code? OK, it does that all right, but when I do an F12 to show my form, and I go to another tab/screen via the Object Inspector, then double click on a button on that specific form (which takes me to that event handler), then all the dots on the left are gone... all the way down through my app's code!

Something very weird going on here...

Shawn
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 7

Accepted Solution

by:
Cynna earned 50 total points
ID: 7139379
aztec,

1. About CR/LF:
   Your symptoms don't indicate this problem, but unpaired LF in source
   creates all kind of strange behaviour in Delphi...so you should check it
   just in case.
   One easy trick to find out if your lines are properly terminated is to
   open source from Notepad, which can't translate LF to CR/LF. If you see any black           rectangles where CR/LF should be, then you got your bug...
   If you have large number of these, I think WordPad can automatically translate it
   to the correct pair. In that case, all you have to do is open your "contaminated"
   file from WordPad, and than save it without any change. You can check if it
   is "cleared" by opening it with NotePad again.



2. Other options are much more likely the cause of your problem.

   Try this little test:
   - place breakpoints in *all* your units.
   - F9
   - write down unit(s) that produce this problem
   
   I think that you should have this behaviour only in some units.
   Even more probably only one unit.
   If this is the case:

a) You should check for exact location of the suspicious files, and
   delete any  of theirs *.dcu. I know you said you deleted all *.dcu files,
   but check again if any of your units is used outside project folder.
   It's easy to make this mistake, since Delphi doesn't show you the full
   unit path. Exact unit locations are stated in editor window caption.

                             OR

b) If this doesn't work, you probably have some old unit version somewhere
   else in search path, and linker is using this one instead of the one
   you are editing. In this case, search for files on your HDD with the
   same name (not extension) as problematic unit. If you find more than
   one copy of them, delete or move all copies except the one you are using.
   This way you are certain only one is used. Alternative is to rename it
   to some unique name, and use this in your project.

                             OR

c) If a) and b) doesn't help, then I can only suggest "atomic-bomb approach":
 
    - start new project in a new folder
    - copy *ONLY* relevant source (*.pas and *.dfm) files to this folder
    - rename problematic ones with unique names
    - add all units to your new project

0
 

Author Comment

by:aztec
ID: 7198522
I think I have isolated the problem....things debug fine up until a certain line in my code. That line is:

fromfile.Destroy;

I am using a 3rd party component called TGPHugeFile, suggested to me by another expert. The component itself seems to be working ok, but it seems to be messing up the debugging. In the procedure containing this ine, I open up a TGPHugeFile like so:

fromfile:=TGpHugeFileStream.Create(infilestr, accRead);

...then I read from it like so:

ibytesOK:=fromfile.Read(buf, bigchunksize);

then finally I close it up with the fromfile.destroy statement as mentioned above. Everything debugs fine until I hit this Destroy statement.


I can step while in debug, right up to this line, when I try to step OVER it, it will go into code of the GPHugeF unit....and from there on, I lose debugging control over my project.

Hope someone can help!

Thanks
   Shawn
0
 
LVL 49

Expert Comment

by:DanRollins
ID: 8442156
Hi aztec,
Experts-Exchange is performing an automated process to delete old questions.  There have been no responses to this question, so it will be DELETED within 3 days.

Your points will be refunded.

If you still need the answer to this question, you should ask it again, as a new question.  Your new question will appear at the top of the list, where many Experts will see it and respond.  Here are some general tips on getting Experts to work on your questions:
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
1) Offer a high point level.  Experts often concentrate on higher-valued questions.
2) Choose the best Topic Area -- target the experts who have the specific skills that you need.
3) Include keywords in the Question Title that will attract the right Experts.
4) Provide FULL DETAILS in the question body so the Experts can get right to work on a solution.
5) When an Expert does make a comment, be sure to be responsive.

For more information on Asking Questions, see http://www.cityofangels.com/Experts/Member.htm
For information on how to finalize questions, see: http://www.cityofangels.com/Experts/Closing.htm
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Please DO NOT respond to this automated post.  DO NOT ACCEPT THIS COMMENT AS AN ANSWER.  Thank you for participating at Experts-Exchange.

CleanupGuy -- EE database cleanup volunteer
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

A lot of questions regard threads in Delphi.   One of the more specific questions is how to show progress of the thread.   Updating a progressbar from inside a thread is a mistake. A solution to this would be to send a synchronized message to the…
The uses clause is one of those things that just tends to grow and grow. Most of the time this is in the main form, as it's from this form that all others are called. If you have a big application (including many forms), the uses clause in the in…
In this video we outline the Physical Segments view of NetCrunch network monitor. By following this brief how-to video, you will be able to learn how NetCrunch visualizes your network, how granular is the information collected, as well as where to f…
Monitoring a network: why having a policy is the best policy? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the enormous benefits of having a policy-based approach when monitoring medium and large networks. Software utilized in this v…

724 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question