Linux x86上, 交叉编 arm code后, copy executed file into target machine, take appForTest executed file as an example.
ps -ef | grep appForTest, to get the pid number, such as 1903
gdb attach 1903
b main
===>
Breakpoint 1 at 0x19a6d4: file /home/henry/src/main.cpp, line 378.
(gdb) l
364 /home/henry/src/main.cpp: No such file or directory.
Solution:
tar -zcvf src.tar.gz /home/henry/src
copy src.tar.gz into target machine, such as /home/root/src.tar.gz
cd /home/root
tar -zxvf src.tar.gz
now, there's a fold named src in /home/root, namely, that is /home/root/src
Important point as below:
repeat upper steps with gdb:
gdb attach 1903
set substiture-path /home/henry/src /home/root/src
b main
l
===>
now source code can be shown normally.
标签:src,code,tar,compiled,cross,gdb,home,root From: https://www.cnblogs.com/henryliublog/p/18633067