{"id":27024084,"url":"https://github.com/ragibasif/xdbg","last_synced_at":"2025-04-04T21:17:29.090Z","repository":{"id":284645201,"uuid":"955587890","full_name":"ragibasif/xdbg","owner":"ragibasif","description":"Memory debugger library for C projects.","archived":false,"fork":false,"pushed_at":"2025-04-04T19:33:59.000Z","size":79,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-04T20:30:48.906Z","etag":null,"topics":["c","c-language","c-library","c-program","c-programming","c-programming-language","c-project","calloc","compile-time","debugger","debugging","debugging-tool","debugging-tools","dynamic-memory-allocation","free","header-only","lightweight","malloc","memory-management","realloc"],"latest_commit_sha":null,"homepage":"","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ragibasif.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,"publiccode":null,"codemeta":null}},"created_at":"2025-03-26T21:57:58.000Z","updated_at":"2025-04-04T19:34:02.000Z","dependencies_parsed_at":null,"dependency_job_id":"d4938716-d63c-4432-935c-8c37703ddf87","html_url":"https://github.com/ragibasif/xdbg","commit_stats":null,"previous_names":["ragibasif/xdbg"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ragibasif%2Fxdbg","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ragibasif%2Fxdbg/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ragibasif%2Fxdbg/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ragibasif%2Fxdbg/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ragibasif","download_url":"https://codeload.github.com/ragibasif/xdbg/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247249548,"owners_count":20908213,"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":["c","c-language","c-library","c-program","c-programming","c-programming-language","c-project","calloc","compile-time","debugger","debugging","debugging-tool","debugging-tools","dynamic-memory-allocation","free","header-only","lightweight","malloc","memory-management","realloc"],"created_at":"2025-04-04T21:17:28.571Z","updated_at":"2025-04-04T21:17:29.080Z","avatar_url":"https://github.com/ragibasif.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# xdbg\n\n\u003e [!note]\n\u003e This library is not complete and will be converted to a single header file once the required features are complete.\n\n\u003e [!warning]\n\u003e\n\u003e - **NOT THREAD SAFE!** (_yet_)\n\u003e - Exclusively developed and tested on MacOS M1 (_for now_)\n\n- Memory Debugging – Detect leaks, corruption, overflows.\n- Minimal Overhead – As light as possible for fast debugging.\n- Toggle debugging\n\n## TODO\n\n- [ ] Add documentation\n- [ ] Handle double frees\n- [ ] Handle out of bounds pointer frees\n- [x] Add `realloc` Wed Apr 2 16:08:31 EDT 2025\n- [x] Add `calloc` Wed Apr 2 16:41:33 EDT 2025\n- [ ] Add thread safety\n- [ ] Add checks to match allocation and freeing of individual pointers by their address\n- [ ] Add stack tracing (_maybe_)\n- [ ] Make the library portable (usable in UNIX and Windows)\n\n## Compiling with Debugging:\n\nTo enable the debugging, you can define `XDBG_ENABLE` during compilation, like so:\n\n```bash\ngcc -DXDBG_ENABLE -o my_program my_program.c\n```\n\n_or_\n\nInclude the following define in a source file:\n\n```c\n#define XDBG_ENABLE\n#include \"xdbg.h\"\n```\n\nThis setup keeps `xdbg` as lightweight as possible with macros that can be entirely stripped out when not needed.\n\n## References\n\n1. [malloc](https://en.cppreference.com/w/c/memory/malloc)\n2. [realloc](https://en.cppreference.com/w/c/memory/realloc)\n3. [calloc](https://en.cppreference.com/w/c/memory/calloc)\n4. [free](https://en.cppreference.com/w/c/memory/free)\n5. [What is a stack trace...?](https://stackoverflow.com/questions/3988788/what-is-a-stack-trace-and-how-can-i-use-it-to-debug-my-application-errors)\n6. [stb_leakcheck.h](https://github.com/nothings/stb/blob/master/stb_leakcheck.h)\n7. [forge.h](https://github.com/quelsolaar/MergeSource/blob/main/forge.h)\n8. [Should I cast the result of malloc (in C)?](https://stackoverflow.com/questions/605845/should-i-cast-the-result-of-malloc-in-c)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fragibasif%2Fxdbg","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fragibasif%2Fxdbg","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fragibasif%2Fxdbg/lists"}