[RFA] Add la_getstr member to language_defn
Thiago Jung Bauermann
bauerman@br.ibm.com
Wed Feb 4 12:37:00 GMT 2009
El mar, 03-02-2009 a las 10:44 -0700, Tom Tromey escribió:
> >>>>> "Thiago" == Thiago Jung Bauermann <bauerman@br.ibm.com> writes:
>
> Tom> When would we want the latter behavior? I think perhaps la_getstr
> Tom> should simply have 'void' type and then call error if read_string
> Tom> returns an error.
>
> [...]
>
> Thiago> I don't have a strong preference. The function could always throw an
> Thiago> exception on error, and the caller would then check LENGTH to see if
> Thiago> something was read. I can change it to do so if you prefer it that way.
>
> When would a caller want to use a partial result? If there is a case
> where we'd want that, then the current approach used in the patch
> seems ok. However, if there is no case where we'd want to do that,
> then this approach is more complex without a benefit.
>
> The reason I ask is that I noticed that the only caller of this
> function -- the new Value.string method -- discards a partial result.
You're worried about complexity in the code for c_get_string, or its
callers? The former is not a problem because we get this behaviour for
free from read_string, which is also called by val_print_string. This
function uses a partial result.
--
[]'s
Thiago Jung Bauermann
IBM Linux Technology Center
More information about the Gdb-patches
mailing list