Recent

Author Topic: Lazarus debugger fail in Ubuntu 13.04  (Read 35213 times)

miguel-laz

  • New Member
  • *
  • Posts: 19
    • Bitiopia
Lazarus debugger fail in Ubuntu 13.04
« on: April 29, 2013, 09:07:15 pm »
Just installed Lazarus 1.0.8 on Ubuntu 13.04 (64bit) and trying to debug a simple program, the debugger stops at the breakpoint marked but when you stop debugging (red square button) displays a debugger error window indicating "The debugger entered into a failed state." In windows7 32bit works perfectly.

This is the simple program:
Code: [Select]
unit Unit1;

{$mode objfpc}{$H+}

interface

uses
  Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, StdCtrls;

type

  { TForm1 }

  TForm1 = class(TForm)
    Edit1: TEdit;
    procedure Edit1Enter(Sender: TObject);
  private
    { private declarations }
  public
    { public declarations }
  end;

var
  Form1: TForm1;

implementation

{$R *.lfm}

{ TForm1 }

procedure TForm1.Edit1Enter(Sender: TObject);
var str:string;
begin
     str:='Un texto';
     TEdit(Sender).Text:=str;
end;

end.

The breaking point is on the line that says "str:='Un texto';":

The version of gdb is GNU gdb (GDB) 7.5.91.20130417-cvs-ubuntu

Has anyone tried Lazarus on Ubuntu 13.04 (64bit)?
Can anyone reproduce the error?

Thanks in advance

Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 9864
  • Debugger - SynEdit - and more
    • wiki
Re: Lazarus debugger fail in Ubuntu 13.04
« Reply #1 on: April 29, 2013, 09:22:55 pm »

marcov

  • Administrator
  • Hero Member
  • *
  • Posts: 11447
  • FPC developer.
Re: Lazarus debugger fail in Ubuntu 13.04
« Reply #2 on: April 29, 2013, 11:27:21 pm »
Btw, gdb 7.6 came out in recent days. Listed some MII improvements.

miguel-laz

  • New Member
  • *
  • Posts: 19
    • Bitiopia
Re: Lazarus debugger fail in Ubuntu 13.04
« Reply #3 on: April 30, 2013, 06:00:00 pm »

As the text exceeds 20000 characters the whole message is in the attachment:

OK, The following text corresponds to the output of the debugger until the breakpoint corresponding to the line "str:='Un texto';":

Code: [Select]
=thread-group-added,id="i1"
(gdb)
<-gdb-set confirm off>
^done
(gdb)
<-gdb-set new-console off>
^error,msg="No hay tabla de s\303\255mbolos cargada. Use la orden \302\253file\302\273."
(gdb)
<set width 50000>
&"set width 50000\n"
=cmd-param-changed,param="width",value="50000"
^done
(gdb)
<-gdb-version>
~"GNU gdb (GDB) 7.5.91.20130417-cvs-ubuntu\n"
~"Copyright (C) 2013 Free Software Foundation, Inc.\n"
~"License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>\nThis is free software: you are free to change and redistribute it.\nThere is NO WARRANTY, to the extent permitted by law.  Type \"show copying\"\nand \"show warranty\" for details.\n"
~"This GDB was configured as \"x86_64-linux-gnu\".\nPara las instrucciones de informe de errores, vea:\n"
~"<http://www.gnu.org/software/gdb/bugs/>.\n"
^done
(gdb)
<-gdb-set env COMPIZ_BIN_PATH=/usr/bin/>
^done
"
"      "Text in file"
"
(gdb)
<-stack-list-frames 0 4>
^done,stack=[frame={level="0",addr="0x0000000000485316",func="EDIT1ENTER",file="unit1.pas",fullname="/home/miguel/Programacion/LazarusTest1/unit1.pas",line="35"},frame={level="1",addr="0x000000000061b77d",func="CONTROLS_TWINCONTROL_$__DOENTER"},frame={level="2",addr="0x00007ffff7fbfbd0",func="??"},frame={level="3",addr="0x000000000064f1c3",func="STDCTRLS_TCUSTOMEDIT_$__DOENTER"},frame={level="4",addr="0x0000000000620dc3",func="CONTROLS_TWINCONTROL_$__CMENTER$TLMESSAGE"}]
(gdb)
<-stack-list-arguments 1 0 0>
^done,stack-args=[frame={level="0",args=[{name="this",value="0x7ffff7fbe5d0"},{name="SENDER",value="0x7ffff7fbfbd0"}]}]
(gdb)
<-stack-list-locals 1>
^done,locals=[{name="STR",value="0x0"}]
(gdb)


