{"id":22916467,"url":"https://github.com/nikhilkhatri/xre","last_synced_at":"2025-05-12T17:05:19.963Z","repository":{"id":103215799,"uuid":"153107815","full_name":"nikhilkhatri/xre","owner":"nikhilkhatri","description":"A library to visualize C data structures.","archived":false,"fork":false,"pushed_at":"2020-04-11T07:19:11.000Z","size":509,"stargazers_count":15,"open_issues_count":1,"forks_count":3,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-05-12T17:04:57.615Z","etag":null,"topics":["c","data-structures","debugging","pointers","visualization"],"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/nikhilkhatri.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":"2018-10-15T12:19:59.000Z","updated_at":"2021-05-31T05:01:50.000Z","dependencies_parsed_at":"2023-06-29T00:01:27.217Z","dependency_job_id":null,"html_url":"https://github.com/nikhilkhatri/xre","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/nikhilkhatri%2Fxre","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nikhilkhatri%2Fxre/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nikhilkhatri%2Fxre/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nikhilkhatri%2Fxre/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nikhilkhatri","download_url":"https://codeload.github.com/nikhilkhatri/xre/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253784908,"owners_count":21963899,"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","data-structures","debugging","pointers","visualization"],"created_at":"2024-12-14T06:12:58.389Z","updated_at":"2025-05-12T17:05:19.947Z","avatar_url":"https://github.com/nikhilkhatri.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Xrē\r\n\r\nA visual trace of your C data structures.\r\n_We're going to call it Xre through the rest of this, because Xrē is really hard to type._\r\n\r\n\u003cp align=\"center\"\u003e\r\n\t\u003cimg src=\"https://media.giphy.com/media/dAdEFJwevwxJgRlz0C/giphy.gif\"/\u003e\r\n\u003c/p\u003e\r\n\r\n\r\n## Introduction\r\n\r\nXre allows you to implement any pointer-node based data-structures with minimum changes to the memory allocation portions of your code. Xre launches a local server which presents you with a visual representations of the nodes and data on your program's heap. This allows you to step through your program's visual trace, making it easy to spot dangling pointers, leaked memory and other pointer redirection errors.\r\n\r\n## Functions\r\n\r\nThree main functions are used to interact with Xre.\r\n\r\n```\r\n\tvoid *node_malloc(size_t size, void **dest);\r\n```\r\nBehaves like malloc, but also tells xre that the space you've just allocated is for a node in your data structure. Places address of newly allocated space in `*dest` .\r\n```\t\r\n\tvoid xmalloc_free(void *);\r\n```\r\nBehaves like free. Also used by Xre to color nodes differently.\r\n```\r\n\tvoid ptrcpy(void **dest, void *src);\r\n```\r\nBasically does `*dest = src`. The signature is more complex than seems necessary, but this information is needed by Xre to determine if the new source of the pointer is also a node. This ensures that you can have dynamic data structures, and the GUI will always reflect this accurately.\r\nThis function adds to client code complexity and we would love feedback on how we migh simplify this, while maintaining functionality.\r\n\r\n## Prerequisites\r\n- python3\r\n- Flask\r\n- cytoscape - https://github.com/cytoscape/cytoscape.js\r\n-- To use cytoscape-js, download the .js files found in the dist directory of branch 2.x of the above repo, and place them in `xre\\src\\server\\static\\scripts\\` of your xre installation.\r\n\r\n## Instruction\r\nMakefile commands supported:\r\n```\r\n\tmake build FILE=\u003cpath_to_c_program\u003e\r\n\tmake clean\r\n```\r\n\r\nTo compile and execute a C program using Xre, execute the following command:\r\n```\r\n\tmake build FILE=./tests/BST/binary_search_tree.c\r\n\tcd bin\r\n\t./binary_search_tree\r\n```\r\nA flask server is instantiated which runs on the localhost[:5000]. To view the visual trace, go to http://localhost:5000/\r\n\r\n## Warning\r\nThe flask server launched must be manually killed before executing a new C program using xre. \r\n```\r\n\tps -x | grep python\r\n\tkill -9 \u003cproc-id\u003e\r\n```\r\nThis prevents multiple instances of the flask server from running simultaneously.\r\n\r\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnikhilkhatri%2Fxre","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnikhilkhatri%2Fxre","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnikhilkhatri%2Fxre/lists"}