Running gdb from the command-line and loading the compiled project runs fine. Here's the output:
obijohn:~/projects/fpc/testprojects/project1$ gdb project1.app
GNU gdb 6.3.50-20050815 (Apple version gdb-1461.2) (Fri Mar 5 04:43:10 UTC 2010)
Copyright 2004 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB. Type "show warranty" for details.
This GDB was configured as "x86_64-apple-darwin"...Reading symbols for shared libraries ............ done
(gdb) run
Starting program: /Users/obijohn/projects/fpc/testprojects/project1/project1.app/Contents/MacOS/project1
Reading symbols for shared libraries .+++++++++++......................................................................................... done
Reading symbols for shared libraries . done
Reading symbols for shared libraries . done
Reading symbols for shared libraries . done
Reading symbols for shared libraries . done
Reading symbols for shared libraries . done
[ here I just quit the program ]
Program exited normally.
(gdb) quit
obijohn:~/projects/fpc/testprojects/project1$
And below is the Debug Output window contents after trying to debug it in Lazarus. The project did not successfully display and I had to use Activity Monitor to fore-quit gdb.
(gdb)
<-gdb-set confirm off>
^done,time={wallclock="0.00006",user="0.00002",system="0.00003",start="1272660731.894504",end="1272660731.894561"}
(gdb)
<-gdb-set new-console off>
^error,msg="No symbol table is loaded. Use the \"file\" command."
(gdb)
<-gdb-version>
~"GNU gdb 6.3.50-20050815 (Apple version gdb-1461.2) (Fri Mar 5 04:43:10 UTC 2010)\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 \"x86_64-apple-darwin\"."
^done,version="6.3.50-20050815 (Apple version gdb-1461.2)",rc_version="1461.2",target="x86_64-apple-darwin",build-date="Fri Mar 5 04:43:10 UTC 2010",time={wallclock="0.00083",user="0.00031",system="0.00002",start="1272660731.905626",end="1272660731.906459"}
(gdb)
<-gdb-set env Apple_PubSub_Socket_Render=/tmp/launch-EHgJpp/Render>
^done,time={wallclock="0.00010",user="0.00006",system="0.00004",start="1272660731.913567",end="1272660731.913668"}
(gdb)
<-gdb-set env COMMAND_MODE=unix2003>
^done,time={wallclock="0.00003",user="0.00003",system="0.00000",start="1272660731.917756",end="1272660731.917784"}
(gdb)
<-gdb-set env DISPLAY=/tmp/launch-3gZz9f/org.x:0>
^done,time={wallclock="0.00002",user="0.00002",system="0.00000",start="1272660731.921206",end="1272660731.921229"}
(gdb)
<-gdb-set env HOME=/Users/obijohn>
^done,time={wallclock="0.00003",user="0.00003",system="0.00000",start="1272660731.924519",end="1272660731.924549"}
(gdb)
<-gdb-set env LOGNAME=obijohn>
^done,time={wallclock="0.00003",user="0.00002",system="0.00000",start="1272660731.927624",end="1272660731.927650"}
(gdb)
<-gdb-set env PATH=/usr/bin:/bin:/usr/sbin:/sbin>
^done,time={wallclock="0.00006",user="0.00006",system="0.00001",start="1272660731.935884",end="1272660731.935943"}
(gdb)
<-gdb-set env SHELL=/bin/bash>
^done,time={wallclock="0.00003",user="0.00002",system="0.00000",start="1272660731.939431",end="1272660731.939456"}
(gdb)
<-gdb-set env SSH_AUTH_SOCK=/tmp/launch-jggwxM/Listeners>
^done,time={wallclock="0.00002",user="0.00002",system="0.00000",start="1272660731.942555",end="1272660731.942572"}
(gdb)
<-gdb-set env TMPDIR=/var/folders/wq/wq3ehK6WFCWBnVQhT-CZqE+++TI/-Tmp-/>
^done,time={wallclock="0.00002",user="0.00002",system="0.00000",start="1272660731.946128",end="1272660731.946147"}
(gdb)
<-gdb-set env USER=obijohn>
^done,time={wallclock="0.00002",user="0.00001",system="0.00000",start="1272660731.949434",end="1272660731.949451"}
(gdb)
<-gdb-set env __CF_USER_TEXT_ENCODING=0x1F5:0:0>
^done,time={wallclock="0.00002",user="0.00002",system="0.00000",start="1272660731.952694",end="1272660731.952711"}
(gdb)
<-file-exec-and-symbols "/Users/obijohn/projects/fpc/testprojects/project1/project1.app">
^done,time={wallclock="0.34025",user="0.25639",system="0.07742",start="1272660731.956120",end="1272660732.296369"}
(gdb)
<-environment-cd .>
^done,time={wallclock="0.00008",user="0.00006",system="0.00002",start="1272660732.302764",end="1272660732.302846"}
(gdb)
<-environment-cd "/Users/obijohn/projects/fpc/testprojects/project1/">
^done,time={wallclock="0.00004",user="0.00003",system="0.00001",start="1272660732.306046",end="1272660732.306085"}
(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"
~"0x00011c00 SYSTEM_FPC_CPUINIT\n"
^done
(gdb)
<-exec-arguments >
^done,time={wallclock="0.00003",user="0.00003",system="0.00001",start="1272660732.346016",end="1272660732.346051"}
(gdb)
<set width 50000>
&"set width 50000\n"
^done
(gdb)
<-gdb-set language pascal>
^done,time={wallclock="0.00003",user="0.00002",system="0.00000",start="1272660732.352609",end="1272660732.352635"}
(gdb)
<info address main>
&"info address main\n"
~"Symbol \"main\" is at 0x1140c in a file compiled without debugging.\n"
^done
(gdb)
<-break-insert -t *70668>
^done,bkpt={number="1",type="breakpoint",disp="del",enabled="y",addr="0x0001140c",file="project1.lpr",line="19",shlib="/Users/obijohn/projects/fpc/testprojects/project1/project1.app/Contents/MacOS/project1",times="0"},time={wallclock="0.00049",user="0.00019",system="0.00031",start="1272660732.361100",end="1272660732.361595"}
(gdb)
<ptype TObject>
&"ptype TObject\n"
[ here I had to force-quit gdb from Activity Monitor ]
Ok, and here is the command-line output of Lazarus:
obijohn:~/projects/src/lazarus$ ./startlazarus
TLazarusManager.Run starting /Users/obijohn/projects/src/lazarus/lazarus.app/Contents/MacOS/lazarus ...
TMainIDE.ParseCmdLineOptions:
PrimaryConfigPath="/Users/obijohn/.lazarus"
SecondaryConfigPath="/etc/lazarus"
TCarbonTabsControl.SetFocus Error: SetKeyboardFocus failed with result -30585
TCarbonTabsControl.SetFocus Error: SetKeyboardFocus failed with result -30585
[TMainIDE.DoRunProject] A
TMainIDE.DoInitProjectRun A True 0
TMainIDE.DoInitProjectRun B
TCompiler.Compile WorkingDir="/Users/obijohn/projects/fpc/testprojects/project1/" CompilerFilename="/usr/local/bin/ppc386" CompilerParams=" -MObjFPC -Scghi -O1 -g -gl -k-framework -kCarbon -k-framework -kOpenGL -k'-dylib_file' -k'/System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGL.dylib:/System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGL.dylib' -vewnhi -l -Fi/Users/obijohn/projects/fpc/testprojects/project1/lib/i386-darwin/ -Fu/Users/obijohn/projects/src/lazarus/lcl/units/i386-darwin/ -Fu/Users/obijohn/projects/src/lazarus/lcl/units/i386-darwin/carbon/ -Fu/Users/obijohn/projects/src/lazarus/packager/units/i386-darwin/ -Fu/Users/obijohn/projects/fpc/testprojects/project1/ -Fu. -FU/Users/obijohn/projects/fpc/testprojects/project1/lib/i386-darwin/ -oproject1 -gw2 -godwarfsets -dLCL -dLCLcarbon project1.lpr"
[TCompiler.Compile] CmdLine="/usr/local/bin/ppc386 -MObjFPC -Scghi -O1 -g -gl -k-framework -kCarbon -k-framework -kOpenGL -k'-dylib_file' -k'/System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGL.dylib:/System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGL.dylib' -vewnhi -l -Fi/Users/obijohn/projects/fpc/testprojects/project1/lib/i386-darwin/ -Fu/Users/obijohn/projects/src/lazarus/lcl/units/i386-darwin/ -Fu/Users/obijohn/projects/src/lazarus/lcl/units/i386-darwin/carbon/ -Fu/Users/obijohn/projects/src/lazarus/packager/units/i386-darwin/ -Fu/Users/obijohn/projects/fpc/testprojects/project1/ -Fu. -FU/Users/obijohn/projects/fpc/testprojects/project1/lib/i386-darwin/ -oproject1 -gw2 -godwarfsets -dLCL -dLCLcarbon project1.lpr"
Hint: Start of reading config file /etc/fpc.cfg
Hint: End of reading config file /etc/fpc.cfg
Free Pascal Compiler version 2.5.1 [2010/04/29] for i386
Copyright (c) 1993-2009 by Florian Klaempfl
Target OS: Darwin for i386
Compiling project1.lpr
Assembling project1
Compiling resource /Users/obijohn/projects/fpc/testprojects/project1/lib/i386-darwin/project1.or
Linking project1
20 lines compiled, 2.6 sec
2 hint(s) issued
[TCompiler.Compile] end
TMainIDE.DoInitProjectRun ProgramFilename=/Users/obijohn/projects/fpc/testprojects/project1/project1
[TCmdLineDebugger] Debug PID: 43044
TGDBMIDebugger.ProcessResult Error: ,msg="No symbol table is loaded. Use the \"file\" command."
[Debugger] Running GDB version: 6.3.50-20050815 (Apple version gdb-1461.2)
[TDebugger.SetFileName] "/Users/obijohn/projects/fpc/testprojects/project1/project1.app"
[TMainIDE.DoRunProject] B TGDBMIDebugger
[TMainIDE.DoRunProject] END
TGDBMIDebugger.StartDebugging WorkingDir="/Users/obijohn/projects/fpc/testprojects/project1/"
TGDBMIDebugger.ProcessResult Error: ,msg="No symbol \"FPC_THREADVAR_RELOCATE_PROC\" in current context."
[Debugger] Log output: &"info functions FPC_CPUINIT\n"
[Debugger] Log output: &"set width 50000\n"
[Debugger] Log output: &"info address main\n"
[Debugger] Log output: &"ptype TObject\n"
[WARNING] Debugger: Execution of external command "-data-evaluate-expression %s" while queue exists
TDebugger.ReqCmd failed: Evaluate
TDebugger.ReqCmd Command not supported: Stop ClassName=TGDBMIDebugger
TDebugger.Stop Class=TGDBMIDebugger failed.
[ the project program did not display and I tried a "Stop" command, which obviously didn't work ]
^C
obijohn:~/projects/src/lazarus$