- 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:
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user