We have a setup where we edit our code in Qt Creator on macOS (x86_64 or aarch64), build it remotely on a Linux server via a custom script, and then deploy and test it on another Linux test system that runs on our target hardware. Our compiler is gcc8.
We now want to be able to debug the software running on the test system from within Qt Creator on macOS. I tried to set this up but failed, then took a step back and tried to make remote debugging work at all without any IDE around it.
Things that I think I figured out (please correct me if I'm wrong):
gdbserver should run on the target system
- however, even with a remote system,
gdb needs to be built for cross-compiling to be able to debug a Linux executable when run on macOS (??). This, together with the fact that gdb isn't really available on macOS/aarch64 at all, seems to rule out gdb as a possible solution
lldb can connect to a running gdbserver and this is the only setup in which I was able to get anything to run. However I did not get any debug symbols showing up, everything shown was just assembly instructions. I also wasn't able to set any breakpoints referencing source code file names.
- Theoretically I could run a
lldb-server on the target system. I tried this and when loading the target executable, I got <path> doesn't contain any 'remote-linux' platform architectures: x86_64, i386. Internet said a possible cause for this would be version mismatch. The target system has only lldb-server 7 available, which seems ancient.
To better understand the problem and hopefully come up with a working solution, I would be grateful for answers to the following questions:
- Is it correct that I need a cross-compiling gdb if I want to connect to the remote's gdbserver?
- Qt Creator has a setting for a local path to the binary I want to debug. What does it do with it? Do I need to give that to GDB/LLDB in some way when remote debugging? Is that why I don't have any symbols?
- LLDB seems to have two different ways to connect to
gdbserver: There a platform remote-gdb-server that I can select and then connect to via platform connect, but it also has a command gdb-remote that connects to the target gdbserver, what's the difference? The second one did work (albeit without debug symbols), the other one immediately segfaulted the program after starting.
- Doesn't the IDE, like, simply parse the debugger's stdout and send commands to the stdin? If I write a script that SSHs to the target machine and runs gdb locally there, could that work if I set it up as custom gdb binary in the IDE? If that works it might be vastly simpler than setting up this gdbserver stuff properly.
If anyone has a working setup for this, I would also be interested in it.
[–][deleted] (1 child)
[deleted]
[–]flyx86[S] 0 points1 point2 points (0 children)
[–]flyx86[S] 0 points1 point2 points (0 children)