Code Monkey home page Code Monkey logo

errors_resolver's Introduction

Errors Resolver

Errors Resolver provides resolutions or recommendations for standard errors. For example, it analyzes some build errors caused by missing components, searches the missing components in the system environment and provides a location to these missing components.

For example:

echo "undefined reference to `pthread_create'" | ./errors_resolver.py

Output with solution:

LDLIBS+=' -l pthread';

In this example errors_resolver.py searches tags and provides the missing header file.

Demonstrations:

Resolving compilation configuration errors:

./errors_resolver_demo

You can see saved output in file errors_resolver_demo.log

Run above demo with cross compiler:

CC=arm-linux-gnueabi-gcc ./errors_resolver_demo

This demo was tested on Ubuntu, where gcc-arm-linux-gnueabi and qemu-user are installed.

Demo of resolving error 'command not found'

Helper /usr/lib/command-not-found resolves the error in interactive shell. To resolve errors in subroutine run:

./command-not-found-demo

Analyze system logs

sudo ./errors_resolver.py /var/log/*log

Resolving various errors from a log file:

./errors_resolver.py < errors.log

Description of core application errors_resolver.py

Input:

Compilation and system errors. Output of compilation or execution log with errors can passed to output of resolver.

Output:

Fixes or recommendations to solve errors in form of modification of environment variables or shell commands.

Features:

Analyzes warnings and errors:

  • implicit declaration
  • undeclared symbol
  • undefined symbol
  • library not found or missing
  • command not found
  • decodes numeric system errno
  • catches some disk errors

Demo supports cross compiler

Provides modification of standard environment variables:

  • CPATH, CPPFLAGS, LIBRARY_PATH, LDFLAGS, LDLIBS, LD_LIBRARY_PATH

Uses tools for searching of missing components:

  • ctags, nm, find
  • /usr/lib/command-not-found
  • apt-file search

Searching for not installed packages

 # assure that demo package is not installed
 test -e /usr/include/aalib.h && (sudo apt-get -y remove libaa1-dev || sudo yum remove -y aalib-devel)
 echo "#include <aalib.h>" | gcc -E - |& ./errors_resolver.py
 gcc -l aa |& ./errors_resolver.py

Both examples above give output: install+=' libaa1-dev'

Regression test:

(./errors_resolver_demo && CC=arm-linux-gnueabi-gcc ./errors_resolver_demo && ./command-not-found-demo && ./errors_resolver.py errors.log && echo PASSED) > regression_test.log 2>&1 && echo PASSED || (tail regression_test.log; false)

To to list:

  • Analyze more ./configure errors.

You are welcome to request additional features in the form of erroneous sample source code (see errors_resolver_sample.c), sample errors and solutions.

For further information you are welcome to read sources.

Thanks

errors_resolver's People

Contributors

julianweiss avatar makelinux avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

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