Coder Social home page Coder Social logo

dcfg's People

Contributors

yanyh15 avatar

Stargazers

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

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

dcfg's Issues

Unable to reproduce example DCFG files

Hello, thank you very much for sharing this repository.

I have tried using some of the examples posted in the simple_loop_dependency-pinplay directory, but unable to reproduce the same DCFG.

When I run the following commands:

$PIN_ROOT/pin -follow_execv -t $PIN_ROOT/extras/dcfg/bin/intel64/loop-tracker.so -dcfg -- ../simple_loop
/home/Downloads/dcfg_pin/extras/dcfg/bin/intel64/dcfg-to-dot dcfg-out.dcfg.json.bz2 test.dot 
sfdp -x -Tpng test.dot > dcfg-out.png

I end up with a monster graph looking like this:
Screenshot 2023-02-09 at 4 54 37 PM

Could you kindly tell me what version of the PIN you were using in addition to any other things I may be missing to produce a concise DCFG graph as provided in the example directory?
image

I have directly downloaded the PIN from the official link, where it also has a PLDI tutorial: https://www.intel.com/content/www/us/en/developer/articles/tool/program-recordreplay-toolkit.html

Thank you in advance.

Compilation Error

I downloaded the DCFG to visualize CFG of a particular binary in DOT format. I think I have already installed the dyninst and the dynamic libraries successfully. However, I still come across the following compilation problem

