Question

Delphi 5 Debugger and source unit with LARGE amounts of constant data

Asked by: rllibby


Here is my current problem:

I have a source unit that I have written (or should say, converted from C) that is about 2,500 lines total, and about 248K in size. This should be well within the limits of the IDE, as there are plenty more units out there that are much larger, and they debug/single step just fine.

Regardless of what I do, I cannot get any of my breakpoints in THIS unit (only) to activate, all other units are fine. The breakpoints are NOT set on no-op lines, or anything like that. And yes, I do have the debug options set (all of them in fact, I have even tried with remote debugging symbols). I have removed the dcu for this unit multiple times, and even checked sizes when compiled with debug vs non debug (148K/96K).

The only thing that makes this unit unique is the fact that there is a LARGE amount of constant data declared in it, mainly in the form of record constants (and I do mean large, about 100K worth).

Before I go splitting this source across multiple units (I would REALLY rather not do this, as it does compile and execute correctly), does anyone have any ideas/suggestions?

All comments are welcome, so long as you don't tell me to set the debug options flag in the compiler options ;-)

Thanks in advance,
Russell

This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.

Subscribe now for full access to Experts Exchange and get

Instant Access to this Solution

  • Plus...
  • 30 Day FREE access, no risk, no obligation
  • Collaborate with the world's top tech experts
  • Unlimited access to our exclusive solution database
  • Never be left without tech help again

Subscribe Now

Asked On
2004-02-25 at 06:50:20ID20897484
Tags

delphi

,

debugger

Topic

Delphi Programming

Participating Experts
6
Points
500
Comments
26

Trusted by hundreds of thousands everyday for fast, accurate and reliable tech support.

  • "The time we save is the biggest benefit of Experts Exchange to Warner Bros. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange." Mike Kapnisakis, Warner Bros.
  • "Our team likes having a resource that is more secure than just using Google and most experts using this service really know their stuff. It's nice to look here first versus using Google." Dayna Sellner, Lockheed Martin
  • "Anytime that I've been stumped with a problem, 9 out of 10 times Experts Exchange has either the accepted solution or an open discussion of the potential solution to the problem." Kenny Red, eBay Inc.

See what Experts Exchange can do for you.

Got a question?

We've got the answer.

Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.

Screenshot of Experts Exchange Knowledgebase

Need individual assistance?

Our experts are ready to help.

If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.

Screenshot of Experts Exchange Knowledgebase

Want to learn from the best?

Read articles from industry experts.

Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.

Screenshot of an Article

Working on a long term project?

Store your work and research.

Save solutions to your questions, answers you’ve discovered through searching plus helpful articles in your personal knowledgebase for easy future access.

Screenshot of Experts Exchange Knowledgebase

Access the answers to your technology questions today.

Subscribe Now

30-day free trial. Register in 60 seconds.

What Makes Experts Exchange Unique?

Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Trusted by the world's most respected brands.

image of each brand's logo

Faithfully serving IT professionals since 1996.

Experts Exchange Logo

Try it out and discover for yourself.

Subscribe Now

30-day free trial. Register in 60 seconds.

Related Solutions

  1. delphi .dcu file format
    Need to know delphi .dcu file format
  2. Using *.dcu
    How can I use some *.dcu file without *.pas file
  3. .dcu problem
    When use smple code, I often stuck over an error of finding no .dcu out. Why? I didn't get the solution on the readme.txt the author wrote. They even didn't mention it. I think I made some mistake when I use the sample program. Something should be noticed? Thank You.
  4. filtedit.pas / .dcu
    what is "filtedit.pas / .dcu" ? (delphi2 ?) where is it?
  5. Debugger not stopping on breakpoints.
    Yesterday, I was debugging an activeForm, Using IE as the host application. Everything was working fine. Execution would stop wherever I set a break point. Today, when I set breakpoints in the same places in the code, it does not stop. The debugger is working somewhat: It...
  6. Delphi 6 debugger slowdown using COM objects
    Hi I'm using an OPC Automation Wrapper on Delphi 6.0. When the debugger is on, the whole server/groups/items creation process is really slow: about 120 times slower than havingthe debuggger off. I tried with two different Automation wrappers (matrikon and a siemens) with t...

