我试图在模块加载到gdb后立即停止.让我们假设二进制文件完全从所有符号信息中删除,因此没有主要信息.
理想情况下,我会在入口点设置断点,但由于重定位,这个想法会中断:
(gdb) info target
Symbols from "./application".
Local exec file:
`./application', file type elf64-x86-64.
Entry point: 0xc154
...
(gdb) break *0xc154
Breakpoint 1 at 0xc154
(gdb) r
Starting program: ./application
Warning:
Cannot insert breakpoint 1.
Error accessing memory address 0xc154: Input/output error.
(gdb) info target
Symbols from "./application".
Unix child process:
Using the running image of child process 22835.
While running this, GDB does not access memory from...
Local exec file:
`./application', file type elf64-x86-64.
Entry point: 0x555555560154
Run Code Online (Sandbox Code Playgroud)
即使这种工作(我可以在新地址上设置新的断点并禁用原始地址),它也不能通过gdb脚本/批处理模式轻松执行,因为它在中间有一个失败的指令. …