Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-devel / 2008-04

gdb crashes with trunk

26 messages · 3 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Martin Schreiber

Hi,
I am currently debugging the "cleanroom code" which is a frustrating matter because gdb crashes at allmost every breakpoint.
Any hints how to let gdb work more stable with trunk on i386-linux? I compile with -O- already, gdb version is 6.6.50.20070726-cvs.

Martin

Reply by email

Martin Schreiber
to Martin Schreiber
Martin Schreiber wrote 6 lines
Hi, I am currently debugging the "cleanroom code" which is a frustrating matter because gdb crashes at allmost every breakpoint. Any hints how to let gdb work more stable with trunk on i386-linux? I compile with -O- already, gdb version is 6.6.50.20070726-cvs.

OK, I found something my self, hiding the stack window of MSEide helps in some cases. If gdb crashes, there is no information about procedure parameters in the stack trace. Example:
"
#0 080D9CBD writer.inc:897 TWRITER__WRITEPROPERTY() #1 080D9086 writer.inc:678 TWRITER__WRITEPROPERTIES() #2 080D8DF6 writer.inc:603 TWRITER__WRITECOMPONENTDATA() #3 080CCDD7 compon.inc:386 TCOMPONENT__WRITESTATE() #4 080FCC12 mseclasses.pas:2915 TMSECOMPONENT__WRITESTATE() #5 080D8B8F writer.inc:545 TWRITER__WRITECOMPONENT() #6 080D8E5E writer.inc:617 TWRITER__WRITEDESCENDENT() #7 080DA25C writer.inc:962 TWRITER__WRITEROOTCOMPONENT() #8 080F90DA mseclasses.pas:979 COPYCOMPONENT()
#9 0816B41F msedesigner.pas:2839 TDESIGNER__COPYCOMPONENT() #10 0816A67E msedesigner.pas:2410 TDESIGNER__CREATECOMPONENT() #11 080D54E1 reader.inc:812 TREADER__READCOMPONENT() #12 080D5AE5 reader.inc:920 TREADER__READDATA()
#13 080CCA57 compon.inc:272 TCOMPONENT__READSTATE() #14 080FC8E5 mseclasses.pas:2824 TMSECOMPONENT__READSTATE() #15 08189973 mseforms.pas:1206 TCUSTOMMSEFORM__READSTATE() #16 080D6DAB reader.inc:1289 TREADER__READROOTCOMPONENT() #17 0816CE1D msedesigner.pas:3474 TDESIGNER__LOADFORMFILE() #18 080A5EF3 main.pas:1230 TMAINFO__OPENFORMFILE() #19 0808FB96 sourceform.pas:479 TSOURCEFO__UPDATESTAT() #20 08177001 projectoptionsform.pas:1187 UPDATEPROJECTOPTIONS() #21 08179966 projectoptionsform.pas:1559 READPROJECTOPTIONS() #22 080A8A94 main.pas:1892 TMAINFO__OPENPROJECT() #23 080A9A77 main.pas:2152 TMAINFO__MAINSTATFILEONUPDATESTAT() #24 0813D058 msestatfile.pas:142 TSTATFILE__DOSTATREAD() #25 0813407C msestat.pas:751 TSTATREADER__READSTAT() #26 0813D5B3 msestatfile.pas:235 TSTATFILE__READSTAT() #27 080A6899 main.pas:1422 TMAINFO__MAINONLOADED() #28 08188A97 mseforms.pas:848 TCUSTOMMSEFORM__DOEVENTLOOPSTART() #29 08188AE3 mseforms.pas:857 TCUSTOMMSEFORM__RECEIVEEVENT() #30 080F80AA mseevent.pas:195 TOBJECTEVENT__DELIVER() #31 08082870 msegui.pas:12320 TINTERNALAPPLICATION__EVENTLOOP() #32 080835BC msegui.pas:12715 TINTERNALAPPLICATION__DOEVENTLOOP() #33 080F66F8 mseapplication.pas:1064 TCUSTOMAPPLICATION__RUN() #34 0804C759 mseide.pas:57 main()
"
Again, a frustrating matter, debugging without stack window.

Martin

Reply by email

Jonas Maebe
to Martin Schreiber: I am currently debugging the "cleanroom code" which is a frustrating matter because gdb…
Martin Schreiber wrote
I am currently debugging the "cleanroom code" which is a frustrating matter because gdb crashes at allmost every breakpoint. Any hints how to let gdb work more stable with trunk on i386-linux?

Can you give a reproducible case? It's possible we can work around it by structuring the debug info differently. Also, did you compile the trunk units with a trunk compiler or with a 2.2.1 compiler?

I compile with -O- already, gdb version is 6.6.50.20070726-cvs.

One thing you can try is using -gw to use dwarf instead of stabs.

Jonas

Reply by email

Martin Schreiber
to Jonas Maebe
Jonas Maebe wrote 7 lines
On 03 Apr 2008, at 13:54, Martin Schreiber wrote: > I am currently debugging the "cleanroom code" which is a frustrating > matter > because gdb crashes at allmost every breakpoint. > Any hints how to let gdb work more stable with trunk on i386-linux? Can you give a reproducible case?

Checkout https://mseide-msegui.svn.sourceforge.net/svnroot/mseide-msegui/trunk Compile apps/ide/mseide.pas and FPC RTL with FPC trunk and -O- -gl. "

gdb ./mseidefp

