[Lazarus] GDB - cannot perform pointer math on incomplete types
Martin
lazarus at mfriebe.de
Tue Dec 4 04:20:16 CET 2012
On 04/12/2012 03:11, David Emerson wrote:
> Martin wrote:
>> Still if you can get me the log + unit source ?
>>
>> because the IDE in many cases tries to work those out. So I wonder what
>> happens behind the curtains...
> Hmm I am working on it ... can't really share the sources :( but I am
> trying to build a miniature version to reproduce it. In the meantime:
>
> The watch item I created looks like this:
> tsrl_ag_cp(f_ag).f_curve.f_cps.f_list[0]
> and after your suggestion, was fixed like this:
> ^pointer(tsrl_ag_cp(f_ag).f_curve.f_cps.f_list)[0]
>
> SELF is a class with field f_ag : tsrl_ag
> tsrl_ag_cp descends from tsrl_ag
> tsrl_ag_cp has field f_curve : tsrl_curve
> tsrl_curve has field f_cps : tsrl_ag_cp_list
> tsrl_ag_cp_list descends from t_ordered_ag_list
> t_ordered_ag_list = specialize gt_unsorted_pointer_list <tsrl_ag>
> generic gt_unsorted_pointer_list <_class> = class
> (t_unsorted_pointer_list)
> t_unsorted_pointer_list is a class with field f_list : ptr_array
> and type ptr_array = array of pointer
>
> So as you can see it is a little complicated :-)
Ok there are 2 possible bits in there.
1) maybe fpc does some odd debug info with generics. Never tested. Unknown
2) The type cast to the class. GDB can get the hick ups, because classes
are pointers, and gdb half-knows it....
try
^tsrl_ag_cp(f_ag).f_curve.f_cps.f_list[0]
More information about the Lazarus
mailing list