[PATCH] Expand LEN parameter of value_*string functions

Siddhesh Poyarekar siddhesh@redhat.com
Tue Sep 25 15:54:00 GMT 2012


Hi,

The value_string and value_cstring functions take string lengths as
parameters and that ought to be at least ssize_t.  Attached patch makes
this change and also adjusts the parameters of functions it calls, i.e.
lookup_array_range_type and lookup_string_range_type.  The bounds
parameters of these functions are expanded to LONGEST instead of just
ssize_t to match them with the type of low and high in
type.main_type.fields[i].flds_bnds.bounds.  This fix is separated from
the earlier bitpos patch[1].

I have verified that this does not cause any regressions on x86_64.  OK
to commit?

Regards,
Siddhesh

[1] http://sourceware.org/ml/gdb-patches/2012-08/msg00144.html

gdb/ChangeLog:

	* gdbtypes.c (lookup_array_range_type): Expand parameters
	LOW_BOUND and HIGH_BOUND to LONGEST.
	(lookup_string_range_type): Likewise.
	* gdbtypes.h (lookup_array_range_type): Likewise.
	(lookup_string_range_type): Likewise.
	* valops.c (value_cstring): Expand parameter LEN to ssize_t.
	Expand HIGHBOUND to ssize_t.
	(value_string): Likewise.
	* value.h (value_cstring): Expand parameter LEN to ssize_t.
	(value_string): Likewise.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: bounds.patch
Type: text/x-patch
Size: 3623 bytes
Desc: not available
URL: <http://sourceware.org/pipermail/gdb-patches/attachments/20120925/c93d6f37/attachment.bin>


More information about the Gdb-patches mailing list