Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Corrupt Delphi 7 data module

6 views
Skip to first unread message

John Randall

unread,
Oct 16, 2008, 10:01:27 AM10/16/08
to
I write the software for the company I work for using Delphi addressing a
MySQL database. My project therefore has a DataModule in a file named
DataUnit.pas. This is a large project and the DataUnit.pas file is large.
It represents many hours of work!

It's been a while since I've needed to do anything to the DataModule but the
other day I needed to look at something, when I discovered to my horror that
the unit appears to be corrupt.

When a project is compiled, small blue dots are placed in the left margin,
to indicate lines on which a a breakpoint may be set. In the case of my
DataModule, there are no blue dots until, in the middle of a procedure, the
blue dots appear from line 4145 to the last line, line 5637. When present,
the blue dots appear to make sense (for example, there is no blue dot next
to a line starting with the word "procedure", but there is one on that
procedures "begin" statement. However, if I set a breakpoint on a line in
this region, it is not honoured; its as though no breakpoint is set.
Suspecting that the blue dots might be offset, I set a breakpoint on the
first blue dot (line 4145) and then set a breakpoint in another unit of the
code at a point where the first routine in the data module is called. Sure
enough, when I singlestep (F7) onto the line calling the first routine in
the data module, control jumps to the data module, to line 4145, the line in
the middle of a procedure. When next I press F7, an access-violation error
message is generated. Makes sense - I can't expect to start in the middle
of a procedure!

When I run without breakpoints, the code does its job correctly, so the code
is (I hope!) fine, the problem is in the breakpoint mechanism.

I've asked my question in a forum with limited relevance and the consensus
was that I was somehow linking to an out-of-date DataUnit.dcu file, hence
the inappropriate positions for the blue dots. (I recently bought and
installed EurekaLog - to track a memory leak - and wanted to eliminate the
possibility that this was the cause of the problem. No-one in the EurekaLog
forum thought EurekaLog was the culprit.) In short, please don't suggest
that I delete all dcu's for my project, then build it (rather than compile
it). I've tested this suggestion and a number of similar ones, all based on
the assumption that my DataUnit.dcu file is not the one I think it is. As
another example of suggestions tested, I removed the DatUnit.pas file from
my project then added to the project, making sure I was selecting the
correct DataUnit.pas file. All the units I've made for this project are in
a single folder, the folder containing the dpr file.

Does anybody know what's wrong here, and how to fix the problem? The idea
that I will not be able to singlestep into my data module when needed
horrifies me!

Many thanks in advance for your assistance.
John Randall.


0 new messages