Forum > Debugger

Pointer range in watches

(1/2) > >>

440bx:
Hello,

I'm unclear as to what the behavior should be when setting the bounds between the "+" and "-" in the watch properties.

Please refer to the screenshot. 

I started watching the first 21st elements of an array by setting the "Expression" to:
--- 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";}};} ---ProgramData.PD_PE_DATA.PED_RUNTIME_FUNCTIONS.RT_FUNCTIONS_TABLE[0..20] then I wanted to see more elements and simply changed the upper bound to "30" in the properties window but, that seems to be ignored.

My question is: should the new value be ignored because it is outside the bounds of the original boundaries or should the new value in the properties window have replaced the upper bound in the expression ?

It would be nice if it automatically replaced the upper bound in the expression. That would save having to set it manually.

PS: Lazarus v3.99 (trunk) downloaded today (5/27/2024)

Martin_fr:
It seems it isn't currently documented... https://wiki.lazarus.freepascal.org/IDE_Window:_Watch_list#Viewing/Expanding_Arrays

The embedded toolbar by default works inside the range of the returned watch (in your case 0..20).

That is, so that the last page ends at the end of the array. If your 21 entries were paginated on pages with 10 elements, then the last page would only show 1 element. Sparing you the random data after your array. (for the toolbar, this is not distinguishable from a real array, and even if it was it would not know if you had chosen the maximum value for the index)

However, if the start point is forcefully set outside the bounds, then it will give up enforcing those bounds.
So in your case, if you set the start or -1 or 21 then the paging will show more values.
The arrows will not set those values. You have to type them directly into the edit fields.

Since the default for pagination size can be bigger than the array (e.g. an array with 5 elements, but pagination starts at 10 per page), the page size is not used to determine if bounds should be ignored.

440bx:
Now I understand.  In one case, it's boundary control in the other it's pagination, which is a different thing.

Thank you Martin. :)

Martin_fr:
The pagination now has an explicit setting for enforcing the bounds.

You should now be able to uncheck it, and enter any bounds you want.

440bx:
Great!  Thank you Martin.

Navigation

[0] Message Index

[#] Next page

Go to full version