This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [RFA] Add la_getstr member to language_defn
- From: Tom Tromey <tromey at redhat dot com>
- To: Thiago Jung Bauermann <bauerman at br dot ibm dot com>
- Cc: Daniel Jacobowitz <drow at false dot org>, gdb-patches ml <gdb-patches at sourceware dot org>
- Date: Tue, 03 Feb 2009 10:44:04 -0700
- Subject: Re: [RFA] Add la_getstr member to language_defn
- References: <1227417278.28256.183.camel@localhost.localdomain> <20081123161013.GA15069@caradoc.them.org> <1227490821.8533.25.camel@hotblack.bauerhaus> <20081124022858.GA19331@caradoc.them.org> <1227551659.28256.225.camel@localhost.localdomain> <20081124202146.GA1991@caradoc.them.org> <1227564549.28256.248.camel@localhost.localdomain> <1230949603.8380.143.camel@localhost.localdomain> <m3d4e0ptoq.fsf@fleche.redhat.com> <1233665501.14735.7.camel@localhost.localdomain>
- Reply-to: Tom Tromey <tromey at redhat dot com>
>>>>> "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.
Tom