- fixed a minor problem with the GDB server that could drop the first packet (non-fatal)

- fixed some small memory leaks (thanks to Spencer Oliver)
- verify chip- and buswidth of cfi flash configurations
- added support for ARM966E based systems (tested only with ST micro STR9, thanks to Spencer Oliver)


git-svn-id: svn://svn.berlios.de/openocd/trunk@81 b42882b7-edfa-0310-969c-e2dbd0fdcd60
This commit is contained in:
drath
2006-08-06 11:20:42 +00:00
parent 7d24476146
commit fbf5bec7f3
13 changed files with 561 additions and 14 deletions

View File

@@ -138,6 +138,23 @@ int gdb_get_char(connection_t *connection, int* next_char)
return ERROR_OK;
}
int gdb_putback_char(connection_t *connection, int last_char)
{
gdb_connection_t *gdb_con = connection->priv;
if (gdb_con->buf_p > gdb_con->buffer)
{
*(--gdb_con->buf_p) = last_char;
gdb_con->buf_cnt++;
}
else
{
ERROR("BUG: couldn't put character back");
}
return ERROR_OK;
}
int gdb_put_packet(connection_t *connection, char *buffer, int len)
{
int i;
@@ -219,6 +236,8 @@ int gdb_get_packet(connection_t *connection, char *buffer, int *len)
if ((retval = gdb_get_char(connection, &character)) != ERROR_OK)
return retval;
DEBUG("character: '%c'", character);
switch (character)
{
case '$':
@@ -427,6 +446,9 @@ int gdb_new_connection(connection_t *connection)
if ((retval = gdb_get_char(connection, &initial_ack)) != ERROR_OK)
return retval;
if (initial_ack != '+')
gdb_putback_char(connection, initial_ack);
return ERROR_OK;
}