Recent

Author Topic: Debugger Error state  (Read 5885 times)

BLL

  • Sr. Member
  • ****
  • Posts: 276
Debugger Error state
« on: June 15, 2016, 11:19:41 am »
Hi, I am using fpc 3.0.0 and lazarus 1.7 on a Raspberry Pi, model 3.

I normally use lazarus via vnc from my laptop. Here I can run my program after building it fine.

However, if I use lazarus on the Pi itself, then when I try and run a program, the debugger says it has entered an error state and says:
The GDB command "-gdb-set confirm off" did not return any result.

How do I put this right?

Brian

Thaddy

  • Hero Member
  • *****
  • Posts: 14390
  • Sensorship about opinions does not belong here.
Re: Debugger Error state
« Reply #1 on: June 15, 2016, 12:33:11 pm »
Did you compile FPC itself on the Pi?
In that case recompile with the make option GDBMI=1
There are some known GDB issues. Not FPC issues. This works for me.
Object Pascal programmers should get rid of their "component fetish" especially with the non-visuals.

BLL

  • Sr. Member
  • ****
  • Posts: 276
Re: Debugger Error state
« Reply #2 on: June 15, 2016, 03:38:47 pm »
Hi, Thanks for the reply. Yes, I did recompile as I had to add some components.

I will try your suggestion.

Thanks

Brian

wp

  • Hero Member
  • *****
  • Posts: 11923
Re: Debugger Error state
« Reply #3 on: June 15, 2016, 04:23:28 pm »
I did recompile as I had to add some components.
I think you don't understand: when you add components you compile Lazarus, but Thaddy's suggestion was about recompiling FPC. This is something different - and more difficult for a beginner.

Thaddy

  • Hero Member
  • *****
  • Posts: 14390
  • Sensorship about opinions does not belong here.
Re: Debugger Error state
« Reply #4 on: June 15, 2016, 06:53:32 pm »
Yes, my suggestion was recompiling just fpc.
There is another option however: download and install a more recent GDB than the one that is provided by RaspBian Jessie as default (although that should work perfectly ok).
I am sorry if this was not clear. My Raspbian Lazarus installs are always compiled from trunk and I do not have a bog standard install available right now.
Object Pascal programmers should get rid of their "component fetish" especially with the non-visuals.

BLL

  • Sr. Member
  • ****
  • Posts: 276
Re: Debugger Error state
« Reply #5 on: June 15, 2016, 07:08:27 pm »
Hi

Thanks for that. I have no idea how to recompile fpc!

It all worked fine after installation and this message has only recently appeared.

Brian

Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 9909
  • Debugger - SynEdit - and more
    • wiki
Re: Debugger Error state
« Reply #6 on: June 16, 2016, 12:36:22 am »
Quote
The GDB command "-gdb-set confirm off"
This error comes from Lazarus (well passed on from gdb).
It has nothing to do with the way fpc was compiled. (unless you add debug info maybe...)

It is always good to try stabs or dwarf.
Definitely try other gdb versions (older or newer / newer is not always better)

 

BLL

  • Sr. Member
  • ****
  • Posts: 276
Re: Debugger Error state
« Reply #7 on: June 16, 2016, 10:45:28 am »
Oh dear, I am getting conflicting advice!
I have done some further tests. I had a backup SD card of lazarus/fpc as installed, before doing anything. I ran that up and the debugger is fine, so it's something that has happened since.
I had problems installing TAChart as it reported problems with numlib. On advice, I downloaded certain .pas files and compiled them. This then allowed the chart utilities to install. Perhaps this upset something.

Since lazarus recompiled on the chart installation, surely this would have put matters right?

I am confused!

Brian

Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 9909
  • Debugger - SynEdit - and more
    • wiki
Re: Debugger Error state
« Reply #8 on: June 16, 2016, 12:12:00 pm »
I did a quick check. "set confirm off" is the very first command the IDE sends to gdb (way before debug info comes into play).

If there is no response then either:
- gdb did not get started (check the processlist)
- the command or response got lost (stdin/stdout pipes not working)

Both of them I would suspect to be a problem with FPC TProcess.

Code: Pascal  [Select][+][-]
  1. function TCmdLineDebugger.CreateDebugProcess(const AOptions: String): Boolean;
  2. begin
  3.   Result := False;
  4.   if FDbgProcess = nil
  5.   then begin
  6.     FDbgProcess := TProcessUTF8.Create(nil);
  7.     try
  8.       FDbgProcess.CommandLine := ExternalDebugger + ' ' + AOptions;
  9.       FDbgProcess.Options:= [poUsePipes, poNoConsole, poStdErrToOutPut, poNewProcessGroup];
  10.       {$if defined(windows) and not defined(wince)}
  11. // ...
  12.       {$endif windows}
  13.       FDbgProcess.ShowWindow := swoNone;
  14.       FDbgProcess.Environment:=DebuggerEnvironment;
  15.     except
  16.       FreeAndNil(FDbgProcess);
  17.     end;
  18.   end;
  19.  

This is how TProcess is configured. You need to test, if that works (and if stdin/stdout get connected) on RPi, and if not report with FPC

 

TinyPortal © 2005-2018