Skip to contentSkip to conversation

Report unmapped addresses in memory_dump

PATCH Superseded Jan Kiszka 2 participants 5 messages Jun 8, 2008 – Aug 18, 2008

lore
Share & tools
lore

Jan Kiszka

author
#0 lore raw

PATCH 1/1 Report unmapped addresses in memory_dump

Instead of dumping incorrect (ie. previously read) data, report the invalid virtual address to the user.

---
 monitor.c |    5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
monitor.c +4 -1
Index: b/monitor.c
===================================================================
@@ -591,7 +591,10 @@ static void memory_dump(int count, int f
             env = mon_get_cpu();
             if (!env)
                 break;
-            cpu_memory_rw_debug(env, addr, buf, l, 0);
+            if (cpu_memory_rw_debug(env, addr, buf, l, 0) < 0) {
+                term_printf(" Cannot access memory\n");
+                break;
+            }
         }
         i = 0;
         while (i < l) {
author
#1 lore raw

PATCH RESEND 1/1 Report unmapped addresses in memory_dump

Instead of dumping incorrect (ie. previously read) data, report the invalid virtual address to the user.

---
 monitor.c |    5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
monitor.c +4 -1
Index: b/monitor.c
===================================================================
@@ -596,7 +596,10 @@ static void memory_dump(int count, int f
             env = mon_get_cpu();
             if (!env)
                 break;
-            cpu_memory_rw_debug(env, addr, buf, l, 0);
+            if (cpu_memory_rw_debug(env, addr, buf, l, 0) < 0) {
+                term_printf(" Cannot access memory\n");
+                break;
+            }
         }
         i = 0;
         while (i < l) {
author
#2 lore raw

PATCH RESEND 1/1 Report unmapped addresses in memory_dump

Instead of dumping incorrect (ie. previously read) data, report the invalid virtual address to the user.

---
 monitor.c |    5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
monitor.c +4 -1
Index: b/monitor.c
===================================================================
@@ -596,7 +596,10 @@ static void memory_dump(int count, int f
             env = mon_get_cpu();
             if (!env)
                 break;
-            cpu_memory_rw_debug(env, addr, buf, l, 0);
+            if (cpu_memory_rw_debug(env, addr, buf, l, 0) < 0) {
+                term_printf(" Cannot access memory\n");
+                break;
+            }
         }
         i = 0;
         while (i < l) {
author
#3 lore raw

PATCH RESEND 1/1 Report unmapped addresses in memory_dump

Instead of dumping incorrect (ie. previously read) data, report the invalid virtual address to the user.

---
 monitor.c |    5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
monitor.c +4 -1
Index: b/monitor.c
===================================================================
@@ -594,7 +594,10 @@ static void memory_dump(int count, int f
             env = mon_get_cpu();
             if (!env)
                 break;
-            cpu_memory_rw_debug(env, addr, buf, l, 0);
+            if (cpu_memory_rw_debug(env, addr, buf, l, 0) < 0) {
+                term_printf(" Cannot access memory\n");
+                break;
+            }
         }
         i = 0;
         while (i < l) {
#4 lore raw
Quoted 3 lines · Jan Kiszka

Instead of dumping incorrect (ie. previously read) data, report the invalid virtual address to the user.

Applied. Thanks.

Sorry it took three resends.

Regards,

Anthony Liguori

Quoted 24 lines
---
 monitor.c |    5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

Index: b/monitor.c
===================================================================

monitor.c +4 -1
@@ -594,7 +594,10 @@ static void memory_dump(int count, int f
             env = mon_get_cpu();
             if (!env)
                 break;
-            cpu_memory_rw_debug(env, addr, buf, l, 0);
+            if (cpu_memory_rw_debug(env, addr, buf, l, 0) < 0) {
+                term_printf(" Cannot access memory\n");
+                break;
+            }
         }
         i = 0;
         while (i < l) {