[PATCH 1/7] Allow more Python scalar conversions

Tom Tromey tom@tromey.com
Mon Sep 24 04:58:00 GMT 2018


>>>>> "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



More information about the Gdb-patches mailing list