The following text corresponds to the output of the debugger when debugging stop (red square button) and show the window debugger error.

Code: [Select]
<kill>
&"kill\n"
=thread-exited,id="3",group-id="i1"
=thread-exited,id="2",group-id="i1"
=thread-exited,id="1",group-id="i1"
=thread-group-exited,id="i1"
^done
(gdb)
<info program>
&"info program\n"
~"El programa que ha sido depurado no estaba corriendo.\n"
^done
(gdb)

miguel-laz

  • New Member
  • *
  • Posts: 19
    • Bitiopia
Re: Lazarus debugger fail in Ubuntu 13.04
« Reply #4 on: April 30, 2013, 06:07:46 pm »
The first error message says something like:
^error,msg="No hay tabla de s\303\255mbolos cargada. Use la orden \302\253file\302\273."

which in English means something like:
^error,msg="No symbol table loaded. Use the command?. ".

Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 9864
  • Debugger - SynEdit - and more
    • wiki
Re: Lazarus debugger fail in Ubuntu 13.04
« Reply #5 on: April 30, 2013, 07:17:26 pm »
Yes, but IIRC that error msg can occur.

I will need the entire log file.

Also, I see that you use a translated gdb (not English). I have see similar cases, and some messages that the IDE looks for in English, are also translated. Then the IDE can not work with that gdb.

macmike

  • Jr. Member
  • **
  • Posts: 85
    • Soft-Practice
Re: Lazarus debugger fail in Ubuntu 13.04
« Reply #6 on: April 30, 2013, 07:55:22 pm »
I've been using Lazarus since v9.3 on Ubuntu without problems until I upgraded to Ubuntu 13.04 (32-bit) on the weekend and now I get this problem too :(

Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 9864
  • Debugger - SynEdit - and more
    • wiki
Re: Lazarus debugger fail in Ubuntu 13.04
« Reply #7 on: April 30, 2013, 08:03:47 pm »
Again: log file please.

Lazarus is currently tested with gdb (english) from 6.3 to 7.5
I will hopefully be able to test tests for 7.6 soon But I don't know how soon.

GDB 7.6 (even english) may have changes, in the response output of some commands. Then the IDE does not understand it.

In addition. If gdb is translated, it may or may not work. I have seen translated gdb working, because the IDE used fallbacks, if it got replies that it could not read (and luckily the fallbacks had enough keywords to be understood). But beeing already forced to fallbacks makes it more likely to fail on other changes.


macmike

  • Jr. Member
  • **
  • Posts: 85
    • Soft-Practice
Re: Lazarus debugger fail in Ubuntu 13.04
« Reply #8 on: April 30, 2013, 08:09:24 pm »
I'm using the English versions. Where can I find the log file?
(sorry for the dumb question!)

Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 9864
  • Debugger - SynEdit - and more
    • wiki
Re: Lazarus debugger fail in Ubuntu 13.04
« Reply #9 on: April 30, 2013, 08:23:35 pm »
I'm using the English versions. Where can I find the log file?
(sorry for the dumb question!)

As I wrote earlier in this thread:
http://wiki.lazarus.freepascal.org/GDB_Debugger_Tips#Log_info_for_debug_session

miguel-laz

  • New Member
  • *
  • Posts: 19
    • Bitiopia
