RE: [RFA] Add la_getstr member to language_defn

Thiago Jung Bauermann
2009-02-05T16:33:22Z

El jue, 05-02-2009 a las 17:06 +0100, Pierre Muller escribiÃ³:
> > Thiago> + Assumes strings are terminated by a null character.
> > [...]
> > Thiago> +void
> > Thiago> +c_get_string (struct value *value, gdb_byte **buffer, int
> > *length,
> > Thiago> + const char **charset)
> >
> > My understanding is that the contract for la_getstr says that the
> > resulting string will be zero-terminated. But if that is the case...
>
> But this would also mean that the string could not contain
> zero in the middle, which sometimes happens for pascal strings...
>
> Isn't the length argument there for this?

Right. The contract (the comment above la_get_string in language_defn,
assuming it is legally binding :-) ) doesn't say that the string should
be null-terminated. And the length argument doesn't count the ending
null character, should it be present.
--
[]'s
Thiago Jung Bauermann
IBM Linux Technology Center