]> git.sur5r.net Git - openocd/commitdiff
Karl Beldan <karl.beldan@gmail.com> - The ibcr count for hw instruction breakpoint...
authoroharboe <oharboe@b42882b7-edfa-0310-969c-e2dbd0fdcd60>
Fri, 5 Dec 2008 17:37:23 +0000 (17:37 +0000)
committeroharboe <oharboe@b42882b7-edfa-0310-969c-e2dbd0fdcd60>
Fri, 5 Dec 2008 17:37:23 +0000 (17:37 +0000)
with soft breakpoints and breakpoint length error.

git-svn-id: svn://svn.berlios.de/openocd/trunk@1215 b42882b7-edfa-0310-969c-e2dbd0fdcd60

src/target/xscale.c

index 022204705e1e4fdb3ba5cbbb454319398772ed81..ef476027ae982088ee361fbd073aff9820bfc414 100644 (file)
@@ -2262,10 +2262,6 @@ int xscale_add_breakpoint(struct target_s *target, breakpoint_t *breakpoint)
                LOG_INFO("no breakpoint unit available for hardware breakpoint");
                return ERROR_TARGET_RESOURCE_NOT_AVAILABLE;
        }
-       else
-       {
-               xscale->ibcr_available--;
-       }
 
        if ((breakpoint->length != 2) && (breakpoint->length != 4))
        {
@@ -2273,6 +2269,11 @@ int xscale_add_breakpoint(struct target_s *target, breakpoint_t *breakpoint)
                return ERROR_TARGET_RESOURCE_NOT_AVAILABLE;
        }
 
+       if (breakpoint->type == BKPT_HARD)
+       {
+               xscale->ibcr_available--;
+       }
+
        return ERROR_OK;
 }