Report unmapped addresses in memory_dump
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
@@ -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) {
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
@@ -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) {
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
@@ -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) {
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
@@ -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) {
Anthony Liguori
AppliedQuoted 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
Signed-off-by Jan Kiszka <[email protected]>--- 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) {