]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
add optional arg [aspacemgr] to v.info memory to show aspacemgr segments.
authorPhilippe Waroquiers <philippe.waroquiers@skynet.be>
Fri, 27 Apr 2012 22:59:43 +0000 (22:59 +0000)
committerPhilippe Waroquiers <philippe.waroquiers@skynet.be>
Fri, 27 Apr 2012 22:59:43 +0000 (22:59 +0000)
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

coregrind/m_gdbserver/server.c
docs/xml/manual-core-adv.xml
gdbserver_tests/mchelp.stdoutB.exp

index 2736419c8cc4712b61a968db89a32615614ecfb5..4eb325c54b7c1c49d15ce2e7617dc138088c0643 100644 (file)
@@ -171,7 +171,8 @@ int handle_gdb_valgrind_command (char* mon, OutputSink* sink_wanted_at_return)
       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 @@ int handle_gdb_valgrind_command (char* mon, OutputSink* sink_wanted_at_return)
          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 */
index 2758ce5b9d1d68da172e583fc475b5fdbf9970aa..efde71102feb47de470d0dcfc474346038840c63 100644 (file)
@@ -1286,10 +1286,13 @@ problems or bugs.</para>
   </listitem>
 
   <listitem>
-    <para><varname>v.info memory</varname> shows the statistics of
+    <para><varname>v.info memory [aspacemgr]</varname> shows the statistics of
     Valgrind's internal heap management. If
     option <option>--profile-heap=yes</option> was given, detailed
-    statistics will be output.
+    statistics will be output. With the optional argument
+    <computeroutput>aspacemgr</computeroutput>. the segment list maintained
+    by valgrind address space manager will be output. Note that
+    this list of segments is always output on the Valgrind log.
     </para>
   </listitem>
 
index 20b2e7673414a43d3a45fba56be004181d2bbbfc..44070dfcd621778e176354e9b619dbef9ac290ec 100644 (file)
@@ -48,7 +48,8 @@ general valgrind monitor commands:
   v.set vgdb-error <errornr> : debug me at error >= <errornr> 
 debugging valgrind internals monitor commands:
   v.info gdbserver_status : show gdbserver status
-  v.info memory           : show valgrind heap memory stats
+  v.info memory [aspacemgr] : show valgrind heap memory stats
+     (with aspacemgr arg, also shows valgrind segments on log ouput)
   v.info scheduler        : show valgrind thread state and stacktrace
   v.set debuglog <level>  : set valgrind debug log level to <level>
   v.translate <addr> [<traceflags>]  : debug translation of <addr> with <traceflags>