Recent

Author Topic: Remote debugging on Raspberry (from Windows)  (Read 3027 times)

DimTim

  • New Member
  • *
  • Posts: 42
Remote debugging on Raspberry (from Windows)
« on: May 06, 2022, 03:58:29 pm »
Trying to set up remote debugging on Raspberry Pi with gdbserver (from Windows in my case), I finally found out that gdb-multiarch.exe is required as debugger backend. One may install that (with a bunch of other stuff) with MSYS2.  Also one needs to set "Architecture: arm" in debugger options. "Standard" windows gdb.exe (and Linux gdb) is built without cross-targets support.  Maybe I should add this note to the wiki page?
« Last Edit: May 07, 2022, 03:12:01 am by DimTim »

MarkMLl

  • Hero Member
  • *****
  • Posts: 6676
Re: Remote debugging on Raspberry (from Windows)
« Reply #1 on: May 06, 2022, 06:39:50 pm »
If it's useful advice it's welcome :-)

From my POV, the major gdbserver gotcha is that the commandline parameters specified in the IDE are ignored. I've used it quite a lot for debugging stuff using POSIX capabilities etc.

MarkMLl
MT+86 & Turbo Pascal v1 on CCP/M-86, multitasking with LAN & graphics in 128Kb.
Pet hate: people who boast about the size and sophistication of their computer.
GitHub repositories: https://github.com/MarkMLl?tab=repositories

DimTim

  • New Member
  • *
  • Posts: 42
Re: Remote debugging on Raspberry (from Windows)
« Reply #2 on: May 07, 2022, 07:45:57 am »
If it's useful advice it's welcome :-)

I hope it is. :)  Lazarus is great programming tool for SBC's such as RasPi, but they are too slow to comfortably work natively.

Edited the Wiki page...

MarkMLl

  • Hero Member
  • *****
  • Posts: 6676
Re: Remote debugging on Raspberry (from Windows)
« Reply #3 on: May 07, 2022, 08:21:57 am »
I hope it is. :)  Lazarus is great programming tool for SBC's such as RasPi, but they are too slow to comfortably work natively.

I've never had any problems, either running with a directly-connected screen etc., tunnelling X11 over SSH, or (in extremis) using VNC.

And you've always got the option of keeping the source in Subversion, doing most of the development on a PC, and doing the final compilation/debug on the RPi.

MarkMLl
MT+86 & Turbo Pascal v1 on CCP/M-86, multitasking with LAN & graphics in 128Kb.
Pet hate: people who boast about the size and sophistication of their computer.
GitHub repositories: https://github.com/MarkMLl?tab=repositories

Thaddy

  • Hero Member
  • *****
  • Posts: 14209
  • Probably until I exterminate Putin.
Re: Remote debugging on Raspberry (from Windows)
« Reply #4 on: May 07, 2022, 01:28:12 pm »
Edited the Wiki page...
Then I will edit it back, because it is not correct.
Specialize a type, not a var.

trev

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2020
  • Former Delphi 1-7, 10.2 user
Re: Remote debugging on Raspberry (from Windows)
« Reply #5 on: May 08, 2022, 12:43:10 am »
Then I will edit it back, because it is not correct.

As you haven't edited it back. do I take it that you misspoke? If you haven't got a round tuit, then perhaps you could elaborate on what exactly is not correct?

MarkMLl

  • Hero Member
  • *****
  • Posts: 6676
Re: Remote debugging on Raspberry (from Windows)
« Reply #6 on: May 08, 2022, 08:56:13 am »
As you haven't edited it back. do I take it that you misspoke? If you haven't got a round tuit, then perhaps you could elaborate on what exactly is not correct?

Agreed. However I think OP should clarify which URL he was looking at, in case different people are looking at different things.

MarkMLl
MT+86 & Turbo Pascal v1 on CCP/M-86, multitasking with LAN & graphics in 128Kb.
Pet hate: people who boast about the size and sophistication of their computer.
GitHub repositories: https://github.com/MarkMLl?tab=repositories

trev

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2020
  • Former Delphi 1-7, 10.2 user

MarkMLl

  • Hero Member
  • *****
  • Posts: 6676
Re: Remote debugging on Raspberry (from Windows)
« Reply #8 on: May 09, 2022, 11:38:18 am »
So I can see that OP (Dim-Tim) has edited that. Thaddy: I'm not trolling but what are you unhappy about?

