Recent

Author Topic: Developing LinuxX86_64 application under windows, using GDB remote debugging  (Read 1718 times)

myisjwj

  • Jr. Member
  • **
  • Posts: 87
Developing LinuxX86_64 application under windows, using GDB remote debugging. There is no corresponding gdb.exe file in either the cross directory or the fpcbootstrap\gdb directory. Where can I download it?

Seenkao

  • Hero Member
  • *****
  • Posts: 711
    • New ZenGL.
Rus: Стремлюсь к созданию минимальных и достаточно быстрых приложений.

Eng: I strive to create applications that are minimal and reasonably fast.
Working on ZenGL

myisjwj

  • Jr. Member
  • **
  • Posts: 87
Compiling gdb with msys2 can be achieved.
https://www.cnblogs.com/jwjss/p/18000218

Seenkao

  • Hero Member
  • *****
  • Posts: 711
    • New ZenGL.
Я бы вам вообще предложил установить Linux либо в виртуалке, либо как вторую систему. Можете взглянуть в сторону Proxmox, будут работать одновременно обе системы и вы даже сможете обмениваться данными между системами, но для этого нужен мощный компьютер и несколько мониторов.

Если выбирать между WSL и Msys2 то я бы выбрал WSL, как наиболее полноценную систему.

Кроссплатформенная разработка - это не просто, если делаешь всё сам. И лучше всего ей заниматься на Linux, а не на Windows.


Google translate:
I would generally suggest that you install Linux either in a virtual machine or as a second system. You can look towards Proxmox, both systems will work simultaneously and you can even exchange data between systems, but this requires a powerful computer and several monitors.

If you choose between WSL and Msys2, I would choose WSL as the most complete system.

Cross-platform development is not easy if you do everything yourself. And it is best to do it on Linux, not on Windows.
Rus: Стремлюсь к созданию минимальных и достаточно быстрых приложений.

Eng: I strive to create applications that are minimal and reasonably fast.
Working on ZenGL

Thaddy

  • Hero Member
  • *****
  • Posts: 17368
  • Ceterum censeo Trump esse delendam
I strive to develop applications that are reasonably safe...
Back to the issue: This might be a simple rights issue, but note that "remote" debugging is usually not a good idea unless you are on a private network. Anything else is being hacked within 24 hours.

Real life example:
My mother died three years ago, she was a good programmer, I can still remotely debug her programs... Yes, she programmed in Delphi. Since her computer is still ON, that still works.

The reason it is still on is family history. HP made pretty good laptops back in the days..
« Last Edit: January 31, 2024, 06:11:42 pm by Thaddy »
Due to censorship, I changed this to "Nelly the Elephant". Keeps the message clear.

Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 11440
  • Debugger - SynEdit - and more
    • wiki
I don't know where to get the correct gdb for this. But....

If you can find a way to do native debugging (assuming it is Intel or AMD, not arm), then you can use FpDebug. And that will give you a tremendously better experience.
- It is faster.
- It crashes less. (at least for the majority of people)
- It will receive fixes faster (because we - the Lazarus team - can fix it; whereas a bug in gdb, well we can't do anything about it)
- It works well with DWARF-3 which preserves the case (upper/lower) of your identifiers
....

You will have your reasons to do the coding on Windows. ok...

But...
Even for remote debugging, you do need a target system. A Linux system.
Gdb and your app need to run in Linux, the IDE and gdbserver run on Windows.

For remote debugging you need to copy the exe over to the target Linux system.


So...
If you do all that work. Just run an Lazarus IDE on that Linux target, and use it for debugging.

If it is a virtual machine, then set up shared folders.
You can edit on either side, and can have the other side reload changed files (just make sure you save always immediately to disk, because if you have changes in memory on both sides ....... then that is no good.

Or better, put everything into git, and use that to synchronize the folders on Win and Linux.

Anyway just some ideas. Think about it.

 

TinyPortal © 2005-2018