This tutorial may still work, but using the native lldb for iOS is suggested:
This tutorial was originally made by caoyin and I got his permission to post it here.
What is lldb?
LLDB is a next generation, high-performance debugger. It is built as a set of reusable components which highly leverage existing libraries in the larger LLVM Project, such as the Clang expression parser and LLVM disassembler.
Homepage: http://lldb.llvm.org/
LLDB on Mac OSX Tutorial: http://iosgods.com/topic/5391-tutorial-memory-debugging-with-lldb-on-mac-osx/
Requirements: - Jailbreak - OpenSSH from Cydia - PuTTY or iFunBox or any other Terminal clients. - LLDB.rar: https://www.dropbox.com/s/cvr0kf3jt6yraem/LLDB.rar - debugserver: https://www.dropbox.com/s/501sg030hhpiuxi/debugserver?dl=0
Instructions: Step 1: Download debugserver from the link above and using iFile, place it in /usr/bin/ then set permissions to 6755.
Step 2: Connect you iDevice to your computer via USB cable.
Step 3: Download and unzip LLDB.rar and rub lldb.cmd.
Update: itunnel_mux.exe does not seem to be working on Windows 10 as it seems. It is suggested you use iFunBox's Quick Toolbox option to create a new USB Tunnel on port 23.
Step 4: Open PuTTY or iFunBox and type in this command:
debugserver 127.0.0.1:23 --attach=PID or BINARYNAME
PID is the Process ID of the app and Binary Name is the Binary Name of the app. You can get PID & Binary Name from iGameGuardian or Binary Name from iFile/Filza.
Note: The app needs to be running on your iDevice in order for lldb to attach.
Example:
PID:
debugserver 127.0.0.1:23 --attach=28437
Binary Name:
debugserver 127.0.0.1:23 --attach=Asphalt8
Replace 127.0.0.1 with your PC IP if you can't connect.
debugserver is now waiting for the connection request from lldb.exe
Step 5: Switch to the lldb window and type in the command below and press enter:
process connect connect://127.0.0.1:23
Replace 127.0.0.1 with your device IP if you can't connect.
Step 6: Press CTRL + C to interrupt the process and type C to continue.
That's it!
----------------------------------
Some popular lldb commands compared with gdb: http://lldb.llvm.org/lldb-gdb.html
GDB LLDB
i r $pc register read $pc or reg re $pc
break *0xaddress b s -a 0xaddress
watch 0xaddress w s e -- 0xaddress
x/dw 0x111 x/dw 0x111 or memory read -s 4 0x1111 or mem re -s 4 0x1111 4 means 4 byte & -s = size
x/i 0x11111 ?x/i 0x11111
set *0x1111=0x11111 memory write -s 4 0x1111 0x1111 or mem wr -s 0x1111 0x1111
set $r1=0x1 register write $r1 0x1