ubuntu 下sh gdb 调试脚本示例
#!/bin/bash
export LD_LIBRARY_PATH=/home/ubuntu/IllegalRecorder/test/lib:$LD_LIBRARY_PATH
export LD_LIBRARY_PATH=../lib/3rdParty/opencv-3.4.10/lib:$LD_LIBRARY_PATH
export LD_LIBRARY_PATH=../lib/3rdParty/caffe/lib:$LD_LIBRARY_PATH
export LD_LIBRARY_PATH=../lib/3rdParty/darknet/lib:$LD_LIBRARY_PATH
export LD_LIBRARY_PATH=../lib/3rdParty/protobuf/lib:$LD_LIBRARY_PATH
export LD_LIBRARY_PATH=../lib/3rdParty/cuda/lib64:$LD_LIBRARY_PATH
export LD_LIBRARY_PATH=../lib/3rdParty/atlas/lib:$LD_LIBRARY_PATH
export LD_LIBRARY_PATH=../lib/3rdParty/boost_1_59_0/lib:$LD_LIBRARY_PATH
export LD_LIBRARY_PATH=../lib/3rdParty/cairo/lib:$LD_LIBRARY_PATH
export LD_LIBRARY_PATH=../lib/3rdParty/freetype/lib:$LD_LIBRARY_PATH
export LD_LIBRARY_PATH=../lib/3rdParty/gflags/lib:$LD_LIBRARY_PATH
export LD_LIBRARY_PATH=../lib/3rdParty/glog/lib:$LD_LIBRARY_PATH
export LD_LIBRARY_PATH=../lib/3rdParty/lib:$LD_LIBRARY_PATH
export LD_LIBRARY_PATH=../lib/3rdParty/rapidjson/lib:$LD_LIBRARY_PATH
export LD_LIBRARY_PATH=../lib/3rdParty/xlnt/lib:$LD_LIBRARY_PATH
export LD_LIBRARY_PATH=../lib/3rdParty/zlog/lib:$LD_LIBRARY_PATH
export LD_LIBRARY_PATH=../lib/3rdParty/libFaceCom190610/lib:$LD_LIBRARY_PATH
export LD_LIBRARY_PATH=../lib/3rdParty/libtorch/lib:$LD_LIBRARY_PATH
export LD_LIBRARY_PATH=../lib/3rdParty/NumCpp/lib:$LD_LIBRARY_PATH
export LD_LIBRARY_PATH=../lib/3rdParty/oplib/lib:$LD_LIBRARY_PATH
export LD_LIBRARY_PATH=../lib/3rdParty/redis_bintest/lib:$LD_LIBRARY_PATH
export LD_LIBRARY_PATH=../lib/3rdParty/redisLib:$LD_LIBRARY_PATH
tool=./redis
deviceId=0
modelPath=../lib/models
videoPath=../video/data
savePath=../result
plateNum=Nanchang
labelType=IllegalParking
uuid="abcd"
redisip=192.168.10.111
./redis $deviceId $modelPath $videoPath $savePath $plateNum $labelType $uuid
gdb ./testcase
# set args 0 ../lib/models /data/vir_300/result/algRes/ /data/vir_300/result/roiRes/ 0 192.168.70.24
- file 可执行文件
- 输入参数: set args arg0 arg1 arg2
3.常见的终端输入指令:
r --run
s --stop
c --continue
b --设置断点 b 编译路径.cpp:行号
eg:b /data_1/project/nanchang/IllegalRecorder/test/model/classification/testcar.cpp:23
设置了断点,下一步就是用r或者run命令执行被调试的程序,执行后会自动在第一个断点处停下来
info b --显示所有的断点信息
bt --显示帧栈
next –
step – next 和step 单步调试的意思,两者的区别是next遇到函数不会进入函数内部,step会执行到函数内部。