From: Philippe Waroquiers Date: Fri, 27 Apr 2012 22:59:43 +0000 (+0000) Subject: add optional arg [aspacemgr] to v.info memory to show aspacemgr segments. X-Git-Tag: svn/VALGRIND_3_8_0~324 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f53053e7c9f49f5338d231dc7abf35df9827d2c3;p=thirdparty%2Fvalgrind.git 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 --- diff --git a/coregrind/m_gdbserver/server.c b/coregrind/m_gdbserver/server.c index 2736419c8c..4eb325c54b 100644 --- a/coregrind/m_gdbserver/server.c +++ b/coregrind/m_gdbserver/server.c @@ -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 : set valgrind debug log level to \n" " v.translate [] : debug translation of with \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 */ diff --git a/docs/xml/manual-core-adv.xml b/docs/xml/manual-core-adv.xml index 2758ce5b9d..efde71102f 100644 --- a/docs/xml/manual-core-adv.xml +++ b/docs/xml/manual-core-adv.xml @@ -1286,10 +1286,13 @@ problems or bugs. - v.info memory shows the statistics of + v.info memory [aspacemgr] shows the statistics of Valgrind's internal heap management. If option was given, detailed - statistics will be output. + statistics will be output. With the optional argument + aspacemgr. 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. diff --git a/gdbserver_tests/mchelp.stdoutB.exp b/gdbserver_tests/mchelp.stdoutB.exp index 20b2e76734..44070dfcd6 100644 --- a/gdbserver_tests/mchelp.stdoutB.exp +++ b/gdbserver_tests/mchelp.stdoutB.exp @@ -48,7 +48,8 @@ general valgrind monitor commands: v.set vgdb-error : debug me at error >= 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 : set valgrind debug log level to v.translate [] : debug translation of with