如何使用 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

      Debug GEM5 Source Using Eclipse: A Quick Tutorial
      Debug GEM5 Source Using Eclipse: A Quick Tutorial

    3. Create a lauch configuration

      Just Leave every thing AS IT IS.
      Debug GEM5 Source Using Eclipse: A Quick Tutorial

  5. Debug configurations
    1. Set arguments for gem5.debug to bootup gem5 in the way you expected.
      Debug GEM5 Source Using Eclipse: A Quick Tutorial
    2. Set the variable M5_PATH to point out the location of your binaries if you are to use gem5 FS mode.
      Debug GEM5 Source Using Eclipse: A Quick Tutorial
    3. Tell Eclipse where to lookup the source.
      Debug GEM5 Source Using Eclipse: A Quick Tutorial
      eg. at gem5/build/X86
  6. Just be ready for THE ENDLESS NIGHTMARE gem5 will bring!
    Debug GEM5 Source Using Eclipse: A Quick Tutorial

相关文章:

  • 2021-04-29
  • 2021-11-06
  • 2021-10-04
  • 2021-10-04
  • 2021-08-30
  • 2021-12-05
猜你喜欢
  • 2021-05-16
  • 2021-12-05
  • 2020-06-21
  • 2021-10-01
  • 2021-07-19
  • 2022-01-19
  • 2018-09-29
相关资源
相似解决方案