gdb debug linux arm Qt
1. 確認是否開啟生成core
ulimit -c
若為unlimited或是具體數字, 則是打開的
若為0, 則說明生成core文件是關閉的, 開啟命令為: ulimit -c unlimited 或 ulimit -c 33268
2. 獲取core dump文件, 跳過systemd, 生成在指定目錄,比如當前可執行文件所在目錄
sysctl -w 'kernel.core_pattern=%t-%e-%p-%c.core', 當然,需要管理員權限才可以
3. bt命令查看
生成xxxxx.core文件后,運行
gdb exe_file_name xxxxx.core
進入(gdb)
輸入bt查看core dump 所在位置
4. arm linux 調試事例:
gdb CT360 1568614925-RtPlotSurface-1256-4294967295.core
(gdb)bt
#0 0xb6e95eae in CPP1Name::FUNCTION1(this=0x3aa860, start_tick=8, duration_tick=248) at CPP1Name.cpp:191
#1 0xb6e921f4 in CPP2Name::FUNCTION2(this=0xb6f54150 <SIGTON::GetInstance()::instance>, pdata_dest=0x294ab4, read_samp_size=31, ptick_time=0xae8e4e00) at CPP2Name.cpp:59
#2 0xb6f134fe in CPP3Name::FUNCTION3(this=0x293ff0) at CPP3Name.cpp:277
#3 0xb6f13058 in CPP4Name::run (this=0x293ff0) at CPP3Name.cpp:161
#4 0xb612bc0e in ?? () from /opt/Qt-arm-5.6.3/lib/libQt5Core.so.5
#5 0xb6071494 in start_thread (arg=0xbf0f8ed2) at pthread_create.c:458
#6 0xb5dfa1ac in ?? () at ../sysdeps/unix/sysv/linux/arm/clone.S:76 from /lib/libc.so.6
Backtrace stopped: previous frame identical to this frame (corrupt stack?)
浙公網安備 33010602011771號