GNU gdb 6.6.50.20070726-cvs
Copyright (C) 2007 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 "i586-suse-linux"...
Using host libthread_db library "/lib/libthread_db.so.1". (gdb) break main.pas:1422
Breakpoint 1 at 0x80a6884: file main.pas, line 1422. (gdb) set args -np
(gdb) run
Starting program: /home/mse/packs/standard/svn/mse/trunk/apps/ide/mseidefp -np [Thread debugging using libthread_db enabled]
[New Thread 0xb7c298d0 (LWP 25514)]
[Switching to Thread 0xb7c298d0 (LWP 25514)]

Breakpoint 1, TMAINFO__MAINONLOADED (SENDER=0xb7645870, this=0xb7645870) at main.pas:1422
1422 mainstatfile.readstat;
(gdb) bt
#0 TMAINFO__MAINONLOADED (SENDER=0xb7645870, this=0xb7645870) at main.pas:1422
#1 0x08188a97 in TCUSTOMMSEFORM__DOEVENTLOOPSTART (this=0xb7645870) at mseforms.pas:848
#2 0x08188ae3 in TCUSTOMMSEFORM__RECEIVEEVENT (EVENT=0xb7c20bc0, this=0xb7645870) at mseforms.pas:857
Segmentation fault

"

It's possible we can work around it by structuring the debug info differently. Also, did you compile the trunk units with a trunk compiler or with a 2.2.1 compiler?

make clean all in trunk, compiled the RTL with the new trunk compiler and -O- -gl.

One thing you can try is using -gw to use dwarf instead of stabs.

That helps, thanks a lot!

#0 080DA2E7 writer.inc:869 WRITEPROPERTY(INSTANCE=0xb74ff0c0, PROPINFO=0x84d0da9, this=0xb7555cf0)
#1 080D9896 writer.inc:678 WRITEPROPERTIES(INSTANCE=0xb74ff0c0, this=0xb7555cf0)
#2 080D9606 writer.inc:603 WRITECOMPONENTDATA(INSTANCE=0xb74ff0c0, this=0xb7555cf0)
#3 080CD5E7 compon.inc:386 WRITESTATE(WRITER=0xb7555cf0, this=0xb74ff0c0) #4 080FD422 mseclasses.pas:2915 WRITESTATE(WRITER=0xb7555cf0, this=0xb74ff0c0)
#5 080D939F writer.inc:545 WRITECOMPONENT(COMPONENT=0xb74ff0c0, this=0xb7555cf0)
#6 080D966E writer.inc:617 WRITEDESCENDENT(AROOT=0xb74ff0c0, AANCESTOR=0x0, this=0xb7555cf0)
#7 080DAA6C writer.inc:962 WRITEROOTCOMPONENT(AROOT=0xb74ff0c0, this=0xb7555cf0)
#8 080F98EA mseclasses.pas:979 COPYCOMPONENT(COPYCOMPONENT=0xb75031e0, SOURCE=0xb74ff0c0, AOWNER=0x0, {Proc = {procedure (^pointer, ^TWRITER = class , ^TCOMPONENT = class , ^Char, ^TCOMPONENT = class , ^TCOMPONENT = class )} 0xbf8e72d8, Self = 0xb77f7020}, {Proc = {procedure (^pointer, ^TREADER =
class , ^Char, ^__vtbl_ptr_type = record )} 0xbf8e72f0, Self = 0xb77f7020}, {Proc = {procedure (^pointer, ^TREADER =
class , ^__vtbl_ptr_type = record , ^TCOMPONENT = class )} 0xbf8e72e8, Self = 0xb77f7020}, {Proc = {procedure (^pointer,
^TREADER = class , ^Char, ^__vtbl_ptr_type = record , ^TCOMPONENT = class )} 0xbf8e72e0, Self = 0xb77f7020})
#9 0816BC2F msedesigner.pas:2838 COPYCOMPONENT(COPYCOMPONENT=0xbf8e7314, SOURCE=0xb74ff0c0, ROOT=0xb74ff0c0, this=0xb77f7020) #10 0816AE8E msedesigner.pas:2410 CREATECOMPONENT(READER=0xb756b740, COMPONENTCLASS=0x84cea98, 0x0, this=0xb77f7020)
#11 080D5CF1 reader.inc:812 READCOMPONENT(READCOMPONENT=0x0, COMPONENT=0x0, this=0xb756b740)
#12 080D62F5 reader.inc:920 READDATA(INSTANCE=0xb7504ff0, this=0xb756b740) #13 080CD267 compon.inc:272 READSTATE(READER=0xb756b740, this=0xb7504ff0) #14 080FD0F5 mseclasses.pas:2824 READSTATE(READER=0xb756b740, this=0xb7504ff0)
#15 0818A183 mseforms.pas:1206 READSTATE(READER=0xb756b740, this=0xb7504ff0) #16 080D75BB reader.inc:1289 READROOTCOMPONENT(READROOTCOMPONENT=0xb7504ff0, AROOT=0xb7504ff0, this=0xb756b740)
#17 0816D62D msedesigner.pas:3474 LOADFORMFILE(LOADFORMFILE=0xb76daff0, FILENAME=0xb75559d8, this=0xb77f7020)
#18 080A6703 main.pas:1230 OPENFORMFILE(OPENFORMFILE=0x0, FILENAME=0xb7555708, ASHOW=true, AACTIVATE=false, SHOWSOURCE=false, CREATEMENU=true, this=0xb75e1870)
#19 080903A6 sourceform.pas:479 UPDATESTAT(STATFILER=0xb75cf460, this=0xb770c2e0)
#20 08177811 projectoptionsform.pas:1187
UPDATEPROJECTOPTIONS(STATFILER=0xb75cf460, AFILENAME=0xb7bb29d8) #21 0817A176 projectoptionsform.pas:1559
READPROJECTOPTIONS(READPROJECTOPTIONS=false, FILENAME=0xb7bb29d8) #22 080A92A4 main.pas:1892 OPENPROJECT(OPENPROJECT=false, ANAME=0xb7bb29d8, ASCOPY=false, this=0xb75e1870)
#23 080A9E7B main.pas:2072 OPENPROJECTONEXECUTE(SENDER=0xb780ebe0, this=0xb75e1870)
#24 0815918D mseact.pas:300 DOACTIONEXECUTE(DOACTIONEXECUTE=true, SENDER=0xb780ebe0, {ACTION = 0x0, CAPTIONTEXT = 0xb7571248, CAPTION1 = {TEXT = 0xb7571208, FORMAT = {{INDEX = 0, NEWINFOS = 1048832, STYLE = {FONTCOLOR = 0x8, COLORBACKGROUND = 0x0, FONTSTYLE = 0}}}}, STATE = 1048832, OPTIONS = 8, SHORTCUT = 0, SHORTCUT1 = 0, GROUP = 0, IMAGENR = -1, IMAGENRDISABLED = -2, COLORGLYPH = 2415919117, COLOR = 2147483649, IMAGECHECKEDOFFSET = 0, IMAGELIST = 0x0, HINT = 0x0, TAG = 0, ONEXECUTE = {Proc = {procedure (^pointer, ^TOBJECT = class )} 0xb780ec54, Self = 0xb75e1870}}, NOCHECKBOX=true)
#25 08150043 msemenus.pas:481 CHECKEXEC(CHECKEXEC=true, this=0xb7a2c860) #26 0815D328 msemenuwidgets.pas:1242 ACTIVATEMENU(KEYMODE=false, ACLICKED=true, this=0xb76024c0)
#27 0815CBF1 msemenuwidgets.pas:1088 MOUSEEVENT( {EVENTKIND = EK_MOUSEMOVE, SHIFTSTATE = 8, POS = {X = 212, Y = 19}, EVENTSTATE = 0, TIMESTAMP = 2530890616, BUTTON = MB_NONE}, this=0xb75f12c0) #28 0815E5FA msemenuwidgets.pas:1738 MOUSEEVENT( {EVENTKIND = EK_MOUSEMOVE, SHIFTSTATE = 8, POS = {X = 212, Y = 19}, EVENTSTATE = 0, TIMESTAMP = 2530890616, BUTTON = MB_NONE}, this=0xb75f12c0) #29 0807F1B1 msegui.pas:10630 DISPATCHMOUSEEVENT( {EVENTKIND = EK_MOUSEMOVE, SHIFTSTATE = 8, POS = {X = 212, Y = 19}, EVENTSTATE = 0, TIMESTAMP = 2530890616, BUTTON = MB_NONE}, CAPTURE=0xb75f12c0, this=0xb76d82e0)
#30 080819DA msegui.pas:11714 PROCESSMOUSEEVENT(EVENT=0xb75ceaa0, this=0xb7a1c020)
#31 0808303F msegui.pas:12305 EVENTLOOP(EVENTLOOP=false, AMODALWINDOW=0x0, ONCE=false, this=0xb7a1c020)
#32 08083DCC msegui.pas:12715 DOEVENTLOOP(ONCE=false, this=0xb7a1c020) #33 080F6F08 mseapplication.pas:1064 RUN(this=0xb7a1c020) #34 0804C759 mseide.pas:57 main()

