Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Qt Creator and other tools
  4. Debugging an imported project is not working in QTcreator
Forum Updated to NodeBB v4.3 + New Features

Debugging an imported project is not working in QTcreator

Scheduled Pinned Locked Moved Qt Creator and other tools
6 Posts 2 Posters 4.7k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • G Offline
    G Offline
    ginovh
    wrote on last edited by
    #1

    Hi,

    I use QTCreator together with an imported project ( import project >> import existing project ).
    The project actually builds a shared library that is loaded by another executable that is build outside QTcreator ( I don't have sources of it )
    I can build the lib and run from QTcreator ( by setting correct Project run settings).
    But it doesn't break at breakpoint's. ( lib is compiled with -g ). In the debugger window I see the message it can't find xxx.cpp source file. Not sure if this is related.

    Debugger works on other projects so I think my setup is ok.
    I use QTcreator 2.5 RC with QT 4.8.0 on CentOS ( gcc 4.1.2, gdb 7.0.1)

    Any hint/idea on what could be wrong?

    By the way I tried to build gdb myself ( to have a more recent version ) with the instructions "here":http://qt-project.org/wiki/QtCreatorBuildGdb

    But it went wrong with the patches. Not sure if "these patches":http://download.qt.nokia.com/misc/gdb/7.2/build/ are ok:

    Thanks,

    Best regards,

    Gino

    1 Reply Last reply
    0
    • A Offline
      A Offline
      apoenitz
      wrote on last edited by
      #2

      You can try to use "Use Full Path" in the "Advanced" option block of the breakpoint properties (right-click on the breakpoint in the Brealpoints view) and check whether it makes a difference. If not, please attach the full debugger log (contents of the right pane of Windows->Views->Debugger Log)

      In any case, the "official" minimal requirement for a gdb that can be used with Qt Creator 2.4 is 7.2. Suitable pre-built binaries are on http://download.qt.nokia.com/misc/gdb/7.2/ and http://builds.qt-project.org/. An plain build from unpatched 7.4 and 7.4.1 sources also works well. Make sure to have python development packages installed when configuring gdb, it will compile without complaints, but the result won't be usable with Qt Creator.

      1 Reply Last reply
      0
      • G Offline
        G Offline
        ginovh
        wrote on last edited by
        #3

        Thanks for the reply.

        Setting "Use Full Path” and using gdb 7.4.1 doesn't help.

        By the way, I have a simple project which uses dynamically loaded libraries and this works perfect. ( I mimmick in this project my real project as close as possible, like also building in a seperate dir etc.).

        Is there something I could/should set in .gdbinit etc?

        1 Reply Last reply
        0
        • A Offline
          A Offline
          apoenitz
          wrote on last edited by
          #4

          It should use "set breakpoint pending on", but that's set by default in Creator, so there's no need to modify .gdbinit. Can you please put the Debugger Log somewhere?

          1 Reply Last reply
          0
          • G Offline
            G Offline
            ginovh
            wrote on last edited by
            #5

            I put debugger log "Here...":http://www.2shared.com/document/0TrCbclG/dbg_log.html

            Some explanation:
            mdb is main program, which dynamically loads the library i want to debug. I don't have sources for mdb. I can put breakpoint at main() where debugger does stop. ( this is not what I want though)

            libsim.so is the dynamical lib I build in QtCreator and want to debug. I put breakpoint in test.cpp:1284, at which debugger doesn't break.

            Any idea?

            1 Reply Last reply
            0
            • A Offline
              A Offline
              apoenitz
              wrote on last edited by
              #6

              Starting with a side note:

              @>~" ^\n"

              ~"SyntaxError: invalid syntax\n"
              &"Error while executing Python code.\n"
              @

              This looks like the version of python your gdb uses is too old from Qt Creator's point of view. 2.6 is minimum. You won't have much fun with that setup further down the road.

              Having said that, the breakpoint setting should work. The issued commands are ok, and work in a similar setup using "stock" GNU gdb (GDB) 7.0.1 for me (just tested)

              @>31^done,BreakpointTable={nr_rows="1",...],body=[bkpt={number="1",type="breakpoint",disp="keep",enabled="y",addr="0x03f1b4d5",func="pluginTest",file="simple_test_plugin.cpp",fullname="/data/dev/creator/tests/manual/debugger/simple/simple_test_plugin.cpp",line="40",times="1",original-location="\"simple_test_plugin.cpp":40"}]}
              @

              Are you sure your .so has debug information?

              1 Reply Last reply
              0

              • Login

              • Login or register to search.
              • First post
                Last post
              0
              • Categories
              • Recent
              • Tags
              • Popular
              • Users
              • Groups
              • Search
              • Get Qt Extensions
              • Unsolved