Changes

Jump to: navigation, search

SysRq debugger

2,122 bytes added, 13:32, 7 August 2006
created
''SysRq debugger'' can help you to obtain some information from oops-ed kernel.

== Features ==
''SysRq debugger'' can do one of the following:
# Dump memory at specified address
# Write arbitrary value to memory at specified address
# Resolve symbol address by its name

== How to use it ==
To enter debug mode press ''SysRq-g''.
After this the following commands will be available:
# ''SysRq-d'' - dump memory
# ''SysRq-w'' - write to memory
# ''SysRq-r'' - resolve symbol
# ''SysRq-x'' - go on dumping memory
#* ... from the latest address dumped with ''-d''
#* ... from the address you wrote to with ''-w''
#* ... from the begginning of the symbol resolved with ''-r''
# ''SysRq-q'' - quit debugger

After entering ''-d'', ''-w'' or ''-r'' state you must enter address to work with (and the value you want to write if you do). Simply do this by pressing according keys while holding ''Alt-StsRq''.

If you need to enter the upper case letter or the underbar (<code>_</code>) while typing a symbol name then you need to press and release ''shift'' and then the letter or minus (<code>-</code>).

At the end press ''enter''.

== Working with proc ==
There is a ''/proc/sysrq-trigger'' entry which triggers sysrq events.
You may send a string to it to trigger commands one by one.
There is one note about it - string must end with '<i>\r</i>' character.

== Examples ==
Here are some examples of how to use debugger

=== Dump memory ===
<pre>
# echo -n -e 'gd0xc0000000\rq' > /proc/sysrq-trigger
</pre>
will dump memory region of 512 bytes

<pre>
# echo -n -e 'gxq' > /proc/sysrq-trigger
</pre>
will dump the next 512 bytes of memory

=== Write to memory ===
<pre>
# echo -n -e 'gw0xc0000000-0x12345678\rq' > /proc/sysrq-trigger
</pre>
will write ''0x12345678'' at ''0xc0000000''

=== Resolve symbol ===
<pre>
# echo -n -e 'grschedule\rq' > /proc/sysrq-trigger
</pre>
will print you an address ''schedule()'' function starts from

<pre>
# echo -n -e 'gxq' > /proc/sysrq-trigger
</pre>
will dump first 512 bytes of it

Note <i>''-n''</i> and <i>''-e''</i> keys to ''echo'' command.

[[Category:HOWTO]]
[[Category:Kernel]]

Navigation menu