GDB plugin proposal

Matthew Fyles Matthew.Fyles@st.com
Tue Apr 23 02:16:00 GMT 2002


For the Superh H architecture we have added a command called fork into GDB to allow the user to create a new process from the GDB command language in the same way that the shell command is implemented.

Basically the new process gets passed a pipe to the GDB command languange when created allowing the user application to talk directly to GDB. This allows you to add new code which can be executed whilst in a GDB session without adding new commands into GDB.

The main use we have for this at the momemt is to solve the problem of having to specify a port to a simulator that is driven via the GBD server interface. We fork a loader process from GDB which sets up the sockets for communication and then passes a target-remote command with the port number back into GDB which then connects to the simulator.

This interface has proved very useful and allows us to add whatever functionality we require without changing the source code for GDB (with the exception of the 20 lines required to add the fork command)

It will also work on all supported host platforms.

If this would be useful to anybody then let me know.




More information about the Gdb mailing list