Solved

VCL50.BPL !!! Is it possible to recompile? No? I need debug info!

Posted on 2002-05-29
34
1,305 Views
Last Modified: 2012-06-22
1st of all, I didn't ever think I'll get so depth into packages, but... The question is:

I have a big problems in debugging application compiled with my own packages. It occures upon apllication exits. When i try to compile applet without packages - everything is allright.
So, I need VCL packages COMPILED WITH debug information, in order to trace the Delphi code which raise an exception. Is this thing exists somewhere?

I mean, VCL50.DPK, VCLX50.DPK etc. in order to recompile the VCL/RTL by myself (btw, I have doubt on it. I think not all the files needed present in installation).

Or ready VCL BPLs/DPCs, compiled WITH DEBUG INFO!
0
Comment
Question by:_sunny_
  • 11
  • 9
  • 6
  • +5
34 Comments
 
LVL 27

Expert Comment

by:kretzschmar
Comment Utility
?are for this not the debug-dcus somewhere in the subdirecrory
0
 

Author Comment

by:_sunny_
Comment Utility
Huh?
0
 
LVL 27

Expert Comment

by:kretzschmar
Comment Utility
well,
i've no delphi on hand yet,
also i'm not an owner of d6
nor have i the possibility to access
a d6 installation

but, as far i have in mind,
there is the directory under the lib
directory, where the dcu's are placed
with debug-information, which are packaged
in the vcl..pkb

the only think you must do,
is to set the debug-library path
in the delphi-enviroment

but i may wrong

meikl ;-)
0
 

Author Comment

by:_sunny_
Comment Utility
Look, the problem is absence in \lib\debug
VCL50.DPC and other DPCs, compiled WITH debug information.
Borland do not provides these. I don't know why.

And - I am talking about Delphi 5 after all.
0
 
LVL 27

Expert Comment

by:kretzschmar
Comment Utility
>I am talking about Delphi 5 after all
was just irritated by CLX ;-)

well, which d5-edition do u use?
0
 

Author Comment

by:_sunny_
Comment Utility
Enterprise
0
 
LVL 27

Expert Comment

by:kretzschmar
Comment Utility
well, ok, i will take a look
into my d5 installation
later at home


0
 
LVL 8

Expert Comment

by:TOndrej
Comment Utility
It's impossible (due to missing units) and illegal for you to recompile the re-distributable standard runtime packages supplied by Borland.

For debugging purposes, rebuild without runtime packages using debug DCUs.

If the problem only occurs when built with runtime packages, take a look at the source code of any custom runtime packages used by your project.

What's the error you get? Perhaps I could take a guess at what to look for in your source code.
0
 

Author Comment

by:_sunny_
Comment Utility
oh, its just AV :(
No additional information available :(

Project FDINVINP.exe raised exception class C0000005 with message 'access violation at 0x00000000: read of address 0x00000000'.

Not lot of information :)

The most interest thing, that, I build the application with ONLY runtime package VCL50 (no other our packages!) and get the same error! You see?
0
 
LVL 8

Expert Comment

by:TOndrej
Comment Utility
I don't really have an idea, I can only guess...
I assume that the error is consistent and reproducible.
C0000005 might be the EXCEPTION_ACCESS_VIOLATION Windows constant.
Read of address 0x00000000 might mean accessing a nil pointer.
It looks like a Windows OS exception raised outside of Delphi's exception handling code (which I think can happen before Delphi exception handling is initialized or after it's uninitialized).
Try to find some unusual/suspicious code in your project...
Perhaps take a look at your initialization/finalization sections.
If you're working with pointers in your code, try to review the code.
Good luck!
0
 
LVL 27

Expert Comment

by:kretzschmar
Comment Utility
hi tondrej,
thanks for clarifying
meikl ;-)
0
 
LVL 8

Expert Comment

by:TOndrej
Comment Utility
Hi kretzschmar,
you're joking, right? ;-)
But I couldn't be more specific, sorry.
0
 
LVL 27

Expert Comment

by:kretzschmar
Comment Utility
no no,

after a recheck at my installation,
there is no package with debuginfo there

therefore this

>It's impossible (due to missing units) and illegal for
>you to recompile the re-distributable standard
>runtime packages supplied by Borland

clarifies, why the vcl50.bpl isn't recompileable

well, also i cannot more say as you, tondrej,
its a bit like digging in the dark

meikl ;-)
0
 
LVL 8

Expert Comment

by:TOndrej
Comment Utility
I see...
It kind of makes sense: the main purpose of Borland runtime packages is to be shared by Delphi/BCB applications (reducing deployed executable size). Imagine the BPL Hell if everybody compiled and distributed their own versions... ;-)
0
 

Author Comment

by:_sunny_
Comment Utility
So we've started this hell, you meant, tondrej :)
I solved the problem with building my own VCL50Debug.BPL
It was unexpectedely easy thing to do.
I created new package, then did doubleclick on VCL50.DCP in it's "Requires", and - oh, man - it bring me new window called "Generated VCL50.DPK"!!!
I saved it to disk. Then I renamed it, changed search path to \LIB\DEBUG (!), compiled (just on my way I was forced to drop from it libintf.dcu and 2-3 other units due to absence of their DCUs) and I have it done!!

Now I have my own VCL50Deb.BPL WITH DEBUG INFO inside :)
And happily trying to catch this f#@$%ing bug :)

Thanks to all, but I think its me who won the points :)
0
 
LVL 9

Expert Comment

by:ITugay
Comment Utility
seems it was meikl's idea to use units (packages) with debug info?
0
 

Author Comment

by:_sunny_
Comment Utility
you mean to recompile vcl50.bpl?
look through the original question, ITugay...
meikl, just checked the bpl's with debugging is absent in his installation as well. imho, it was matter-of-course...

