Limiting the amount of data presented when hovering over a variable or structure lazarus / 12-Debugger ---------------------------------------------------------------------- 440bx · 2019-05-14 01:03 Hello, A rather nice feature of the debugger in Lazarus is its presenting a nicely formatted popup window with the values of the fields (in the case of a structure.) There are some times when that rather nice feature causes a problem.  If one hovers over a pointer to an allocated array that contains tens of thousands of records, the building of that nice popup window can take a very significant amount of time. In cases of arrays, is it possible to tell the debugger to present only the first "n" entries ? Thank you for your help. ---------------------------------------------------------------------- Martin_fr · 2019-05-14 01:42 What kind of structure? Dyn array IIRC show 5 entries, and less for nested. Static array can be set in the Tools > Option > Debugger In the grid is an option MaxDisplayLengthForStaticArray For all others you can limit the max memory that gdb will use. But then big structures will simply give an error, and that applies to watches too. Those feature only exists for pure gdb. For gdb+fpdebug there are no options. ---------------------------------------------------------------------- 440bx · 2019-05-14 02:58 Thank you for your help Martin. Quote from: Martin_fr on May 14, 2019, 03:42:55 amWhat kind of structure? A rather convoluted one.  None are static arrays nor FPC dynamic arrays.  They are all arrays of structures residing in memory blocks obtained using HeapAlloc. Now, I have to apologize for the complexity of what follows, it's just to give an idea of what I am dealing with. Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i const  PARENT_WIDGET_ENTRIES_MAX_COUNT = 65535; const  ORIGIN_FILES_MAX_COUNT          = 256 * 1024;  MATCHING_PARENTS_MAX            = 16;    TPARENT_WIDGET_ENTRY = record    { contains the Parented Widget name, the TPARENTS_FILES_LIST index of     }    { the file name that Parents the Widget and the name of the               }    { related target if the Parented Widget is Related to another Widget      }     efi_WidgetName        : packed array[0..511] of char;    efi_WidgetNameUpper   : packed array[0..511] of char;    efi_ParentFileIndex   : integer;    efi_RelatedTo         : packed array[0..511] of char;    efi_RelatedToUpper    : packed array[0..511] of char;  end;  PPARENT_WIDGET_ENTRY   = ^TPARENT_WIDGET_ENTRY;    { array of pointers to TPARENT_WIDGET_ENTRY                               }   TPARENT_WIDGET_LIST    = record    efl_ParentedWidgetCount : integer;    efl_ParentedWidget      : array[0..PARENT_WIDGET_ENTRIES_MAX_COUNT - 1]                               of TPARENT_WIDGET_ENTRY;  end;  PPARENT_WIDGET_LIST    = ^TPARENT_WIDGET_LIST;    { array of Widgets that Parent Widgets                                    }   TPARENT_FILES_LIST = record    xfl_ParentFilesCount   : integer;    xfl_ParentFiles        : packed array[0..PARENT_FILES_MAX_COUNT  - 1] of                             packed array[0..PARENT_FILE_BUFFER_SIZE - 1] of                           char;  end;  PPARENT_FILES_LIST = ^TPARENT_FILES_LIST;  type  { array of Origin Widgets                                                }   TORIGIN_FILE_ENTRY = record    WidgetsPointer              : pchar;    ReferenceCount              : ptruint;    MatchingParentWidgetIndexes : packed array[0..MATCHING_PARENTS_MAX]                                          of ptruint;  end;   TORIGIN_FILE_LIST  = record    hfl_OriginFileCount  : integer;    hfl_OriginFiles      : packed array[0..ORIGIN_FILES_MAX_COUNT - 1]                                   of TORIGIN_FILE_ENTRY;  end;  PORIGIN_FILE_LIST = ^TORIGIN_FILE_LIST;  { all of these variables point to blocka of memory allocated with HeapAlloc,  }{ the blocks are VERY large, in some cases in the hundreds of megabytes and   }{ may contain anywhere from 15,000 entry minimum to about 180,000 entries max } var  ParentFilesList           : PPARENT_FILES_LIST;  ParentedWidgetsList       : PPARENT_WIDGET_LIST;  OriginWidgetsList       : PORIGIN_FILE_LIST;  OriginNullTerminated      : pchar;  OriginNullTerminatedSize  : ptruint;  when the cursor (accidentally) hovers over either, the ParentFilesList or the parentedwidgetslist, I have to terminate Lazarus because it most likely won't finish in a "reasonable" amount of time (10+ minutes). I try to not place the cursor over those pointers when debugging but, if it goes over one of those, the debugging session is for practical purposes, over. I'd like to tell Lazarus to limit the number of entries displayed for any of those dynamically allocated arrays to 50 entries. Right now, it seems that either Lazarus or GDB (or both) are trying to format about a 100 megs of stuff.  As totally expected, they are not going to get that done in any reasonable amount of time.