This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH, doc RFA] Fix lazy string type docs
On Thu, Nov 03, 2016 at 12:03:46PM -0700, Doug Evans wrote:
> To fix this bug we're going to have to break one or the other, or add
> a knob (bleah) to control the old, broken, behaviour.
Adding a knob to enable the old behaviour does not really help
frontends, as with the same effort a frontend adds a "set knob
enabled" command it could just adapt to the new behaviour.
> Or mark the "type" LazyString attribute as broken/deprecated and
> provide a new attribute with correct behaviour. [...]
> Opinions?
To be honest, I don't really have an opinion on which is better or even
correct, as it is still rather unclear to me in which situation a
frontend would benefit from using gdb.LazyString at all. To me, the need
to specify an encoding or rely on GDB to select something appropriate
seems to be a disadvantage over keeping a (address, length) pair and
using gdb.Inferior.read_memory() when needed, especially when the
contents of that memory can be corrupted and not necessarily contain
data of an intended encoding anymore.
André
PS:
> [...] will select the most appropriate
> encoding when the sting is printed [...]
s/sting/string/ ? (also copied to guile/scm-lazy-string.c)