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 

Debug problems

 
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> C++ Builder (IDE)
View previous topic :: View next topic  
Author Message
Mark Guerrieri
Guest





PostPosted: Tue Jun 20, 2006 11:00 pm    Post subject: Debug problems Reply with quote



BDS2006 SP2-

I can't seem to reliably debug any of my executables. I put a breakpoint
and try to inspect variables, but only reference and built-in types seem to
work. For example, I have the following code as the first line in an event
handler:

void __fastcall TfrmMain::UpdateComboEditActions(TObject *Sender)
{
TAction* a = dynamic_cast<TAction*>(Sender);
if(a == NULL)
return;

a->Enabled = false;

TCustomComboBox* cb = dynamic_cast<TCustomComboBox*>(a->ActionComponent);
if(cb == NULL)
return;

HWND hEdit = FindWindowEx(cb->Handle, NULL, "EDIT", NULL);
....
}

I put a breakpoint on the IF line, and inspect the value of 'a' - The Debug
Inspector shows

a: void :0012E700
Data:
Quote:
a : ????

I get the same thing if I inspect the Sender parameter.

I can inspect 'hEdit', but not 'cb'

In an OnContextPopup event handler, I have:

void __fastcall TfrmMain::FormContextPopup(TObject *Sender,
TPoint &MousePos, bool &Handled)
{
TForm* f = dynamic_cast<TForm*>(Sender);
if(f == NULL)
return;
TPoint p = f->ClientToScreen(MousePos);

....
}

I can inspect 'p' and 'MousePos' but not 'f'

Inspecting 'this' (TForm*) shows a small subset of the form's members on the
'Data' tab, and the 'Properties' tab shows ONLY the 'Terminated' property?!?

ToolTip expression evaluation shows nothing for the 'bad' variables and
works fine for the 'good.'

I am experiencing this issue on every app I build, on 2 seperate machines.
Builds are using Runtime Packages, and there are no 3rd party components
installed outside of what comes with BDS and components I have created and
installed. When stepping into Delphi source (i.e. the VCL) things seem to
work fine. I have tried loading BDS with just the C++ personality and with
all personalities. I do NOT have (or have ever had) any other versions of
Builder installed on these machines.

The apps run fine. I have delete all PCH and incremental linker files. I
put all OBJ files in a seperate folder, and they are all correctly
timestamped to the current build and do not exist anywhere else.

What the heck is going on?

Mark
Back to top
Danzer
Guest





PostPosted: Wed Jun 21, 2006 9:13 pm    Post subject: Re: Debug problems Reply with quote



Mark Guerrieri wrote:
Quote:
BDS2006 SP2-

I can't seem to reliably debug any of my executables. I put a breakpoint
and try to inspect variables, but only reference and built-in types seem to
work. For example, I have the following code as the first line in an event
handler:

void __fastcall TfrmMain::UpdateComboEditActions(TObject *Sender)
{
TAction* a = dynamic_cast<TAction*>(Sender);
if(a == NULL)
return;

a->Enabled = false;

TCustomComboBox* cb = dynamic_cast<TCustomComboBox*>(a->ActionComponent);
if(cb == NULL)
return;

HWND hEdit = FindWindowEx(cb->Handle, NULL, "EDIT", NULL);
...
}

I put a breakpoint on the IF line, and inspect the value of 'a' - The Debug
Inspector shows

a: void :0012E700
Data:
a : ????

I get the same thing if I inspect the Sender parameter.

I can inspect 'hEdit', but not 'cb'

In an OnContextPopup event handler, I have:

void __fastcall TfrmMain::FormContextPopup(TObject *Sender,
TPoint &MousePos, bool &Handled)
{
TForm* f = dynamic_cast<TForm*>(Sender);
if(f == NULL)
return;
TPoint p = f->ClientToScreen(MousePos);

...
}

I can inspect 'p' and 'MousePos' but not 'f'

Inspecting 'this' (TForm*) shows a small subset of the form's members on the
'Data' tab, and the 'Properties' tab shows ONLY the 'Terminated' property?!?

ToolTip expression evaluation shows nothing for the 'bad' variables and
works fine for the 'good.'

I am experiencing this issue on every app I build, on 2 seperate machines.
Builds are using Runtime Packages, and there are no 3rd party components
installed outside of what comes with BDS and components I have created and
installed. When stepping into Delphi source (i.e. the VCL) things seem to
work fine. I have tried loading BDS with just the C++ personality and with
all personalities. I do NOT have (or have ever had) any other versions of
Builder installed on these machines.

