improve gdb_init() sequence

Rework gdb_init to create flexible APIs (gdb_target_add_{one,all}) and
static helper (gdb_target_start) for starting GDB services.  Eliminates
duplicated code and provides general mechanisms for adding GDB services.
The 'init' command is updated to call the new API, and later patches can
decouple its policy of adding all targets therein.

Provides the new capability to use both piped and TCP servers when
multiple targets are defined.  The first target fills the pipe, and
others will be started on TCP ports (unless disabled, i.e. gdb_port=0).
This commit is contained in:
Zachary T Welch
2009-11-28 18:56:23 -08:00
parent 2264270fe4
commit ec6c1962c2
3 changed files with 50 additions and 36 deletions

View File

@@ -52,7 +52,8 @@ struct gdb_service
struct target *target;
};
int gdb_init(void);
int gdb_target_add_one(struct target *target);
int gdb_target_add_all(struct target *target);
int gdb_register_commands(struct command_context *command_context);
#define ERROR_GDB_BUFFER_TOO_SMALL (-800)