{"id":13732354,"url":"https://github.com/progbits/smldbg","last_synced_at":"2025-05-08T06:31:59.866Z","repository":{"id":134311420,"uuid":"201139257","full_name":"progbits/smldbg","owner":"progbits","description":"A small, dependency free debugger.","archived":false,"fork":false,"pushed_at":"2022-06-16T22:01:22.000Z","size":653,"stargazers_count":4,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-08-04T02:11:02.501Z","etag":null,"topics":["cpp","debugger","educational"],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"unlicense","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/progbits.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2019-08-07T22:55:37.000Z","updated_at":"2023-09-18T20:36:23.000Z","dependencies_parsed_at":null,"dependency_job_id":"f5a174b3-b5fd-4bfa-9a42-defa8c48cc01","html_url":"https://github.com/progbits/smldbg","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/progbits%2Fsmldbg","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/progbits%2Fsmldbg/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/progbits%2Fsmldbg/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/progbits%2Fsmldbg/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/progbits","download_url":"https://codeload.github.com/progbits/smldbg/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":224708180,"owners_count":17356497,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cpp","debugger","educational"],"created_at":"2024-08-03T02:01:53.991Z","updated_at":"2024-11-14T23:32:08.115Z","avatar_url":"https://github.com/progbits.png","language":"C++","readme":"# smldbg\nA small, educational debugger with no dependencies.\n\n## Prerequisites\nTo build the project and run the tests, the following are required:\n - A C++20 compliant compiler (tested with `clang++ 11.0.0` and `g++ 10.2.0`)\n - CMake 3.12 or higher\n - The [Google Test Framework](https://github.com/google/googletest)\n\n## Building the Project\n\n```bash\ngit checkout git@github.com:progbits/smldbg\ncd smldbg\nmkdir build \u0026\u0026 cd build\ncmake ..\nmake\n```\n\n## Running the Debugger\nTo run the debugger, compile the following small example program with optimization disabled and debug symbols enabled (normally flags `-o0` and `-g` for most compilers).\n\n```cpp\n#include \u003ciostream\u003e\n\nvoid qux(int value) {\n  std::cout \u003c\u003c \"value: \" \u003c\u003c value \u003c\u003c \"\\n\";\n}\n\nvoid baz(int value) {\n  qux(value + 3);\n}\n\nvoid bar(int value) {\n  baz(value + 2);\n}\n\nvoid foo(int value) {\n  bar(value + 1);\n}\n\nint main() {\n  foo(1);\n  bar(3);\n  return 0;\n}\n```\n\nThe following commands will step through the program, set breakpoints on both methods and source code locations and inspect the current program state.\n\n```shell\nstart               # Start debugging the executable\nstep 2              # Move the instruction pointer forwards 2 instructions\ninfo registers      # Print the current register values\nbt                  # Print the backtrace of the current stack\nbreak main.cpp:12   # Add a new breakpoint at line 12\ncont                # Run until the next breakpoint is hit\nbt                  # Print the backtrace of the current stack\nprint value         # Print the variable `value`\nbreak qux           # Set a breakpoint on the function `qux(...)`\ncont                # Run until the next breakpoint is hit\nbt                  # Print the backtrace of the current stack\nprint value         # Print the variable `value`\nset value 99        # Set the variable `value` to 99\nstep                # Move the instruction pointer forwards 1 instruction\nfinish              # Run until the end of the current method\nfinish              # Run until the end of the current method\nbt                  # Print the backtrace of the current stack\nfinish              # Run until the end of the current method\nfinish              # Run until the end of the current method\ndelete              # Delete all breakpoint\nnext                # Run until the next line\nstep                # Move the instruction pointer forwards 1 instruction\n```\n\n![](resources/smldbg.gif)\n","funding_links":[],"categories":["Tools"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fprogbits%2Fsmldbg","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fprogbits%2Fsmldbg","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fprogbits%2Fsmldbg/lists"}