Recent

Author Topic: Debugger error on first try...  (Read 33108 times)

SoftQuiPeut

  • Newbie
  • Posts: 5
Debugger error on first try...
« on: March 26, 2009, 11:06:52 am »
Lazarus newbie question: Thanks for your help.

I'm an experimented Delphi programmer for years.

I just discovered fpc/lazarus and installed it on my PC and my Mac to test it.

I downloaded and installed the following: (Mac OSX and Windows versions)
fpc: 2.2.2
lazarus 0.9.26

I tried to write and compile my first Lazarus "Hello World" application.

The good thing was: it compiled and ran correctly !  YESSSS !

But the bad thing:  I got the following debugger error:

Debugger Error
Ooops, the debugger entered the error state
Save your work now !
Hit Stop, and hope the best, we're pulling the plug.

I got this error on both machines (PC and Mac)

Any help ?

It would be nice if a could debug my next application (probably more complex...) with some breakpoints...

I'm using a PC on Windows XP and a Mac OSX.
 
Thanks.
« Last Edit: March 27, 2009, 09:09:15 am by SoftQuiPeut »
Sex is good, but software development lasts longer...

Marc

  • Administrator
  • Hero Member
  • *
  • Posts: 2645
Re: Debugger error on first try...
« Reply #1 on: March 26, 2009, 11:15:24 am »
Welcome.

It is hard to tell what happened, it can have a lot of causes.

Can you post the output of the view -> debugger -> debugger output ?

« Last Edit: March 26, 2009, 11:17:31 am by Marc »
//--
{$I stdsig.inc}
//-I still can't read someones mind
//-Bugs reported here will be forgotten. Use the bug tracker

SoftQuiPeut

  • Newbie
  • Posts: 5
Re: Debugger error on first try... (SOLUTION FOR WINDOWS)
« Reply #2 on: March 26, 2009, 11:38:59 am »
I just found the cause of the problem on the PC side:

My first project was saved in My Documents.

Actually on the following path: C:\Documents and Settings\CULAND_P\My Documents\dev\FPC_Projects

The spaces in the windows path "Documents and settings" and "My Documents" seem to cause the debugger problem.

I moved my FPC_Projects  directory directly on the root of the C: drive at C:\FPC_Projects and reloaded the project1.lpr in lazarus and...

... it worked fine with the debugger !

Do you know why the debugger does not work on projects saved on paths with spaces ?

Any possible solution to this in the futures vesrions of lazarus ?


I'm not in front of my Mac at the moment, so I don't know if the Mac side problem is similar...

Marc: What do you mean by "the output of the view -> debugger -> debugger output " ?
How can I get this output ? (Sorry if my question is basic...)



Sex is good, but software development lasts longer...

Marc

  • Administrator
  • Hero Member
  • *
  • Posts: 2645
Re: Debugger error on first try... (SOLUTION FOR WINDOWS)
« Reply #3 on: March 26, 2009, 03:51:29 pm »
I just found the cause of the problem on the PC side:

My first project was saved in My Documents.

Actually on the following path: C:\Documents and Settings\CULAND_P\My Documents\dev\FPC_Projects

The spaces in the windows path "Documents and settings" and "My Documents" seem to cause the debugger problem.

I moved my FPC_Projects  directory directly on the root of the C: drive at C:\FPC_Projects and reloaded the project1.lpr in lazarus and...

... it worked fine with the debugger !

Do you know why the debugger does not work on projects saved on paths with spaces ?

