Skip to contentSkip to conversation

exec: Fix watchpoint implementation

PATCH In review Meador Inge 2 participants 4 messages Feb 17, 2012 – Feb 20, 2012

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 exec: Fix watchpoint implementation

Fix a bug introduced by commit 1ec9b909ff207a44d5ef2609cb4a2e3d449d485f where 'watch_mem_write' was modified to fall-through to 'abort' on every input.

---
* Changes since v1:
- 'break' out of switch statement instead of 'return'.

 exec.c |   12 +++++++++---
 1 files changed, 9 insertions(+), 3 deletions(-)
exec.c +9 -3
index b81677a..f105b43 100644
@@ -3289,9 +3289,15 @@ static void watch_mem_write(void *opaque, target_phys_addr_t addr,
 {
     check_watchpoint(addr & ~TARGET_PAGE_MASK, ~(size - 1), BP_MEM_WRITE);
     switch (size) {
-    case 1: stb_phys(addr, val);
-    case 2: stw_phys(addr, val);
-    case 4: stl_phys(addr, val);
+    case 1:
+        stb_phys(addr, val);
+        break;
+    case 2:
+        stw_phys(addr, val);
+        break;
+    case 4:
+        stl_phys(addr, val);
+        break;
     default: abort();
     }
 }
Signature · 1 line
1.7.7.6
Reviewed-by on v2 1/1
#1 lore raw

Am 17.02.2012 18:03, schrieb Meador Inge:

Quoted 5 lines

Fix a bug introduced by commit 1ec9b909ff207a44d5ef2609cb4a2e3d449d485f where 'watch_mem_write' was modified to fall-through to 'abort' on every input.

Andreas

Quoted 29 lines

---
* Changes since v1:
- 'break' out of switch statement instead of 'return'.

 exec.c |   12 +++++++++---
 1 files changed, 9 insertions(+), 3 deletions(-)
exec.c +9 -3
index b81677a..f105b43 100644
@@ -3289,9 +3289,15 @@ static void watch_mem_write(void *opaque, target_phys_addr_t addr,
 {
     check_watchpoint(addr & ~TARGET_PAGE_MASK, ~(size - 1), BP_MEM_WRITE);
     switch (size) {
-    case 1: stb_phys(addr, val);
-    case 2: stw_phys(addr, val);
-    case 4: stl_phys(addr, val);
+    case 1:
+        stb_phys(addr, val);
+        break;
+    case 2:
+        stw_phys(addr, val);
+        break;
+    case 4:
+        stl_phys(addr, val);
+        break;
     default: abort();
     }
 }
Signature · 2 lines
SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany
GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer; HRB 16746 AG Nürnberg
#2 lore raw

Am 17.02.2012 18:06, schrieb Andreas Färber:

Quoted 8 lines

Am 17.02.2012 18:03, schrieb Meador Inge:

Quoted 5 lines

Fix a bug introduced by commit 1ec9b909ff207a44d5ef2609cb4a2e3d449d485f where 'watch_mem_write' was modified to fall-through to 'abort' on every input.

Actually I already reviewed such a fix by Max on Jan 29 (with breaks from the start), and it's in his PULL request now. So this is again a duplicate and shouldn't be applied.

If you want to remind maintainers of a patch that's been on the list but has not yet been applied, the correct procedure is to add a Reviewed-by or Acked-by tag if you haven't already, or to reply with a "Ping?" otherwise.

Andreas

Quoted 29 lines
Quoted 29 lines

---
* Changes since v1:
- 'break' out of switch statement instead of 'return'.

 exec.c |   12 +++++++++---
 1 files changed, 9 insertions(+), 3 deletions(-)
exec.c +9 -3
index b81677a..f105b43 100644
@@ -3289,9 +3289,15 @@ static void watch_mem_write(void *opaque, target_phys_addr_t addr,
 {
     check_watchpoint(addr & ~TARGET_PAGE_MASK, ~(size - 1), BP_MEM_WRITE);
     switch (size) {
-    case 1: stb_phys(addr, val);
-    case 2: stw_phys(addr, val);
-    case 4: stl_phys(addr, val);
+    case 1:
+        stb_phys(addr, val);
+        break;
+    case 2:
+        stw_phys(addr, val);
+        break;
+    case 4:
+        stl_phys(addr, val);
+        break;
     default: abort();
     }
 }
Signature · 2 lines
SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany
GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer; HRB 16746 AG Nürnberg
#3 lore raw
Quoted 10 lines · Andreas Färber

Am 17.02.2012 18:06, schrieb Andreas Färber:

Quoted 8 lines

Am 17.02.2012 18:03, schrieb Meador Inge:

Quoted 5 lines

Fix a bug introduced by commit 1ec9b909ff207a44d5ef2609cb4a2e3d449d485f where 'watch_mem_write' was modified to fall-through to 'abort' on every input.

Quoted 8 lines

Actually I already reviewed such a fix by Max on Jan 29 (with breaks from the start), and it's in his PULL request now. So this is again a duplicate and shouldn't be applied.

If you want to remind maintainers of a patch that's been on the list but has not yet been applied, the correct procedure is to add a Reviewed-by or Acked-by tag if you haven't already, or to reply with a "Ping?" otherwise.

Ah, I missed that. I will add a review tag to the other. Thanks for the heads up.

Signature · 3 lines
Meador Inge
CodeSourcery / Mentor Embedded
http://www.mentor.com/embedded-software