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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Easy Debug Question

Status
Not open for further replies.

Vovin

Programmer
Aug 24, 2003
63
0
0
GB
My breakpoints aren't working correctly can anyone help me. My application just does not stop on breakpoints when it's run....arrghhh

I know this is some kind of project options thing but I just don't know what's wrong with this. Does delphi not have the option to choose between different types of builds (i.e. release and debug) without having to go through all the checkboxes each time? Any help would be much appreciated as it is driving me up the wall. Thanks in advance.

Here is my current project settings:

Code Generation pane:
Optimization OFF
Aligned record fields On
Stack Frames On
Pentium-safe FDIV Off

Syntax options pane:
Strict var-strings On
Complete boolean eval Off
Extended Syntax On
Typed @ Operator Off
Open Parameters On
Huge Strings On
Assignable typed constants On

Runtime Errors pane
Range Checking On
I/O Checking On
Overflow Checking On

Debugging pane
Debug information On
Local Symbols On
Reference Info On
Definitions Only On
Assertions On
Use Debug DCU’s On

Messages Pane
Show hints On
Show warnings On
 
Which version of Delphi are you running?

If Delphi 7 (maybe earlier versions too), have you checked that Tools | Debugger Options | Integrated Debugging is checked ?



Andrew
Hampshire, UK
 
Hi Andrew,

sorry forgot to mention the version. It's Delphi 5 I'm using.

I checked the Tools | Debugger Options | Integrated Debugging and it's checked.

I've done this before and I just can't remember how I did it.
 
Are you actually calling the procedure/function the breakpoint is in?

 
Yes I'm calling it the code. The breakpoints turn green with a small cross beside it (indicating that they're switched of I presume). I'm pretty sure it must be a compiler/project option thing.
 
My settings actually work. I had to actually make a change to the code and click 'save all' before the project settings took effect.

Hmmm...I'm a C++ programmer and new to Delphi. I have to say I haven't been very impressed so far.
 
vovin,

quote :
I'm a C++ programmer and new to Delphi. I have to say I haven't been very impressed so far.

I'm very interested in what makes you say this...

 
Hi whosrdaddy ,

I'm possibly not giving Delphi a chance really but I have had so many problems with it (as can be seen by the number of posts I've got in this forum).

Maybe I'll like it better when I know more about it. Borland doesn't really do it self any favours though by having bugs in the environment like the one I described in this post. Compiler options should really take effect when you click 'OK' not by having to change bits of code so that you can click 'save all'.

I prefer C++ to Delphi as well. It's what I know and it's more flexable. I find Pascal slightly limiting sometimes. There doesn't seem to be any hash maps for instance.
 
Just found this when looking for somthing else and I have to comment, although its unlikly that Vovin will see this I know.
I write windows applications in Delphi and Embedded code in 'C'.
'C' is horrible, As for C++, well I belive that it is worse, but I dont need to know as I have a perfectly good Windows Language already.
I my opinion being 'hard to learn' does not make a language good or proffesional. Its what you achive thats important.
Plus most compiler options can be set in the IDE, there is rarly any need to include compiler directives in the code.


Steve: Delphi a feersum engin indeed.
 
Vovin,

I think I'm right in saying that you just recompile your code (or it may be a re-Build, I can't remember which) and the breakpoints should be reactivated. I've never had to Save All in this scenario.

I have to say I haven't been very impressed so far.
I know this is no excuse for bugs but you are using a rather dated version of Delphi (the following versions have been released since the one you are using: 6, 7, 8 and 2005) - so a lot of bug-fixes and improvements have been made along the way.

I learnt C++ first before I learnt Delphi and I must say my preference is Delphi (it's a lot easier to use, and better for Rapid Application Development (RAD)). Although, I have only used C++ at university and not commercially.

Clive [infinity]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
"To err is human, but to really foul things up you need a computer."
Paul Ehrlich
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
To get the best answers from this forum see: faq102-5096
 
The definitive answer on why a breakpoint turns green with the little cross is because Delphi has not included that line in the currently compiled project. This can happen for two reasons that come to mind:
[ul]
[li]You have modified your code after the last compile by inserting or deleting lines in the unit, so that the breakpoint is on a line where no compiled code exists[/li]
[li]The procedure or function is not actually called by your project, and therefore was eliminated by the linker.[/li]
[/ul]

Borland doesn't really do it self any favours though by having bugs in the environment like the one I described in this post.

I've often thought that problems I couldn't understand in Delphi were bugs in the compiler or in the IDE, but every time it's turned out I was wrong. The breakpoints turning green with the cross can't really be considered a bug, because really, it's accurately informing you of an issue with a breakpoint on that line.
 
C++ can be a beetch and it's certainly much harder to learn and code than Delphi, but there is no denying it's the daddy of all high level languages. I've used C/C++/C# (yeah, bit of a pattern there) along with Delphi 5 + 6, and I can confidently say Delphi has pi$$ed me off the most (C++ takes 2nd place though, but at least it was my own fault it screwed up). Unstable and with a poor debugger, I only use it because it's my company's primary language for front-end development. I like the RAD aspect (mainly due to the masses of 3rd party components littered across cyberspace) but very little else.
C# is my fave, immutable strings and all, so presumably I would like D2005 as well. Just so long as they have given it ternary operators at last ;)

BTW Vovin - you are correct about hashtables and will not find them in Delphi 7 and below, which was a major oversight on Borlands part imo. That was one of my first big gripes when I started Delphi development.
 
Oooops I seem to have set the cat among the pigeons a bit here :) I was quite suprised that this thread has started again after about a year and a half. I have to say that since I first posted this thread I have moved company and am now no longer using Delphi. I've worked for 5 software companies so far and I've only had to use Delphi once - the rest were C++, C, Perl, Java.

I know the subject of which programming language is better than another can be a highly emotive subject and people can be a bit defensive about it. All I was saying was I've tried a few different languages and Delphi I have to say wasn't one of my favourites. Its just my personal opinion based on my own personal experiences. I keep an open mind and I would have liked to have liked Delphi because I was using it at the time...but we just didn't get on..ha. I'm sure lots of people love it, and are very productive with it but I wasn't one of them I'm afraid...sorry.
 
I didn't realize that it was an [pharaoh] ancient thread. Vovin thanks anyway for the update on your experiences, there are many ways that lead to Rome, but the tool is worthless without a brain/hand to handle it.

the cat among the pigeons a bit here

Looking at the reactions of the forum members, I would rather classify them as vultures [thumbsup]

Steven
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top