On Sun, 2011-10-02 at 14:29 +0100, Martin wrote: > On 02/10/2011 14:05, Joost van der Sluis wrote: > > On Sat, 2011-10-01 at 09:08 +0200, Joost van der Sluis wrote: > >> On Sat, 2011-10-01 at 01:05 +0100, Martin wrote: > >>> Ok, seems to have big issues with strings in fields. > >> Ow, man.. That's probably difficult again. While evaluating values, it > >> does not 'recurse' into the structure, but uses all kinds of > >> work-arounds. (For example: an array of strings wasn't working either) > > It was easier then I thought. The recursive calls were ok, but you did a > > 'ptype class.stringprop'. But when evaluating the type, there was > > object-address set (which is logical) > > > > New version: > > http://www.lazarussupport.com/gdb_lazarssupport_20111002.zip > > Thanks, I will test.
(To test the function-calls you have to do 'set cp-abi gnu-v3' I forgot to set that as the default. Will place a new version which does that later) > > There are more things that we need to discuss, though. > > > > For example, when I want to evaluate 'object.stringprop', Lazarus issues > > a '-data-evaluate-expression object.stringprop^', which obviously won't > > work with that '^' in the end. > > Afaik it should fallback to omit it. > > Anyway, those "gdb workarounds" that Lazarus does, will be updated, as > soon as the major gdb crashes are gone. btw: I could not reproduce the external-linker and stabs crashes. Can you give me some more info? > IIRC, Lazarus uses the ptype result, to detect if the > variable/expression, is of an "internal pointer" type (object, > dyn-array, string). If so, it will attempt the "^" postfix. > > This is important for: > - objects, without the "^" gdb only reports the address, but with it, > all the values of all the fields are listed. (afaik this still aplies > iin dwarf 3) Yes, when I changed that people started to complain. I don't know anymore what the exact reason for those complaints was. Maybe because a object really is a pointer, or that with this change it got impossible to obtain the address. > And (also afaik) this behaviour is important, as it allows for > expressions like "Obj1=Obj2" to work the way it is pascal-expectation. Maybe that this was the reason... > Such expression are used in breakpoint-conditions. > - dyn array: to be tested under dwarf 3, probably no longer needing the > "^". with dwarf2 dyn array do need the "^" > - strings: little tested, they are treated as dyn array of chars. > > Obviously, with dwarf3 strings may be improved, and the IDE will get > better detection. > > In dwarf2/stabs they are reported as "^(array of char)" which could also > be dyn-array. > It is possible to get the type-name, but: > - the user may have aliased it: "type MyAnsi = type Ansistring;" > - the user may have a local type "type Ansistring = array of char;" > (0-based) We should find a way to detect if -gw3 is used. Then you don't need those adaptations for strings anymore. Just do 'p variable', it will always give the right result. Joost. -- My Lazarus blog: http://www.lazarussupport.com/lazarus/weblog _______________________________________________ fpc-devel maillist - fpc-devel@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-devel