- fixed bug in Thumb sw breakpoint handling (thanks to Spen for this patch)
- fixed handling of services linked list (thanks to Spen for this patch) git-svn-id: svn://svn.berlios.de/openocd/trunk@76 b42882b7-edfa-0310-969c-e2dbd0fdcd60
This commit is contained in:
parent
d4d36b0a9a
commit
1960973baf
|
@ -18,7 +18,7 @@
|
||||||
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
|
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
|
||||||
***************************************************************************/
|
***************************************************************************/
|
||||||
|
|
||||||
#define OPENOCD_VERSION "Open On-Chip Debugger (2006-06-25 22:45 CEST)"
|
#define OPENOCD_VERSION "Open On-Chip Debugger (2006-06-25 23:00 CEST)"
|
||||||
|
|
||||||
#ifdef HAVE_CONFIG_H
|
#ifdef HAVE_CONFIG_H
|
||||||
#include <config.h>
|
#include <config.h>
|
||||||
|
|
|
@ -86,19 +86,16 @@ int add_connection(service_t *service, command_context_t *cmd_ctx)
|
||||||
|
|
||||||
int remove_connection(service_t *service, connection_t *connection)
|
int remove_connection(service_t *service, connection_t *connection)
|
||||||
{
|
{
|
||||||
connection_t *c, *p = NULL;
|
connection_t *c = service->connections;
|
||||||
|
|
||||||
/* find connection */
|
/* find connection */
|
||||||
for (c = service->connections; c; c = c->next)
|
while(c)
|
||||||
{
|
{
|
||||||
|
connection_t *next = c->next;
|
||||||
|
|
||||||
if (c->fd == connection->fd)
|
if (c->fd == connection->fd)
|
||||||
{
|
{
|
||||||
/* unlink connection */
|
service->connections = next;
|
||||||
if (p)
|
|
||||||
p->next = c->next;
|
|
||||||
else
|
|
||||||
service->connections = c->next;
|
|
||||||
|
|
||||||
service->connection_closed(c);
|
service->connection_closed(c);
|
||||||
close(c->fd);
|
close(c->fd);
|
||||||
|
|
||||||
|
@ -112,7 +109,7 @@ int remove_connection(service_t *service, connection_t *connection)
|
||||||
}
|
}
|
||||||
|
|
||||||
/* remember the last connection for unlinking */
|
/* remember the last connection for unlinking */
|
||||||
p = c;
|
c = next;
|
||||||
}
|
}
|
||||||
|
|
||||||
return ERROR_OK;
|
return ERROR_OK;
|
||||||
|
@ -182,28 +179,27 @@ int add_service(char *name, enum connection_type type, unsigned short port, int
|
||||||
|
|
||||||
int remove_service(unsigned short port)
|
int remove_service(unsigned short port)
|
||||||
{
|
{
|
||||||
service_t *c, *p = NULL;
|
service_t *c = services;
|
||||||
|
|
||||||
/* find service */
|
/* find service */
|
||||||
for (c = services; c; c = c->next)
|
while(c)
|
||||||
{
|
{
|
||||||
|
service_t *next = c->next;
|
||||||
|
|
||||||
if (c->port == port)
|
if (c->port == port)
|
||||||
{
|
{
|
||||||
/* unlink service */
|
|
||||||
if (p)
|
|
||||||
p->next = c->next;
|
|
||||||
else
|
|
||||||
services = c->next;
|
|
||||||
|
|
||||||
if (c->name)
|
if (c->name)
|
||||||
free(c->name);
|
free(c->name);
|
||||||
|
|
||||||
|
if (c->priv)
|
||||||
|
free(c->priv);
|
||||||
|
|
||||||
/* delete service */
|
/* delete service */
|
||||||
free(c);
|
free(c);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* remember the last service for unlinking */
|
/* remember the last service for unlinking */
|
||||||
p = c;
|
c = next;
|
||||||
}
|
}
|
||||||
|
|
||||||
return ERROR_OK;
|
return ERROR_OK;
|
||||||
|
|
|
@ -186,7 +186,7 @@ int arm7_9_set_breakpoint(struct target_s *target, breakpoint_t *breakpoint)
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
target->type->read_memory(target, breakpoint->address, 2, 1, breakpoint->orig_instr);
|
target->type->read_memory(target, breakpoint->address, 2, 1, breakpoint->orig_instr);
|
||||||
target->type->read_memory(target, breakpoint->address, 2, 1, (u8*)(&arm7_9->arm_bkpt));
|
target->type->write_memory(target, breakpoint->address, 2, 1, (u8*)(&arm7_9->arm_bkpt));
|
||||||
}
|
}
|
||||||
breakpoint->set = 1;
|
breakpoint->set = 1;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue