You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
工作内容
对比lx前辈的Cargo.lock中的依赖版本和我的是一模一样的,所以那些复现问题应该不是版本的问题。
最新的async-os用户态还是跑不起来,所以还是打算复现原版的async-os:https://github.com/AsyncModules/async-os,复现成功:
适配 async-debug调试 async-os。
适配过程中遇到的详细问题:
白名单生成为空
调试器连接后白名单生成失败,什么都没有。之前在 最新版上也遇到过一次同样问题,当时加
-g就解决了,但这次不一样。排查过程:
-g有没有传进去。ELF 从 1.4M 涨到了 6.3M,说明-g确实生效了,符号表有内容。readelf -S | grep debug看不到 debug sections,GDB 的info functions输出仍然是Non-debugging symbols:格式,没有File <路径>:和行号。make V=1看实际的 rustc 命令行:-C strip=debuginfo——这是 Rust release profile 的默认行为,编译器在链接之后把调试信息又删掉了。根本原因:Rust release 模式默认
strip = "debuginfo"。即使传了-g,cargo 也会在最后一步把 debuginfo strip 掉。解决:在 RUSTFLAGS 中加
-C strip=none,明确禁止 strip。最终的编译指令:make build ARCH=riscv64 BLK=y NET=y A=apps/user_boot \ RUSTFLAGS="-C link-arg=-T/home/iristseng/data/async-os-original/linker_riscv64-qemu-virt.lds -C link-arg=-no-pie -C force-frame-pointers=yes -g -C strip=none"NOTE:必须通过
make的命令行传 RUSTFLAGS,不能用export环境变量——因为 Makefile 里的RUSTFLAGS := ...会覆盖环境变量,但命令行传参会覆盖 Makefile 赋值。特权级切换的跟踪逻辑并没有生效
调试调试器,发现调试器并没有走任何特全级切换的调试逻辑,应该是边界断点未生效。实际检查,确实是边界断点只存入了调试器,但是并没有在GDB设置实际的断点,将逻辑补充完整。
hook 断点逻辑的移植
async-debug的hook断点逻辑还是最早之前的版本,需要把osgdb的hook逻辑移植过来,不依赖硬编码解析rust,而是直接解析GDB输出。

这个问题之前whm遇到过,但是我这里的情况可能和他的还不完全一样,问题还在排查。
尝试了用GDB直接调试,在user_reture处设置了断点,命中后,开始单步,结果一直停在这里。
会议内容
All reactions