I try to figure out what’s the best way to do remote debugging on jetson target.
First of all some background: we are afriad that the chip will be weak to do all debugging on target, so we want to use remote debugging.
Is it best to do it by using the same OS in a HOST and do the same installations on host,for example prepare install both host and target with ubuntu 18.04 and make the exact installations on both (for example same installation instruction for qt,gstreamer, etc (using exact same apt-get ) etc. ?
Alternative: using any OS in HOST, and copy files in /lib and /include into host’s sysroot and using cross compile in host after installations.
Mostly I just use gdb directly on the host. I prefer the cgdb front end (it is still gdb, but a custom text interface which runs in console or gui and makes gdb more convenient).
Something like the nsight edition of eclipse runs remotely from an Ubuntu host, and is probably more like what you are thinking (this is described in the official documentation which comes with the release you run). Eclipse is a bit heavy, and although it would work reasonably well from an Xavier it would be a bit intense on a TX2. The nsight edition (specific to Jetsons) is meant to run on a regular desktop PC with Ubuntu.
You can do remote debugging for other code, but as you mention for some cases you must put the environment on your host first (a loopback mounted clone works nicely for that). I tend to only do this with kgdb/kgdboc kernel debugging (which conveniently doesn’t need the user space libraries, but it does have other setup…something you wouldn’t have to worry about in user space).
One more if I may:
You mentioned kernel remote debugging.
It’s something that I am also very intereseted in doing but was not sure how to:
Is it that you actually use remote PC connected to serial ? Do you than use loopback mount for this ? If you have any tutorial or something a like can you please share ?
This uses a combination of serial console and ethernet. The topic is “kgdb” and “kgdboc”. It requires a kernel image on the host PC, and some setup information from “/proc” or “/sys” (basically memory location information).
The official documents actually have something on this. After unpacking the docs for your release version look for file “nvl4t_docs/Tegra Linux Driver Package Development Guide/debugging_kgdb.html” and point a web browser at it. This provides kgdb information.
Note that there is essentially a shell the serial console can drop into, and then kgdboc can be used from the host. It is a steep learning curve, but once you set up scripts for gathering memory locations it becomes much easier.