I've noticed that often, but not always, the line of code the IDE takes me when debugging is off by one. For example, double-clicking an entry to the call stack will take me to the line in the editor after the line shown in the call stack. This happens for exception raise locations, for call stack locations, when using JCLDebug info as well, etc. This is in a full debug build.

I've noticed that often, but not always, the line of code the IDE takes me when debugging is off by one. For example, double-clicking an entry to the call stack will take me to the line in the editor after the line shown in the call stack. This happens for exception raise locations, for call stack locations, when using JCLDebug info as well, etc. This is in a full debug build.

Has anyone else seen this? If so, what is the cause, and what can be done to fix it?

My guess is something like the IP register or something else (I'm not yet super-familiar with x86 assembly) is updated too early, so it is pointing at something that ends up being the next line. I'm quite ok with this in a release build since the compiler should optimise as much as it wants, but in a debug build I want call stacks and locations to be accurate, and they aren't.

Comments

  1. Nicholas Ring Great thanks.  Did not notice that Castalia could do that.

    ReplyDelete
  2. madExcept always takes me to the exact line. The IDE always takes me to the line that would be executed next.

    ReplyDelete
  3. Today, in the same project I was using when I posted this, I am now being taken to one line before the correct line.

    It's particularly strange because it's always been one line after every other time I've seen this problem. In this project, I'm using JclDebug, but poking through its code it directly reads/converts the map file and so it's definitely that output which must be wrong.

    ReplyDelete

Post a Comment