User forums > Help

Problem with disassembly window and inline assembly

(1/1)

skirby:
Hello,

I have found a really strange behavior with inline assembly and the debugger (Disassembly window).
Here is a simple example:

--- Code: ---#include <stdio.h>

int main()
{
    asm(
      ".intel_syntax noprefix \n"

      "mov eax, 5 \n"
      "mov eax, 1 \n"
      "mov ecx, eax \n"

      ".att_syntax noprefix \n"
    );

  return 0;
}

--- End code ---

Put a break point on the asm line.
Here is what I have on screen:


Now, invert the two lines:
      "mov eax, 1 \n"
      "mov ecx, eax \n"
becomes
      "mov ecx, eax \n"
      "mov eax, 1 \n"
and launch again the program by F8

Here is now what I have on disassembly window:


The same thing as before while I have invert the two lines.
But, if you trace assembly code, it is corretely executed.

Is it a bug?
If yes, do I have to report it on BerliOS?

Thanks and have a nice day.

For information, I am on Windows 2000 sp4 and I use the following C::B version
Version 1.0 revision 2891 ()   gcc 3.4.5 Windows/unicode

mandrav:
Yes, it's a bug of optimization. Although you have restarted the debugger, the disassembly window hasn't cleared its state and because the stack frame address is the same as before it doesn't ask for a refresh of its contents....

Post it to berlios, or else I might forget about it ;).

skirby:
Thank you mandrav,

The bug has been reported on BerliOS.
Like that you won't forget it  :wink:

Navigation

[0] Message Index

Go to full version