Recent

Author Topic: How can I set up debugging for cross-compiled files?  (Read 797 times)

CCRDude

  • Sr. Member
  • ****
  • Posts: 468
How can I set up debugging for cross-compiled files?
« on: October 30, 2018, 12:47:30 pm »
Windows 10 brings WSL (Windows Subsystem for Linux), which allows to run cross-compiled linux ELF binaries (for the same hardware) natively.

gdb is available in WSL.

Challenge 1: Lazarus tells me gdb is not found. My fpcupdeluxe Installation looks for it in the fpcbootstrap\gdb\x86_64-linux\ folder. I can wrap up a small wrapper that calls "wsl gdb" and place it there to continue.

Challenge 2: Lazarus won't debug my executable, because the path is different. Forward input and output streams and manipulating them to change \ to / and prepend /mnt/c/ to the executing call is far from what I could do in a spare minute though.

Has anyone had success in debugging Linux binaries on Windows through WSL?

Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 5027
    • wiki
Re: How can I set up debugging for cross-compiled files?
« Reply #1 on: November 03, 2018, 06:34:25 pm »
This will probably need some work. Please report as a reminder/feature-request on our bugtracker