Existing gdbserver is able to communicate with agent via socket and command buffer. We want to grow this way for a more general purpose -- for gdb/gdbserver to communicate with agent for different types of operations. This patch is to move this bits of code to common/agent.c, so that these routines can be used by gdb and gdbserver Since this part of code needs to query symbol and access inferior's memory, these APIs are different between gdb and gdbserver. This causes some #ifdef/#endif blocks in the code. Previously, the communication channel is quite specific to gdbserver and tracepoint. With this patch, the communication channel is more generic, so that gdb and gdbserver can use this channel to talk with agent. -- Yao (齐尧)