Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Mobile and Embedded
  4. Unable to debug Android App (Windows + Qt Creator 12 + LLDB)
Forum Updated to NodeBB v4.3 + New Features

Unable to debug Android App (Windows + Qt Creator 12 + LLDB)

Scheduled Pinned Locked Moved Unsolved Mobile and Embedded
169 Posts 9 Posters 68.0k Views 2 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.
  • J JoeCFD
    1 Mar 2024, 21:59

    @Axel-Spoerl Just tested a simple group box example.
    QtCreator 12.0.2
    Ubuntu 22.04
    Qt 6.6.2
    JDK-17
    NDK 21 or 25
    Device: Samsung tablet A-8 with Android 13

    Problem 1: break into disassembler binary with JDK 17. The test case runs fine without breakpoints.
    Problem 2: JDK 11 is not supported anymore. If JDK 11 and Qt 5.15.2 are applied, NDK can not be set-up. For Android 13, JDK 11 is the right selection.

    A Offline
    A Offline
    Axel Spoerl
    Moderators
    wrote on 1 Mar 2024, 22:54 last edited by
    #157

    @JoeCFD
    Does that mean, things break with JDK 17?

    Software Engineer
    The Qt Company, Oslo

    J 1 Reply Last reply 1 Mar 2024, 23:02
    0
    • A Axel Spoerl
      1 Mar 2024, 22:54

      @JoeCFD
      Does that mean, things break with JDK 17?

      J Offline
      J Offline
      JoeCFD
      wrote on 1 Mar 2024, 23:02 last edited by JoeCFD 3 Jan 2024, 23:03
      #158

      @Axel-Spoerl Nope. No break stop in the code, instead in disassembler.

      1 Reply Last reply
      0
      • J JoeCFD referenced this topic on 4 Mar 2024, 01:43
      • C Offline
        C Offline
        cristian-adam
        wrote on 5 Mar 2024, 19:33 last edited by
        #159

        At https://github.com/qt-creator/qt-creator/actions/runs/8161009528 I have artifacts for a fix for the Android debugger issue.

        It's one line of code that brings Qt Creator 13 to the level of Qt Creator 10.

        In my case of MacBook Pro M1 I am getting breakpoints hits and no longer "Waiting for debugger".

        J 1 Reply Last reply 5 Mar 2024, 19:56
        0
        • C cristian-adam
          5 Mar 2024, 19:33

          At https://github.com/qt-creator/qt-creator/actions/runs/8161009528 I have artifacts for a fix for the Android debugger issue.

          It's one line of code that brings Qt Creator 13 to the level of Qt Creator 10.

          In my case of MacBook Pro M1 I am getting breakpoints hits and no longer "Waiting for debugger".

          J Offline
          J Offline
          JoeCFD
          wrote on 5 Mar 2024, 19:56 last edited by JoeCFD 3 May 2024, 19:56
          #160

          @cristian-adam Good news. We have to use 13? No fix in 12?

          C 1 Reply Last reply 5 Mar 2024, 21:33
          0
          • J JoeCFD
            5 Mar 2024, 19:56

            @cristian-adam Good news. We have to use 13? No fix in 12?

            C Offline
            C Offline
            cristian-adam
            wrote on 5 Mar 2024, 21:33 last edited by
            #161

            @JoeCFD At https://wiki.qt.io/Qt_Creator_Releases there is no 12.0.3 release planed.

            But, you can backport the change, is just one liner. Just clone Qt Creator on GitHub, cherry-pick the change and push a release tag to your fork. You will get releases automatically.

            C 1 Reply Last reply 6 Mar 2024, 11:31
            0
            • C cristian-adam
              5 Mar 2024, 21:33

              @JoeCFD At https://wiki.qt.io/Qt_Creator_Releases there is no 12.0.3 release planed.

              But, you can backport the change, is just one liner. Just clone Qt Creator on GitHub, cherry-pick the change and push a release tag to your fork. You will get releases automatically.

              C Offline
              C Offline
              cristian-adam
              wrote on 6 Mar 2024, 11:31 last edited by
              #162

              https://download.qt.io/snapshots/qtcreator/13.0/13.0.0-rc1/78/ has the needed fixes for the working Android debugging.

              J 1 Reply Last reply 6 Mar 2024, 20:39
              0
              • C cristian-adam
                6 Mar 2024, 11:31

                https://download.qt.io/snapshots/qtcreator/13.0/13.0.0-rc1/78/ has the needed fixes for the working Android debugging.

                J Offline
                J Offline
                JoeCFD
                wrote on 6 Mar 2024, 20:39 last edited by
                #163

                @cristian-adam just downloaded it and had a try. The problem is still there.
                Ubuntu 22.04
                Qt 6.6.2
                JDK-17
                NDK 21 or 25

                C 1 Reply Last reply 7 Mar 2024, 09:47
                0
                • J JoeCFD
                  6 Mar 2024, 20:39

                  @cristian-adam just downloaded it and had a try. The problem is still there.
                  Ubuntu 22.04
                  Qt 6.6.2
                  JDK-17
                  NDK 21 or 25

                  C Offline
                  C Offline
                  cristian-adam
                  wrote on 7 Mar 2024, 09:47 last edited by
                  #164

                  @JoeCFD I just gave it a try on my MacBook Pro M1 with:

                  • Qt 6.6.1
                  • Android arm64-v8 emulator image
                  • Android SDK 33
                  • Android NDK 25
                  • OpenJDK-17

                  See the recording at qtcreator13-android33.mp4.

                  A 1 Reply Last reply 7 Mar 2024, 17:37
                  0
                  • C cristian-adam
                    7 Mar 2024, 09:47

                    @JoeCFD I just gave it a try on my MacBook Pro M1 with:

                    • Qt 6.6.1
                    • Android arm64-v8 emulator image
                    • Android SDK 33
                    • Android NDK 25
                    • OpenJDK-17

                    See the recording at qtcreator13-android33.mp4.

                    A Offline
                    A Offline
                    Axel Spoerl
                    Moderators
                    wrote on 7 Mar 2024, 17:37 last edited by
                    #165

                    @JoeCFD
                    Note the following:

                    • if you have legacy break points, remove them all.
                    • if you want to set a break point into main(), add a QThread::sleep(1) on top. It has to be the first instruction in main.
                    • if you set no break points at all, the debugger will still jump to the disassembler. It looks as if the bug was still present. If you hit "continue" many times (18 in my case), the debuggee will start normally.

                    Software Engineer
                    The Qt Company, Oslo

                    C 1 Reply Last reply 7 Mar 2024, 18:32
                    0
                    • A Axel Spoerl
                      7 Mar 2024, 17:37

                      @JoeCFD
                      Note the following:

                      • if you have legacy break points, remove them all.
                      • if you want to set a break point into main(), add a QThread::sleep(1) on top. It has to be the first instruction in main.
                      • if you set no break points at all, the debugger will still jump to the disassembler. It looks as if the bug was still present. If you hit "continue" many times (18 in my case), the debuggee will start normally.
                      C Offline
                      C Offline
                      cristian-adam
                      wrote on 7 Mar 2024, 18:32 last edited by cristian-adam 3 Jul 2024, 18:32
                      #166

                      I have tested the "dice" Qt example and I was able to land into "disassembly" only the first time that the application was installed on the device.

                      If I click continue it will skip all the SIGSEGVS and would hit my breakpoints.

                      See the recording: qtcreator13-disassembly.

                      The Java exceptions are implemented with signals and it looks like the lldb-server is picking up and giving them further down the chain.

                      Android Studio users also have this problem see Android Studio keeps pausing with SIGSEGV (signal SIGSEGV: invalid address (fault address: 0x0)) at random [240007217] - Issue Tracker (google.com)

                      I have tried telling the debugger to ignore the signal:

                      process handle SIGSEGV --pass true --stop false --notify true 
                      

                      but it didn't work.

                      This doesn't look like a Qt Creator bug.

                      C 1 Reply Last reply 7 Mar 2024, 21:54
                      1
                      • C cristian-adam
                        7 Mar 2024, 18:32

                        I have tested the "dice" Qt example and I was able to land into "disassembly" only the first time that the application was installed on the device.

                        If I click continue it will skip all the SIGSEGVS and would hit my breakpoints.

                        See the recording: qtcreator13-disassembly.

                        The Java exceptions are implemented with signals and it looks like the lldb-server is picking up and giving them further down the chain.

                        Android Studio users also have this problem see Android Studio keeps pausing with SIGSEGV (signal SIGSEGV: invalid address (fault address: 0x0)) at random [240007217] - Issue Tracker (google.com)

                        I have tried telling the debugger to ignore the signal:

                        process handle SIGSEGV --pass true --stop false --notify true 
                        

                        but it didn't work.

                        This doesn't look like a Qt Creator bug.

                        C Offline
                        C Offline
                        cristian-adam
                        wrote on 7 Mar 2024, 21:54 last edited by
                        #167

                        As a workaround one can paste (plus Enter):

                        pro hand -p true -s false SIGSEGV
                        

                        In the debugger console at the first assembly hit, and then all the rest are ignored!

                        See qtcreator13-only-one-dissassembly-hit.mp4

                        1 Reply Last reply
                        0
                        • E Offline
                          E Offline
                          esnosy
                          wrote on 26 Mar 2024, 02:08 last edited by esnosy
                          #168

                          I had luck with using ADB over Wi-Fi, debugging with QtCreator works at least once with ADB over Wi-Fi, in Android Studio debugging worked for me over USB and Wi-Fi, at least for a hello world app

                          EDIT: I take it back

                          A 1 Reply Last reply 26 Mar 2024, 07:51
                          0
                          • E esnosy
                            26 Mar 2024, 02:08

                            I had luck with using ADB over Wi-Fi, debugging with QtCreator works at least once with ADB over Wi-Fi, in Android Studio debugging worked for me over USB and Wi-Fi, at least for a hello world app

                            EDIT: I take it back

                            A Offline
                            A Offline
                            Axel Spoerl
                            Moderators
                            wrote on 26 Mar 2024, 07:51 last edited by
                            #169

                            @esnosy said in Unable to debug Android App (Windows + Qt Creator 12 + LLDB):

                            EDIT: I take it back

                            Does that mean, you are still struggling?

                            Software Engineer
                            The Qt Company, Oslo

                            1 Reply Last reply
                            0

                            • Login

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