angr@BinWorks:~/Desktop/dyninst-install/dyninst_CFG$ make
[ 25%] Building CXX object CMakeFiles/CFG.dir/CFG.cpp.o
/home/angr/Desktop/dyninst-install/dyninst_CFG/CFG.cpp: In function ‘void PrintBlockInfo(Dyninst::ParseAPI::Block*)’:
/home/angr/Desktop/dyninst-install/dyninst_CFG/CFG.cpp:87:29: error: no match for ‘operator=’ (operand types are ‘Dyninst::InstructionAPI::Instruction::Ptr {aka boost::shared_ptr<Dyninst::InstructionAPI::Instruction>}’ and ‘Dyninst::InstructionAPI::Instruction’)
  while ( (insn = dec.decode()) != NULL ) {
                             ^
In file included from /home/angr/Desktop/dyninst-install/include/boost/shared_ptr.hpp:17:0,
                 from /home/angr/Desktop/dyninst-install/include/dyn_regs.h:36,
                 from /home/angr/Desktop/dyninst-install/include/dyntypes.h:183,
                 from /home/angr/Desktop/dyninst-install/include/symutil.h:36,
                 from /home/angr/Desktop/dyninst-install/include/Symbol.h:44,
                 from /home/angr/Desktop/dyninst-install/include/Symtab.h:36,
                 from /home/angr/Desktop/dyninst-install/include/CodeObject.h:36,
                 from /home/angr/Desktop/dyninst-install/dyninst_CFG/CFG.cpp:12:
/home/angr/Desktop/dyninst-install/include/boost/smart_ptr/shared_ptr.hpp:524:18: note: candidate: boost::shared_ptr<T>& boost::shared_ptr<T>::operator=(const boost::shared_ptr<T>&) [with T = Dyninst::InstructionAPI::Instruction]
     shared_ptr & operator=( shared_ptr const & r ) BOOST_NOEXCEPT
                  ^~~~~~~~
/home/angr/Desktop/dyninst-install/include/boost/smart_ptr/shared_ptr.hpp:524:18: note:   no known conversion for argument 1 from ‘Dyninst::InstructionAPI::Instruction’ to ‘const boost::shared_ptr<Dyninst::InstructionAPI::Instruction>&’
/home/angr/Desktop/dyninst-install/include/boost/smart_ptr/shared_ptr.hpp:533:18: note: candidate: template<class Y> boost::shared_ptr<T>& boost::shared_ptr<T>::operator=(const boost::shared_ptr<Y>&) [with Y = Y; T = Dyninst::InstructionAPI::Instruction]
     shared_ptr & operator=(shared_ptr<Y> const & r) BOOST_NOEXCEPT
                  ^~~~~~~~
/home/angr/Desktop/dyninst-install/include/boost/smart_ptr/shared_ptr.hpp:533:18: note:   template argument deduction/substitution failed:
/home/angr/Desktop/dyninst-install/dyninst_CFG/CFG.cpp:87:29: note:   ‘Dyninst::InstructionAPI::Instruction’ is not derived from ‘const boost::shared_ptr<X>’
  while ( (insn = dec.decode()) != NULL ) {
                             ^
In file included from /home/angr/Desktop/dyninst-install/include/boost/shared_ptr.hpp:17:0,
                 from /home/angr/Desktop/dyninst-install/include/dyn_regs.h:36,
                 from /home/angr/Desktop/dyninst-install/include/dyntypes.h:183,
                 from /home/angr/Desktop/dyninst-install/include/symutil.h:36,
                 from /home/angr/Desktop/dyninst-install/include/Symbol.h:44,
                 from /home/angr/Desktop/dyninst-install/include/Symtab.h:36,
                 from /home/angr/Desktop/dyninst-install/include/CodeObject.h:36,
                 from /home/angr/Desktop/dyninst-install/dyninst_CFG/CFG.cpp:12:
/home/angr/Desktop/dyninst-install/include/boost/smart_ptr/shared_ptr.hpp:544:18: note: candidate: template<class Y> boost::shared_ptr<T>& boost::shared_ptr<T>::operator=(std::auto_ptr<_Up>&) [with Y = Y; T = Dyninst::InstructionAPI::Instruction]
     shared_ptr & operator=( std::auto_ptr<Y> & r )
                  ^~~~~~~~
/home/angr/Desktop/dyninst-install/include/boost/smart_ptr/shared_ptr.hpp:544:18: note:   template argument deduction/substitution failed:
/home/angr/Desktop/dyninst-install/dyninst_CFG/CFG.cpp:87:29: note:   ‘Dyninst::InstructionAPI::Instruction’ is not derived from ‘std::auto_ptr<Y>’
  while ( (insn = dec.decode()) != NULL ) {
                             ^
In file included from /home/angr/Desktop/dyninst-install/include/boost/shared_ptr.hpp:17:0,
                 from /home/angr/Desktop/dyninst-install/include/dyn_regs.h:36,
                 from /home/angr/Desktop/dyninst-install/include/dyntypes.h:183,
                 from /home/angr/Desktop/dyninst-install/include/symutil.h:36,
                 from /home/angr/Desktop/dyninst-install/include/Symbol.h:44,
                 from /home/angr/Desktop/dyninst-install/include/Symtab.h:36,
                 from /home/angr/Desktop/dyninst-install/include/CodeObject.h:36,
                 from /home/angr/Desktop/dyninst-install/dyninst_CFG/CFG.cpp:12:
/home/angr/Desktop/dyninst-install/include/boost/smart_ptr/shared_ptr.hpp:553:18: note: candidate: template<class Y> boost::shared_ptr<T>& boost::shared_ptr<T>::operator=(std::auto_ptr<_Up>&&) [with Y = Y; T = Dyninst::InstructionAPI::Instruction]
     shared_ptr & operator=( std::auto_ptr<Y> && r )
                  ^~~~~~~~
/home/angr/Desktop/dyninst-install/include/boost/smart_ptr/shared_ptr.hpp:553:18: note:   template argument deduction/substitution failed:
/home/angr/Desktop/dyninst-install/dyninst_CFG/CFG.cpp:87:29: note:   ‘Dyninst::InstructionAPI::Instruction’ is not derived from ‘std::auto_ptr<Y>’
  while ( (insn = dec.decode()) != NULL ) {
                             ^
In file included from /home/angr/Desktop/dyninst-install/include/boost/shared_ptr.hpp:17:0,
                 from /home/angr/Desktop/dyninst-install/include/dyn_regs.h:36,
                 from /home/angr/Desktop/dyninst-install/include/dyntypes.h:183,
                 from /home/angr/Desktop/dyninst-install/include/symutil.h:36,
                 from /home/angr/Desktop/dyninst-install/include/Symbol.h:44,
                 from /home/angr/Desktop/dyninst-install/include/Symtab.h:36,
                 from /home/angr/Desktop/dyninst-install/include/CodeObject.h:36,
                 from /home/angr/Desktop/dyninst-install/dyninst_CFG/CFG.cpp:12:
/home/angr/Desktop/dyninst-install/include/boost/smart_ptr/shared_ptr.hpp:575:18: note: candidate: template<class Y, class D> boost::shared_ptr<T>& boost::shared_ptr<T>::operator=(std::unique_ptr<_Up, _Ep>&&) [with Y = Y; D = D; T = Dyninst::InstructionAPI::Instruction]
     shared_ptr & operator=( std::unique_ptr<Y, D> && r )
                  ^~~~~~~~
/home/angr/Desktop/dyninst-install/include/boost/smart_ptr/shared_ptr.hpp:575:18: note:   template argument deduction/substitution failed:
/home/angr/Desktop/dyninst-install/dyninst_CFG/CFG.cpp:87:29: note:   ‘Dyninst::InstructionAPI::Instruction’ is not derived from ‘std::unique_ptr<_Tp, _Dp>’
  while ( (insn = dec.decode()) != NULL ) {
                             ^
In file included from /home/angr/Desktop/dyninst-install/include/boost/shared_ptr.hpp:17:0,
                 from /home/angr/Desktop/dyninst-install/include/dyn_regs.h:36,
                 from /home/angr/Desktop/dyninst-install/include/dyntypes.h:183,
                 from /home/angr/Desktop/dyninst-install/include/symutil.h:36,
                 from /home/angr/Desktop/dyninst-install/include/Symbol.h:44,
                 from /home/angr/Desktop/dyninst-install/include/Symtab.h:36,
                 from /home/angr/Desktop/dyninst-install/include/CodeObject.h:36,
                 from /home/angr/Desktop/dyninst-install/dyninst_CFG/CFG.cpp:12:
/home/angr/Desktop/dyninst-install/include/boost/smart_ptr/shared_ptr.hpp:584:18: note: candidate: template<class Y, class D> boost::shared_ptr<T>& boost::shared_ptr<T>::operator=(boost::movelib::unique_ptr<Y, D>) [with Y = Y; D = D; T = Dyninst::InstructionAPI::Instruction]
     shared_ptr & operator=( boost::movelib::unique_ptr<Y, D> r )
                  ^~~~~~~~
/home/angr/Desktop/dyninst-install/include/boost/smart_ptr/shared_ptr.hpp:584:18: note:   template argument deduction/substitution failed:
/home/angr/Desktop/dyninst-install/dyninst_CFG/CFG.cpp:87:29: note:   ‘Dyninst::InstructionAPI::Instruction’ is not derived from ‘boost::movelib::unique_ptr<Y, D>’
  while ( (insn = dec.decode()) != NULL ) {
                             ^
In file included from /home/angr/Desktop/dyninst-install/include/boost/shared_ptr.hpp:17:0,
                 from /home/angr/Desktop/dyninst-install/include/dyn_regs.h:36,
                 from /home/angr/Desktop/dyninst-install/include/dyntypes.h:183,
                 from /home/angr/Desktop/dyninst-install/include/symutil.h:36,
                 from /home/angr/Desktop/dyninst-install/include/Symbol.h:44,
                 from /home/angr/Desktop/dyninst-install/include/Symtab.h:36,
                 from /home/angr/Desktop/dyninst-install/include/CodeObject.h:36,
                 from /home/angr/Desktop/dyninst-install/dyninst_CFG/CFG.cpp:12:
/home/angr/Desktop/dyninst-install/include/boost/smart_ptr/shared_ptr.hpp:632:18: note: candidate: boost::shared_ptr<T>& boost::shared_ptr<T>::operator=(boost::shared_ptr<T>&&) [with T = Dyninst::InstructionAPI::Instruction]
     shared_ptr & operator=( shared_ptr && r ) BOOST_NOEXCEPT
                  ^~~~~~~~
/home/angr/Desktop/dyninst-install/include/boost/smart_ptr/shared_ptr.hpp:632:18: note:   no known conversion for argument 1 from ‘Dyninst::InstructionAPI::Instruction’ to ‘boost::shared_ptr<Dyninst::InstructionAPI::Instruction>&&’
/home/angr/Desktop/dyninst-install/include/boost/smart_ptr/shared_ptr.hpp:639:18: note: candidate: template<class Y> boost::shared_ptr<T>& boost::shared_ptr<T>::operator=(boost::shared_ptr<Y>&&) [with Y = Y; T = Dyninst::InstructionAPI::Instruction]
     shared_ptr & operator=( shared_ptr<Y> && r ) BOOST_NOEXCEPT
                  ^~~~~~~~
/home/angr/Desktop/dyninst-install/include/boost/smart_ptr/shared_ptr.hpp:639:18: note:   template argument deduction/substitution failed:
/home/angr/Desktop/dyninst-install/dyninst_CFG/CFG.cpp:87:29: note:   ‘Dyninst::InstructionAPI::Instruction’ is not derived from ‘boost::shared_ptr<X>’
  while ( (insn = dec.decode()) != NULL ) {
                             ^
In file included from /home/angr/Desktop/dyninst-install/include/boost/shared_ptr.hpp:17:0,
                 from /home/angr/Desktop/dyninst-install/include/dyn_regs.h:36,
                 from /home/angr/Desktop/dyninst-install/include/dyntypes.h:183,
                 from /home/angr/Desktop/dyninst-install/include/symutil.h:36,
                 from /home/angr/Desktop/dyninst-install/include/Symbol.h:44,
                 from /home/angr/Desktop/dyninst-install/include/Symtab.h:36,
                 from /home/angr/Desktop/dyninst-install/include/CodeObject.h:36,
                 from /home/angr/Desktop/dyninst-install/dyninst_CFG/CFG.cpp:12:
/home/angr/Desktop/dyninst-install/include/boost/smart_ptr/shared_ptr.hpp:649:18: note: candidate: boost::shared_ptr<T>& boost::shared_ptr<T>::operator=(boost::detail::sp_nullptr_t) [with T = Dyninst::InstructionAPI::Instruction; boost::detail::sp_nullptr_t = std::nullptr_t]
     shared_ptr & operator=( boost::detail::sp_nullptr_t ) BOOST_NOEXCEPT // never throws
                  ^~~~~~~~
/home/angr/Desktop/dyninst-install/include/boost/smart_ptr/shared_ptr.hpp:649:18: note:   no known conversion for argument 1 from ‘Dyninst::InstructionAPI::Instruction’ to ‘boost::detail::sp_nullptr_t {aka std::nullptr_t}’
CMakeFiles/CFG.dir/build.make:62: recipe for target 'CMakeFiles/CFG.dir/CFG.cpp.o' failed
make[2]: *** [CMakeFiles/CFG.dir/CFG.cpp.o] Error 1
CMakeFiles/Makefile2:67: recipe for target 'CMakeFiles/CFG.dir/all' failed
make[1]: *** [CMakeFiles/CFG.dir/all] Error 2
Makefile:83: recipe for target 'all' failed
make: *** [all] Error 2

I am new to dyninst. Am I missing any library? does anyone know the reason? Thanks!

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.