The apps run fine. I have delete all PCH and incremental linker files. I
put all OBJ files in a seperate folder, and they are all correctly
timestamped to the current build and do not exist anywhere else.

What the heck is going on?

Mark



Do you have optimizations turned on? If so, try debugging with all
optimizations off.

Danzer
Back to top
Mark Guerrieri
Guest





PostPosted: Wed Jun 21, 2006 10:04 pm    Post subject: Re: Debug problems Reply with quote



Ok, I solved the problem- I'll post this here in case anyone else runs into
this.

I routinely change the path/name of the precompiled header file used (under
C++ Compiler Options) to a file in a subdirectory under my project folder,
with the name of my project and a .CSM extension. I do this because I work
with COM/ATL, and compiling frequently produces internal compiler errors
that can oly be resolved by deleting all precompiled header files (*.csm,
*.#xx) and doing a build.

The .#xx files contain centalized debugging info for all symbols in the PCH
file, thus decreasing the size of the OBJ files since debug info is not
duplicated in them.

Unfortunately, if you do not add the path to your new PCH files to the
Linker Options|Paths and Defines|Library Search Paths setting, the debugging
information in those files is never loaded, and they could typically contain
debug symbols for the VCL in you have

#include <vcl.h>
#pragma hdrstop

in your source.

You would typically not notice this problem if you use the default PCH
settings, since the default is to put vcl100.csm in the $(BDS)\lib folder,
which is also, by default, in the library search path.

This seems like a bug to me, since adding the PCH path to any of the Debug
Symbol search paths does nothing, and that would seem more appropriate since
the debug info is loaded dy the debugger and not actually linked into the
app... either way, this should be documented somewhere, and I couldn't find
any mention of a requirement of the linker having to find the debug symbols,
or any warning if it coudn't find them.

Should I put in a QC report for this?

Mark
Back to top
au
Guest





PostPosted: Thu Jun 22, 2006 8:10 am    Post subject: Re: Debug problems Reply with quote

On Tue, 20 Jun 2006 20:00:29 +0200, Mark Guerrieri
<mguerrieri (AT) ncogroup (DOT) com> wrote:

Quote:
put all OBJ files in a seperate folder,

There's your problem. BCB gets confused if you set output folders to
anything
but the defaults.


--
Using Opera's revolutionary e-mail client: http://www.opera.com/mail/
Back to top
David Dean
Guest





PostPosted: Thu Jun 22, 2006 6:48 pm    Post subject: Re: Debug problems Reply with quote

In article <449837bd$1 (AT) newsgroups (DOT) borland.com>,
"Mark Guerrieri" <mguerrieri (AT) ncogroup (DOT) com> wrote:

Quote:
I can inspect 'p' and 'MousePos' but not 'f'

This sounds a lot like this QC report:

<http://qc.borland.com/wc/qcmain.aspx?d=29310>

--
-David

Quis custodiet custodes ipsos?
Back to top
David Dean
Guest





PostPosted: Thu Jun 22, 2006 6:49 pm    Post subject: Re: Debug problems Reply with quote

In article <44997c0d$1 (AT) newsgroups (DOT) borland.com>,
"Mark Guerrieri" <mguerrieri (AT) no_spam_verizon (DOT) net> wrote:

Quote:
Unfortunately, if you do not add the path to your new PCH files to the
Linker Options|Paths and Defines|Library Search Paths setting, the debugging
information in those files is never loaded, and they could typically contain
debug symbols for the VCL in you have

Please add this as a comment to the following QC report:

<http://qc.borland.com/wc/qcmain.aspx?d=29310>

--
-David

Quis custodiet custodes ipsos?
Back to top
vavan
Guest





PostPosted: Fri Jun 23, 2006 8:10 am    Post subject: Re: Debug problems Reply with quote

On Thu, 22 Jun 2006 09:49:24 -0400, David Dean
<ozchzhq02 (AT) sneakemail (DOT) com> wrote:

btw anybody noticed that in bcb2006 Reload Symbol Table is _always_
disabled in Modules window or is it just me?

--
Vladimir Ulchenko aka vavan
Back to top
Mark Guerrieri
Guest





PostPosted: Mon Jun 26, 2006 9:14 pm    Post subject: Re: Debug problems Reply with quote

Quote:
Please add this as a comment to the following QC report:

http://qc.borland.com/wc/qcmain.aspx?d=29310



Done- Thanks.
Back to top
Display posts from previous:   
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> C++ Builder (IDE) 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.