Debugging and testing Kodi
#1
Over the years I have built full versions of Kodi in linux for speed and also built and debugged in Windows because it was so easy to run portable mode and have many versions installed at the same time.   Is  linux portable mode always configured to point to the compiled install folder or can I easily change this without using symlinks?

Another question debugging Kodi and pvr addons on Windows is very wasy in Visual Studio but I have never found gdb to be as easy. Does anyone who has used both found away to improve the linux experience and maybe offer me some tips.

Thanks.

Martin
Reply
#2
Me again!!

Yes, portable mode points to the build directory.  So if your build dir is 'kodi-build' then executing ./kodi-x11 -p inside there will create kodi-build/portable_data/userdata etc.  It's hard-coded in the settings https://github.com/xbmc/xbmc/blob/master...t.cpp#L248

I used to use ddd as a frontend for gdb but it's variable display is somewhat difficult to follow at times.  Eclipse is better and shows me a nice backtrace of what called what along with all the threads running/paused.  I still have issues occasionally with it getting stuck in the wrong thread but I think that's more down to gdb. Breakpoints and watches are easy to set and it displays variables much better than ddd.  It also has github integration which is handy.  I don't like its editor though so I use Geany for writing stuff in and only run the code in Eclipse if I know I'm going to need to break into it for some reason.
Learning Linux the hard way !!
Reply
#3
Ok so I guess symlinks with scripts seems to be the solution.

I am not a fan of Eclipse either but I can continue with VS code  The issue for me is finding documentation on how to compile both kodi and pvr-nextpvr for debugging and load them into Eclipse so I can trace the addon execution with breakpoints.  Visual Studio does this so well and so easily.

Martin
Reply
#4
Hmmm, lots of instances of Kodi installs might not be trivial to achieve on Ubuntu.  I have two, a system-wide normal install and a portable version in the build directory.  My build commands include the stuff needed for Eclipse and are as follows :-

Configure release version - cmake ../xbmc -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_BUILD_TYPE=Release -DPYTHON_INCLUDE_DIR=/usr/include/python3.7m -DPYTHON_LIBRARY=/usr/lib/x86_64-linux-gnu/libpython3.7m.so -DX11_RENDER_SYSTEM=gl

Note that on Ubuntu, if you configure and build for a system wide install (-DCMAKE_INSTALL_PREFIX=/usr) Kodi will not run in portable mode.  If you try, it will fail with an error regarding logging.  This is because of permissions problems.

Configure debug version which includes all the Eclipse stuff necessary (executable will be much larger as it contains all the debug symbols) - cmake -G"Eclipse CDT4 - Unix Makefiles" -DCMAKE_ECLIPSE_GENERATE_SOURCE_PROJECT=TRUE ../xbmc -DCMAKE_INSTALL_PREFIX=/usr/local -DCMAKE_BUILD_TYPE=Debug -DPYTHON_INCLUDE_DIR=/usr/include/python3.7m -DPYTHON_LIBRARY=/usr/lib/x86_64-linux-gnu/libpython3.7m.so -DX11_RENDER_SYSTEM=gl -DENABLE_MARIADBCLIENT=ON  - obviously, mariadb is a personal setting that you probably don't need.

Build Kodi according to how you have configured the build Build release version - [inline]time cmake --build . -- VERBOSE=1 -j5 - There is no need for timing it unless you want to and you can adjust how many cores to build on with the number after -j

It's been a while since I last built an addon from source, and that was TVHeadend when I moved my main install to v19.  I seem to remember that I had no issues with building it by following the github instructions, but I have a feeling that it installed into the wrong place and that I had to copy it somewhere else.  Certainly, I remember it not working initially and still picking up the old version.
Learning Linux the hard way !!
Reply

Logout Mark Read Team Forum Stats Members Help
Debugging and testing Kodi0