Martin

Reply by email

Jonas Maebe
to Martin Schreiber
Martin Schreiber wrote 5 lines
On Thursday 03 April 2008 14.04:44 Jonas Maebe wrote: > > One thing you can try is using -gw to use dwarf instead of stabs. > It seems sets are displayed as integers with dwarf?

$ ppcppc57 -h
[snip]
-g Generate debug information (default format for target) [snip]
-go<x> Set debug information options
-godwarfsets Enable Dwarf set debug information (breaks gdb < 6.5)

Jonas

Reply by email

Martin Schreiber
to Jonas Maebe
Jonas Maebe wrote 14 lines
On 03 Apr 2008, at 17:16, Martin Schreiber wrote: > On Thursday 03 April 2008 14.04:44 Jonas Maebe wrote: >> One thing you can try is using -gw to use dwarf instead of stabs. > > It seems sets are displayed as integers with dwarf? $ ppcppc57 -h [snip] -g Generate debug information (default format for target) [snip] -go<x> Set debug information options -godwarfsets Enable Dwarf set debug information (breaks gdb < 6.5)

The compiler crashes with -godwarfsets.
"
Free Pascal Compiler version 2.3.1 [2008/03/28] for i386 Copyright (c) 1993-2007 by Florian Klaempfl
Target OS: Linux for i386
Compiling mseide.pas
Compiling /home/mse/packs/standard/svn/mse/trunk/lib/common/kernel/mseerr.pas Compiling /home/mse/packs/standard/svn/mse/trunk/lib/common/kernel/msekeyboard.pas msekeyboard.pas(21,28) Note: Values in enumeration types have to be ascending Compiling /home/mse/packs/standard/svn/mse/trunk/lib/common/kernel/i386-linux/msesetlocale.pas Compiling /home/mse/packs/standard/svn/mse/trunk/lib/common/kernel/msereal.pas Compiling /home/mse/packs/standard/svn/mse/trunk/lib/common/kernel/i386-linux/msesysintf.pas Compiling /home/mse/packs/standard/svn/mse/trunk/lib/common/kernel/i386-linux/msesysintf.pas Compiling /home/mse/packs/standard/svn/mse/trunk/lib/common/kernel/msehash.pas msehash.pas(464,31) Warning: Converting pointers to signed integers may result in wrong comparison results and range errors, use an unsigned type instead. msehash.pas(681,31) Warning: Converting pointers to signed integers may result in wrong comparison results and range errors, use an unsigned type instead. Compiling /home/mse/packs/standard/svn/mse/trunk/lib/common/kernel/i386-linux/msesysintf.pas Compiling /home/mse/packs/standard/svn/mse/trunk/lib/common/kernel/msesysutils.pas msesysintf.pas(768,2) Note: Local variable "err" not used Compiling actionsmodule.pas
Compiling main.pas
Compiling sourcepage.pas
Compiling breakpointsform.pas
Compiling sourceform.pas
Compiling sourcepage.pas
Compiling pascaldesignparser.pas
Compiling msedesigner.pas
Compiling /home/mse/packs/standard/svn/mse/trunk/lib/common/designutils/msedesignintf.pas Compiling msedesigner.pas
Compiling /home/mse/packs/standard/svn/mse/trunk/lib/common/designutils/msepropertyeditors.pas Compiling msedesigner.pas
Compiling formdesigner.pas
Compiling componentpaletteform.pas
Compiling main.pas
Compiling sourcepage.pas
Compiling sourcepage_mfm.pas
Compiling sourceform.pas
Compiling finddialogform.pas
Compiling projectoptionsform.pas
Compiling /home/mse/packs/standard/svn/mse/trunk/lib/common/sysutils/msesysenv.pas Compiling projectoptionsform_mfm.pas
Compiling sourceform.pas
Compiling finddialogform.pas
Compiling finddialogform_mfm.pas
Compiling sourceform_mfm.pas
Compiling main.pas
Compiling /home/mse/packs/standard/svn/mse/trunk/lib/common/printer/msepostscriptprinter.pas Compiling /home/mse/packs/standard/svn/mse/trunk/lib/common/printer/mseprinter.pas Fatal: Compilation aborted
An unhandled exception occurred at $0819E73F :
EAccessViolation : Access violation
$0819E73F
$0819EA0D
$080D5D59
$081A2386
$080D64DE
$0811E994
$0810608F
$08114594
$0811D7D7
$0811E235
$0810608F
$08114594
$0811D7D7
$0811E235
$0810608F
$08114594
$0811D7D7

