I using the following command to debug it, but not work.
Thanks a lot.
gdb --args “/home/zzy/llvm-10.0.0/bin/bin/clang-10” “-cc1” “-triple” “x86_64-unknown-linux-gnu” “-emit-obj” “-mrelax-all” “-disable-free” “-main-file-name” “hello.c” “-mrelocation-model” “static” “-mthread-model” “posix” “-mframe-pointer=all” “-fmath-errno” “-fno-rounding-math” “-masm-verbose” “-mconstructor-aliases” “-munwind-tables” “-target-cpu” “x86-64” “-dwarf-column-info” “-fno-split-dwarf-inlining” “-debugger-tuning=gdb” “-resource-dir” “/home/zzy/llvm-10.0.0/bin/lib/clang/10.0.0” “-internal-isystem” “/usr/local/include” “-internal-isystem” “/home/zzy/llvm-10.0.0/bin/lib/clang/10.0.0/include” “-internal-externc-isystem” “/usr/include/x86_64-linux-gnu” “-internal-externc-isystem” “/include” “-internal-externc-isystem” “/usr/include” “-O0” “-fdebug-compilation-dir” “/home/zzy/study/llvm_learn/llvm-10” “-ferror-limit” “19” “-fmessage-length” “0” “-fgnuc-version=4.2.1” “-fobjc-runtime=gcc” “-fdiagnostics-show-option” “-fcolor-diagnostics” “-mllvm” “-unroll-threshold=100” “-faddrsig” “-o” “/tmp/hello-c6133e.o” “-x” “c” “hello.c”
(gdb) b computeUnrollCount
Breakpoint 1 at 0x39be695: file /home/zzy/llvm-10.0.0/llvm-project/llvm/lib/Transforms/Scalar/LoopUnrollPass.cpp, line 743.
(gdb) b getUserCost
Breakpoint 2 at 0x244fb06: getUserCost. (9 locations)
(gdb) r
Starting program: /home/zzy/llvm-10.0.0/bin/bin/clang-10 -cc1 -triple x86_64-unknown-linux-gnu -emit-obj -mrelax-all -disable-free -main-file-name hello.c -mrelocation-model static -mthread-model posix -mframe-pointer=all -fmath-errno -fno-rounding-math -masm-verbose -mconstructor-aliases -munwind-tables -target-cpu x86-64 -dwarf-column-info -fno-split-dwarf-inlining -debugger-tuning=gdb -resource-dir /home/zzy/llvm-10.0.0/bin/lib/clang/10.0.0 -internal-isystem /usr/local/include -internal-isystem /home/zzy/llvm-10.0.0/bin/lib/clang/10.0.0/include -internal-externc-isystem /usr/include/x86_64-linux-gnu -internal-externc-isystem /include -internal-externc-isystem /usr/include -O0 -fdebug-compilation-dir /home/zzy/study/llvm_learn/llvm-10 -ferror-limit 19 -fmessage-length 0 -fgnuc-version=4.2.1 -fobjc-runtime=gcc -fdiagnostics-show-option -fcolor-diagnostics -mllvm -unroll-threshold=100 -faddrsig -o /tmp/hello-c6133e.o -x c hello.c
[Thread debugging using libthread_db enabled]
Using host libthread_db library “/lib/x86_64-linux-gnu/libthread_db.so.1”.
[Inferior 1 (process 5489) exited normally]