Force gdb to load shared library at randomized address

后端 未结 1 605
猫巷女王i
猫巷女王i 2020-12-11 09:49

I\'m debugging a shared library. I found that the bug can be trigger when I enable ASLR in Linux host, while the bug disappears when ASLR is disabled.

I want to furt

相关标签:
1条回答
  • 2020-12-11 10:25

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

    Yes, you can set disable-randomization off before running the program. See this part of 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.

    0 讨论(0)
提交回复
热议问题