Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Debug a plugin [Solved]
Forum Updated to NodeBB v4.3 + New Features

Debug a plugin [Solved]

Scheduled Pinned Locked Moved General and Desktop
5 Posts 2 Posters 4.2k 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.
  • L Offline
    L Offline
    luca
    wrote on 1 Jun 2011, 14:24 last edited by
    #1

    Hi all,
    I'm continuing in my tests with library and plugin.

    I'm working under Linux.
    Now I compiled a simple plugin (".so") but obviously it isn't impossible to execute it.

    In my main application I load the plugin this way:

    @
    QPluginLoader plugin_loader(dir_plugin.absoluteFilePath(nome_file));
    QObject *plugin = plugin_loader.instance();
    if (plugin)
    {
    PluginInterface *plugin_widget = qobject_cast<PluginInterface *>(plugin);
    if (plugin_widget)
    {
    QWidget *widget = plugin_widget->createWidget();
    widget->show();
    ....
    ....
    }
    }
    @

    It works fine but how can I debug (stepping between instruction) the plugin?

    1 Reply Last reply
    0
    • F Offline
      F Offline
      Franzk
      wrote on 1 Jun 2011, 14:27 last edited by
      #2

      As far as I know, if you built the plug-in with -g (debug mode), you should be able to tell gdb to place breakpoints there without any trouble. I've never experienced any trouble using this approach.

      "Horse sense is the thing a horse has which keeps it from betting on people." -- W.C. Fields

      http://www.catb.org/~esr/faqs/smart-questions.html

      1 Reply Last reply
      0
      • L Offline
        L Offline
        luca
        wrote on 1 Jun 2011, 14:30 last edited by
        #3

        [quote author="Franzk" date="1306938438"]As far as I know, if you built the plug-in with -g (debug mode), you should be able to tell gdb to place breakpoints there without any trouble. I've never experienced any trouble using this approach.[/quote]

        The problem is that in my main application I haven't included plugin source so how can I put breakpoints in it using Qt Creator?

        1 Reply Last reply
        0
        • F Offline
          F Offline
          Franzk
          wrote on 1 Jun 2011, 14:34 last edited by
          #4

          You need access to the source for it to work. Maybe "specifying the source directory":http://inside.mines.edu/fs_home/lwiencke/elab/gdb/gdb_49.html of the plug-in could help you further.

          "Horse sense is the thing a horse has which keeps it from betting on people." -- W.C. Fields

          http://www.catb.org/~esr/faqs/smart-questions.html

          1 Reply Last reply
          0
          • L Offline
            L Offline
            luca
            wrote on 1 Jun 2011, 14:38 last edited by
            #5

            [quote author="Franzk" date="1306938845"]You need access to the source for it to work. Maybe "specifying the source directory":http://inside.mines.edu/fs_home/lwiencke/elab/gdb/gdb_49.html of the plug-in could help you further.[/quote]

            Thanks Franzk,
            I solved navigating with Qt Creator (while opened main application project) in the source of the plugin, opening the .cpp an putting the breakpoints.

            1 Reply Last reply
            0

            1/5

            1 Jun 2011, 14:24

            • Login

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