← Back to team overview

unity-dev team mailing list archive

Re: [Ayatana-dev] Debugging Unity-2d QML

 

On Monday, April 11, 2011 04:57:44 PM Ugo Riboni wrote:
>  > On the other hand, if I try and run unity-2d-spread from qt creator it
> > 
> > doesn't start properly, and doesn't log anything in the Application
> > Output pane to explain why either. I had assumed this was because it
> > wasn't running as root.
> 
> I normally run all the unity-2d-* applications from qtcreator in debug
> or non debug mode without trouble.
> What do you mean that "it doesn't start properly" ? There's no process
> launched or the process is there but you see no output ? Or something else
> ?
The problem was that I was building unity-2d outside of the source tree, in 
unity-2d/build. The code for isRunningInstalled() and unity2dDirectory() is 
assuming that the project has been built 'in situ' in the source tree. I 
needed to copy the qmldir files, qml files and icons across to the build area. 
It should be possible to add some statements to the CMakeLists.txt files to do 
that automatically (or I'll just switch to building in the source tree).

So I finally got unity-2d-spread to run under the qml debugger in Qt Creator, 
but unfortunately it didn't tell me anything when the crash happened. I tried 
running it under valgrind and that didn't tell me anything either. Then I 
discovered a gdb command called 'catch throw' which allows you to break at the 
point where an exception is thrown and so I've finally been able to find out 
which code was causing the std::bad_alloc exception.

> >> Second, you don't need launcher and panel to be started by the session,
> >> if all you need is to debug them.
> >> What you can do is to change the
> >> /usr/share/applications/unity-2d-launcher and change the line with the
> >> name of the executable to something that doesn't exist (to prevent the
> >> session from starting it).
> >> Then log out of your session and log in again. Press ctrl+alt+t to start
> >> a new terminal and launch qtcreator from there, then start your launcher
> >> under a debugger.
> > 
> > Yes, I assume you mean /usr/share/applications/unity-2d-launcher.desktop
> > above. I've got the various binaries that are normally exec'd by the
> > .desktop files replaced with custom shell scripts and that is working
> > well. I can also try your suggestion of making the .desktop files try to
> > run a non-existent binary.
> 
> Olivier's solution in this thread is probably cleaner. I would follow
> that one.
Yes, that sounds a tidy way to do it - I didn't realize that gnome-session 
didn't have to start the unity-2d processes.

-- Richard



Follow ups

References