BorlandTalk.com Forum Index BorlandTalk.com
Borland discussion newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Re: Debugging into initialization and finalization code

 
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> C++ Builder (VCL Components Development)
View previous topic :: View next topic  
Author Message
Edward Diener
Guest





PostPosted: Wed Jun 25, 2003 11:31 pm    Post subject: Re: Debugging into initialization and finalization code Reply with quote



Harold Howe [TeamB] wrote:
Quote:
Edward Diener wrote:
I recall Harold Howe mentioning how one can debug into
initialization and finalization code for a unit. I don't remember
how this can be done. Does anybody know how one can debug into this
code ?

Are you talking about the magic pascalian Initialize and Finalize that
are generated for you but you can't see?

Yes, that is it.

Quote:
I debugged through these by
building a debug version of the RTL.

OK, there are instructions for doing that and I have all the source
installed.

Quote:
From inside the RTL, you can see
the for loop that initializes each unit.

Where does one place a breakpoint in any given VCL unit in order to step
into the Initialize and/or Finalize code for that unit ? As you say, the C++
source code for a unit doesn't show it.

Quote:

Initialize and Finalize had a priority of 30 if I remember correctly.

PS: You can't build the RTL in BCB6 unless you install the patches.

All patches are installed.



Back to top
Michael Harris
Guest





PostPosted: Fri Jun 27, 2003 2:21 am    Post subject: Re: Debugging into initialization and finalization code Reply with quote



Edward
see if this works.
run the app. ide menu. view debugwindows. modules.
select the exe or whatever module the offending code is in.
in the righ pane. find the namespace @@ finalize method.
click it a couple of times.
put in a breakpoint where you want to stop.
close the exe.


--
Michael



Back to top
Harold Howe [TeamB]
Guest





PostPosted: Fri Jul 04, 2003 5:39 am    Post subject: Re: Debugging into initialization and finalization code Reply with quote



Quote:
Where does one start in order to step through it in assembly ?

F7 :)

When the RTL is rebuilt with debugging information, stepping into the
program takes you to the RTL source code. The stuff that runs before main.

When I did this, I stepped in to the RTL source and kept stepping until
I hit the for loop that initializes all of the units. Most of the code
up to this point was in C. Stepping through the for loop took me to
assembly land.

From what I remember, there wasn't a good way to break in Initialize
and Finalize for a particular unit. Although once you step through
initialization loop and discover where the code jumps to during the
init, you could put a breakpoint in the assembly code.

h^2


Back to top
Display posts from previous:   
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> C++ Builder (VCL Components Development) All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.