[RFA] Add la_getstr member to language_defn

Thiago Jung Bauermann bauerman@br.ibm.com
Thu Feb 5 16:33:00 GMT 2009


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



More information about the Gdb-patches mailing list