Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » U++ Library support » U++ Widgets - General questions or Mixed problems » Strange behavior of Point in watches
Re: Strange behavior of Point in watches [message #22891 is a reply to message #22890] Tue, 25 August 2009 10:07 Go to previous messageGo to previous message
mirek is currently offline  mirek
Messages: 14266
Registered: November 2005
Ultimate Member
dolik.rce wrote on Tue, 25 August 2009 03:42

Hello,
I've encountered strange problem while debugging my code... Here is simplest possible testcase:
#include <CtrlLib/CtrlLib.h>
using namespace Upp;

class win : public TopWindow{
public:
	typedef win CLASSNAME;
	virtual void LeftDown(Point p,dword flags){
		DUMP(p);
	}
};

GUI_APP_MAIN{
	win().Run();
}

I setup breakpoint in LeftDown() and run in debug mode. When the execution stops at the breakpoint, opening Quick watch window and entering "p" yields:
{
  <Upp::Moveable<Upp::Point_<int>, Upp::EmptyClass>> = {
    <Upp::EmptyClass> = {<No data fields>}, <No data fields>}, 
  members of Upp::Point_<int>: 
  x = -1078378568, 
  y = 8388608
}

Same values are shown if I add watch in the bottom panel of theide. But the most interesting (or puzzling) thing is, that the output in log file is correct, i.e. something like "p = [59, 138]".

At first, I thought that it is a problem in watches, but for something like "Point P(10,20);" watches show correct result. It can be very confusing, I was looking for bug almost an hour on absolutely wrong place, because of this...

Just in case this is compiler/platform specific: I use gcc 4.3 on ubuntu.

Regards,
Honza

PS: I'm not sure if this belongs here. If not, feel free to move this topic to some better place.


It is because correct stack frame for the function is not yet established - gdb reads incorrect values.

If you step inside, you they get corrected.

This is dbg feature, there is nothing we can do about it...

Mirek
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: tutorial Gui20c's defect
Next Topic: DropList + AddSeparator + mouse wheel problem
Goto Forum:
  


Current Time: Fri Jul 18 10:10:27 CEST 2025

Total time taken to generate the page: 0.00755 seconds