Debug GEM5 Source Using Eclipse: A Quick Tutorial

如何使用 Eclipse 调试 GEM5 代码

Found DPRINTF based debugging unable to meet your needs?

Found GDB based debugging unfriendly to human beings?

Want to debug gem5 source with the help of modern IDEs like Eclipse?

Failed in getting help from GEM5 community?

Come on, dude! Here is the up-to-date tutorial for you!

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
      alt
      Select gem5.debug as the executable

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

      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.
      在这里插入图片描述

      It’s beyond of this tutorial’s scope to describe where to put these binaries and disk images .

    3. Tell Eclipse where to lookup the source.
      在这里插入图片描述
      eg. at gem5/build/X86
  6. Just be ready for THE ENDLESS NIGHTMARE gem5 will bring!
    在这里插入图片描述
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值