Author Topic: Problem with disassembly window and inline assembly  (Read 2964 times)

Offline skirby

  • Almost regular
  • **
  • Posts: 137
Problem with disassembly window and inline assembly
« on: August 24, 2006, 03:13:45 pm »
Hello,

I have found a really strange behavior with inline assembly and the debugger (Disassembly window).
Here is a simple example:
Code: [Select]
#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;
}

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

Offline mandrav

  • Project Leader
  • Administrator
  • Lives here!
  • *****
  • Posts: 4291
    • Code::Blocks IDE
Re: Problem with disassembly window and inline assembly
« Reply #1 on: August 24, 2006, 03:19:51 pm »
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 ;).
Be patient!
This bug will be fixed soon...

Offline skirby

  • Almost regular
  • **
  • Posts: 137
Re: Problem with disassembly window and inline assembly
« Reply #2 on: August 24, 2006, 03:31:22 pm »
Thank you mandrav,

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