+<sect1 id="mc-manual.monitor-commands" xreflabel="Memcheck Monitor Commands">
+<title>Memcheck Monitor Commands</title>
+<para>The Memcheck tool provides monitor commands handled by the Valgrind
+gdbserver (see <xref linkend="manual-core.gdbserver-commandhandling"/>).
+</para>
+
+<itemizedlist>
+ <listitem>
+ <para><varname>mc.get_vbits <addr> [<len>]</varname>
+ outputs the validity bits for the range of <len> (default 1)
+ bytes at <addr>. The validity of each byte of the range is
+ given using two hexadecimal digits. These hexadecimal digits are
+ encoding the validity of each bit of the corresponding byte, using
+ 0 if the bit is valid and 1 if the bit is invalid. In the
+ following example, 'string10' is an array of 10 characters in
+ which one byte on two is undefined. If a byte is not addressable,
+ its validity bits are replaced by __. In the below example, the byte 6
+ is not addressable.</para>
+<programlisting><![CDATA[
+(gdb) p &string10
+$4 = (char (*)[10]) 0x8049e28
+(gdb) monitor mc.get_vbits 0x8049e28 10
+ff00ff00 ff__ff00 ff00
+(gdb)
+]]></programlisting>
+ </listitem>
+
+ <listitem>
+ <para><varname>mc.make_memory [noaccess|undefined|defined|ifaddressabledefined] <addr> [<len>]</varname>
+ marks the range of <len> (default 1) bytes at <addr>
+ with the given accessibility. Marking with 'noaccess' changes the
+ (A) bits of the range to be not addressable. Marking with
+ 'undefined' or 'defined' are changing the definedness of the
+ range. 'ifaddressabledefined' marks the range as defined but only
+ if the range is addressable. In the following example, the first
+ byte of the 'string10' is marked as defined.
+ </para>
+<programlisting><![CDATA[
+(gdb) monitor mc.make_memory defined 0x8049e28 1
+(gdb) monitor mc.get_vbits 0x8049e28 10
+0000ff00 ff00ff00 ff00
+(gdb)
+]]></programlisting>
+ </listitem>
+
+ <listitem>
+ <para><varname>mc.check_memory [addressable|defined] <addr>
+ [<len>]</varname> checks that the range of <len>
+ (default 1) bytes at <addr> has the given accessibility. It
+ then outputs a description of <addr>. In the below case, a
+ detailed description is given as the option --read-var-info=yes
+ was used to start Valgrind.
+ </para>
+<programlisting><![CDATA[
+(gdb) monitor mc.check_memory defined 0x8049e28 1
+Address 0x8049E28 len 1 defined
+==14698== Location 0x8049e28 is 0 bytes inside string10[0],
+==14698== declared at prog.c:10, in frame #0 of thread 1
+(gdb)
+]]></programlisting>
+ </listitem>