add optional arg [aspacemgr] to v.info memory to show aspacemgr segments.

When investigating Valgrind out of memory situation,
it is useful to be able to output the list of segments of the
aspacemgr at any moment.
The GDB monitor command "v.info memory" has now an optional
argument allowing to output this list of segments



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12544 a5019735-40e9-0310-863c-91ae7b9d1cf9
diff --git a/coregrind/m_gdbserver/server.c b/coregrind/m_gdbserver/server.c
index 2736419..4eb325c 100644
--- a/coregrind/m_gdbserver/server.c
+++ b/coregrind/m_gdbserver/server.c
@@ -171,7 +171,8 @@
       if (int_value) { VG_(gdb_printf) (
 "debugging valgrind internals monitor commands:\n"
 "  v.info gdbserver_status : show gdbserver status\n"
-"  v.info memory           : show valgrind heap memory stats\n"
+"  v.info memory [aspacemgr] : show valgrind heap memory stats\n"
+"     (with aspacemgr arg, also shows valgrind segments on log ouput)\n"
 "  v.info scheduler        : show valgrind thread state and stacktrace\n"
 "  v.set debuglog <level>  : set valgrind debug log level to <level>\n"
 "  v.translate <addr> [<traceflags>]  : debug translation of <addr> with <traceflags>\n"
@@ -261,6 +262,18 @@
          VG_(print_all_arena_stats) ();
          if (VG_(clo_profile_heap))
             VG_(print_arena_cc_analysis) ();
+         wcmd = strtok_r (NULL, " ", &ssaveptr);
+         if (wcmd != NULL) {
+            switch (VG_(keyword_id) ("aspacemgr", wcmd, kwd_report_all)) {
+            case -2:
+            case -1: break;
+            case  0: 
+               VG_(am_show_nsegments) (0, "gdbserver v.info memory aspacemgr");
+               break;
+            default: tl_assert (0);
+            }
+         }
+
          ret = 1;
          break;
       case  5: /* scheduler */