bug in visual studio .net 2003 - breakpoints and memcpy



hi,

this is a funny one, which took me hours to realise.


__declspec( naked )void asmFoo()
{
push EAX;
pop EAX;
}

now do this:

int main
{
RtlCopyMemory(newLocation, asmFoo, sizeofasmFoo);
}

and stick an IDE breakpoint on the line push EAX.

What happens when you run it? Well the opcodes for push EAX gets corrupted
by a CC (= int 3).

This is surely a bug, the ide shouldnt be doing this when you step through
the code?? It should remove the breakpoint for the purposes of memcpy??

Thanks,

Gareth


.



Relevant Pages