[fpc-pascal] find the "List index (1) out of bounds" error

Graeme Geldenhuys graemeg.lists at gmail.com
Mon Jan 21 10:03:41 CET 2008


Hi,

Anybody got an idea how I can trace the location of a "List index (1)
out of bounds" error. I can't seem to find where this error occurs. Is
there any extra fpc parameters I can use to give me more information.
I have placed writeln()'s in every damn location I can think of. I've
tried to run it via GDB but the output is simply numbers relating to
the TList class...

I've narrowed it down to one fpGUI component, the TfpgComboBox. It
only occurs if I open/close the combobox dropdown and then exit the
application.  If I don't touch the ComboBox, the program exits fine -
without errors. From the backtrace I gather it's got todo with the
internal TStringList used inside the TfpgComboBox.

This is the actual error message I get when I quit my application.

-----------------[ cut ]----------------
  << TMainForm.MsgClose
  >> TfpgComboBox.Destroy
    **** Freeing off the ComboBox items
  << TfpgComboBox.Destroy
An unhandled exception occurred at $08077EBF :
EListError : List index (1) out of bounds
  $08077EBF
-----------------[ end ]---------------


Here is the backtrace information:

Breakpoint 1, 0x08055fe6 in fpc_raiseexception ()
(gdb) bt
#0  0x08055fe6 in fpc_raiseexception ()
#1  0x08078288 in CLASSES_TFPLIST_$__ERROR$ANSISTRING$LONGINT ()
#2  0x08077ebf in CLASSES_TFPLIST_$__RAISEINDEXERROR$LONGINT ()
#3  0x08077ee2 in CLASSES_TFPLIST_$__GET$LONGINT$$POINTER ()
#4  0xb7c010e0 in ?? ()
#5  0xb7c011a0 in ?? ()
#6  0x08078a6a in CLASSES_TLIST_$__DELETE$LONGINT ()
#7  0xb7f5da60 in ?? ()
#8  0xb7c011a0 in ?? ()
#9  0x00000000 in ?? ()
(gdb)


Regards,
  - Graeme -


_______________________________________________
fpGUI - a cross-platform Free Pascal GUI toolkit
http://opensoft.homeip.net/fpgui/



More information about the fpc-pascal mailing list