gdb remote debug cache remote target

Viewed 1547

I'm using CLion in order to connect to remote gdbserver which is run on remote machine (via ssh port forwarding).

I't works quite well except one thing, it downloads all linked dependencies every time I connect to gdbserver:

enter image description here

So, I could not find out is there any flag to pass in gdb remote to cache such files.

2 Answers

There is no built-in way to do this.

You could do it by hand by copying all the needed files once, and then using set sysroot. But, that's a bit error-prone, as you must remember to sync whenever anything changes.

Another idea would be to set up some kind of caching remote filesystem. (But I don't know if a canned one that does this exists.)

If your problem is not caching the libs but actually speeding up the GDB starting process you could set solib-absolute-prefix to a location on your host that contains all the shared libs. If you are using a nfs mounted environment for your target on your host. You could use the solib-absolute-prefix to set the path of shared libraries to your nfs host location so you don't retrieve them through the network every time you start the session.

Related