Free Tech Articles

  1. WARNING: 5 Reasons why you should NEVER fix a computer for free.
    It is in our nature to love the puzzle. We are obsessed. The lot of us. We love puzzles. We love the challenge. We thrive on finding the answer. We hate disarray. It bothers us deep in our soul. W...
  2. SCCM OSD Basic troubleshooting
    SCCM 2007 OSD is a fantastic way to deploy operating systems, however, like most things SCCM issues can sometimes be difficult to resolve due to the sheer volume of logs to sift through and the dispe...
  3. Migrate Small Business Server 2003 to Exchange 2010 and Windows 2008 R2
    This guide is intended to provide step by step instructions on how to migrate from Small Business Server 2003 to Windows 2008 R2 with Exchange 2010. For this migration to work you will need the fo...
  4. Create a Win7 Gadget
    This article shows you how to create a simple "Gadget" -- a sort of mini-application supported by Windows 7 and Vista. Gadgets can be dropped anywhere on the desktop to provide instant information, ...
  5. Outlook continually prompting for username and password
    There have been a lot of questions recently regarding Outlook prompting for a username and password whilst using Exchange 2007. There are a few reasons why this would happen and I will try to cover t...
  6. Backup Exchange 2010 Information Store using Windows Backup
    There seems to be quite a lot of confusion around the ability to backup Exchange 2010 using the built in Windows Backup feature. This stems from the omission of this feature prior to Exchange 2007 s...

Cloud Class Webinars

  1. Avoiding Bugs in Microsoft Access
    Alison Balter takes and in-depth look at avoiding bugs in Access. In this webinar you will learn about using the immediate window to debug your applications, invoking the debugger, using breakpoints to troubleshoot, stepping through code, setting the next statement to execute, ...
  2. Top 10 Best New Features in Visio 2010
    Scott Helmers gives live demonstrations of the top 10 new features in Visio 2010. This webinar will teach you how to create compelling diagrams by adding shapes to the page with a single click, linking the shapes in a diagram to data in Excel (or SQL Server, or SharePoint), ...
  3. IT Consultant Business Secrets Revealed
    Michael Munger, Experts Exchange tech pro and IT consultant, pulls back the curtain on his very successful businesses and answers question on every IT consultant and business owner should know about. He shares secrets on what he did to solve the 5 most common problems in IT, ...
  4. Disaster Recovery and Business Continuity
    Quest CTO, Mike Billon, gives an overview of the steps involved in building a dunamic disaster recovery plan. Through case studies and an examination of software/hardware tooles for monitoring and testing, you'll gain a better understandin of where you are, where you want ...
  5. Organize Your Visio Diagrams with Containers and Lists
    Scott Helmers uses cross functional flowcharts, wireframe diagrams, data graphic legends and seating charts to teach you: how to ustilize all three new structured diagram components in Visio 2010, the best practices for organizeing shapes in previous version of Visio, how to organize ...
  6. How to Us Objects, Properties, Events and Methods in Microsoft Access
    Alison Dalter gives an in-depbth look at objects, properties, events and methods in Microsoft Access. In this webinar you will learn about using the object browser, referring to objects, working with properties and methods, working with object variables, understanding the ...

Join the Community

Give a Little. Get a Lot.

Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.

Join the Community

Answers

 

by: kretzschmarPosted on 2004-02-25 at 06:53:31ID: 10450819

no suggestion yet,
but if you set a breakpoint,
does this breakpoint remain at runtime, or becomes it an x on it?

can you step into your unit?

meikl ;-)

 

by: rllibbyPosted on 2004-02-25 at 07:00:48ID: 10450900

Meikl,

I set the breakpoint at design time and its red (active), but as soon as I "Run..." the program it becomes green (X in it, indicating not active).

And no, I cannot step into the unit. I even tried using :

  DebugBreak; // generate an INT3

Which DID force the CPU window to come up (and I can trace in there), but no lines in the source code get hi-lighted.

Very strange....
I have never run into anything quite like this. ;-)

Regards,
Russell


 

by: wframsayPosted on 2004-02-25 at 07:02:05ID: 10450916

Since you say you have a large number of constants in the file, if they aren't local constants, can you split just the constants into a separate file?

 

by: aikimarkPosted on 2004-02-25 at 07:02:14ID: 10450917

