I am trying to use DS-5 debugger to debug remotely an OpenCV code, that simply reads and displays an image. The target platform is Hardkernel ODROID-XU4 SBC running on Ubuntu 18.04, and the host is a Windows 7 host PC. Everything works just fine and I can debug and step into different regions in my program, however, when I try to display the image in my PC, I get the error depicted in the following debug log
Preparing the debug session # cd "/home/bin" # export LD_LIBRARY_PATH=".:$LD_LIBRARY_PATH" # gdbserver :5000 "./opencv_cross_tutorial" Process ./opencv_cross_tutorial created; pid = 2362 Listening on port 5000 Debug session has been started, connecting to gdbserver Remote debugging from host 192.168.1.36 Unable to init server: Could not connect: Connection refused (Display window:2362): Gtk-[1;33mWARNING[0m **: [34m16:50:47.229[0m: cannot open display: Child exited with status 1
I would like to know, how can I resolve this display error and display the image on my host PC, and how can I export the display to the ODROID since it is connected to an LCD screen ?
Hi Stephan,
I tried the Xaos example, and it yields exactly the same error, here is the debug log
Preparing the debug session # cd "/writeable" # export DISPLAY=":0.0" # export LD_LIBRARY_PATH=".:$LD_LIBRARY_PATH" # gdbserver :5000 "./xaos" -threads 5 -autopilot -streamlinevisualannotation Process ./xaos created; pid = 5017 Listening on port 5000 Debug session has been started, connecting to gdbserver Remote debugging from host 192.168.43.27 Warning gator_func(streamline_annotate.c:496): Not connected to gatord, the application will run normally but Streamline will not collect annotations. To collect annotations, please verify you are running gatord 5.24 or later and that SELinux is disabled. No protocol specified (xaos:5017): Gtk-[1;33mWARNING[0m **: [34m12:37:43.483[0m: cannot open display: :0.0 Child exited with status 1
What is the possible issue here ?
I have found the solution in the web, logging in my odroid as "root" and executing the following command solved the problem
xhost +SI:localuser:root
I can now view the graphical output of my applications either locally or remotely.