MDB (acronym for Modular Debugger) is a debugger by Oracle and it is mostly found on Solaris machines. If you need to debug a user application in Solaris, MDB might be the tool for you (along DBX and GDB). MDB support both Sparc and x86. MDB’s greatest advance among the other is that it comes with every Solaris machine. So if you find yourself on a Sparc machine running Solaris, surrounded with binary files and executables you are not familiar with, attack them with MDB!!
In this post I write commands I used. This is a personal post 🙂
ENTER LEAVE MDB
Launch mdb to debug [executable file]:
$ mdb [executable file]
Exit mdb:
> ::quit
BREAKPOINTS
Set breakpoint
> [address] ::bp
EXECUTION CONTOL
Run executable (Can be used multiple times, there is no need to relaunch MDB)
> ::run
> :r
Step into instrucion
> ::step
> :s
Step over instruction – Refer to a function called from instruction as a single instruction. Can also be used instead of ::run
> ::next
> :e
Display Information
Show register
> ::regs
Notes to myself:
When debugging sparc remember that due to delayed execution (pipelined architecture) registers gets updated only after 2 instruction executions.
For additional reading:
The Oracle Solaris Modular Debugger Guide
Hello!
Interesting articles indeed. I’ve tried to find a way to contact you, with one question.
If you will have extra 5 min, could you please send me an e-mail so we can get in touch? I’m working on some project now, related to something I believe you’ve researched.
Thank you sooo much 🙂