|
From: <sv...@va...> - 2012-04-27 22:59:51
|
philippe 2012-04-27 23:59:43 +0100 (Fri, 27 Apr 2012)
New Revision: 12544
Log:
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
Modified files:
trunk/coregrind/m_gdbserver/server.c
trunk/docs/xml/manual-core-adv.xml
trunk/gdbserver_tests/mchelp.stdoutB.exp
Modified: trunk/docs/xml/manual-core-adv.xml (+5 -2)
===================================================================
--- trunk/docs/xml/manual-core-adv.xml 2012-04-26 15:17:50 +01:00 (rev 12543)
+++ trunk/docs/xml/manual-core-adv.xml 2012-04-27 23:59:43 +01:00 (rev 12544)
@@ -1286,10 +1286,13 @@
</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>
Modified: trunk/gdbserver_tests/mchelp.stdoutB.exp (+2 -1)
===================================================================
--- trunk/gdbserver_tests/mchelp.stdoutB.exp 2012-04-26 15:17:50 +01:00 (rev 12543)
+++ trunk/gdbserver_tests/mchelp.stdoutB.exp 2012-04-27 23:59:43 +01:00 (rev 12544)
@@ -48,7 +48,8 @@
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>
Modified: trunk/coregrind/m_gdbserver/server.c (+14 -1)
===================================================================
--- trunk/coregrind/m_gdbserver/server.c 2012-04-26 15:17:50 +01:00 (rev 12543)
+++ trunk/coregrind/m_gdbserver/server.c 2012-04-27 23:59:43 +01:00 (rev 12544)
@@ -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 */
|