Forum > Debugger

Debugger step-over issue (step over perform step in)

(1/1)

Martin_fr:
This is a known issue under 64 bit Windows, when using the default debugger of Lazarus (gdb based / GDBMI debugger).
There have been sporadic reports that this may occur on other platforms too...

Anyway the symptoms of this issue are:
- During debugging you press F8 (or otherwise trigger step-over)
- The debugger will NOT step to the next line, but stop inside a function that was called by the line you tried to step over.

I myself have only reproduced this, in cases where the debugger stepped into code that has debug info. So the source of the stepped-into procedure is shown. If anyone has experienced stepping into assembler I would like feedback on this.

I have added some code, that may work around the issue. But that needs testing.
It is present in trunk (r60274) and fixes 2.0 branch (merge is actually pending, but is planned to happen before release).

Due to the lack of tests this feature is disabled by default.
Go to Tools > Option > Debugger
Find (in the property grid) "FixIncorrectStepOver" and enable it.

If the IDE detects a step-in when expecting a step over, it will try to solve the issue (perform a further step-over and then a step-out / a step out from the "begin" line of a procedure does not always work).

If you have cases where this does not work, could you please report with:
- a reproducible example (if you have)
- always (even if you have an example): a logfile
  http://wiki.lazarus.freepascal.org/GDB_Debugger_Tips#Log_info_for_debug_session

BrunoK:
Testing some personal hacks in x86_64 Win10 I fell on that F8 problem.
It seems to occur systematically every time a kernel procedure is called.

Example code :

--- Code: Pascal  [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ---function WriteProtectedMemory(aBaseAddress, aBuffer: Pointer; aSize: Cardinal):boolean;var  lOldProtect, lDummy: Cardinal;begin  if aSize > 0 then begin    lOldProtect := 0;    Result := VirtualProtect(aBaseAddress, aSize, PAGE_EXECUTE_READWRITE, lOldProtect);    if Result then begin      Move(aBuffer^, aBaseAddress^, aSize);      if lOldProtect in [PAGE_EXECUTE, PAGE_EXECUTE_READ, PAGE_EXECUTE_READWRITE, PAGE_EXECUTE_WRITECOPY] then      begin        FlushInstructionCache(GetCurrentProcess, aBaseAddress, aSize);        lDummy := 0;        VirtualProtect(aBaseAddress, aSize, lOldProtect, lDummy);      end      else        Exit(False);    end;  end;end; Problems appears with F4, F7, F8 when on lines 7, 12 and 14. 

>>>> FixIncorrectStepOver Enabled seems to completly correct that situation, thanks  <<<<

GNU gdb (GDB) 8.2

Navigation

[0] Message Index

Go to full version