Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Installation and Deployment
  4. Unable to debug program, on raspberry Pi 3 from QT
Forum Updated to NodeBB v4.3 + New Features

Unable to debug program, on raspberry Pi 3 from QT

Scheduled Pinned Locked Moved Solved Installation and Deployment
11 Posts 2 Posters 4.9k Views
  • 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
    linuxTown
    wrote on 17 Mar 2018, 20:14 last edited by
    #1

    Hi,

    I am having trouble debugging program on Raspberry pi 3 via gdb. I cross compile, from Ubuntu machine to raspberry.
    I followed tutorials from here:
    https://medium.com/@amirmann/how-to-cross-compile-qt-for-raspberry-pi-3-on-linux-ubuntu-for-beginners-75acf2a078c
    and
    https://fecub.wordpress.com/2018/01/15/compile-qt-for-raspberry-pi/

    If I try to run without debugging, program builds successfully, it deploys, I can start it on raspberry, but if I try to run and debug from qt I receive these messages:

    Checking available ports...
    Found 101 free ports.
    Starting gdbserver...
    Debugging starts

    Listening on port 10001
    Remote debugging from host 192.168.0.103
    Process /home/pi/Program created; pid = 5062
    Remote side has terminated connection. GDBserver will reopen the connection.
    Listening on port 10001
    Debugging has finished

    I am using gdb multiarch on Ubuntu and gdbserver from apt-get on raspberry. Every time I try to debug, new port opens and I receive same message. What could be wrong?

    A 1 Reply Last reply 17 Mar 2018, 21:08
    0
    • L linuxTown
      17 Mar 2018, 20:14

      Hi,

      I am having trouble debugging program on Raspberry pi 3 via gdb. I cross compile, from Ubuntu machine to raspberry.
      I followed tutorials from here:
      https://medium.com/@amirmann/how-to-cross-compile-qt-for-raspberry-pi-3-on-linux-ubuntu-for-beginners-75acf2a078c
      and
      https://fecub.wordpress.com/2018/01/15/compile-qt-for-raspberry-pi/

      If I try to run without debugging, program builds successfully, it deploys, I can start it on raspberry, but if I try to run and debug from qt I receive these messages:

      Checking available ports...
      Found 101 free ports.
      Starting gdbserver...
      Debugging starts

      Listening on port 10001
      Remote debugging from host 192.168.0.103
      Process /home/pi/Program created; pid = 5062
      Remote side has terminated connection. GDBserver will reopen the connection.
      Listening on port 10001
      Debugging has finished

      I am using gdb multiarch on Ubuntu and gdbserver from apt-get on raspberry. Every time I try to debug, new port opens and I receive same message. What could be wrong?

      A Offline
      A Offline
      aha_1980
      Lifetime Qt Champion
      wrote on 17 Mar 2018, 21:08 last edited by
      #2

      Hi @linuxTown

      can you please post the contents of Window > Views > Debugger Log? It may contain more information to isolate the problem.

      Regards

      Qt has to stay free or it will die.

      L 1 Reply Last reply 17 Mar 2018, 21:29
      0
      • A aha_1980
        17 Mar 2018, 21:08

        Hi @linuxTown

        can you please post the contents of Window > Views > Debugger Log? It may contain more information to isolate the problem.

        Regards

        L Offline
        L Offline
        linuxTown
        wrote on 17 Mar 2018, 21:29 last edited by
        #3

        Hi, @aha_1980

        I pasted output here:
        https://pastebin.com/Lt3kjMTM

        One of the lines says, that executable was not found, but there is, I can see it and run it on my pi.

        A 1 Reply Last reply 17 Mar 2018, 21:37
        0
        • L linuxTown
          17 Mar 2018, 21:29

          Hi, @aha_1980

          I pasted output here:
          https://pastebin.com/Lt3kjMTM

          One of the lines says, that executable was not found, but there is, I can see it and run it on my pi.

          A Offline
          A Offline
          aha_1980
          Lifetime Qt Champion
          wrote on 17 Mar 2018, 21:37 last edited by
          #4

          @linuxTown

          I don't see any obvious, except the "path not found" errors.

          Can you check that the path to your executable does not contain spaces or other special characters?

          Qt has to stay free or it will die.

          L 1 Reply Last reply 18 Mar 2018, 07:09
          0
          • A aha_1980
            17 Mar 2018, 21:37

            @linuxTown

            I don't see any obvious, except the "path not found" errors.

            Can you check that the path to your executable does not contain spaces or other special characters?

            L Offline
            L Offline
            linuxTown
            wrote on 18 Mar 2018, 07:09 last edited by
            #5

            @aha_1980

            There aren't any special characters in path, and no spaces...
            alt text

            I am just a begginer, so it's hard to know whats wrong.

            And what about these lines? Are they related to file not being found?
            //---------------------
            ...

            ~"/build/gdb-9un5Xp/gdb-7.11.1/gdb/thread.c:982: internal-error: is_thread_state: Assertion tp' failed.\nA problem internal to GDB has been detected,\nfurther debugging may prove unreliable.\nQuit this debugging session? " ~"(y or n) [answered Y; input not from terminal]\n" &"\nThis is a bug, please report it." &" For instructions, see:\n<http://www.gnu.org/software/gdb/bugs/>." &"\n\n" ~"/build/gdb-9un5Xp/gdb-7.11.1/gdb/thread.c:982: internal-error: is_thread_state: Assertion tp' failed.\nA problem internal to GDB has been detected,\nfurther debugging may prove unreliable.\nCreate a core file of GDB? "
            dQUIT DEBUGGER REQUESTED IN STATE 19
            ~"(y or n) [answered Y; input not from terminal]\n"

            dHANDLE GDB ERROR: The process was ended forcefully.
            dProcess crashed
            ....
            //------------------------------------

            A 1 Reply Last reply 18 Mar 2018, 07:38
            0
            • L linuxTown
              18 Mar 2018, 07:09

              @aha_1980

              There aren't any special characters in path, and no spaces...
              alt text

              I am just a begginer, so it's hard to know whats wrong.

              And what about these lines? Are they related to file not being found?
              //---------------------
              ...

              ~"/build/gdb-9un5Xp/gdb-7.11.1/gdb/thread.c:982: internal-error: is_thread_state: Assertion tp' failed.\nA problem internal to GDB has been detected,\nfurther debugging may prove unreliable.\nQuit this debugging session? " ~"(y or n) [answered Y; input not from terminal]\n" &"\nThis is a bug, please report it." &" For instructions, see:\n<http://www.gnu.org/software/gdb/bugs/>." &"\n\n" ~"/build/gdb-9un5Xp/gdb-7.11.1/gdb/thread.c:982: internal-error: is_thread_state: Assertion tp' failed.\nA problem internal to GDB has been detected,\nfurther debugging may prove unreliable.\nCreate a core file of GDB? "
              dQUIT DEBUGGER REQUESTED IN STATE 19
              ~"(y or n) [answered Y; input not from terminal]\n"

              dHANDLE GDB ERROR: The process was ended forcefully.
              dProcess crashed
              ....
              //------------------------------------

              A Offline
              A Offline
              aha_1980
              Lifetime Qt Champion
              wrote on 18 Mar 2018, 07:38 last edited by
              #6

              @linuxTown the lines may be related to your problem, but let's check first the project path on your host PC also. does the program has the same name there?

              Qt has to stay free or it will die.

              L 1 Reply Last reply 18 Mar 2018, 07:52
              0
              • A aha_1980
                18 Mar 2018, 07:38

                @linuxTown the lines may be related to your problem, but let's check first the project path on your host PC also. does the program has the same name there?

                L Offline
                L Offline
                linuxTown
                wrote on 18 Mar 2018, 07:52 last edited by
                #7

                @aha_1980

                I just recreated project, from scratch, now I can go a bit further. Program has same name on host and raspberry. The path to project is a bit diferent, its in:
                /home/tt/build-Project-Raspberry_pi-Debug/Program

                Now if I try to debug, I receive this message:

                alt text

                and here is the log:
                https://pastebin.com/dtZFcgBc

                A 1 Reply Last reply 18 Mar 2018, 08:24
                0
                • L linuxTown
                  18 Mar 2018, 07:52

                  @aha_1980

                  I just recreated project, from scratch, now I can go a bit further. Program has same name on host and raspberry. The path to project is a bit diferent, its in:
                  /home/tt/build-Project-Raspberry_pi-Debug/Program

                  Now if I try to debug, I receive this message:

                  alt text

                  and here is the log:
                  https://pastebin.com/dtZFcgBc

                  A Offline
                  A Offline
                  aha_1980
                  Lifetime Qt Champion
                  wrote on 18 Mar 2018, 08:24 last edited by
                  #8

                  @linuxTown yeah, looks better. could you try a non-GUI aka console program first ?

                  Qt has to stay free or it will die.

                  L 2 Replies Last reply 18 Mar 2018, 13:34
                  0
                  • A aha_1980
                    18 Mar 2018, 08:24

                    @linuxTown yeah, looks better. could you try a non-GUI aka console program first ?

                    L Offline
                    L Offline
                    linuxTown
                    wrote on 18 Mar 2018, 13:34 last edited by
                    #9

                    @aha_1980

                    Thank you for helping, I just found in this tutorial comments solution:
                    https://www.baldengineer.com/raspberry-pi-gui-tutorial.html

                    It appears, I was missing $DISPLAY variable.
                    I just did these steps:
                    – sudo nano ~/.profile
                    – I added the following line to the end: export DISPLAY=:0
                    – Reboot: sudo reboot <–This is a must!!!!!

                    Now I am able to run with debugger. But now, when I add breakpoint in code I once again get new error :/

                    Listening on port 10001
                    Remote debugging from host 192.168.0.103
                    Process /home/pi/Project created; pid = 967
                    libEGL warning: DRI2: failed to authenticate
                    Could not load shared library symbols for /usr/lib/arm-linux-gnueabihf/libtxc_dxtn.so.
                    Do you need "set solib-search-path" or "set sysroot"?

                    If I can't find solution, then I will try console program.

                    1 Reply Last reply
                    0
                    • A aha_1980
                      18 Mar 2018, 08:24

                      @linuxTown yeah, looks better. could you try a non-GUI aka console program first ?

                      L Offline
                      L Offline
                      linuxTown
                      wrote on 18 Mar 2018, 14:30 last edited by
                      #10

                      @aha_1980

                      I just used code form this website and now I can run program and debug it, finally :)

                      https://catonrug.blogspot.lt/2018/01/libegl-warning-dri2-failed-authenticate.html

                      A 1 Reply Last reply 18 Mar 2018, 14:33
                      1
                      • L linuxTown
                        18 Mar 2018, 14:30

                        @aha_1980

                        I just used code form this website and now I can run program and debug it, finally :)

                        https://catonrug.blogspot.lt/2018/01/libegl-warning-dri2-failed-authenticate.html

                        A Offline
                        A Offline
                        aha_1980
                        Lifetime Qt Champion
                        wrote on 18 Mar 2018, 14:33 last edited by
                        #11

                        @linuxTown: Cool - Thanks for your feedback.

                        So please mark this thread as solved now.

                        Qt has to stay free or it will die.

                        1 Reply Last reply
                        1

                        1/11

                        17 Mar 2018, 20:14

                        • Login

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