gdb에서 프로그램을 디버깅 중이며 메모리 영역 0x08049000에서 0x0804a000에 액세스 할 때 프로그램을 중단하고 싶습니다. 메모리 중단 점을 수동으로 설정하려고하면 gdb가 한 번에 두 개 이상의 위치를 지원하지 않는 것 같습니다.gdb에서 메모리 범위보기
(gdb) awatch *0x08049000
Hardware access (read/write) watchpoint 1: *0x08049000
(gdb) awatch *0x08049001
Hardware access (read/write) watchpoint 2: *0x08049001
(gdb) awatch *0x08049002
Hardware access (read/write) watchpoint 3: *0x08049002
(gdb) run
Starting program: /home/iblue/git/some-code/some-executable
Warning:
Could not insert hardware watchpoint 3.
Could not insert hardware breakpoints:
You may have requested too many hardware breakpoints/watchpoints.
이미 질문이 제기되었고 답변은 valgrind에서 가능할 수도 있습니다. 불행히도 대답은 valgrind 매뉴얼에 대한 예제 나 참조를 포함하지 않으므로 매우 enlightning이 아닙니다. How can gdb be used to watch for any changes in an entire region of memory?
So : 전체 메모리 영역을 어떻게 볼 수 있습니까?
재미있는 사실 the Valgrind user manual on gdb integration를 참조 http://stackoverflow.com/questions/ 13410941/set-break-on-every-line-in-gdb/31658056 # 31658056 –
x86은 최대 8 바이트의 작은 시계 범위를 지원합니다 : https://en.wikipedia.org/wiki/X86_debug_register –