Installing KGDB and peda gdb in Ubuntu 16 & 18

If you don’t have cmake, it need to be installed first.

 sudo apt install cmake extra-cmake-modules 

Then, following modules must be installed.

sudo apt-get install qtbase5-dev qtdeclarative5-dev libkf5config-dev libkf5auth-dev libkf5package-dev libkf5declarative-dev libkf5coreaddons-dev libkf5kcmutils-dev libkf5i18n-dev libqt5core5a libqt5widgets5 libqt5gui5 libqt5qml5 extra-cmake-modules qtbase5-dev 

Download the source code via git and extract the tar file

wget http://sourceforge.net/projects/kdbg/files/Source%20Code/3.0.0/kdbg-3.0.0.tar.gz/download -O kgdb.tar.gz

tar -xvzf kgdb.tar.gz

Then go to the extracted folder and install using cmake

cmake .
make
sudo make install

Installing peda gdb

git clone https://github.com/longld/peda.git ~/peda
echo "source ~/peda/peda.py" >> ~/.gdbinit
echo "DONE! debug your program with gdb and enjoy"

Tips

3 ways to pass arguments to the debugger

At start of debugger

gdb --args name arg1 arg2 arg3 

After starting debugger

$ gdb ./a.out
(gdb) [r]un arg1 arg2 arg3

or save the arguments in text file, arg.txt

$ gdb ./a.out
(gdb) [r]un < arg.txt

2 Comments on "Installing KGDB and peda gdb in Ubuntu 16 & 18"

  1. I’m extremely pleased to discover this website. I wanted to thank you for ones time just for this fantastic read!! I absolutely enjoyed every part of it and i also have you bookmarked to see new stuff in your site.

  2. Definitely, what a great blog and revealing posts, I definitely will bookmark your site. Best Regards!

Leave a comment

Your email address will not be published.


*