This patch adds support for the GDB remote pipe, plus new handlers so the back-end can handle XML files and add custom monitor commands. I have used the gdbserver code to implement a remote server for the Coldfire BDM interface. The XML back-end handler allows the back-end to detect the type of processor and then provide the suitable XML file. I have also added support to detect if a register in the cache is dirty when collected by the back-end. The 'z' and 'Z' watchpoint type filtering now allows type 1 through to the back-end. I checked the current back-ends in the gdbserver code and where not effected. I have run make check but I could not see a gdbserver test run. Is there one ? The various low level back-ends have not be changed to printf_filtered or warning. Should they ? Regards Chris 2007-11-05 Chris Johns * regcache.h (collect_register): Return true if the register is dirty. * regcache.c (struct inferior_regcache_data): Add a shadow copy of the registers. (new_register_cache): Allocate memory for the shadow. (free_register_cache): Free the shadow memory. (registers_from_string): Use warning. (register_shadow_data): New. (register_dirty): New. (supply_register): Write the register to the shadow. (collect_register): Return true if the register is dirty. Copy to the shadow once copied to the user. * utils.h (my_stdout): New. (my_stderr): New. (warning_prefix): New. (printf_filtered): New. (error): Use my_stdout and my_stderr. (fatal): Use my_stdout and my_stderr. Print the warning_prefix rather than the fixed gdbserver. (warning): Use my_stdout and my_stderr. Print the warning_prefix rather than the fixed gdbserver. * target.h (struct target_ops): Added xml_file and commands. * server.h (my_stderr): New extern. (my_stdout): New extern. (monitor_output): Changed to printf type variable arguments. (printf_filtered): New. * server.c (start_inferior, attach_inferior, gdbserver_version) (gdbserver_usage): Use printf_filtered. (get_features_xml): If USE_XML is not defined check to the backend has supplied the xml_file handler and call it if it has. (handle_query): Added NO_PASS_SIGNALS and NO_LIBRARIES to control the supported string returned to GDB. The default is signals are passed and libraries is supported. Externed the monitor command handling to check of the backend has defined a command handler. (myname): New global for the program name. It may not be gdbserver. (main): Initialise my_stdout, my_stderr, and myname. If the COMM is pipe set my_stdout to be stderr. Use warning. If error is called in the main loop return an error to GDB. Merged the 'z' and 'Z' code together and allowed type 1 watchpoints to be passed to the backend. * remote-utils.c (remote_piping): New. (WRITE_FD): New. (remote_open): Use warning and printf_filtered. Check if port_str is a pipe and set the remote_desc to STDOUT_FILENO. Allow async to be compiled out. The default is on. (remote_write): New. Flush stdout when pipe is being used. (putpkt_binary, getpkt): Use remote_write. Use warning and printf_filtered. (input_interrupt, readchar): Use warning. (prepare_resume_reply): Use printf_filtered. (monitor_output): Changed to printf type variable arguments.