MarkMLl
MT+86 & Turbo Pascal v1 on CCP/M-86, multitasking with LAN & graphics in 128Kb.
Pet hate: people who boast about the size and sophistication of their computer.
GitHub repositories: https://github.com/MarkMLl?tab=repositories

DimTim

  • New Member
  • *
  • Posts: 42
Re: Remote debugging on Raspberry (from Windows)
« Reply #9 on: May 15, 2022, 06:59:19 am »
Well, it works, and may be useful for someone.  If I omitted something important, anyone is free to edit and add missing parts. :)

The thing is, I usually work with MCU's, and this way of debugging is most natural for me: cross-compiling on PC and debugging remotely from IDE with an ICE-tool.

MarkMLl

  • Hero Member
  • *****
  • Posts: 6676
Re: Remote debugging on Raspberry (from Windows)
« Reply #10 on: May 15, 2022, 09:09:41 am »
Yes, that's been pretty standard since the 80s- thinking about some of the groundbreaking work Logitech did.

But an RPi is entirely adequate for native development.

MarkMLl
MT+86 & Turbo Pascal v1 on CCP/M-86, multitasking with LAN & graphics in 128Kb.
Pet hate: people who boast about the size and sophistication of their computer.
GitHub repositories: https://github.com/MarkMLl?tab=repositories

DimTim

  • New Member
  • *
  • Posts: 42
Re: Remote debugging on Raspberry (from Windows)
« Reply #11 on: May 16, 2022, 07:10:31 am »
But an RPi is entirely adequate for native development.
Well, it's incomparable by speed and comfort with an average modern desktop system - Windows or Linux.  Besides, I couldn't install Lazarus with fpcupdeluxe at Bullseye.  Generally, for me RPi is just amazing MCU with true Linux but without real time capabilities and powerful peripherals, usually present in MCU-s. :)

att2

  • Jr. Member
  • **
  • Posts: 52
Re: Remote debugging on Raspberry (from Windows)
« Reply #12 on: May 17, 2022, 10:01:08 pm »
Hello,
I have a somewhat similar question... My Setup is: A virtualbox VM with Linux Mint Tara 19 inside and Lazarus/FreePascal for compiling.
I cross-compile to ARM, the target system is a Odroid C2 or an Odroid C4.
Is it possible to configure the Lazarus environment in such a way that after compiling, the executable will be copied to the Odroid C2 or C4, and can I then single-step inside the Lazarus environment to cross-debug the running program on Odroid C2/C4 ?

If this is possible, how do I have to setup the Lazarus/FPC inside the VM? Has anybody done this ... ?

MarkMLl

  • Hero Member
  • *****
  • Posts: 6676
Re: Remote debugging on Raspberry (from Windows)
« Reply #13 on: May 17, 2022, 10:54:23 pm »
Hello,
I have a somewhat similar question... My Setup is: A virtualbox VM with Linux Mint Tara 19 inside and Lazarus/FreePascal for compiling.
I cross-compile to ARM, the target system is a Odroid C2 or an Odroid C4.
Is it possible to configure the Lazarus environment in such a way that after compiling, the executable will be copied to the Odroid C2 or C4, and can I then single-step inside the Lazarus environment to cross-debug the running program on Odroid C2/C4 ?

If this is possible, how do I have to setup the Lazarus/FPC inside the VM? Has anybody done this ... ?

Yes.

MarkMLl
MT+86 & Turbo Pascal v1 on CCP/M-86, multitasking with LAN & graphics in 128Kb.
Pet hate: people who boast about the size and sophistication of their computer.
GitHub repositories: https://github.com/MarkMLl?tab=repositories

DimTim

  • New Member
  • *
  • Posts: 42
Re: Remote debugging on Raspberry (from Windows)
« Reply #14 on: May 18, 2022, 05:04:27 am »
If this is possible, how do I have to setup the Lazarus/FPC inside the VM? Has anybody done this ... ?
I think, your setup will be similar to mine.  Though you should install the Linux version of gdb-multiarch.  Copying executable by Lazarus didn't work for me (Windows to RasPi), so I uploaded it with a scp client; it should work in Linux also.

 

TinyPortal © 2005-2018