21 lines
363 B
Bash
21 lines
363 B
Bash
|
#!/usr/bin/env bash
|
||
|
|
||
|
if [[ -f "memory.dump" ]];
|
||
|
then
|
||
|
rm -f memory.dump
|
||
|
fi
|
||
|
|
||
|
if [[ -f "memory.bin" ]];
|
||
|
then
|
||
|
rm memory.bin
|
||
|
fi
|
||
|
|
||
|
if [[ ! -e "qmp.socket" ]];
|
||
|
then
|
||
|
echo "Couldn't find socket (file: 'qmp.socket')."
|
||
|
exit -1
|
||
|
fi
|
||
|
|
||
|
echo "dump-guest-memory memory.dump" | qmp-shell -H qmp.socket
|
||
|
echo "dump memory memory.bin 0 0xa0000" | gdb --core=memory.dump
|