Dave,
The patch, sent by Ian Lawrence, looks good me.
I also found some other places, where the similar changes were required (specially in debugger code).
I've attached the combined patch (debugger changes and Ian's patch).
If nobody has any objection, I will check-in the patch on both REL-1_18_0_PATCHES and master branch.