Re: Lazarus debugger fail in Ubuntu 13.04
« Reply #10 on: April 30, 2013, 09:19:18 pm »
OK, this is the log file
Code: [Select]
TMainIDE.ParseCmdLineOptions:
  PrimaryConfigPath="/home/miguel/.lazarus"
  SecondaryConfigPath="/etc/lazarus"
TIDEAnchorDockMaster.MakeIDEWindowDockSite MainIDE:TMainIDEBar
TIDEAnchorDockMaster.LoadUserLayout anchordocklayout.xml
TIDEAnchorDockMaster.LoadUserLayout restoring ...
TMainIDE.DoLoadLFM Creating designer for hidden component of /home/miguel/Programacion/LazarusTest1/unit1.pas
TMainIDE.DoOpenProjectFile select form in designer: Form1:TForm1 TDesigner
[TMainIDE.DoRunProject] A
TMainIDE.DoInitProjectRun A True 0
TMainIDE.DoInitProjectRun B
TLazPackageGraph.CheckIfCurPkgOutDirNeedsCompile  Compiler custom params changed for FCL 1.0.1
  Old=" -MObjFPC -Scghi -O1 -g -gl fcllaz.pas"
  Now=" -MObjFPC -Scghi -O1 -g -gl -O2 -g- -Xs fcllaz.pas"
  State file="/usr/share/lazarus/1.0.8/packager/units/x86_64-linux/FCL.compiled"
TLazPackageGraph.CheckIfPackageNeedsCompilation normal output dir is not writable: /usr/share/lazarus/1.0.8/packager/units/x86_64-linux/
TLazPackageGraph.GetFallbackOutputDir  FCL: /home/miguel/.lazarus/lib/units/x86_64-linux
TParsedCompilerOptions.SetOutputDirectoryOverride New=/home/miguel/.lazarus/lib/units/x86_64-linux
TLazPackageGraph.CheckIfCurPkgOutDirNeedsCompile  Compiler custom params changed for LazUtils 1.0
  Old=" -MObjFPC -Scghi -O1 -g -gl lazutils.pas"
  Now=" -MObjFPC -Scghi -O1 -g -gl -O2 -g- -Xs lazutils.pas"
  State file="/usr/share/lazarus/1.0.8/components/lazutils/lib/x86_64-linux/LazUtils.compiled"
TLazPackageGraph.CheckIfPackageNeedsCompilation normal output dir is not writable: /usr/share/lazarus/1.0.8/components/lazutils/lib/x86_64-linux/
TLazPackageGraph.GetFallbackOutputDir  LazUtils: /home/miguel/.lazarus/lib/LazUtils/lib/x86_64-linux
TParsedCompilerOptions.SetOutputDirectoryOverride New=/home/miguel/.lazarus/lib/LazUtils/lib/x86_64-linux
TLazPackageGraph.CheckIfCurPkgOutDirNeedsCompile  Compiler custom params changed for LCLBase 1.0.8
  Old=" -MObjFPC -Scghi -O1 -g -gl alllclunits.pp"
  Now=" -MObjFPC -Scghi -O1 -g -gl -O2 -g- -Xs alllclunits.pp"
  State file="/usr/share/lazarus/1.0.8/lcl/units/x86_64-linux/LCLBase.compiled"
TLazPackageGraph.CheckIfPackageNeedsCompilation normal output dir is not writable: /usr/share/lazarus/1.0.8/lcl/units/x86_64-linux/
TLazPackageGraph.GetFallbackOutputDir  LCLBase: /home/miguel/.lazarus/lib/LCLBase/units/x86_64-linux
TParsedCompilerOptions.SetOutputDirectoryOverride New=/home/miguel/.lazarus/lib/LCLBase/units/x86_64-linux
TLazPackageGraph.CheckIfCurPkgOutDirNeedsCompile  Compiler custom params changed for LCL 1.0.8
  Old=" -MObjFPC -Scghi -O1 -g -gl lcl.pas"
  Now=" -MObjFPC -Scghi -O1 -g -gl -O2 -g- -Xs lcl.pas"
  State file="/usr/share/lazarus/1.0.8/lcl/units/x86_64-linux/gtk2/LCL.compiled"
