gpt4 book ai didi

gdb - 强制 gdb 在随机地址加载共享库

转载 作者:行者123 更新时间:2023-12-01 12:21:02 26 4
gpt4 key购买 nike

我正在调试共享库。我发现在Linux主机上启用ASLR时可以触发该错误,而禁用ASLR时该错误消失。

我想用gdb进一步调试共享库。但是我发现它总是在固定地址加载共享库,这使得bug消失了。

有什么办法可以禁用这个 gdb 的功能吗?

最佳答案

Is there any way to disable this gdb's feature?



是的,您可以 set disable-randomization off在运行程序之前。
查看 gdb documentation的这一部分:

set disable-randomization off

Leave the behavior of the started executable unchanged. Some bugs rear their ugly heads only when the program is loaded at certain addresses. If your bug disappears when you run the program under GDB, that might be because GDB by default disables the address randomization on platforms, such as GNU/Linux, which do that for stand-alone programs. Use set disable-randomization off to try to reproduce such elusive bugs.

关于gdb - 强制 gdb 在随机地址加载共享库,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43944064/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com