How do I see a stringlist element during debugging? lazarus / 12-Debugger ---------------------------------------------------------------------- bobo · 2010-03-10 18:36 When going step by step through a program I would like to see the elements of a TStringList variable but the watch list and mouse over only shows some strange results: MyStringList[3] shows something like this: {   = {     = {       = {         _vptr$ = {           0x0,           0x0}},       },     FSPECIALCHARSINITED = false,     FQUOTECHAR = 0 #0,     FDELIMITER = 0 #0,     FNAMEVALUESEPARATOR = 0 #0,     FUPDATECOUNT = 0,     FADAPTER = {       = {},       },     FLBS = TLBSLF,     FSTRICTDELIMITER = false},   FLIST = $41baad,   FCOUNT = -1559227364,   FCAPACITY = 104,   FONCHANGE = 0,   FONCHANGING = 0,   FDUPLICATES = DUPIGNORE,   FCASESENSITIVE = false,   FSORTED = false} Where can I see the content of the tstringlist? Or the .text property (MyStringList.Text)? ---------------------------------------------------------------------- Martin_fr · 2010-03-10 20:54 There is no easy way. At current the debugger does only debug varieables, fields, and properties mapped directly to a field. But the strings you want a returned by a function (the property reader is a function). http://wik i.lazarus.freepascal.org/Lazarus_Faq#How_Can_I_inspect_properties.3F You can evaluate or watvh the following: MyStringList.FList^ But FList is an array, and depending on the version of GDB, the version of FPC, dwarf or stabs you will see different things when loking at an array. http://wiki.lazarus.freepascal.org/Lazarus_Faq#Why_does_the_debugger_n ot_show_some_Variables.2FStructures_.28.22no_such_symbol.22.2F.22incom plete_type.22.29 http://wiki.lazarus.freepascal.org/GDB_Debugger_Tips You would have to figure out yourself, if any of those tricks helps in your case. In anyway, it's a lot of work to and even if it would work it is hardly usable for everyday debuging. The better option is to go to the project options, unselect the check box that says "Win32 GUI" and start your application with a console. then use debugln (LCLProc) or writeln to output the desired info. ---------------------------------------------------------------------- bobo · 2010-03-10 21:45 Thanks Martin, I'm using the latest SVN for both Lazarus and FPC, and have DGB 7.0.90 on my Windows XP 32bit. For MyStringList.FList^ its says cannot access memory at address ... MyStringList.FList[0]^ seems to work ok, however any other index that 0 does not (ex: with 2 strings in the TStringList the index 1 will not work) so there is still some kind of a problem because this is not a function call or anything, but a direct accessible property. for the 0 index it displays: " record TSTRINGITEM {   FSTRING = $6f3f8 'blah blah my long string is here blah blah...,   FOBJECT = $0} " Which is super, except that it cuts off the string (maybe an artificial 200 length limit?). I guess it is not that easy to get this implemented or it would have been done long ago. Unfortunately, this makes the debugging GUI applications a pain, since using log files are so 80's compared with what we have got used to with Delphi. I wouldn't mind if the functions for properties could be called after a warning or confirmation either.