Her*_*che 4 debugging gdb errno libc watchpoint
我试图找出errno何时发生变化.
起初,我在gdb中尝试了"watch errno",这导致了错误
Cannot find thread-local variables on this target
Run Code Online (Sandbox Code Playgroud)
我能够通过编译"-pthread"来解决这个问题.但是,它仍然不起作用,我现在得到错误
Cannot find shared library `/usr/lib/debug/lib/x86_64-linux-gnu/libc-2.13.so' in dynamic linker's load module list
Run Code Online (Sandbox Code Playgroud)
当我输入"watch errno"时.我需要做什么才能在errno上设置观察点?
errno不再只是一个静态变量了.以下是Linux上用户态应用程序(来自我当地/usr/include/x86_64-linux-gnu/bits/errno.h)的显示方式:
# define errno (*__errno_location ())
Run Code Online (Sandbox Code Playgroud)
这是为了获得每个线程的错误状态.
| 归档时间: |
|
| 查看次数: |
1828 次 |
| 最近记录: |