Forum > Debugger

Freezing debugger when stepping because of a large object

<< < (2/3) > >>

Martin_fr:
Displaying a warning helps only in the sense that people know they still need to wait for an unknown amount of time.
Since the command is already running in gdb, afaik there is no way to stop it, so gdb is still blocked until it finishes.

Did you try any of my above suggestions? Trying to limit the amount of work done by gdb?

JernejL:
yeah, it helped to set the limit, but since the gui freezing is pretty serious, a warning would explain people what the issue is and how to resolve it.

Just a check if it took a lot of time and a lot of data was transferred over from gdb, then show a warning about what is the cause.

Martin_fr:
You used
  GdbValueMemLimit
or
  --eval-command="set print elements 10"
?

If this helps, then maybe it should be set by default to a lower value, so the problem doesnt happen at first. (Ideally, but I am not sure if that is easy to do, if the limit is hit, it should show a message...)

I will need to do some testing of my own, to see what is possible.
Also maybe set a lower value for getting the stack. Then explicit watches will still work (even if slow / or at a medium value)

JernejL:
I used "set print elements"
 
Here is example of what causes massive slowdowns:
 

--- Code: Pascal  [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} --- const    mapheight = 7;        mapsize = 255; type TTerrainType = word;     Tblock = packed record        Terrain: TTerrainType;        case boolean of            True:                (Sides: array[0..4] of TBlockFace);                        False:                (West, East, North, South, Lid: TBlockFace);    end;         TCityMapGrid = array[0..mapheight, 0..mapsize, 0..mapsize] of Tblock;         TTopDownCityCubeMap = object        public                citymap:                                TCityMapGrid;     // the map (z, y, x)        end;  
Create an instance of TTopDownCityCubeMap in a unit global variable, then pass it as a parameter to one function, and have it breakpoint in that function, it will lockup for up to half a minute before debugger becomes responsive.
 

Martin_fr:
I implemented a limit in rev 58212.

The limit applies to
- stack window
- thread window (though this did not show large data anyway
- locals window

The watches windows is not protected (well partly). You add your structure there, you have to wait. (But then the lesson should be learned and you do not add it again).

=============
The problem with the max array len is that gdb applies it for each recursion level.
On a flat array, a limit of 10 (locals window) is to low. So the default limit is 25, but in your case that is 25*25*25 which already takes 2 or 3 seconds for gdb.

So for stack/local there is also a separate memory limit (for each object). This is set to ~30k. In your case it leads to the object not show, but instead an error.

You can adjust both values in the options dialog:
    MaxLocalsLengthForStaticArray
    LocalsValueMemLimit

The limits can also be set for watches, but with diff values
    MaxDisplayLengthForStaticArray
    GdbValueMemLimit




Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version