天气阴。

今日尝试直接修改 Makefile 在 unmatched 编译,发现 ncpus 不显示 optimized out 了。
说明 Makefile 的生成脚本确实写糊了,和 x86 一样可以得出值是 0。

运行的时候:

(gdb) r ./gprofng/src/gp-collect-app echo 1
Starting program: /home/xyenchi/binutils-gdb/debug-build/gprofng/src/gp-collect-app ./gprofng/src/gp-collect-app echo 1
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/riscv64-linux-gnu/libthread_db.so.1".
Creating experiment directory test.1.er (Process ID: 1319751) ...
process 1319751 is executing new program: /home/xyenchi/binutils-gdb/debug-build/gprofng/src/gp-collect-app
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/riscv64-linux-gnu/libthread_db.so.1".
Creating experiment directory test.2.er (Process ID: 1319751) ...
Warning: libgp-collector.so is already defined in one or more LD_PRELOAD environment variables
process 1319751 is executing new program: /usr/bin/echo
Error in re-setting breakpoint 1: Function "write_header" not defined.
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/riscv64-linux-gnu/libthread_db.so.1".
1
[Inferior 1 (process 1319751) exited normally]
(gdb) p ncpus
No symbol "ncpus" in current context.

但是大佬说使用ptrace的程序可能不能用gdb。

学习到使用 gdb 设置 watchpoint 的方法,但是跑了七个小时。明天再来看看。
有个问题就是hw watchpoint降级成了software watchpoint。

warning: watchpoint 1 downgraded to software watchpoint

今天开始将 RISC-V 相关 patch cherry-pick 到 gcc-12.3.0, 然后推到 ruyisdk 。
尝试给 riscv-gnu-toolchain 仓库写一个 CI, 发现如果我更新 gcc 的分支,我写的 CI 并不会自动运行,尴尬捏。