<html>
  <head>
    <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
  </head>
  <body text="#000000" bgcolor="#FFFFFF">
    <div class="moz-cite-prefix">Myriam Schweingruber wrote:<br>
      > Disclaimer: I am not a coder, I just understand some code
      when I see
      it, but can't <br>
      > write well enough to be useful as a dev.
      <br>
      <br>
      No worries, your patience with me is appreciated all the same!<br>
      <br>
      > I don't really see the reason to set breakpoints in main.cpp,
      as this
      only calls the<br>
      >  other modules needed to execute Amarok, <br>
      <br>
      Just a proof of concept. When testing a new IDE, a new debugger
      etc, fairly standard practice to fire up the app and trest a
      break, and play around in the IDE to inspect vars, stack and
      single step and so on. Baby steps. The only place you KNOW the app
      is going to is main(), so you break on line 1 there to get
      rolling. <br>
      <br>
      <code>> </code>so if that
      execution doesn't happen, of course your breakpoints will not be
      reached. <br>
      > A lot of services are started when Amarok starts, as well as
      the database initialisation, <br>
      > the GUI drawing, the existing playlist
      reading, etc, so there are a lot of things that will <br>
      > happen before any
      of your breakpoint is reached.
      <br>
      <br>
      Understanding all that is useful. Is there an Amarok bootstrap
      guide? Where is all that happening? In
      <meta http-equiv="content-type" content="text/html; charset=utf-8">
      "KUniqueApplication::start( startFlag )"?<br>
      <br>
      Should I do some reading of KDE?<br>
      <br>
      >Maybe have a look at the architecture of Amarok, there is a
      nice map
      in the source tree Ralf<br>
      > made a few years back, that might give you
      some more information about the structure of<br>
      > Amarok.<br>
      <br>
      Do you mean this stuff: ~/kde/src/amarok/HACKING/architecture?<br>
      <br>
      If so, anything and everything is always appreciated, but lacks a
      startup walkthrough.<br>
      <br>
      > There are over
      500'000 lines of code in Amarok, it is quite a complex beast, and
      I
      doubt main.cpp<br>
      > will help you much as a starter. Looking at a specific
      element of Amarok (GUI, services, playlist, <br>
      > browser, database, etc)
      might be more useful.
      <br>
      <br>
      Agreed, but I can't break anywhere else that be the problem. I
      just retired a few ways and here is the result:<br>
      <br>
      1) I can build and run in QtCreator - all fine.<br>
      <br>
      2) I can debug and two amarok processes and a gdb process are
      visible but I never see a UI nor System tray icon (but if I run,
      not debug both appear reliably). <br>
      <br>
      3) If I set a breakpoint at start of main() and debug, then
      QtCreator throws me into the editor at that line when it breaks
      and I can examine variables without trouble. If I continue, same
      as 2). I see one gdb and two amarok processes running (ps) when
      interrupted.<br>
      <br>
      4) If I run "gdb amarok" on the binary (in ~/kde/build/amarok/src)
      and "run" the UI and System Tray icon fire up fine. <br>
      <br>
      5)If I set a breakpoint at line 127 in MainWindow.cpp (the
      constructor for MainWindow) and debug in QtCreator same as 2)
      above.<br>
      <br>
      6) If I try similar in gdb I get:<br>
      <blockquote>(gdb) break MainWindow::MainWindow<br>
        Function "MainWindow::MainWindow" not defined.<br>
        Make breakpoint pending on future shared library load? (y or
        [n])<br>
      </blockquote>
      which hints at an issue. If I say yes and run, then the UI and Sys
      Tray icon fire up I can interact with Amarok but the breakpoint
      never triggers. And that may well relate to QtCreators issue, but
      Qt Creator won't even fire up the UI alas in debug mode. The <b>Application
        output </b>in  QtCreator shows only:<br>
      <br>
      <meta name="qrichtext" content="1">
      <p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Monospace'; font-size:9pt; font-weight:600; color:#0b0bb5;">Debugging starts</span></p>
      <p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Monospace'; font-size:9pt; color:#212121;">&"warning: GDB: Failed to set controlling terminal: Inappropriate ioctl for device\n"</span><!--EndFragment--></p>
      <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
      <style type="text/css">
p, li { white-space: pre-wrap; }
</style><br>
      If you can break on any line in the UI code, nominate one (file
      and line number) and I'll try and do same. <br>
      <br>
    </div>
    Thanks enormously for the support Myriam. Anyone with a working
    QtCreator who can break anywhere in Amarok can help me here by
    holding my hand in a sense through the experience. I'm getting no
    joy yet.<br>
    <br>
    My theory is  simple:<br>
    <br>
    a) Amarok is big and developed<br>
    b) Therefore people have been developing it<br>
    c) I presume them to use an IDE with debugging to do so<br>
    d) These people seem to use QtCreator dominantly<br>
    e) It must work, either out of the box or with special Amarok tweaks
    therefore<br>
    f) I need to find someone who can do it, and has the time and
    patience to walk through it with me to help find why I can't.<br>
    <br>
    This is a roadblock for me alas. <br>
    <br>
    Regards,<br>
    <br>
    Bernd.<br>
  </body>
</html>