TLazPackageGraph.CheckIfPackageNeedsCompilation normal output dir is not writable: /usr/share/lazarus/1.0.8/lcl/units/x86_64-linux/gtk2/
TLazPackageGraph.GetFallbackOutputDir  LCL: /home/miguel/.lazarus/lib/units/x86_64-linux/gtk2
TParsedCompilerOptions.SetOutputDirectoryOverride New=/home/miguel/.lazarus/lib/units/x86_64-linux/gtk2
TMainIDE.DoInitProjectRun ProgramFilename=/home/miguel/Programacion/LazarusTest1/project1
[TCmdLineDebugger] Debug PID: 5117
TGDBMIDebugger.ProcessResult Error: ,msg="No hay tabla de s\303\255mbolos cargada. Use la orden \302\253file\302\273."
[Debugger] Log output: &"set width 50000\n"
[WARNING] Debugger: Unexpected async-record: =cmd-param-changed,param="width",value="50000"
[Debugger] Running GDB version: GDB
[TDebugger.SetFileName] "/home/miguel/Programacion/LazarusTest1/project1"
[TMainIDE.DoRunProject] B TGDBMIDebugger
[TMainIDE.DoRunProject] END
TGDBMIDebugger.StartDebugging WorkingDir="/home/miguel/Programacion/LazarusTest1/"
TGDBMIDebugger.ProcessResult Error: ,msg="El s\303\255mbolo \302\253FPC_THREADVAR_RELOCATE_PROC\302\273 no est\303\241 en el contexto actual."
[Debugger] Log output: &"info functions FPC_CPUINIT\n"
[WARNING] Debugger: Unexpected async-record: =cmd-param-changed,param="args",value=""
[Debugger] Log output: &"set inferior-tty /dev/pts/1\n"
[WARNING] Debugger: Unexpected async-record: =cmd-param-changed,param="inferior-tty",value="/dev/pts/1"
[Debugger] Log output: &"ptype TObject\n"
[Debugger] Log output: &"ptype Exception\n"
[Debugger] Log output: &"El s\303\255mbolo \302\253Exception\302\273 no est\303\241 en el contexto actual.\n"
TGDBMIDebugger.ProcessResult Error: ,msg="El s\303\255mbolo \302\253Exception\302\273 no est\303\241 en el contexto actual."
[Debugger] Log output: &"ptype Shortstring\n"
[Debugger] Log output: &"ptype pointer\n"
[Debugger] Log output: &"ptype byte\n"
[Debugger] Log output: &"info file\n"
[Debugger] File type:
[Debugger] Entry point:
[WARNING] [Debugger.TargetInfo] Unknown FileType: , using GDB cpu
[Debugger] Log output: &"Funci\303\263n \302\253foo\302\273 no definida.\n"
[Debugger] Console output: ~"[Depuraci\303\263n de hilo usando libthread_db enabled]\n"
[Debugger] Console output: ~"Using host libthread_db library \"/lib/x86_64-linux-gnu/libthread_db.so.1\".\n"
[Debugger] Console output: ~"[Nuevo Thread 0x7fffed2fa700 (LWP 5123)]\n"
[DBGTGT] *
[DBGTGT] running,thread-id="all"
[Debugger] Console output: ~"[Nuevo Thread 0x7fffecaf9700 (LWP 5124)]\n"
[DBGTGT] *
[DBGTGT] running,thread-id="all"
[WARNING] Debugger: Unexpected async-record: =breakpoint-modified,bkpt={number="2",type="breakpoint",disp="keep",enabled="y",addr="0x0000000000446e19",func="main",file="project1.lpr",fullname="/home/miguel/Programacion/LazarusTest1/project1.lpr",line="16",thread-groups=["i1"],times="1",original-location="main"}
[WARNING] Debugger: Unexpected async-record: =breakpoint-modified,bkpt={number="3",type="breakpoint",disp="keep",enabled="y",addr="0x0000000000446e19",func="main",file="project1.lpr",fullname="/home/miguel/Programacion/LazarusTest1/project1.lpr",line="5",thread-groups=["i1"],times="1",original-location="/home/miguel/Programacion/LazarusTest1/project1.lpr:+0"}
[Debugger] Log output: &"info program\n"
[Debugger] Target PID: 5119
[Debugger] Log output: &"info address FPC_RAISEEXCEPTION\n"
[Debugger] Log output: &"info address FPC_BREAK_ERROR\n"
[Debugger] Log output: &"info address FPC_RUNERROR\n"
[Debugger] Log output: &"info line \"/home/miguel/Programacion/LazarusTest1/unit1.pas\":35\n"
[WARNING] Debugger: Unexpected async-record: =breakpoint-modified,bkpt={number="7",type="breakpoint",disp="keep",enabled="y",addr="0x0000000000485316",func="EDIT1ENTER",file="unit1.pas",fullname="/home/miguel/Programacion/LazarusTest1/unit1.pas",line="35",thread-groups=["i1"],times="1",original-location="unit1.pas:35"}
[Debugger] Log output: &"kill\n"
[Debugger] Log output: &"info program\