"

Reply by email

Martin Schreiber
to Jonas Maebe
Jonas Maebe wrote 5 lines
On 03 Apr 2008, at 19:12, Martin Schreiber wrote: > The compiler crashes with -godwarfsets. Fixed.

It doesn't crash anymore, thanks.
The display of sets seems to be wrong:
"

gdb ./mseidefp

GNU gdb 6.6.50.20070726-cvs
Copyright (C) 2007 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 "i586-suse-linux"...
Using host libthread_db library "/lib/libthread_db.so.1". (gdb) break reader.inc:1260
Breakpoint 1 at 0x80d6c1e: file ../objpas/classes/reader.inc, line 1260. (gdb) run
Starting program: /home/mse/packs/standard/svn/mse/trunk/apps/ide/mseidefp [Thread debugging using libthread_db enabled]
[New Thread 0xb7c188d0 (LWP 4821)]
[Switching to Thread 0xb7c188d0 (LWP 4821)]

Breakpoint 1, READROOTCOMPONENT (READROOTCOMPONENT=0xb786a020, AROOT=0xb786a020, this=0xb785a020) at ../objpas/classes/reader.inc:1260 1260 Result.FComponentState :=
(gdb) print result.fcomponentstate
$1 = []
(gdb) next
1264 i := 0;
(gdb) print result.fcomponentstate
$2 = []
(gdb)
"
"

          Result.FComponentState :=
            Result.FComponentState + [csLoading, csReading];

{ We need an unique name }

          i := 0;

"
Martin

Reply by email

Martin Schreiber
to Martin Schreiber: Checkout https://mseide-msegui.svn.sourceforge.net/svnroot/mseide-msegui/trunk Compile…
Martin Schreiber wrote 7 lines
On Thursday 03 April 2008 14.04:44 Jonas Maebe wrote: > One thing you can try is using -gw to use dwarf instead of stabs. That helps, thanks a lot!

There are gdb crashes with -gw too:
"

gdb ./mseidefp

GNU gdb 6.6.50.20070726-cvs
Copyright (C) 2007 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 "i586-suse-linux"...
Using host libthread_db library "/lib/libthread_db.so.1". (gdb) break fpc_raiseexception
Breakpoint 1 at 0x805b635: file ../inc/except.inc, line 195. (gdb) run
Starting program: /home/mse/packs/standard/svn/mse/trunk/apps/ide/mseidefp [Thread debugging using libthread_db enabled]
[New Thread 0xb7bb88d0 (LWP 5338)]
[Switching to Thread 0xb7bb88d0 (LWP 5338)]

Breakpoint 1, fpc_raiseexception (fpc_raiseexception=0x846aee0, OBJ=0xb7bb1da0, ANADDR=0x80dd526, AFRAME=0xbfeef30c) at ../inc/except.inc:195 195 fpc_Raiseexception:=nil;
(gdb) c
Continuing.