move the static assignments to a resource file and see if enables breakpoint setting.

 

by: rllibbyPosted on 2004-02-25 at 07:09:53ID: 10451000

aikimark,

The static assignments are in the form of record constants (as noted above), so please elaborate further. How would I go about storing the following, then loading it?

For example (one of the smaller ones).

const
  tbl_fpuDF_00BF:   Array [0..7] of instr =
  ((table: 0; mnemFlg: INS_FPU; destFlg: ADDRMETH_M or OPTYPE_w or OP_W; srcFlg: ARG_NONE; auxFlg: ARG_NONE; cpu: cpu_80387; mnemonic: 'fild'; dest: 0; src: 0; aux: 0),
   (table: 0; mnemFlg: 0; destFlg: ARG_NONE; srcFlg: ARG_NONE; auxFlg: ARG_NONE; cpu: cpu_80387; mnemonic: #0; dest: 0; src: 0; aux: 0),
   (table: 0; mnemFlg: INS_FPU; destFlg: ADDRMETH_M or OPTYPE_w or OP_W; srcFlg: ARG_NONE; auxFlg: ARG_NONE; cpu: cpu_80387; mnemonic: 'fist'; dest: 0; src: 0; aux: 0),
   (table: 0; mnemFlg: INS_FPU; destFlg: ADDRMETH_M or OPTYPE_w or OP_W; srcFlg: ARG_NONE; auxFlg: ARG_NONE; cpu: cpu_80387; mnemonic: 'fistp'; dest: 0; src: 0; aux: 0),
   (table: 0; mnemFlg: INS_FPU; destFlg: ADDRMETH_M or OPTYPE_fb or OP_W; srcFlg: ARG_NONE; auxFlg: ARG_NONE; cpu: cpu_80387; mnemonic: 'fbld'; dest: 0; src: 0; aux: 0),
   (table: 0; mnemFlg: INS_FPU; destFlg: ADDRMETH_M or OPTYPE_q or OP_W; srcFlg: ARG_NONE; auxFlg: ARG_NONE; cpu: cpu_80387; mnemonic: 'fild'; dest: 0; src: 0; aux: 0),
   (table: 0; mnemFlg: INS_FPU; destFlg: ADDRMETH_M or OPTYPE_fb or OP_W; srcFlg: ARG_NONE; auxFlg: ARG_NONE; cpu: cpu_80387; mnemonic: 'fbstp'; dest: 0; src: 0; aux: 0),
   (table: 0; mnemFlg: INS_FPU; destFlg: ADDRMETH_M or OPTYPE_q or OP_W; srcFlg: ARG_NONE; auxFlg: ARG_NONE; cpu: cpu_80387; mnemonic: 'fistp'; dest: 0; src: 0; aux: 0));

--------

wframsay,
I CAN split it, but was hoping to avoid doing so. And I'm also not sure how much I'll have to split it. I will look into this though

--------

Regards,
Russell

 

by: kretzschmarPosted on 2004-02-25 at 07:47:24ID: 10451365

hmm, does a delete of the dcu and rebuild not help?

 

by: rllibbyPosted on 2004-02-25 at 07:55:01ID: 10451430


No, have tried deleting the dcu multiple times with no success. :-(

And looking over the code some more, it is very difficult to split cleanly due to the dependancies invoved with the tables/constants/structure definitions.

I am thinking that I could run this as it currently is, then take the tables and dump them to memory, then to disk. Then, similar to what aikimark suggested, store them as RC_RTDATA resource streams. If i change the tables from const to var, then I could Move(...) the table data into the tables at runtime during the initialization. Not the best of solutions, but its what I am currently looking at now.

Thanks for the comments so far,
Russell
 

 

by: gmayoPosted on 2004-02-25 at 07:59:51ID: 10451465

One of our pieces of software generates vast amounts of data which is then used to effectively embed data within software. It is not of constant form, but the source file size is well over 1Mb. I can step through with no problems.

Sample extracts:
var
_ADIDCOT, _ADNDID, _ADNMNE, _ADNMNW, _ADNOXFD, _ADNRLFE, _ARLFDID, _AUFFDN,
_AUFFUP, _AUPDID, _AUPMNE, _AUPMNW, _AUPOXFD, _AUPRLFE : TARS;
_B0901, _B0903, _B0904, _B0905, _B0906, _B0907, _B0911, _B0912,
_B0913, _B0914, _B0916, _B0918, _B0920, _B0921, _B0922, _B0923,
_B0924, _B0925, _B0926, _B0928, _B0931, _B0933, _B0935, _B0936,
_B0937, _B0938, _B0940, _B0941, _B0942, _B0944, _B0947, _B0949,
_B0951, _B0952, _B0954, _B0961, _B0963, _B0966, _B0973, _B0976,

_ADIDCOT := TARS(ARSList.Objects[0]);
_ADIDCOT.ID := 'ADIDCOT';
_ADNDID := TARS(ARSList.Objects[1]);
_ADNDID.ID := 'ADNDID';
_ADNMNE := TARS(ARSList.Objects[2]);
_ADNMNE.ID := 'ADNMNE';
_ADNMNW := TARS(ARSList.Objects[3]);
_ADNMNW.ID := 'ADNMNW';
_ADNOXFD := TARS(ARSList.Objects[4]);
_ADNOXFD.ID := 'ADNOXFD';
_ADNRLFE := TARS(ARSList.Objects[5]);
_ADNRLFE.ID := 'ADNRLFE';
_ARLFDID := TARS(ARSList.Objects[6]);
_ARLFDID.ID := 'ARLFDID';

_D10.InitData(367, 14,
'CHOLSEY',
True);
_D11.InitData(795, 41,
'DOWN MAIN',
True);

ad finitum.

--

Earlier versions of Delphi had a limit of the number of constants in one unit. I am not aware if this limitation still exists or not - I would hope it doesn't!

Geoff M.

 

by: DragonSlayerPosted on 2004-02-25 at 08:28:15ID: 10451715

Russell, juz a thought... if you did your code in a Linux file format (without the proper CR/LF combo), then the IDE might not parse your code correctly.



DragonSlayer.

 

by: rllibbyPosted on 2004-02-25 at 08:33:54ID: 10451762


DragonSlayer,
I also had the same though earlier in regards to this, as I have previously run into the type of issue you mention. (mainly happens when I transcribe C code over)

Thus, a few days ago I dumped the pas file and ran it though 2 parse phases, the first was to ensure all line ends were CRLF and the second was to remove all TAB chars from the source. Still no joy at this point.

Russell

 

by: gmayoPosted on 2004-02-25 at 08:58:22ID: 10451980

Tabs aren't a problem for Delphi - we use them as standard.

I don't expect this to work, but try putting your constants in a seperate file and $INCLUDEing it.

Geoff M.

 

by: kretzschmarPosted on 2004-02-25 at 08:59:26ID: 10451989

which os do u use?
just read about a debugging problem on w2k-os

 

by: rllibbyPosted on 2004-02-25 at 09:04:32ID: 10452032


Meikl - Windows XP.

Geoff - I realize that tabs aren't supposed to be an issue, but I wanted to make sure that this source was as "clean" as possible, in order to rule out all possibilites. Due to the dependancies,  a split is not trivial. (am almost done dumping the tables to an rc format which I can compile to res).

As I said, its just this unit. All other included units in this project will let me debug/single step/etc..

Will let you know the results of resource streams/and var tables in a bit.

Russell

 

by: aikimarkPosted on 2004-02-25 at 09:19:02ID: 10452148

I was initially thinking of changing const to var and using the resource file streaming that you already know about.

I was about to suggest the use of $Includes for your constants, but that has also been suggested.

Thinking outside of the box, I wonder if you might make a meta-unit with multiple $Includes for multiple segmented versions of your current unit.

 

by: kretzschmarPosted on 2004-02-25 at 09:39:44ID: 10452342

well, xp, not far away from w2k
would be a worth try

http://codecentral.borland.com/codecentral/ccweb.exe/listing?id=15804

maybe also just unusual

meikl ;-)

 

by: DragonSlayerPosted on 2004-02-25 at 09:43:30ID: 10452387

Hi Russel,

I have had this problem in my old Pascal days, whereby if I have long declaration, the debugging doesn't work.

e.g.

if I have

const
  MyLongArray: array[1 .. 3] of string = (
    "This is a long string, a very very long string, I guess... and what do we do about it";

etc. etc.

Now, I'm not trying to touch into some memory/variable issues here... but more on to the length of the code. I recall that there used to be a limit to the length of a statement... and your constant declaration qualifies as only a *single statement* regardless of how many lines you break it into.

So, perhaps it's a limitation in Delphi as well?



DragonSlayer.

 

by: rllibbyPosted on 2004-02-25 at 10:04:42ID: 10452599

Well,

I have this working and can now debug the unit code. What I ended up doing is writing a routine that built an RC file and then dumped all my tables (record constants) into this resource file. After converting the rc->res, and {$R including the res, and finally loading the tables, it all works... (seems like way to much work).

To satisfy my own curiosity, I started from scratch again and started removing the tables one by one, changing the const declaration over to var (empty table). It would appear that 64K is the magic number in this scenario. As to the why, I can't really say....

Once I got the total constant data under 64K, then I was able to debug just fine.

I do appreaciate the comments and suggestion that were offered by all, but I am going to give the lion's share of the points to aikimark, as his suggestion got me down the right path, with the least amount of work. (It would have taken MUCH longer for me to split this apart and get it all working again).

Thanks to all,
Russell


 

by: DragonSlayerPosted on 2004-02-25 at 10:05:17ID: 10452609

found the solution?

 

by: DragonSlayerPosted on 2004-02-25 at 10:05:53ID: 10452613

ooops... i posted late ;-)

 

by: BrrPosted on 2004-02-25 at 10:14:37ID: 10452687

Hi
I guess there is a limit to the number of symbols the debugger can handle in a unit (also in Delphi 7).
We experienced a problem in a unit with a class containing about 800 properties with associated getter/setter methods.
After compiling/building the "blue dots" on the left side of the editor window would disappear around the middle of the unit.
Getting rid of the getters/setters by using index properties solved the problem.
So I think the solution is to reduce the number of symbols in the unit.
Henrik

 

by: kretzschmarPosted on 2004-02-25 at 10:28:48ID: 10452820

64k limit on constant declaration,
remeber me on turbo pascal,
there was also such a limit,
not guessed that this is already present on delphi

glad you got it work

meikl ;-)

 

by: DragonSlayerPosted on 2004-02-25 at 10:30:55ID: 10452836

meikl... remember "64K is enough for everyone"? ;-)

 

