Do not crash when the Memory window shows a dump after an error message.
commit4e19e7239e12a62ae120a662134d51d3c3c88108
authorJohannes Sixt <j6t@kdbg.org>
Thu, 6 Dec 2012 21:21:33 +0000 (6 22:21 +0100)
committerJohannes Sixt <j6t@kdbg.org>
Thu, 6 Dec 2012 21:21:33 +0000 (6 22:21 +0100)
tree31b4471ae9579d2c44ff76f1fdbe8bfd3c8da6c1
parent842186fcdc3d0983a0b7f79d28e9273d07203f41
Do not crash when the Memory window shows a dump after an error message.

When a memory dump of an expression is requested that refers to
inaccessible memory, an error message is displayed in the Memory window.
When the memory later becomes accessible, the memory dump should replace
the error message, but we crash instead due to an out-of-bounds access.
This fixes it.

The bug is most annoying because the address of the requested memory dump
is "sticky", and is not reverted by restarting the debug session; just
stepping over a memory allocation that makes the address accessible
triggered the bogus behavior, as was discovered by Terry Boldt.
kdbg/memwindow.cpp