Breakpoint 1, fpc_raiseexception (fpc_raiseexception=0x846aee0, OBJ=0xb7bb2830, ANADDR=0x80dd526, AFRAME=0xbfeeef4c) at ../inc/except.inc:195 195 fpc_Raiseexception:=nil;
(gdb)
Continuing.

Breakpoint 1, fpc_raiseexception (fpc_raiseexception=0x846aee0, OBJ=0xb7bb2580, ANADDR=0x80dd526, AFRAME=0xbfeeef4c) at ../inc/except.inc:195 195 fpc_Raiseexception:=nil;
(gdb)
Continuing.

Breakpoint 1, fpc_raiseexception (fpc_raiseexception=0x846aee0, OBJ=0xb7bb2830, ANADDR=0x80dd526, AFRAME=0xbfeeef4c) at ../inc/except.inc:195 195 fpc_Raiseexception:=nil;
(gdb)
Continuing.

Breakpoint 1, fpc_raiseexception (fpc_raiseexception=0x846aee0, OBJ=0xb7bb26a0, ANADDR=0x80dd526, AFRAME=0xbfeeef4c) at ../inc/except.inc:195 195 fpc_Raiseexception:=nil;
(gdb)
Continuing.

Breakpoint 1, fpc_raiseexception (fpc_raiseexception=0x846aee0, OBJ=0xb7bb26d0, ANADDR=0x80dd526, AFRAME=0xbfeeef4c) at ../inc/except.inc:195 195 fpc_Raiseexception:=nil;
(gdb)
Continuing.

Breakpoint 1, fpc_raiseexception (fpc_raiseexception=0x846aee0, OBJ=0xb7bb26a0, ANADDR=0x80dd526, AFRAME=0xbfeeef4c) at ../inc/except.inc:195 195 fpc_Raiseexception:=nil;
(gdb)
Continuing.
[New Thread 0xb74cab90 (LWP 5347)]

Breakpoint 1, fpc_raiseexception (fpc_raiseexception=0x84642e0, OBJ=0xb7bb24b0, ANADDR=0x80ccd55, AFRAME=0xbfeef428) at ../inc/except.inc:195 195 fpc_Raiseexception:=nil;
(gdb) bt
#0 fpc_raiseexception (fpc_raiseexception=0x84642e0, OBJ=0xb7bb24b0, ANADDR=0x80ccd55, AFRAME=0xbfeef428) at ../inc/except.inc:195 #1 0x080ccd61 in VALIDATERENAME (ACOMPONENT=0xb74d1a80, CURNAME=0x0, NEWNAME=0xb76dc188 'inlinefo2', this=0xb74cfc10)
at ../objpas/classes/compon.inc:364
#2 0x080ccbff in SETNAME (NEWNAME=0xb76dc188 'inlinefo2', this=0xb74d1a80) at ../objpas/classes/compon.inc:313
#3 0x080d56bc in READCOMPONENT (READCOMPONENT=0xb74d1a80, COMPONENT=0x0, this=0xb755c220) at ../objpas/classes/reader.inc:854 #4 0x080d5ae5 in READDATA (INSTANCE=0xb74cfc10, this=0xb755c220) at ../objpas/classes/reader.inc:920
#5 0x080cca57 in READSTATE (READER=0xb755c220, this=0xb74cfc10) at ../objpas/classes/compon.inc:272
#6 0x080fc8e5 in TMSECOMPONENT__READSTATE (READER=0xb755c220, this=0xb74cfc10) at mseclasses.pas:2834
#7 0x08189983 in TCUSTOMMSEFORM__READSTATE (READER=0xb755c220, this=0xb74cfc10) at mseforms.pas:1206
#8 0x080d6dab in READROOTCOMPONENT (READROOTCOMPONENT=0xb74cfc10, AROOT=0xb74cfc10, this=0xb755c220) at ../objpas/classes/reader.inc:1289 #9 0x0816782c in TDESCENDENTINSTANCELIST__MODULEMODIFIED (AMODULE=0xb76cc5b0, this=0xb7ba0570) at msedesigner.pas:1277
#10 0x08169960 in TMODULELIST__COMPONENTMODIFIED (ACOMPONENT=0xb75fee30, this=0xb7b99e20) at msedesigner.pas:2097
#11 0x0816b2c2 in TDESIGNER__COMPONENTMODIFIED (COMPONENT=0xb75fee30, this=0xb77ea020) at msedesigner.pas:2802
#12 0x08167acc in TDESCENDENTINSTANCELIST__MODULEMODIFIED (AMODULE=0xb76cc470, this=0xb7ba0570) at msedesigner.pas:1341
#13 0x08169960 in TMODULELIST__COMPONENTMODIFIED (ACOMPONENT=0xb7602100, this=0xb7b99e20) at msedesigner.pas:2097
#14 0x0816b2c2 in TDESIGNER__COMPONENTMODIFIED (COMPONENT=0xb7602100, this=0xb77ea020) at msedesigner.pas:2802
#15 0x0826e595 in TDESIGNWINDOW__DOMODIFIED (this=0xb7808620) at formdesigner.pas:2080
#16 0x0826ef59 in TFORMDESIGNERFO__DOASYNCEVENT (ATAG=1, this=0xb7602c80) at formdesigner.pas:2343
---Type <return> to continue, or q <return> to quit--- #17 0x080fc22d in TMSECOMPONENT__RECEIVEEVENT (EVENT=0xb752b1e0, this=0xb7602c80) at mseclasses.pas:2588
#18 0x080f4b17 in TACTCOMPONENT__RECEIVEEVENT (EVENT=0xb752b1e0, this=0xb7602c80) at mseapplication.pas:388
#19 0x0807b1ba in TWIDGET__RECEIVEEVENT (EVENT=0xb752b1e0, this=0xb7602c80) at msegui.pas:9158
#20 0x08144afb in TCUSTOMEVENTWIDGET__RECEIVEEVENT (EVENT=0xb752b1e0, this=0xb7602c80) at msewidgets.pas:3910
#21 0x08188aca in TCUSTOMMSEFORM__RECEIVEEVENT (EVENT=0xb752b1e0, this=0xb7602c80) at mseforms.pas:854
Segmentation fault