miguel-laz

  • New Member
  • *
  • Posts: 19
    • Bitiopia
Re: Lazarus debugger fail in Ubuntu 13.04
« Reply #11 on: April 30, 2013, 09:26:58 pm »
The terminal displays the following message:

(lazarus:5110): LIBDBUSMENU-GLIB-WARNING **: Translation has an invalid value 'I-->D' for default text direction.  Defaulting to left-to-right.

Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 9864
  • Debugger - SynEdit - and more
    • wiki
Re: Lazarus debugger fail in Ubuntu 13.04
« Reply #12 on: April 30, 2013, 09:43:13 pm »
Sorry, I dint see the attachment on the post earlier. reading that now

Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 9864
  • Debugger - SynEdit - and more
    • wiki
Re: Lazarus debugger fail in Ubuntu 13.04
« Reply #13 on: April 30, 2013, 10:01:02 pm »
Just installed Lazarus 1.0.8 on Ubuntu 13.04 (64bit) and trying to debug a simple program, the debugger stops at the breakpoint marked but when you stop debugging (red square button) displays a debugger error window indicating "The debugger entered into a failed state." In windows7 32bit works perfectly.

Ok, I went to through the log file (from the attachment. It looks like everithing went correct.

When you stop (rud square) then the app is killed.
The IDE verifies that the app really is killed, by sending "info program"

An English gdb will reply with a phrase containing "not being run" (as the program is not being run), and the IDE checks for this text.
Your gdb responds  (as you actually pointed out correct)
Code: [Select]
&"info program\n"
~"El programa que ha sido depurado no estaba corriendo.\n"

The IDE does not understand this, and assumes something went wrong.

Maybe this message was not translated in previous versions of gdb. (you will notice, that some messages by your gdb are still English)

---
Another thing I spotted is, that the response to "info file" is not English.

This does not cause an error right away. But it does mean, that the IDE may not show you the type and msg of an "raise exception"

I know this problem also exists in older gdb, if they are translated.

----
and

""[Nuevo Thread 0x7fffecaf9700"

may mean that your thread window does not always update
« Last Edit: April 30, 2013, 10:04:08 pm by Martin_fr »

Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 9864
  • Debugger - SynEdit - and more
    • wiki
Re: Lazarus debugger fail in Ubuntu 13.04
« Reply #14 on: April 30, 2013, 10:02:52 pm »
I've been using Lazarus since v9.3 on Ubuntu without problems until I upgraded to Ubuntu 13.04 (32-bit) on the weekend and now I get this problem too :(

If yours is not translated, then there must be yet another issue. It is possible the gdb team changed some of the english messages too.

 

TinyPortal © 2005-2018