This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH 1/7] Allow more Python scalar conversions
>>>>> "Simon" == Simon Marchi <simark@simark.ca> writes:
Simon> On 2018-09-15 3:24 a.m., Tom Tromey wrote:
>> +proc test_float_conversion {} {
>> + gdb_test "python print int(gdb.Value(0))" "0"
>> + gdb_test "python print int(gdb.Value(0.0))" "0"
>> + gdb_test "python print long(gdb.Value(0))" "0"
>> + gdb_test "python print long(gdb.Value(0.0))" "0"
>> + gdb_test "python print float(gdb.Value(0.0))" "0\\.0"
>> + gdb_test "python print float(gdb.Value(0))" "0\\.0"
>> +}
Simon> This LGTM, but I just wanted to mention that I would probably have tested
Simon> with another value than 0. For example, test that the truncation (int(2.3)
Simon> which becomes 2) works correctly. Not really a big deal.
I've changed the ones with floating point arguments.
Tom