GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - progbits/smldbg: A small, dependency free debugger.

BranchesTags
Open more actions menu

Latest commit

 

History

5 Commits
5 Commits

Folders and files

NameName
Last commit message
Last commit date
resources
resources
 
 
src
src
 
 
test
test
 
 
.clang-format
.clang-format
 
 
.gitignore
.gitignore
 
 
CMakeLists.txt
CMakeLists.txt
 
 
LICENSE
LICENSE
 
 
README.md
README.md
 
 

Repository files navigation

smldbg

A small, educational debugger with no dependencies.

Prerequisites

To build the project and run the tests, the following are required:

  • A C++20 compliant compiler (tested with clang++ 11.0.0 and g++ 10.2.0)
  • CMake 3.12 or higher
  • The Google Test Framework

Building the Project

git checkout [email protected]:progbits/smldbg
cd smldbg
mkdir build && cd build
cmake ..
make

Running the Debugger

To run the debugger, compile the following small example program with optimization disabled and debug symbols enabled (normally flags -o0 and -g for most compilers).

#include <iostream>

void qux(int value) {
  std::cout << "value: " << value << "\n";
}

void baz(int value) {
  qux(value + 3);
}

void bar(int value) {
  baz(value + 2);
}

void foo(int value) {
  bar(value + 1);
}

int main() {
  foo(1);
  bar(3);
  return 0;
}

The following commands will step through the program, set breakpoints on both methods and source code locations and inspect the current program state.

start               # Start debugging the executable
step 2              # Move the instruction pointer forwards 2 instructions
info registers      # Print the current register values
bt                  # Print the backtrace of the current stack
break main.cpp:12   # Add a new breakpoint at line 12
cont                # Run until the next breakpoint is hit
bt                  # Print the backtrace of the current stack
print value         # Print the variable `value`
break qux           # Set a breakpoint on the function `qux(...)`
cont                # Run until the next breakpoint is hit
bt                  # Print the backtrace of the current stack
print value         # Print the variable `value`
set value 99        # Set the variable `value` to 99
step                # Move the instruction pointer forwards 1 instruction
finish              # Run until the end of the current method
finish              # Run until the end of the current method
bt                  # Print the backtrace of the current stack
finish              # Run until the end of the current method
finish              # Run until the end of the current method
delete              # Delete all breakpoint
next                # Run until the next line
step                # Move the instruction pointer forwards 1 instruction

About

A small, dependency free debugger.

Topics

cppdebuggereducational

Resources

Readme
Unlicense
Activity

Stars

6 stars

Watchers

1 watching

Forks

1 fork
Report repository

Releases

Packages

Contributors

Languages

You are visitor 01402520 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.