Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

gdb remote debug cache remote target

Tags:

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.

like image 684
Ivan Talalaev Avatar asked Oct 06 '17 13:10

Ivan Talalaev


People also ask

How will you do remote debugging using GDB?

To start remote debugging, run GDB on the host machine, and specify as an executable file the program that is running in the remote machine. This tells GDB how to find your program's symbols and the contents of its pure text. Start GDB on the host, and connect to the target (see section Connecting to a remote target).

What is GDB target?

A target is the execution environment occupied by your program. Often, GDB runs in the same host environment as your program; in that case, the debugging target is specified as a side effect when you use the file or core commands.

What is a debug target?

A target is typically a protocol for talking to debugging facilities. You use the argument type to specify the type or protocol of the target machine. Further parameters are interpreted by the target protocol, but typically include things like device names or host names to connect with, process numbers, and baud rates.

Is GDB backwards compatible?

Yes, the remote serial protocol used to communicate between GDB and GDBServer absolutely should be backward compatible.


1 Answers

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.

like image 189
Guillaume.P Avatar answered Sep 22 '22 11:09

Guillaume.P