* * *

Author Topic: An alternative way of debugging FPC executables in Windows  (Read 538 times)

440bx

  • Full Member
  • ***
  • Posts: 207
An alternative way of debugging FPC executables in Windows
« on: July 24, 2018, 03:01:22 pm »
Hello,

I wasn't sure where to put this information, I hope this is a reasonably good place for it.  It only applies to Windows.

Lazarus does a very nice job using GDB to debug at the source code level.  When having to debug at the assembly level, GDB makes the process painful and clumsy.  It gets worse, close to unusable, when one needs to step through system dlls.

There is a little utility, cv2pdb, which can convert DWARF debug information to PDB information and store it in a separate PDB file.  Then to debug the executable, one only needs to do "devenv exename.exe" and Visual Studio will load the executable, allow source level debugging and full assembly level debugging along with the PDB files it can automatically download when stepping through system dlls.

The process has some limitations.   The debugging experience isn't as full as when the exe was developed in VS itself but, for assembly level debugging, it's way better than GDB.   It should also be possible to use WinDbg for those cases when system information is really needed.

I attached a screenshot of VS2017 debugging a simple GUI app.

the url where to find cv2pdb is https://github.com/rainers/cv2pdb

 

Recent

Get Lazarus at SourceForge.net. Fast, secure and Free Open Source software downloads Open Hub project report for Lazarus