[Lazarus] Improve message dialog

Martin lazarus at mfriebe.de
Fri May 18 13:57:07 CEST 2012

On 18/05/2012 12:18, Benito van der Zander wrote:
> Hi,
> the watch dialog is already much better than it used to be (remember 
> the time, it just dumped the entire gdb output in a single line...)
> so I think there are two other features that are really important for it:
> * complete support for dynamical arrays (still shows the wrong length 
> / not all elements,  or "No symbol \"length\" in current context." )

Do you have an example where it shows the wrong length?
http://imagebin.org/212839  First thing in the watch is the len (and yes 
it is a dyn array)

"length" is a function. And function evaluation does not yet work (would 
be nice to have, but different topic).
Simulating "length" imho is no good. Because if there is a local 
function of the same name, the simulation still had the default 
behaviour, and the result would be wrong.
Simulating is also not needed, since len is shown.

About showing the content of dyn arrays. Currently the first 5 entries 
are shown.

One of the issues here is that the IDE must ask gdb for each entry. This 
can be a very time consuming process. And since a dynamic array can have 
thousands of entries, some limit need to apply. ( *** One day this 
should be made configurable. *** )

If you do want to change your own limit:
debugger\gdbtypeinfo.pp  line 2025
   FArrayIndexValueLimit := 5;

For multi dimensional arrays, the nested level have the limit lowered by 
3 for each level...

> * direct memory inspection:
>    So you can print all bytes from address $123 to $456, or all TRects 
> from @foo[0] to @foo[high(foo)]...
>    Then, if gdb fails to understand again some types, you can still 
> watch the variables.

You can change the watch type to memory.
Of course it would be nice to have a better viewer, but with the new 
"detail pane" (from the patch), it is usable.

More information about the Lazarus mailing list