>I mean, VCL50.DPK, VCLX50.DPK etc. in order to recompile >the VCL/RTL by myself (btw, I have doubt on
>it. I think not all the files needed present in >installation).

so I just droped my doubt out :)
0
Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

 
LVL 27

Expert Comment

by:kretzschmar
Comment Utility
at least, you've solved the question byself

ask at community support to move the question
into paq and for refunding your points

meikl ;-)

0
 
LVL 8

Expert Comment

by:TOndrej
Comment Utility
And what have you solved with this solution?
You still don't have vcl50.dcp with debug info, unless I'm missing something.
0
 

Author Comment

by:_sunny_
Comment Utility
Yes, I do have!
The name doesn't matter (vcl50deb, vcl50...).
I've got exactly what I wanted. I've got vcl50 package (almost vcl50, of course) WITH POSSIBILITY to walk inside its code!

Actually, I already found what the bug was :)
I found, which exactly finalization raise exception. If it is interesting, it was a windows message (WM_ACTIVATE), which none waited for at this moment... all objects was freed till this moment.
0
 

Author Comment

by:_sunny_
Comment Utility
Tondrej, I mean, I reassembled vcl50.bpl, but from DCUs not from \LIB nor from \LIB\DEBUG !
0
 
LVL 8

Expert Comment

by:TOndrej
Comment Utility
Cool! Congrats on your solution :-)
I knew you could generate .dpk from a required .dcp that way but I didn't think it would help.
I'll have to look at it again ;-)
0
 

Author Comment

by:_sunny_
Comment Utility
Many thanks to all...
Somebody can tell me what should I do with this question?
Who wants the points? :))
Or I can just close it? How?
0
 
LVL 27

Expert Comment

by:kretzschmar
Comment Utility
just to repeat

ask at community support to move the question
into paq and for refunding your points

meikl ;-)

0
 
LVL 9

Expert Comment

by:ITugay
Comment Utility
May be I missed something, but there is another way documented in Delphi.

1. specify Debug DCU Path located in
 Tools | Debugger options | [General]

C:\Delphi5\lib\Debug



2. check "Use debug DCU" in
Project | Options | [Compiler]

<Delphi help>
Use Debug DCUs     Allows you to link in debug versions of the VCL. When checked, Delphi prepends the Debug DCU path (specified in Tools|Debugger Options on the General page) to the unit Search path specified in Project|Options ont he Directories/Conditionals page.
</Delphi help>



3. specify "Debug source path"
Project | Options | [Debug source path]

$(DELPHI)\Source\Rtl\Sys\;$(DELPHI)\Source\Vcl


<Delphi help>
Debug source path     Search path for the debugger. The debugger searches paths defined by the compiler by default. If the directory structure has changed since the last compile, a path can be entered here to include a file in the debugging session.
</Delphi help>

now the test code

begin
  Application.Initialize;
  Application.CreateForm(TForm1, Form1);
  Application.Run;
end. // set breakpoint here and then press F7 key when debugger stops here
// it will walk via system.pas,  forms.pas etc.
// and even ask for path to source code of some unit which path was not specified in "Debug source path"


-----
Igor


0
 

Author Comment

by:_sunny_
Comment Utility
Igor, please, now check "Build with runtime packages" checkbox in Project Options...

Repeat your experiment.... :)

Got exciting? :)
0
 
LVL 9

Expert Comment

by:ITugay
Comment Utility
Nothing exciting, but very predictedly.

I can't understand, are you trying to find a bug by easy way or produce as many problems as it is possible?

btw, have no time to continue discussion, so, I recommend you to ask community support to refund your points. Seems you really deserved it.

-----
Igor
0
 

Author Comment

by:_sunny_
Comment Utility
it seems you wasn't attentive enough.
I sayed before: the bug occures ONLY when program built WITH PACKAGES. It not occures if one built WITHOUT.
0
 
LVL 9

Expert Comment

by:ITugay
Comment Utility
agree, I missed it.
0
 

Expert Comment

by:RayNorrish
Comment Utility
"Project FDINVINP.exe raised exception class C0000005 with message 'access violation at 0x00000000: read of address 0x00000000'"

In my experience, I find that this is nearly always caused by accessing / releasing an object that isn't instantiated - and should be easily tracked down, even without debug.

0
 
LVL 1

Expert Comment

by:pnh73
Comment Utility
No comment has been added lately, so it's time to clean up this TA.
I will leave a recommendation in the Cleanup topic area that this question is:

PAQ with refund

Please leave any comments here within the next seven days.
 
PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!
 
Paul (pnh73)
EE Cleanup Volunteer
0
 
LVL 6

Accepted Solution

by:
Mindphaser earned 0 total points
Comment Utility
Force accepted

** Mindphaser - Community Support Moderator **
0
 

Expert Comment

by:CleanupPing
Comment Utility
_sunny_:
This old question needs to be finalized -- accept an answer, split points, or get a refund.  For information on your options, please click here-> http:/help/closing.jsp#1
EXPERTS:
Post your closing recommendations!  No comment means you don't care.
0
 
LVL 27

Expert Comment

by:kretzschmar
Comment Utility
>Post your closing recommendations!  No comment means you don't care.

i am definitivly not able to post recommendations for 200+ cleanup-posts per day.

that means not, that i didn't care of it, if i post no recommendation there!!

even so on this q, i post this unseen of the q
0

Featured Post

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

Introduction The parallel port is a very commonly known port, it was widely used to connect a printer to the PC, if you look at the back of your computer, for those who don't have newer computers, there will be a port with 25 pins and a small print…
Introduction I have seen many questions in this Delphi topic area where queries in threads are needed or suggested. I know bumped into a similar need. This article will address some of the concepts when dealing with a multithreaded delphi database…
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…

762 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now