"
I have no simple testcase.

Martin

Reply by email

Martin Schreiber
to Martin Schreiber
Martin Schreiber wrote 9 lines
On Thursday 03 April 2008 15.02:46 Martin Schreiber wrote: > On Thursday 03 April 2008 14.04:44 Jonas Maebe wrote: > > One thing you can try is using -gw to use dwarf instead of stabs. > > That helps, thanks a lot! There are gdb crashes with -gw too: " > gdb ./mseidefp

I was to fast with the my messages, i didn't compile all units with -gw, sorry. I'll investigate further.

Martin

Reply by email

Martin Schreiber
to Martin Schreiber
Martin Schreiber wrote 14 lines
On Friday 04 April 2008 08.37:24 Martin Schreiber wrote: > On Thursday 03 April 2008 15.02:46 Martin Schreiber wrote: > > On Thursday 03 April 2008 14.04:44 Jonas Maebe wrote: > > > One thing you can try is using -gw to use dwarf instead of stabs. > > > > That helps, thanks a lot! > > There are gdb crashes with -gw too: > " > > gdb ./mseidefp I was to fast with the my messages, i didn't compile all units with -gw, sorry. I'll investigate further.

Yup, the gdb crash vanished when I compiled correct. The wrong set display is still there.

Martin

Reply by email

Jonas Maebe
to Martin Schreiber: It doesn't crash anymore, thanks. The display of sets seems to be wrong: " GNU gdb…
Martin Schreiber wrote 41 lines
On Thursday 03 April 2008 21.33:17 Jonas Maebe wrote: > On 03 Apr 2008, at 19:12, Martin Schreiber wrote: >> The compiler crashes with -godwarfsets. > > Fixed. > It doesn't crash anymore, thanks. The display of sets seems to be wrong: " > gdb ./mseidefp GNU gdb 6.6.50.20070726-cvs Copyright (C) 2007 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 "i586-suse-linux"... Using host libthread_db library "/lib/libthread_db.so.1". (gdb) break reader.inc:1260 Breakpoint 1 at 0x80d6c1e: file ../objpas/classes/reader.inc, line 1260. (gdb) run Starting program: /home/mse/packs/standard/svn/mse/trunk/apps/ide/ mseidefp [Thread debugging using libthread_db enabled] [New Thread 0xb7c188d0 (LWP 4821)] [Switching to Thread 0xb7c188d0 (LWP 4821)] Breakpoint 1, READROOTCOMPONENT (READROOTCOMPONENT=0xb786a020, AROOT=0xb786a020, this=0xb785a020) at ../objpas/classes/reader.inc: 1260 1260 Result.FComponentState := (gdb) print result.fcomponentstate $1 = [] (gdb) next 1264 i := 0; (gdb) print result.fcomponentstate $2 = []

It does work for me:

(gdb) p Result.FComponentState
No symbol "Result" in current context.
(gdb) p result.FComponentState
$1 = []
(gdb) l
1255 begin
1256 Result := ARoot;
1257
1258 if not (csDesigning in Result.ComponentState) then 1259 begin
1260 Result.FComponentState :=
1261 Result.FComponentState + [csLoading, csReading]; 1262
1263 { We need an unique name }
1264 i := 0;
(gdb) n
1264 i := 0;
(gdb) p result.FComponentState
$2 = [CSLOADING..CSREADING]

$ gdb --version
GNU gdb Red Hat Linux (6.6-45.fc8rh)
Copyright (C) 2006 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 "i386-redhat-linux-gnu".

Seems like you may have to update your gdb (fwiw, the 6.5-15.fc6rh I have access to crashes even with Dwarf).

Jonas

Reply by email

Jonas Maebe
to Jonas Maebe
Jonas Maebe wrote
It does work for me:

Another thing: in gdb < 6.7, you have use "set lang pascal" because gdb didn't recognize the Pascal language marker in the Dwarf header in those versions (and the default gdb language mode is "minimal").

Jonas

Reply by email

Jonas Maebe
to Jonas Maebe: It does work for me: (gdb) p Result.FComponentState No symbol "Result" in current context.
Jonas Maebe wrote 14 lines
$ gdb --version GNU gdb Red Hat Linux (6.6-45.fc8rh) Copyright (C) 2006 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 "i386-redhat-linux-gnu". Seems like you may have to update your gdb (fwiw, the 6.5-15.fc6rh I have access to crashes even with Dwarf).

And this 6.6 also works fine with stabs.

Jonas

Reply by email

Martin Schreiber
to Jonas Maebe
Jonas Maebe wrote
And this 6.6 also works fine with stabs.

