Git Product home page Git Product logo

xre's Introduction

Xrē

A visual trace of your C data structures. We're going to call it Xre through the rest of this, because Xrē is really hard to type.

Introduction

Xre 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.

Functions

Three main functions are used to interact with Xre.

	void *node_malloc(size_t size, void **dest);

Behaves 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 .

	void xmalloc_free(void *);

Behaves like free. Also used by Xre to color nodes differently.

	void ptrcpy(void **dest, void *src);

Basically 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. This function adds to client code complexity and we would love feedback on how we migh simplify this, while maintaining functionality.

Prerequisites

  • python3
  • Flask
  • cytoscape - https://github.com/cytoscape/cytoscape.js -- 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.

Instruction

Makefile commands supported:

	make build FILE=<path_to_c_program>
	make clean

To compile and execute a C program using Xre, execute the following command:

	make build FILE=./tests/BST/binary_search_tree.c
	cd bin
	./binary_search_tree

A flask server is instantiated which runs on the localhost[:5000]. To view the visual trace, go to http://localhost:5000/

Warning

The flask server launched must be manually killed before executing a new C program using xre.

	ps -x | grep python
	kill -9 <proc-id>

This prevents multiple instances of the flask server from running simultaneously.

xre's People

Contributors

nikhilkhatri avatar priyabagaria avatar rahul-1996 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.