Kenneth Binney replied to the topic 'Debugging' in the forum. 12 months ago


Good luck with your project...


Kenneth Binney replied to the topic 'Debugging' in the forum. 12 months ago


This is actually my first post here, so hello everyone...

For me, the issues getting the debugger up and running mainly involved getting qtcreator to set up the relative paths between the indiserver and the INDI driver correctly for GDB.

There seems to be a couple of ways to get debug working - Initially I tried the one involving connecting to the indiserver found under 'usr/bin', but this involves getting from user space to root, which was a bit inconvenient when debugging the device side, (I used the program 'ssh-askpass-gnome' in the end). These days, I connect straight to a user space debug build of the indiserver, it just saves a step.

This is the process I use to get INDI device driver debug working on my Ubuntu 20.04.1 LTS, (gnome) system. I'm using Qt Creator 4.14:

Setup for 'kstars' client side:

From kstars main menu bar:

Tools -> Devices -> Device Manager -> client tab -> Add

Add new 'host':

Name: my_device_name
Host: localhost
Port: 7624

Setup for QtCreator IDE environment:

From top menu Tools -> Options... -> Debugger panel icon -> GDB tab:

In the 'Additional startup commands' window, add the 'follow-fork-mode' GDB command with a parameter of 'child':

follow-fork-mode child

Then on closing this panel, return to the main panel and select the 'Build & Run' panel icon:

Projects -> 'Run' icon -> Run Settings panel -> Run configuration, (with custom Executable selected) ->

Executable: absolute_path_to_debug_indiserver/indiserver
Command-line arguments: -v relative_path_from_indiserver_to_my_device_driver/my_device_driver
Working directory: %{CurrentProject:BuildPath}

All other settings are on defaults, (with the 'debugger settings' set to enable C++, disable QML).

Then to start a debug session:

Build the project, and run the executable, (F5). The 'run' settings should kick off of an instance of the indiserver and attach the driver automatically.

I then start kstars and use the device manager window to connect to the device.

Note: As mentioned above, the indiserver I'm using has already been build using the install script, but I connect to the version in my personal 'indi' build directory, not the final 'installed' location.

I can supply screenshots if that would help.

Ken B.