版权声明:本文为博主 "猫科龙" 原创文章,未经博主允许不得转载。 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
- 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 ../../..
- Install JRE
sudo apt install default-jre
- 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
- Config eclipse
-
Open eclipse
cd eclipse ./eclipse
-
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
-
Create a lauch configuration
Just Leave every thing AS IT IS.
-
- Debug configurations
- Set arguments for gem5.debug to bootup gem5 in the way you expected.
- Set the variable M5_PATH to point out the location of your binaries if you are to use gem5 FS mode.
- Tell Eclipse where to lookup the source.
eg. at gem5/build/X86
- Set arguments for gem5.debug to bootup gem5 in the way you expected.
- Just be ready for THE ENDLESS NIGHTMARE gem5 will bring!