当前位置:网站首页>Crash usage

Crash usage

2022-06-10 05:25:00 Xinxin defect gold

Environment building

1.crash Tool compilation

sudo apt-get install libaio-dev  libncurses5-dev  zlib1g-dev liblzma-dev  flex bison byacc m4 bison g++-multilib gcc-multilib lib32ncurses5-dev lib32z1-dev

2. install termcap libary

1) download termcap

wget http://ftp.gnu.org/gnu/termcap/termcap-1.3.1.tar.gz

2) decompression

tar -zxv -f  termcap-1.3.1.tar.gz

3) install

cd termcap-1.3.1
./configure

3. download crash Source code

https://github.com/crash-utility/crash
https://github.com/crash-utility/crash.git

4. compile crash Tools

cd  crash-master/crash-master	
make target=ARM64
sudo make install

5、 If you need a fallback code

git reset --hard 0ab7ac3bea5deaa3da894247ffab9ef2433c1b9b

start-up

According to the environment, we built our door and compiled it crash Executable program , There are two , One is debugging ARM Of , One is ARM64 Of ,
See you debug target yes ARM still ARM64, Then decide which one to use , Here we will debug ARM The named carsh, To be debugged ARM64 The named crash64.
start-up crash You need two files , One is coredump(dump) Here is SYS_COREDUMP、 One is vmlinux( The symbol table ).

take vmlinux and SYS_COREDUMP Put in crash In the same directory of the executable program , start-up :

crash vmlinux SYS_COREDUMP

give the result as follows
 Insert picture description here

 At this point, you can enter various debugging commands 

Routine debugging

Common commands
crash Use GDB As his internal engine ,crash Many commands and grammars in are related to GDB identical . If ever used GDB, You will find crash It's not that strange .
If you want to get crash More commands and detailed descriptions of related commands , have access to crash The internal order of help To get :

 Please add a picture description
 Please add a picture description
 Please add a picture description
 Please add a picture description

Command expansion

The extension command
crash Support extended commands , To be specific, see crash Expand the description of the command

Two commands to help analyze the problem
 Please add a picture description
Compile extended command Library
Download the source code on the official website of the expansion command , Put in crash Source code inside extensions Catalog , For example, will trace.c Put in extensions Catalog .
And then in crash Enter the following command in the source directory :

make extensions

After compiling , There will be so Library generation , Files in extensions Catalog , such as trace.so
 Please add a picture description
Use the expand command
Enter into crash after , stay crash Command line diagram

extend <path-to> /xxx.so

 Please add a picture description
crash The corresponding command is supported .

Unique features - see ftrace( Write next time )

原网站

版权声明
本文为[Xinxin defect gold]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/161/202206100521188247.html