I'm trying to set a debugger breakpoint that triggers on a memory read/write over a memory range rather than a single address. I think it could be a handy, time-saving feature to catch and track down suspected random memory writes caused by bugs in my code
Couldn't find much information online about setting this type of breakpoint in the capable InkSpector or ZX-Spin debuggers, which I suspect have this ability.
Anyone know how to do it? Thanks
Breakpoint on a memory range
Re: Breakpoint on a memory range
Here is a very old post about breakpoints in Spin, which is probably the best documentation existing about them
https://worldofspectrum.org/forums/disc ... edirect/p1
You want probably something like this:
Please notice that the field Address must be empty. It is filled by default and means that breakpoint will hit only on this single memory address.
https://worldofspectrum.org/forums/disc ... edirect/p1
You want probably something like this:
Please notice that the field Address must be empty. It is filled by default and means that breakpoint will hit only on this single memory address.
Re: Breakpoint on a memory range
Works great.. thanks!Ralf wrote: ↑Sat Jun 11, 2022 11:56 am Here is a very old post about breakpoints in Spin, which is probably the best documentation existing about them
https://worldofspectrum.org/forums/disc ... edirect/p1
You want probably something like this:
Please notice that the field Address must be empty. It is filled by default and means that breakpoint will hit only on this single memory address.
Now to track down those pesky (and spurious.. the worst kind) memory writes
Cosmium
https://cosmium.itch.io/
https://cosmium.itch.io/
Re: Breakpoint on a memory range
Hi,Cosmium wrote: ↑Sat Jun 11, 2022 2:32 am I'm trying to set a debugger breakpoint that triggers on a memory read/write over a memory range rather than a single address. I think it could be a handy, time-saving feature to catch and track down suspected random memory writes caused by bugs in my code
Couldn't find much information online about setting this type of breakpoint in the capable InkSpector or ZX-Spin debuggers, which I suspect have this ability.
Anyone know how to do it? Thanks
Sorry for the tardy response!
The way to do it with Inkspector (it's easier with the new 2.0.4 release so I'd suggest you upgrade any older version first) is to add a breakpoint with the following settings:
Breakpoint Type: Memory Read
Address: 0 (this value will actually be ignored due to the mask value below being set to 0)
Address Mask: 0 (this causes all memory addresses to be considered, not just Address above)
ROM/RAM Pages: Any
Condition: @addr >16384 && @addr < 32768
The remaining values are OK with their defaults.
In the condition box, @addr is the address being read from or written to, so you can change the breakpoint type to Memory *Write* and it will then break on memory writes of the same range. All symbols and z80 regsiters are available too, so you can include those in the condition expression.
If you change the breakpoint type to Condition, it will break when the specified condition is true regardless of when it occurs.
HTH
Inky.
Re: Breakpoint on a memory range
Thanks Inky - really helps. Expecially coupled with the debugger's inherent awareness of the system variable symbols
Cosmium
https://cosmium.itch.io/
https://cosmium.itch.io/