by: rllibbyPosted on 2004-02-25 at 10:32:47ID: 10452858

lol,
Yeah, the 64 K limit still seems to be there in one form or another. Like I said, it would compile fine, the tables were filled correctly, everything worked like it was supposed to..... except for the debugger.

Go figure.

 

by: aikimarkPosted on 2004-02-25 at 10:44:41ID: 10452967

I thought Bill Gates said "640K was enough for everyone"

Thanks for the points, Russell.  I'm glad to have helped you in turn for your great assistance to me.

 

by: kretzschmarPosted on 2004-02-25 at 10:47:47ID: 10452999

exactly
"640K ought to be enough for anybody."
-- Bill Gates, 1981

meikl ;-)

 

by: DragonSlayerPosted on 2004-02-25 at 10:50:48ID: 10453024

ya, i missed out the 0 ;-)

20120131-EE-VQP-002

3 Ways to Join

30-Day Free Trial

The Experts

98% positive feedback on 31,087 answers since March 2000. angeliii is a Microsoft Most Valuable Professional for his work with MS SQL Server & Develoment.

He has also proven his knowledge of Visual Basic Programming, PHP Scripting and Oracle Databases.

The Experts

97% positive feedback on 10,752 answers since July 2000. lrmoore has more than 18 years experience in the networking industry.

The six-time Mircosoft MVPs specialties include firewalls, virtual private networking, and network management.

Testimonials

"...and excellent source for support... Kind of like having your very own IT dept." Electriciansnet

Testimonials

"I was apprehensive at signing up at first. However... it has already made my life as an IT administrator much easier." JaCrews

Testimonials

"WOW! You guys have great, active, and knowledgeable people on here." moore50

Business Clients

Business Clients

In the Press

"If you’ve got a question... Experts Exchange can supply an answer.”

In the Press

"...an invaluable aid for both IT professionals and those who require tech support."

In the Press

"where IT professionals provide quick answers on just about any topic"

Business Account Plans

Loading Advertisement...