Probably like most other unix utils. But I'm not sure it is GDB. iirc it can handle spaces
(can't remember if it was an issue we fixed after 0.9.26)

Quote
Any possible solution to this in the futures vesrions of lazarus ?

You can check the bugtracker if someone had report it.

Quote
I'm not in front of my Mac at the moment, so I don't know if the Mac side problem is similar...

Marc: What do you mean by "the output of the view -> debugger -> debugger output " ?
How can I get this output ? (Sorry if my question is basic...)

Should have been [Menu] -> view -> debugger windows -> debugger output

(click each step)
//--
{$I stdsig.inc}
//-I still can't read someones mind
//-Bugs reported here will be forgotten. Use the bug tracker

SoftQuiPeut

  • Newbie
  • Posts: 5
Re: Debugger error on first try...
« Reply #4 on: March 26, 2009, 11:48:28 pm »
Marc: Here's the asked output: (Sorry for the length...Huh... %)..)
(The output is not complete, I had to cut the end due to the size...)
Note also that the Mac problem is not due to spaces in the project path. I placed my FPC_projects directory directly at the root of my user location on the Mac. (/Users/pfc/FPC_Projects)
debugger output:
****************************************************************
(gdb)

<-gdb-version>
~"GNU gdb 6.3.50-20050815 (Apple version gdb-960) (Sun May 18 18:38:33 UTC 2008)\n"

~"Copyright 2004 Free Software Foundation, Inc.\n"

~"GDB is free software, covered by the GNU General Public License, and you are\nwelcome to change it and/or distribute copies of it under certain conditions.\nType \"show copying\" to see the conditions.\nThere is absolutely no warranty for GDB.  Type \"show warranty\" for details.\n"

~"This GDB was configured as \"i386-apple-darwin\"."

^done,version="6.3.50-20050815 (Apple version gdb-960)",rc_version="960",target="i386-apple-darwin",build-date="Sun May 18 18:38:33 UTC 2008",time={wallclock="0.00034",user="0.00032",system="0.00001",start="1238094837.625237",end="1238094837.625573"}

(gdb)

<-gdb-set env Apple_PubSub_Socket_Render=/tmp/launch-Ty1j8e/Render>
^done,time={wallclock="0.00002",user="0.00002",system="0.00001",start="1238094837.626344",end="1238094837.626367"}

(gdb)

<-gdb-set env COMMAND_MODE=legacy>
^done,time={wallclock="0.00001",user="0.00001",system="0.00000",start="1238094837.626587",end="1238094837.626599"}

(gdb)

<-gdb-set env DISPLAY=/tmp/launch-LFFq9x/:0>
^done,time={wallclock="0.00001",user="0.00001",system="0.00000",start="1238094837.626823",end="1238094837.626835"}

(gdb)

<-gdb-set env HOME=/Users/pfc>
^done,time={wallclock="0.00001",user="0.00001",system="0.00000",start="1238094837.627013",end="1238094837.627025"}

(gdb)

<-gdb-set env LMILAUNCHAGENTFIXER_GOODGUISESSION=1>
^done,time={wallclock="0.00001",user="0.00001",system="0.00000",start="1238094837.627255",end="1238094837.627268"}

(gdb)

<-gdb-set env LOGNAME=pfc>
^done,time={wallclock="0.00001",user="0.00001",system="0.00000",start="1238094837.627439",end="1238094837.627451"}

(gdb)

<-gdb-set env PATH=/usr/bin:/bin:/usr/sbin:/sbin>
^done,time={wallclock="0.00001",user="0.00001",system="0.00000",start="1238094837.627676",end="1238094837.627688"}

(gdb)

<-gdb-set env SECURITYSESSIONID=b14eb0>
^done,time={wallclock="0.00001",user="0.00001",system="0.00000",start="1238094837.627888",end="1238094837.627900"}

(gdb)

<-gdb-set env SHELL=/bin/bash>
^done,time={wallclock="0.00001",user="0.00001",system="0.00000",start="1238094837.628078",end="1238094837.628089"}

(gdb)

<-gdb-set env SSH_AUTH_SOCK=/tmp/launch-ILxRMC/Listeners>
^done,time={wallclock="0.00001",user="0.00001",system="0.00000",start="1238094837.628346",end="1238094837.628358"}

(gdb)

<-gdb-set env TMPDIR=/var/folders/2R/2RAODLD2EIu5927MBk6yLk+++TI/-Tmp-/>
^done,time={wallclock="0.00001",user="0.00001",system="0.00000",start="1238094837.628659",end="1238094837.628671"}

(gdb)

<-gdb-set env USER=pfc>
^done,time={wallclock="0.00001",user="0.00001",system="0.00000",start="1238094837.628872",end="1238094837.628884"}

(gdb)

<-gdb-set env __CF_USER_TEXT_ENCODING=0x1F5:0:1>
^done,time={wallclock="0.00001",user="0.00001",system="0.00000",start="1238094837.629107",end="1238094837.629119"}

(gdb)

<-file-exec-and-symbols "/Volumes/CLÉ USB PFC/FPC_Projects/project1.app">
^done,time={wallclock="0.25764",user="0.17975",system="0.05835",start="1238094837.629543",end="1238094837.887182"}

(gdb)

<-environment-cd .>
^done,time={wallclock="0.00005",user="0.00004",system="0.00001",start="1238094837.888123",end="1238094837.888170"}

(gdb)

<-environment-cd "/Volumes/CLÉ USB PFC/FPC_Projects/">
^error,msg="/Volumes/CLE\314\201: No such file or directory."

(gdb)

<-data-evaluate-expression FPC_THREADVAR_RELOCATE_PROC>
^error,msg="No symbol \"FPC_THREADVAR_RELOCATE_PROC\" in current context."

(gdb)

<info functions FPC_CPUINIT>
&"info functions FPC_CPUINIT\n"

~"All functions matching regular expression \"FPC_CPUINIT\":\n"

~"\nNon-debugging symbols:\n"

~"0x00002f40  SYSTEM_FPC_CPUINIT\n"

^done

(gdb)

<-exec-arguments >
^done,time={wallclock="0.00003",user="0.00003",system="0.00000",start="1238094841.703953",end="1238094841.703981"}

(gdb)

<-gdb-set language pascal>
^done,time={wallclock="0.00002",user="0.00002",system="0.00000",start="1238094841.704163",end="1238094841.704184"}

(gdb)

<info address main>
&"info address main\n"

~"Symbol \"main\" is at 0x27a7 in a file compiled without debugging.\n"

^done

(gdb)

<-break-insert -t *10151>
^done,bkpt={number="1",type="breakpoint",disp="del",enabled="y",addr="0x000027a7",at="<main>",shlib="/Volumes/CLE\314\201 USB PFC/FPC_Projects/project1.app/Contents/MacOS/project1",times="0"},time={wallclock="0.00027",user="0.00021",system="0.00006",start="1238094841.705650",end="1238094841.705918"}

(gdb)

<-break-insert FPC_RAISEEXCEPTION>
^done,bkpt={number="2",type="breakpoint",disp="keep",enabled="y",addr="0x0000fd26",at="<fpc_raiseexception+6>",shlib="/Volumes/CLE\314\201 USB PFC/FPC_Projects/project1.app/Contents/MacOS/project1",times="0"},time={wallclock="0.00379",user="0.00332",system="0.00043",start="1238094841.706149",end="1238094841.709935"}

(gdb)

<-break-insert FPC_BREAK_ERROR>
^done,bkpt={number="3",type="breakpoint",disp="keep",enabled="y",addr="0x00013c40",at="<SYSTEM_HANDLEERRORADDRFRAME$LONGINT$POINTER$POINTER>",shlib="/Volumes/CLE\314\201 USB PFC/FPC_Projects/project1.app/Contents/MacOS/project1",times="0"},time={wallclock="0.00605",user="0.00396",system="0.00014",start="1238094841.710218",end="1238094841.716269"}

(gdb)

<-break-insert FPC_RUNERROR>
^done,bkpt={number="4",type="breakpoint",disp="keep",enabled="y",addr="0x00013d86",at="<SYSTEM_RUNERROR$WORD+6>",shlib="/Volumes/CLE\314\201 USB PFC/FPC_Projects/project1.app/Contents/MacOS/project1",times="0"},time={wallclock="0.00339",user="0.00335",system="0.00004",start="1238094841.716588",end="1238094841.719978"}

(gdb)

<info file>
&"info file\n"

~"Symbols from \"/Volumes/CLE\314\201 USB PFC/FPC_Projects/project1.app/Contents/MacOS/project1\".\n"

~"Mac OS X executable:\n"
« Last Edit: March 27, 2009, 09:08:06 am by SoftQuiPeut »
Sex is good, but software development lasts longer...

Marc

  • Administrator
  • Hero Member
  • *
  • Posts: 2645
Re: Debugger error on first try...
« Reply #5 on: March 27, 2009, 10:50:04 am »
Thanks, but....
the problem was not on OSX, so I don't expect to find a problem in that log. Further, when a problem happens it is at the end of the log :)

Anyway, I see you compiled your exe without debug info:

~"Symbol \"main\" is at 0x27a7 in a file compiled without debugging.\n"
//--
{$I stdsig.inc}
//-I still can't read someones mind
//-Bugs reported here will be forgotten. Use the bug tracker

SoftQuiPeut

  • Newbie
  • Posts: 5
Re: Debugger error on first try...
« Reply #6 on: March 27, 2009, 04:20:27 pm »
Quote
the problem was not on OSX

Yes the debugger problem was on OSX only, since I solved the "spaces in path" problem on Windows.

Quote
Anyway, I see you compiled your exe without debug info

True.

But this didn't prevent the debugger to work properly when I compiled and executed the same project on Windows...
Sex is good, but software development lasts longer...

SoftQuiPeut

  • Newbie
  • Posts: 5
Re: Debugger error on first try... (SOLVED)
« Reply #7 on: March 27, 2009, 11:18:33 pm »
Ok I'm back on my Mac.

I rebuild the project with debugger switch on.

And...

it works !

I'm surprised the debugger switch is not required on Windows...

Thanks for your help anyway.
Sex is good, but software development lasts longer...

Jaapg

  • New Member
  • *
  • Posts: 11
Re: Debugger error on first try...
« Reply #8 on: November 09, 2009, 09:10:33 pm »
I am new at using Lazarus and this on a Mac. Just put a label with caption Hello world in the standard project, save, build and run. On Run I get the famous Ooops ... etc message. Tried all of the above options, but still can not get beyond this error.

Did:
1. Compiler settings generate debug info
2. Use smart linking
3. check that Run parameters - display reads :0

I use a brand new MacBook with Snow Leopard and the latest fpc (2.2.4) and latest Lazarus 0.9.28.2 all for Mac OS.

Who knows what to do next?

Greetings,

Jaap


Marc

  • Administrator
  • Hero Member
  • *
  • Posts: 2645
Re: Debugger error on first try...
« Reply #9 on: November 10, 2009, 04:30:32 pm »
What are the last lines of the debugger output ?

view -> debugger -> debugger output
//--
{$I stdsig.inc}
//-I still can't read someones mind
//-Bugs reported here will be forgotten. Use the bug tracker

Jaapg

  • New Member
  • *
  • Posts: 11
Re: Debugger error on first try...
« Reply #10 on: November 10, 2009, 08:07:50 pm »
Marc, thanks for the reply.

The last lines of the debugger read:
Code: [Select]

*stopped,time={wallclock="0.78825",user="0.43351",system="0.23277",start="1257880330.542052",end="1257880331.330302"},reason="breakpoint-hit",commands="no",times="1",bkptno="1",thread-id="1"

(gdb)

<info program>
&"info program\n"

macosx_debug_inferior_status: current status:

              inferior task: 0x4103

                [SIGNAL THREAD]

macosx_debug_inferior_status: information on debugger task:

macosx_debug_inferior_status: information on inferior task:

macosx_debug_inferior_status: information on debugger threads:

  thread: 0x60f

  thread: 0x1703

  thread: 0x1b03

  thread: 0x2003

  thread: 0x3903

  thread: 0x4303

  thread: 0x4503

macosx_debug_inferior_status: information on inferior threads:

  thread: 0x4203

~"Program stopped at 0x2da7.\n"

~"It stopped at a breakpoint that has since been deleted.\n"

~"Type \"info stack\" or \"info registers\" for more information.\n"

^done

(gdb)

Seems there should be breakpoints. I set none as it is the first try and the source with one label also does not contain many line to break in.

Hope you can help.

Jaap
« Last Edit: November 10, 2009, 08:13:56 pm by Jaapg »

Marc

  • Administrator
  • Hero Member
  • *
  • Posts: 2645
Re: Debugger error on first try...
« Reply #11 on: November 10, 2009, 11:24:20 pm »
hmm... weird..

the breakpoint you see here is a temp breakpoint lazarus put on the first execution point, so you can singlestep ans gives lazarus the ability to enable the breakpoints.

At the same time it uses "info program" to get some info about the exe. Somehow it doesn't understand the gdb output I fear.

Can you start Lazarus from a console to see what gets logged there ?
//--
{$I stdsig.inc}
//-I still can't read someones mind
//-Bugs reported here will be forgotten. Use the bug tracker

Jaapg

  • New Member
  • *
  • Posts: 11
Re: Debugger error on first try...
« Reply #12 on: November 11, 2009, 01:34:52 pm »
Marc, I am a newbie with Lazarus and also with Mac development. Keep that in mind.

When I use the Step into command I get the same "Ooops ..." error. And after this I can only reset or stop the debugger.

I can not find a place where I can set "Breakpoints enabled". Only in the breakpoints overview I see this option (right mouse click) but this is grayed out as there are no breakpoints to be shown.

How do I run Lazarus from a Console? On a Mac.

I checked some other things in Lazarus and this is what abnormalities I find:

Package links window
 gtk2interface is indicated as not existing ?
 demopackagewithhelp also seems not to exist

In the Compiler Options for Project screen when I press the test button I get a long list of warnings:
Code: [Select]
WARNING: ppu exists twice: /usr/local/lib/fpc/2.2.4/units/i386-darwin/httpd20/httpd.ppu, /usr/local/lib/fpc/2.2.4/units/i386-darwin/httpd13/httpd.ppu
WARNING: ppu exists twice: /usr/local/lib/fpc/2.2.4/units/i386-darwin/httpd22/apr.ppu, /usr/local/lib/fpc/2.2.4/units/i386-darwin/httpd20/apr.ppu
WARNING: ppu exists twice: /usr/local/lib/fpc/2.2.4/units/i386-darwin/httpd22/apriconv.ppu, /usr/local/lib/fpc/2.2.4/units/i386-darwin/httpd20/apriconv.ppu
WARNING: ppu exists twice: /usr/local/lib/fpc/2.2.4/units/i386-darwin/httpd22/aprutil.ppu, /usr/local/lib/fpc/2.2.4/units/i386-darwin/httpd20/aprutil.ppu
WARNING: ppu exists twice: /usr/local/lib/fpc/2.2.4/units/i386-darwin/httpd22/httpd.ppu, /usr/local/lib/fpc/2.2.4/units/i386-darwin/httpd20/httpd.ppu
WARNING: ppu exists twice: /usr/local/lib/fpc/2.2.4/units/i386-darwin/univint/Dialogs.ppu, /usr/local/lib/fpc/2.2.4/units/i386-darwin/fv/dialogs.ppu
WARNING: ppu exists twice: /usr/local/lib/fpc/2.2.4/units/i386-darwin/univint/Menus.ppu, /usr/local/lib/fpc/2.2.4/units/i386-darwin/fv/menus.ppu
WARNING: ppu exists twice: /usr/local/lib/fpc/2.2.4/units/i386-darwin/univint/Video.ppu, /usr/local/lib/fpc/2.2.4/units/i386-darwin/rtl/video.ppu
WARNING: ppu exists twice: /usr/local/lib/fpc/2.2.4/units/i386-darwin/unzip/unzip.ppu, /usr/local/lib/fpc/2.2.4/units/i386-darwin/paszlib/unzip.ppu
WARNING: ppu exists twice: /usr/local/lib/fpc/2.2.4/units/i386-darwin/fv/dialogs.ppu, /Developer/lazarus/lcl/units/i386-darwin/dialogs.ppu
WARNING: ppu exists twice: /usr/local/lib/fpc/2.2.4/units/i386-darwin/fv/menus.ppu, /Developer/lazarus/lcl/units/i386-darwin/menus.ppu
WARNING: ppu exists twice: /usr/local/lib/fpc/2.2.4/units/i386-darwin/univint/Controls.ppu, /Developer/lazarus/lcl/units/i386-darwin/controls.ppu
WARNING: ppu exists twice: /usr/local/lib/fpc/2.2.4/units/i386-darwin/univint/Dialogs.ppu, /Developer/lazarus/lcl/units/i386-darwin/dialogs.ppu
WARNING: ppu exists twice: /usr/local/lib/fpc/2.2.4/units/i386-darwin/univint/Menus.ppu, /Developer/lazarus/lcl/units/i386-darwin/menus.ppu

As a first time user and installer this all seems strange. I used the normal default install sets and procedure as described on this website.
Can this be a reason why the debugger also does not want to work?

Greetings,
Jaap

Jaapg

  • New Member
  • *
  • Posts: 11
Re: Debugger error on first try...
« Reply #13 on: November 11, 2009, 01:48:03 pm »
In addition. In Delphi it can also happen that there is a blind breakpoint. This happens when you set a breakpoint in a line of code that you then delete of move to another part of the code. Resetting the breakpoints by setting a new one and then deleting them all does the trick.
I tried this here in my Hello world project. All worked like expected but after deleting all breakpoints I still get the "Ooops ..." message.

Jaap

Marc

  • Administrator
  • Hero Member
  • *
  • Posts: 2645
Re: Debugger error on first try...
« Reply #14 on: November 11, 2009, 07:50:52 pm »
How do I run Lazarus from a Console? On a Mac.
Applications - Utilities - Terminal.app

on that prompt, eenter:

the_path_where_your_lazarus_is_located/Lazarus.app/Contents/MacOS/lazarus
//--
{$I stdsig.inc}
//-I still can't read someones mind
//-Bugs reported here will be forgotten. Use the bug tracker

 

TinyPortal © 2005-2018