I tried with gdb 6.8.50:
"
GNU gdb 6.8.50.20080306
Copyright (C) 2008 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html> This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. Type "show copying" and "show warranty" for details.
This GDB was configured as "i686-pc-linux-gnu"...
(gdb) break reader.inc:1260
Breakpoint 1 at 0x80d742e: file ../objpas/classes/reader.inc, line 1260. (gdb) run
Starting program: /home/mse/packs/standard/svn/mse/trunk/apps/ide/mseidefp [Thread debugging using libthread_db enabled]
[New Thread 0xb7b538d0 (LWP 5905)]
[Switching to Thread 0xb7b538d0 (LWP 5905)]

Breakpoint 1, READROOTCOMPONENT (READROOTCOMPONENT=0xb77a5020, AROOT=0xb77a5020, this=0xb7795020) at ../objpas/classes/reader.inc:1260 1260 Result.FComponentState :=
(gdb) print result.fcomponentstate
$1 = []
(gdb) next
1264 i := 0;
(gdb) print result.fcomponentstate
$2 = []
(gdb)
"
BTW the set display is not always wrong.

This is with stabs (-O- -gl):
"
GNU gdb 6.8.50.20080306
Copyright (C) 2008 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html> This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. Type "show copying" and "show warranty" for details.
This GDB was configured as "i686-pc-linux-gnu"...
(gdb) break main.pas:1422
Breakpoint 1 at 0x80a7094: file main.pas, line 1422. (gdb) run
Starting program: /home/mse/packs/standard/svn/mse/trunk/apps/ide/mseidefp [Thread debugging using libthread_db enabled]
[New Thread 0xb7b5d8d0 (LWP 8469)]
[Switching to Thread 0xb7b5d8d0 (LWP 8469)]

Breakpoint 1, MAINONLOADED (SENDER=0xb7579870, this=0xb7579870) at main.pas:1422
1422 mainstatfile.readstat;
(gdb) bt
#0 MAINONLOADED (SENDER=0xb7579870, this=0xb7579870) at main.pas:1422 #1 0x08189347 in DOEVENTLOOPSTART (this=0xb7579870) at ../../lib/common/widgets/mseforms.pas:848
#2 0x08189393 in RECEIVEEVENT (EVENT=0xb7b54be0, this=0xb7579870) at ../../lib/common/widgets/mseforms.pas:857
#3 0x080f88ea in DELIVER (this=0xb7b54be0)
at ../../lib/common/kernel/mseevent.pas:195
#4 0x08083080 in EVENTLOOP (EVENTLOOP=false, AMODALWINDOW=0x0, ONCE=false, this=0xb79b4020) at ../../lib/common/kernel/msegui.pas:12320 #5 0x08083dcc in DOEVENTLOOP (ONCE=false, this=0xb79b4020) at ../../lib/common/kernel/msegui.pas:12715
#6 0x080f6f38 in RUN (this=0xb79b4020)
at ../../lib/common/kernel/mseapplication.pas:1064 #7 0x0804c759 in main () at mseide.pas:57
(gdb)
"
Hurray!

Now MSEide and probably Lazarus too have a problem: debugging of FPC trunk applications will not work with some distributions. OpenSuse 10.3 gdb crashes with stabs and does not show set results correctly with dwarf. The need of different debugger compiler switches for different compiler versions is not ideal anyway.

Martin

Reply by email

Martin Schreiber
to Martin Schreiber
Martin Schreiber wrote
Hurray!

Update:
"
GNU gdb 6.8.50.20080306
Copyright (C) 2008 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html> This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. Type "show copying" and "show warranty" for details.
This GDB was configured as "i686-pc-linux-gnu"...
(gdb) break main.pas:1422
Breakpoint 1 at 0x80a6884: file main.pas, line 1422. (gdb) run
Starting program: /home/mse/packs/standard/svn/mse/trunk/apps/ide/mseidefp [Thread debugging using libthread_db enabled]
[New Thread 0xb7c038d0 (LWP 9561)]
[Switching to Thread 0xb7c038d0 (LWP 9561)]

