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++ TheIDE » U++ TheIDE: Compiling, Linking, Debugging of your packages » IDE debugger hangs on GuiMT example
IDE debugger hangs on GuiMT example [message #36115] Sun, 29 April 2012 18:56 Go to next message
awksed is currently offline  awksed
Messages: 39
Registered: April 2012
Member
Hi,

The IDE debugger hangs when debugging the reference/GuiMT example.

To reproduce, place a breakpoint at:

void Divisors::TestNumber()
{
if(IsNull(editor)) // Breakpoint here
return;

Hit F5, enter a number and click 'Test'.

The mouse pointer moves but nothing responds to lbutton down etc., nothing on the desktop works, i.e. menu, app icons, widjets etc. Ctrl+Alt+Del puts up the Log Off/Shutdown dialog but the buttons do not work (times out to log off after 30 seconds which is the only way out).

Other example apps debug ok (I wish to develop a similar MT app so need to resolve this).

Mandriva 2012.2, KDE 4.4 desktop. gdb 7.1-1mdv2010.1.

Thanks,

Jan
Re: IDE debugger hangs on GuiMT example [message #36116 is a reply to message #36115] Sun, 29 April 2012 20:02 Go to previous messageGo to next message
mdelfede is currently offline  mdelfede
Messages: 1259
Registered: September 2007
Senior Contributor
Confirming.... I had same problem on my app.
A workaround is to play with keyboard :

ALT-D (opens debugger menu) and then navigate with arrows and select 'stop debugging'.

Not a solution, but I'll try to investigate that one....

Max

p.s.: just tested with my MI2 interface, don't know what happens with the default one....

p.p.s: same stuff with default GDB interface.

[Updated on: Sun, 29 April 2012 20:04]

Report message to a moderator

Re: IDE debugger hangs on GuiMT example [message #36117 is a reply to message #36116] Sun, 29 April 2012 20:36 Go to previous messageGo to next message
mdelfede is currently offline  mdelfede
Messages: 1259
Registered: September 2007
Senior Contributor
The problem seems well known when hitting a breakpoint inside a callback.... if debugged code grabs mouse globally, this behaviour appears.
Don't know any workaround for it indeed.... It seems that the problem is not easily solvable by debugger alone.

See this one for example...

https://bugs.eclipse.org/bugs/show_bug.cgi?id=20006

Max
Re: IDE debugger hangs on GuiMT example [message #36122 is a reply to message #36117] Mon, 30 April 2012 19:01 Go to previous messageGo to next message
awksed is currently offline  awksed
Messages: 39
Registered: April 2012
Member
Hi Max,

Thanks for you replies.

I tried Alt-D but no joy.

I tried installing Xephyr so I could ungrab the mouse/keyboard but hit too many problems and havent the time to fix them.

I tried setting the AllowDeactivateGrabs option in xorg.conf but some kind soul has disabled this in the latest X server.

I am trying a sideways step of avoiding callbacks during debugging.

Thanks for your help.

Jan
Re: IDE debugger hangs on GuiMT example [message #36123 is a reply to message #36122] Mon, 30 April 2012 20:11 Go to previous messageGo to next message
mdelfede is currently offline  mdelfede
Messages: 1259
Registered: September 2007
Senior Contributor
Hi,

I've read about another possible way, running on a separate Display, but I' don't remember where and how.
You should look with google "debug hang x11 callback" or something like that... you'll find it.

BTW, as you are here, I'll be glad if you test my GDB extensions (Setup-Environment-IDE and select GDB_MI2) and give some feedback.

Ciao

Max
Re: IDE debugger hangs on GuiMT example [message #36126 is a reply to message #36123] Tue, 01 May 2012 12:24 Go to previous messageGo to next message
awksed is currently offline  awksed
Messages: 39
Registered: April 2012
Member
> BTW, as you are here, I'll be glad if you test my GDB extensions (Setup-Environment-IDE and select GDB_MI2) and give some feedback.

Sure, but I dont have a debugger selection option on Setup-Environment-IDE. I built version 4179 from source 2 day ago and the updater reports "Can't find file uppsrc/ide/version.h" (it is in ~/upp/uppsrc/ide/).

Regards,

Jan
Re: IDE debugger hangs on GuiMT example [message #36127 is a reply to message #36126] Tue, 01 May 2012 12:29 Go to previous messageGo to next message
mdelfede is currently offline  mdelfede
Messages: 1259
Registered: September 2007
Senior Contributor
awksed wrote on Tue, 01 May 2012 12:24

> BTW, as you are here, I'll be glad if you test my GDB extensions (Setup-Environment-IDE and select GDB_MI2) and give some feedback.

Sure, but I dont have a debugger selection option on Setup-Environment-IDE. I built version 4179 from source 2 day ago and the updater reports "Can't find file uppsrc/ide/version.h" (it is in ~/upp/uppsrc/ide/).

Regards,

Jan


That's quite weird, because the option is there since about 3 monthes.... did you update the sources from svn ?
Anyways, if you do so, please use latest svn (yesterday one at most...), as I fixed many stuffs on last 2 days.

If you build from sources, I guess the updater from ide becomes useless, you should do it with svn+build from sources or at least downloading manually from nighty builds. I suggest you the svn way.

Ciao

Max

p.s.: about the x11 hang problem... I had it yesterday again, but the keyboard trick was working. Maybe you should try combining it with alt-tab to switch windows.

[Updated on: Tue, 01 May 2012 12:31]

Report message to a moderator

Re: IDE debugger hangs on GuiMT example [message #36133 is a reply to message #36127] Wed, 02 May 2012 22:55 Go to previous messageGo to next message
awksed is currently offline  awksed
Messages: 39
Registered: April 2012
Member
Hi Max,

The Alt-Tab + Atl-D worked. The mouse buttons didnt work until I hit F10 a couple of times.

I built version 4193 (the latest source available) but I still have trouble seeing where I select your GDB_MI2 debugger.

Attached is a screenshot of my Setup-Environment-IDE dialog. Still can't see where I select your GDB_MI2 debugger.

Regards,

Jan
Re: IDE debugger hangs on GuiMT example [message #36134 is a reply to message #36133] Wed, 02 May 2012 23:01 Go to previous messageGo to next message
mdelfede is currently offline  mdelfede
Messages: 1259
Registered: September 2007
Senior Contributor
Please try getting the sources from svn... the debugger selection is in this page, as shown here :

index.php?t=getfile&id=3741&private=0

if you don't have it, this just means you're using an old code.

Max
  • Attachment: mi2.png
    (Size: 50.22KB, Downloaded 496 times)
Re: IDE debugger hangs on GuiMT example [message #36135 is a reply to message #36134] Thu, 03 May 2012 00:03 Go to previous messageGo to next message
awksed is currently offline  awksed
Messages: 39
Registered: April 2012
Member
Hi Max,

My mistake was to use the latest stable release.

I have downloaded the tarball of version 4874. I will build it tomorrow and let you know what I think.

I have 'Post Notification' selected and the email address in my account is correct but I dont receive any notification of replies to my posts - I don't know if you have anything to do with the forum administration.

Regards,

Jan
Re: IDE debugger hangs on GuiMT example [message #36136 is a reply to message #36135] Thu, 03 May 2012 00:07 Go to previous messageGo to next message
mdelfede is currently offline  mdelfede
Messages: 1259
Registered: September 2007
Senior Contributor
No, I'm not a forum admin... but I do receive notifications.
Maybe you cleared the 'Post Notification' checkbox on topic.

About releases, upp moves so fast that IMHO it makes few sense to stay on stable releases. Usually nighty builds or svn builds are by far better.

Max
icon1.gif  Re: IDE debugger hangs on GuiMT example [message #36147 is a reply to message #36136] Fri, 04 May 2012 09:47 Go to previous messageGo to next message
awksed is currently offline  awksed
Messages: 39
Registered: April 2012
Member
Hi Max,

Emails work now (or at least I got one this time). No I didnt uncheck 'Post Notification' checkbox.

Re: debugger. GDB_M12 is an improvement on the 'Stable' debugger. However it crashes the IDE (no core dump) on a breakpoint in a worker thread with an 'Invalid memory access!' messagbox (then terminates). Sorry I can't let you have the source that shows this, it contains proprietry code.

Drill down is nice but it would be more intuitive to use a control with a + indicating expansion available. I only discovered double-click action by accident (frankly I never read manuals - if the app neads a manual it isnt very intuitive).

It would be nice to have more buttons ('Stop' would be useful and 2 minutes to add). 'Pause' or the ability to add checkpoints while running would greatly enhance things (Eclipse manages the latter, try cribbing their code Smile ).

The 'Stable' debugger has a bug. Select reference/ColumnList. Put breakpoint in TestWind::Layout. When BP hit, click 'Autos' tab. 'Attempt to use type name in expression' is displayed briefly and execution continues.

Overall impression. Excellent framework/library. IDE needs work, esp. the debugger GUI. I'm sure your 'getting there'.

Email me when you fix the GDB_M12 bug and I'll try it again.

Ragards,

Jan
Re: IDE debugger hangs on GuiMT example [message #36148 is a reply to message #36147] Fri, 04 May 2012 12:51 Go to previous messageGo to next message
mdelfede is currently offline  mdelfede
Messages: 1259
Registered: September 2007
Senior Contributor
awksed wrote on Fri, 04 May 2012 09:47

Hi Max,


Re: debugger. GDB_M12 is an improvement on the 'Stable' debugger. However it crashes the IDE (no core dump) on a breakpoint in a worker thread with an 'Invalid memory access!' messagbox (then terminates). Sorry I can't let you have the source that shows this, it contains proprietry code.



well, if you can make a small testcase that crashes the debugger, I'll be glad to fix it... I need to reproduce to find the bug.

Quote:


Drill down is nice but it would be more intuitive to use a control with a + indicating expansion available.....


Indeed. I'll look for it, if it's possible to add.

Quote:


It would be nice to have more buttons ('Stop' would be useful and 2 minutes to add). 'Pause' or the ability to add checkpoints while running would greatly enhance things (Eclipse manages the latter, try cribbing their code Smile ).


Well... the button are easy, ok... I can add them.
About the checkpoints/breakpoints added on running debugger, that's another matter, gdb is quite picky on asynchronous mode
and I've got already problems (not all solved) about.
Anyways, you can now stop app with "asynchronous break", set your breakpoints and restart again. Beware, it still has some problems with MT apps.

Quote:


The 'Stable' debugger has a bug. Select reference/ColumnList. Put breakpoint in TestWind::Layout. When BP hit, click 'Autos' tab. 'Attempt to use type name in expression' is displayed briefly and execution continues.


well, the "stable" version is now updated and will be replaced by the MI2 one as default; I plan to do bugfixes just on latter.

Thank you for feedback !

Max
Re: IDE debugger hangs on GuiMT example [message #36225 is a reply to message #36115] Mon, 14 May 2012 18:37 Go to previous messageGo to next message
mdelfede is currently offline  mdelfede
Messages: 1259
Registered: September 2007
Senior Contributor
About the mouse grabbing problem of X11 above, a quick and dirty workaround is to put those lines juse BEFORE the breakpoint :

	XUngrabPointer(Xdisplay, CurrentTime);
	XUngrabKeyboard(Xdisplay, CurrentTime);
	XFlush(Xdisplay);
	user code                 <--breakpoint on THIS LINE


This will ungrab mouse just before gdb takes control.
I'll try to find a more automatic solution from inside GDB, with some helpers in user code.

Ciao

Max
Re: IDE debugger hangs on GuiMT example [message #36227 is a reply to message #36115] Mon, 14 May 2012 20:50 Go to previous messageGo to next message
mdelfede is currently offline  mdelfede
Messages: 1259
Registered: September 2007
Senior Contributor
Better solution... I would say it's solved if/when a small helper code is embedded in Upp CtrlCore :

#ifdef _DEBUG
void _DBG_Ungrab(void)
{
	XUngrabPointer(Xdisplay, CurrentTime);
	XUngrabKeyboard(Xdisplay, CurrentTime);
	XFlush(Xdisplay);
}
#endif


In the meanwhile, if you need you can drop the following code somewhere in your debugged application :

NAMESPACE_UPP
#ifdef _DEBUG
void _DBG_Ungrab(void)
{
	XUngrabPointer(Xdisplay, CurrentTime);
	XUngrabKeyboard(Xdisplay, CurrentTime);
	XFlush(Xdisplay);
}
#endif
END_UPP_NAMESPACE


and you'll see that the problem is gone.
Gdb_MI2 will take care of mouse grabbing unlock every time the application is stopped.

Mirek, could you please add this one to CtrlCore ? I put into X11App.cpp, but any cpp inside CtrlCore should be good.

Ciao

Max
Re: IDE debugger hangs on GuiMT example [message #36338 is a reply to message #36227] Mon, 21 May 2012 10:16 Go to previous messageGo to next message
mdelfede is currently offline  mdelfede
Messages: 1259
Registered: September 2007
Senior Contributor
Solved, now GDB ungrabs X when stopping.

Please mark post as SOLVED.

Max

[Updated on: Mon, 21 May 2012 10:17]

Report message to a moderator

Re: IDE debugger hangs on GuiMT example [message #36370 is a reply to message #36338] Wed, 23 May 2012 08:28 Go to previous messageGo to next message
awksed is currently offline  awksed
Messages: 39
Registered: April 2012
Member
Hi Max,

Good job.

I've been using the MS Windows IDE. It appears to be more advanced/stable than the *nix version, especially the debugger 'Variables' display.
Cheers.

Jan

P.S.

SOLVED

[Updated on: Wed, 23 May 2012 08:35]

Report message to a moderator

Re: IDE debugger hangs on GuiMT example [message #36395 is a reply to message #36370] Wed, 23 May 2012 20:45 Go to previous messageGo to next message
mdelfede is currently offline  mdelfede
Messages: 1259
Registered: September 2007
Senior Contributor
awksed wrote on Wed, 23 May 2012 08:28

Hi Max,

Good job.

I've been using the MS Windows IDE. It appears to be more advanced/stable than the *nix version, especially the debugger 'Variables' display.
Cheers.

Jan



Did you test the latest GDB version ? It has many improvements.

Quote:


P.S.

SOLVED


Hem... I meant to endit first post adding SOLVED to title Smile

Ciao

Max
Re: IDE debugger hangs on GuiMT example [message #39292 is a reply to message #36115] Sun, 10 March 2013 13:08 Go to previous messageGo to next message
Alboni is currently offline  Alboni
Messages: 182
Registered: January 2012
Location: Deventer, Netherlands
Experienced Member
On my computer theide hangs right after starting the app if I use a breakpoint anywhere in the program, even if the breakpoint was never triggered. If I don't kill TheIde withing 15 second or so I'd also have to reboot my computer.
That makes the debugger pretty much useless except for investigating crashes.
5485 on XP/msvc 10
Re: IDE debugger hangs on GuiMT example [message #41562 is a reply to message #39292] Mon, 30 December 2013 16:30 Go to previous message
Alboni is currently offline  Alboni
Messages: 182
Registered: January 2012
Location: Deventer, Netherlands
Experienced Member
For who missed it (and still want to use XP till april)
The solution for Windows XP can be found here.
Previous Topic: gcc.bm file for Xubuntu
Next Topic: Build a project composed by multiple shared libs
Goto Forum:
  


Current Time: Wed Nov 13 14:00:16 CET 2019

Total time taken to generate the page: 0.02687 seconds