Skip to contentSkip to conversation

monitor: Fix "info mem" to print the last memory range

PATCH Applied Austin Clements 2 participants 2 messages Aug 15, 2011 – Aug 21, 2011

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 monitor: Fix "info mem" to print the last memory range

"info mem" groups its output into contiguous ranges with identical protection bits, but previously forgot to print the last range.

---
 monitor.c |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)
monitor.c +6 -0
index 6a4f8c2..f8ba0ef 100644
@@ -2258,6 +2258,8 @@ static void mem_info_32(Monitor *mon, CPUState *env)
             mem_print(mon, &start, &last_prot, end, prot);
         }
     }
+    /* Flush last range */
+    mem_print(mon, &start, &last_prot, (target_phys_addr_t)1 << 32, 0);
 }
 
 static void mem_info_pae32(Monitor *mon, CPUState *env)
@@ -2311,6 +2313,8 @@ static void mem_info_pae32(Monitor *mon, CPUState *env)
             mem_print(mon, &start, &last_prot, end, prot);
         }
     }
+    /* Flush last range */
+    mem_print(mon, &start, &last_prot, (target_phys_addr_t)1 << 32, 0);
 }
 
 
@@ -2385,6 +2389,8 @@ static void mem_info_64(Monitor *mon, CPUState *env)
             mem_print(mon, &start, &last_prot, end, prot);
         }
     }
+    /* Flush last range */
+    mem_print(mon, &start, &last_prot, (target_phys_addr_t)1 << 48, 0);
 }
 #endif
 
Signature · 1 line
1.7.5.4
Applied
#1 lore raw

Thanks, applied.

Quoted 44 lines · Austin Clements

"info mem" groups its output into contiguous ranges with identical protection bits, but previously forgot to print the last range.

---
 monitor.c |    6 ++++++

 1 files changed, 6 insertions(+), 0 deletions(-)
monitor.c +6 -1
index 6a4f8c2..f8ba0ef 100644
@@ -2258,6 +2258,8 @@ static void mem_info_32(Monitor *mon, CPUState *env)
             mem_print(mon, &start, &last_prot, end, prot);
         }
     }
+    /* Flush last range */
+    mem_print(mon, &start, &last_prot, (target_phys_addr_t)1 << 32, 0);
  }
 
  static void mem_info_pae32(Monitor *mon, CPUState *env)
@@ -2311,6 +2313,8 @@ static void mem_info_pae32(Monitor *mon, CPUState *env)
             mem_print(mon, &start, &last_prot, end, prot);
         }
     }
+    /* Flush last range */
+    mem_print(mon, &start, &last_prot, (target_phys_addr_t)1 << 32, 0);
  }
 
 
@@ -2385,6 +2389,8 @@ static void mem_info_64(Monitor *mon, CPUState *env)
             mem_print(mon, &start, &last_prot, end, prot);
         }
     }
+    /* Flush last range */
+    mem_print(mon, &start, &last_prot, (target_phys_addr_t)1 << 48, 0);
  }
  #endif
 
--

1.7.5.4