Breakpoint 1, TMAINFO__MAINONLOADED (SENDER=0xb761f870, this=0xb761f870) at main.pas:1422
1422 mainstatfile.readstat;
(gdb) bt
#0 TMAINFO__MAINONLOADED (SENDER=0xb761f870, this=0xb761f870) at main.pas:1422
#1 0x08188b37 in TCUSTOMMSEFORM__DOEVENTLOOPSTART (this=0xb761f870) at mseforms.pas:848
#2 0x08188b83 in TCUSTOMMSEFORM__RECEIVEEVENT (EVENT=0xb7bfabe0, this=0xb761f870) at mseforms.pas:857
Segmentation fault
"
:-(
Because of the missing TMAINFO_ it was probably dwarf and not stabs which worked before.
Argh, so many different possibilities to make errors...

Martin

Reply by email

Jonas Maebe
to Martin Schreiber
Martin Schreiber wrote 16 lines
main.pas:1422 1422 mainstatfile.readstat; (gdb) bt #0 TMAINFO__MAINONLOADED (SENDER=0xb761f870, this=0xb761f870) at main.pas:1422 #1 0x08188b37 in TCUSTOMMSEFORM__DOEVENTLOOPSTART (this=0xb761f870) at mseforms.pas:848 #2 0x08188b83 in TCUSTOMMSEFORM__RECEIVEEVENT (EVENT=0xb7bfabe0, this=0xb761f870) at mseforms.pas:857 Segmentation fault " :-( Because of the missing TMAINFO_ it was probably dwarf and not stabs which worked before.

This is caused by the fact that some restructuring of the debug info writer broke this fix:

------------------------------------------------------------------------ r8565 | jonas | 2007-09-19 18:37:49 +0200 (Wed, 19 Sep 2007) | 5 lines Changed paths:
M /trunk/compiler/dbgstabs.pas
M /trunk/compiler/symconst.pas
A /trunk/tests/webtbs/tw9766.pp

* avoid writing the stabs for a child class before those of a parent class in case the parent class has a field with as type the (forward
defined) child class, because this crashes gdb
+ (interactive) test for this

------------------------------------------------------------------------

I'll try to fix it again.

It's unfortunate that automating testing the debug info is hard to do in a cross-platform way. Does the unix "expect" utility exist for Windows? If so, maybe we can add tests similar to those in the gdb testsuite -- and otherwise we can still add them for unix only, since several unix testsuite runs are performed daily and the debug info is mostly OS-independent.

Jonas

Reply by email

Marco van de Voort
to Jonas Maebe
Show quoted text 9 lines
On 05 Apr 2008, at 10:48, Martin Schreiber wrote: I'll try to fix it again. It's unfortunate that automating testing the debug info is hard to do in a cross-platform way. Does the unix "expect" utility exist for Windows? If so, maybe we can add tests similar to those in the gdb testsuite -- and otherwise we can still add them for unix only, since several unix testsuite runs are performed daily and the debug info is mostly OS-independent.

A quick google turns up cygwin versions, but no standalone mingwones.

Note that this is probably also because expect requires tcl.

Reply by email

Jonas Maebe
to Jonas Maebe: This is caused by the fact that some restructuring of the debug info writer broke this…
Jonas Maebe wrote 19 lines
This is caused by the fact that some restructuring of the debug info writer broke this fix: ------------------------------------------------------------------------ r8565 | jonas | 2007-09-19 18:37:49 +0200 (Wed, 19 Sep 2007) | 5 lines Changed paths: M /trunk/compiler/dbgstabs.pas M /trunk/compiler/symconst.pas A /trunk/tests/webtbs/tw9766.pp * avoid writing the stabs for a child class before those of a parent class in case the parent class has a field with as type the (forward defined) child class, because this crashes gdb + (interactive) test for this ------------------------------------------------------------------------ I'll try to fix it again.

Fixed. gdb 6.5 also works again. It starts a lot slower than 6.6, so I guess 6.5 read all debug information on startup (which is why it crashed immediately) while 6.6 and later only read the debug info as needed (and hence only crashed when the type info it can't handle was needed).

Jonas

Reply by email

Jonas Maebe
to Martin Schreiber: I tried with gdb 6.8.50: " GNU gdb 6.8.50.20080306 Copyright (C) 2008 Free Software…
Martin Schreiber wrote 34 lines
I tried with gdb 6.8.50: " GNU gdb 6.8.50.20080306 Copyright (C) 2008 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html > This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. Type "show copying" and "show warranty" for details. This GDB was configured as "i686-pc-linux-gnu"... (gdb) break reader.inc:1260 Breakpoint 1 at 0x80d742e: file ../objpas/classes/reader.inc, line 1260. (gdb) run Starting program: /home/mse/packs/standard/svn/mse/trunk/apps/ide/ mseidefp [Thread debugging using libthread_db enabled] [New Thread 0xb7b538d0 (LWP 5905)] [Switching to Thread 0xb7b538d0 (LWP 5905)] Breakpoint 1, READROOTCOMPONENT (READROOTCOMPONENT=0xb77a5020, AROOT=0xb77a5020, this=0xb7795020) at ../objpas/classes/reader.inc: 1260 1260 Result.FComponentState := (gdb) print result.fcomponentstate $1 = [] (gdb) next 1264 i := 0; (gdb) print result.fcomponentstate $2 = [] (gdb) " BTW the set display is not always wrong.

It works with gdb 6.6, but indeed not with 6.8. I'll try to find the cause and file a bug report with gdb if necessary.

Jonas

Reply by email

Martin Schreiber
to Jonas Maebe: Fixed. gdb 6.5 also works again. It starts a lot slower than 6.6, so I guess 6.5 read all…
Jonas Maebe wrote 6 lines
Fixed. gdb 6.5 also works again. It starts a lot slower than 6.6, so I guess 6.5 read all debug information on startup (which is why it crashed immediately) while 6.6 and later only read the debug info as needed (and hence only crashed when the type info it can't handle was needed).

Tested with stabs and gdb 6.6.50 and 6.8.50 -> works. Thanks a lot!
For an automated test you could use gdb scripts?

Martin

Reply by email

Jonas Maebe
to Jonas Maebe: It works with gdb 6.6, but indeed not with 6.8. I'll try to find the cause and file a bug…
Jonas Maebe wrote 19 lines
On 05 Apr 2008, at 10:25, Martin Schreiber wrote: > I tried with gdb 6.8.50: > " > Breakpoint 1, READROOTCOMPONENT (READROOTCOMPONENT=0xb77a5020, > AROOT=0xb77a5020, this=0xb7795020) at ../objpas/classes/reader.inc: > 1260 > 1260 Result.FComponentState := > (gdb) print result.fcomponentstate > $1 = [] > (gdb) next > 1264 i := 0; > (gdb) print result.fcomponentstate > $2 = [] > (gdb) > " > BTW the set display is not always wrong. It works with gdb 6.6, but indeed not with 6.8. I'll try to find the cause and file a bug report with gdb if necessary.

I've implemented a workaround in the compiler and submitted a gdb bug report.

Jonas

Reply by email