Coder Social home page Coder Social logo

angie's People

Contributors

charvn avatar mchalupa avatar michkot avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

Forkers

mchalupa

angie's Issues

Commands, parameters, console interface

Collected tasks relevant to console application variant of Angie. opt pass variant is also planned, and that should considered when implementing console functionality.

  • Analysis should be self-contained, but for start all compiled into one application. One should be able to pick the analysis he ones to run via parameter.
  • Print diagnostic messages in GCC/clang compatible format (create wrapper around LLVM pass diagnostics message machinery ?)

Design multiple approaches to attach information to CFG or Values

Design several possible ways how to attach information to instructions or values.
Present motivation for this is dead/live variable analysis - results of such an analysis could be precomputed and assigned either to CfgNodes (instructions) or to FrontendIds (values / SSA registers).

Info sources:
https://github.com/kdudka/predator/blob/master/cl/killer.cc
http://llvm.org/docs/doxygen/html/LiveVariables_8h_source.html
http://llvm.org/docs/doxygen/html/classllvm_1_1LiveVariables.html

Error tracing

What should the interaction of user and the analysis look like when an error has been found?

We can assume it should like like some kind of back-trace explaining the origin of such erroneous state.
Could be:

  • dumping analysis specific graphic/text (SMG plots) for deduced or manually specified points of program
  • print compiler-message-like line-of-code back-trace for every line that participated in origin of error-triggering value
  • dumping SVCOMP-like XML error trace for the user
  • dumping executable (debugging possible) error trace for the user

This issue is about

  1. coming up with other user interaction patterns
  2. discussing those patterns, theirs pros, cons and whether their implementation is feasible ATM
  3. which patterns should we implement framework-wide / we should at least provide support for them in Angie and which patterns are suitable only for analysis-specific implementation

Keep in mind that Angie is meant to be an analysis framework.

Exception with function calls wrapped in ConstExpr

Running angie on this code:

  1 int main(void)
  2 {
  3         int *p = malloc(sizeof *p);
  4         free(p); 
  5         free(p);
  6 
  7         return 0;
  8 }

Results in

terminate called after throwing an instance of 'NotSupportedException'
  what():  attempted to call unknown function -- either an unsupported stdlib function or missing definition

The problem is that #include <stdlib.h> is missing and calls to free are wrapped in ConstExpr due to unknown prototype, e.g.:

call i32 (i32*, ...) bitcast (i32 (...)* @free to i32 (i32*, ...)*)(i32* %7)

Adding #include<stdlib.h> fixes the problem:

$./angie -f db.ll

Error: Program tried to free an already freed memory.

Wrappers for critical front-end components

We need access to program/functions/instructions details for proper development and debugging.

  • Function: name, return type, argument types, argument Frontend IDs. Optional: "is intrinsic", linkage type
  • Instruction: LLVM string rep, source info {file, line, column}
  • Values = {Constants and Instructions}: source name (named register vs named stack variable?)

Implementation notes:
Generate map for values when creating CFG
Add "debugger mode" functionality -> retrieve all information on construction and cache it in the wrapper

Support breakpoints placed on normal IR instructions

Adding an intrinsic IR instruction to trigger a special behaviour is relatively easy.
I would be interested in a way of simply annotating the IR code such that the analysis would trigger __builtin_trap() / __debugbreak() if compiled in debug mode.

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.