Recent

Author Topic: Remote Debugging [SOLVED, It works]  (Read 15129 times)

halmariane

  • New Member
  • *
  • Posts: 30
Re: Remote Debugging
« Reply #15 on: March 03, 2013, 01:33:48 pm »
---
It will eventually be added and be available by default.

But I made the latest changes (async) in a bit of a rush. I had no time to test them, and I have not added any error handling yet.

Once that is done, this will be the added.

Good news Martin.

For the moment thanks to your help at least i can run remotely the application and more,..... i can stop it by a breakpoint, inspect variables ...

One very important and missing detail is that if we need debug remotely other platforms then we need to compile the local gdb sources indicating the target platform. Remember that in this case i am debugging arm-linux hardware from x64-linux hardware, so there are needed to solve other issues that are nothing to see with Lazarus.

We need to debug some things as you told me. There is some strange warning that i can not understand, and ... there are confused debugger options for me that i think are undocumented like "append-gdb-to-openssh-opt", or "consoletty"..... really i think that i need understand almost all options.

For the moment if i want to work with remote debugging i need set to true "append-gdb-to-openssh-opt" but i don't know the reason.

I have to say also that this method is similar to Borland Remote Debugger. In Borland Remote Debugger we need start a remote debugging server and then configure the client options. Run option from the IDE and it takes the control of the program such as occurs in Delphi 7.

Thanks to remote debugging i have detected there is an issue regarding gtk2 unit that i would like to report later.

I will try more..

Regards

« Last Edit: March 03, 2013, 06:51:12 pm by halmariane »

halmariane

  • New Member
  • *
  • Posts: 30
Re: Remote Debugging
« Reply #16 on: March 04, 2013, 05:36:30 pm »
After a few testings i would like to post what i think that it's missing to remote debugger. I think that some has been published yet, i am not sure:

When the application is running.......

  • Application can not be paused
  • Application can not be stopped
  • No more breakpoints can be added after running
  • Getters of properties can not be debugged

I have to check why gdbserver stops when the application halts also.

Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 5960
    • wiki
Re: Remote Debugging
« Reply #17 on: March 04, 2013, 08:08:21 pm »
After a few testings i would like to post what i think that it's missing to remote debugger. I think that some has been published yet, i am not sure:

When the application is running.......

  • Application can not be paused
  • Application can not be stopped
  • No more breakpoints can be added after running
That is all caused by the same issue. And was attempted to be solved using the new target async.

run gdb on the target (or gdbserver, if you use that, and then connect to it). No need to load a project.
Enter:
Code: [Select]
set target-async on
show target-async
    The 2nd command must say, that it is on.

    Also: You are using the latest Lazarus? Either a snapshot of Lazarus 1.1 (Lazarus 1.0.7 will NOT do) or SVN/trunk. And also it must be revision 40412 or higher. Dated 26 February or later.

    If so, then please supply a log as described here:
http://wiki.lazarus.freepascal.org/GDB_Debugger_Tips#Log_info_for_debug_session

Quote

  • Getters of properties can not be debugged
 
That is a known issue, and unfortunately not easy to fix. This applies to all debugging, not just remote. Please read the rest of the page, that I linked above.

halmariane

  • New Member
  • *
  • Posts: 30
Re: Remote Debugging [It Works]
« Reply #18 on: March 06, 2013, 03:02:10 pm »
Also: You are using the latest Lazarus? Either a snapshot of Lazarus 1.1 (Lazarus 1.0.7 will NOT do) or SVN/trunk. And also it must be revision 40412 or higher. Dated 26 February or later.

Martin, finally it works. Seems that it is in the very right way. Here are what i have needed in my case to remotely debug an ARM-Linux application from a X64-Linux system.

LOCAL SYSTEM (x64)
- FPC version 2.7.1
- Lazarus 1.1 SVN 40461
- Linux Mint Debian X64
- Manually include GDBMiServerDebbuger in the public "uses" clause of debugmanager.pas file located in lazarus/ide
- Build Lazarus IDE
- Config, make and make install GNU debugger sources to support ARM-Linux system debugging (CrossCompiled ARM debugger)
- Lazarus-> Menu-> Tools-> Options-> Debugger: Select GNU Remote Debugger (gdbserver), Fill the editbox with the path to croscompiled ARM-debugger, IP or Name of the remote system in the Debugger_Remote_HostName property
- Follow the instructions located in http://wiki.lazarus.freepascal.org/Remote_Debugging to configure SSH without password prompting
- Transfer the crosscompiled project to remote system.

REMOTE SYSTEM (ARM)
- Linux Raspbian Wheezy
- Execute shell command : gdbserver host:2345 name_of_executable_project. In case of GUI application it must be executed from a X11 terminal.

LOCAL SYSTEM (x64)
- Run command/option from the IDE.
- Enjoy

Very good job. Congratulations.

Thanks and best regards
« Last Edit: March 06, 2013, 03:11:23 pm by halmariane »