Debug GEM5 Source Using Eclipse: A Quick Tutorial

版权声明:本文为博主 "猫科龙" 原创文章,未经博主允许不得转载。 https://blog.csdn.net/maokelong95/article/details/85333905

Debug GEM5 Source Using Eclipse: A Quick Tutorial

如何使用 Eclipse 调试 GEM5 代码

Environment Configuration

Note that this is just the environment we are currently working under, and it’s at your own risk to adopt the other environments.

  • OS:Ubuntu 16.04.1 Desktop
  • Eclipse: eclipse-cpp-2018-12-R-linux-gtk-x86_64
  • Gem5 Commit ID:c428c220fd351626e2ee0005dda696940261793b
  • OpenJDK: 1.8.0_191

Steps to Work

  1. Build gem5.debug
    git clone https://github.com/gem5/gem5
    cd gem5
    scons build/X86/gem5.debug -j$(cat /proc/cpuinfo | grep "processor" | wc -l)
    cd util/term
    make && sudo make install
    cd ../../..
    
  2. Install JRE
    sudo apt install default-jre
    
  3. Setup eclipse
    wget http://ftp.yz.yamagata-u.ac.jp/pub/eclipse/technology/epp/downloads/release/2018-12/R/eclipse-cpp-2018-12-R-linux-gtk-x86_64.tar.gz
    tar -xvzf eclipse-cpp-2018-12-R-linux-gtk-x86_64.tar.gz
    
  4. Config eclipse
    1. Open eclipse

      cd eclipse
      ./eclipse
      
    2. Import gem5.debug as the C/C++ executable file

      Menu -> File -> Import -> C/C++ folder -> C/C++ Executable -> Select gem5.debug

      eg. at gem5/build/X86/gem5.debug

      alt
      alt

    3. Create a lauch configuration

      Just Leave every thing AS IT IS.
      在这里插入图片描述

  5. Debug configurations
    1. Set arguments for gem5.debug to bootup gem5 in the way you expected.
      在这里插入图片描述
    2. Set the variable M5_PATH to point out the location of your binaries if you are to use gem5 FS mode.
      在这里插入图片描述
    3. Tell Eclipse where to lookup the source.
      在这里插入图片描述
      eg. at gem5/build/X86
  6. Just be ready for THE ENDLESS NIGHTMARE gem5 will bring!
    在这里插入图片描述

猜你喜欢

转载自blog.csdn.net/maokelong95/article/details/85333905