Breakpoints never reached in main.cpp, when they really should be

Myriam Schweingruber myriam at kde.org
Tue Mar 22 12:26:38 UTC 2016


Hi Bernd,

On Tue, Mar 22, 2016 at 6:23 AM, Bernd Wechner <bwechner at yahoo.com> wrote:
> OK, am stepping through amarok code in QtCreator and find the most bizarre
> behaviour as follows.
>
> Using the latest git snapshot from git://anongit.kde.org/amarok.git
>
> in main.cpp I can set a breakpoint at line 300 which reads:
>
>     if( !KUniqueApplication::start( startFlag ) )
>
> I can set breakpoints anywhere after this in main.cpp and they are never
> reached. If I single step over line 300, it amarok UI just fires up and
> enters its wait loop for events.
>
> This strikes me as particularly odd as it is not until line 329:
>
>     return app.exec();
>
> that it looks like the app is fired up proper and this looks suspsciously
> like a debugging issue with QtCreator.

Disclaimer: I am not a coder, I just understand some code when I see
it, but can't write well enough to be useful as a dev.

I don't really see the reason to set breakpoints in main.cpp, as this
only calls the other modules needed to execute Amarok, so if that
execution doesn't happen, of course your breakpoints will not be
reached. A lot of services are started when Amarok starts, as well as
the database initialisation, the GUI drawing, the existing playlist
reading, etc, so there are a lot of things that will happen before any
of your breakpoint is reached.

Maybe have a look at the architecture of Amarok, there is a nice map
in the source tree Ralf made a few years back, that might give you
some more information about the structure of Amarok. There are over
500'000 lines of code in Amarok, it is quite a complex beast, and I
doubt main.cpp will help you much as a starter. Looking at a specific
element of Amarok (GUI, services, playlist, browser, database, etc)
might be more useful.

My knowledge of Amarok comes from years of looking at bug reports, so
maybe looking at some specific crash for example could also be helpful
to get a first grasp.

Hope this helps.

Regards, Myriam

-- 
Proud member of the Amarok and KDE Community
Protect your freedom and join the Fellowship of FSFE:
http://www.fsfe.org
Please don't send me proprietary file formats,
use ISO standard ODF instead (ISO/IEC 26300)


More information about the Amarok-devel mailing list