0

I tried to set watch into address

(gdb) watch 0x7536546 but I got an error Warning: Could not insert hardware watchpoint 6. Could not insert hardware breakpoints: You may have requests too many hardware breakpoints/watchpoints

That the first hardware breakpoint that I have tried to insert

What is the problem and what can I do ?

MicrosoctCprog
  • 460
  • 1
  • 3
  • 23
  • Please edit your question to say which OS and what version of GDB you are using, as well as explaining where the `0x7536546` address camer from. – Employed Russian Jan 27 '21 at 04:53

1 Answers1

2

(gdb) watch 0x7536546

Above command instructs GDB to wait until expression 0x7536546 changes, but it never will -- that expression will forever remain 0x7536546.

You probably wanted to watch the value stored at address 0x7536546. To do so, the command to use is:

(gdb) watch *(int*)0x7536546
(gdb) watch *(long*)0x7536546

Adjust the type to whatever type is stored at the given address.

Employed Russian
  • 199,314
  • 34
  • 295
  • 362