Skip to content

davidkdickson/basicdbg

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Basicdbg

For learning purposes built myself a very basic debugger in an effort to refresh my understanding of C++. Code heavily based on the following blog posts.

Getting started

Ubuntu

$ git clone --recursive git@github.com:davidkdickson/basicdbg.git
$ sudo apt install build-essential      # installs gcc, tested on version 9.3
$ cd basicdbg
$ make
$ ./basicdbg examples/hello

Docker

$ docker build -t basicdbg .
$ docker run -it basicdbg /bin/bash
$ ./basicdbg examples/hello

Usage

basicdbg <program>
  • s step in, note cannot step in to shared library dependencies
  • n next / step over
  • f finish / step out
  • b address break at hex address, e.g. b 0x11b5
  • b file:line_number break at line number, e.g. b examples/hello.cc:9
  • c continue
  • q quit

Useful articles

Useful supporting commands

objdump -f examples/hello       # outputs start address
objdump -d examples/hello       # assembler sections of executable
nm examples/hello               # another way at identifying address of main function

About

Implementing a basic debugger in C++

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published