[libcxx-commits] [libcxx] r373570 - Fix libc++ pretty printer test for Python 3 after D67238 (take 2)

Fāng-ruì Sòng via libcxx-commits libcxx-commits at lists.llvm.org
Thu Oct 3 22:56:59 PDT 2019


If Python 3 still doesn't work or it breaks for some platforms using gdb
linked against libpython2*, I think we probably should just disable or
delete test/pretty_printers/gdb_pretty_printer_test.py and wait for
Sterling to fix it. This will be less disruptive than reverting
D65238/r371131.

On Fri, Oct 4, 2019 at 1:53 PM Fāng-ruì Sòng <maskray at google.com> wrote:

> r373452 was an attempt to fix gdb linked against libpython3*.so. The
> Python 3 pretty printer never worked.
>
> Can you try r373691?
>
> On Fri, Oct 4, 2019 at 11:58 AM David Zarzycki <dave at znu.io> wrote:
>
>> This still isn’t working on Fedora 31 (x86_64):
>>
>> https://gist.github.com/davezarzycki/1e2d91792df37c0c0295fda3414519fa
>>
>> Everything was fine before r373452. Can we please revert r373452?
>>
>> On Oct 3, 2019, at 11:02 AM, David Zarzycki via libcxx-commits <
>> libcxx-commits at lists.llvm.org> wrote:
>>
>> Still doesn’t work. Maybe we should revert r373452
>>
>> On Oct 3, 2019, at 9:19 AM, Fangrui Song via libcxx-commits <
>> libcxx-commits at lists.llvm.org> wrote:
>>
>> Author: maskray
>> Date: Wed Oct  2 23:19:50 2019
>> New Revision: 373570
>>
>> URL: http://llvm.org/viewvc/llvm-project?rev=373570&view=rev
>> Log:
>> Fix libc++ pretty printer test for Python 3 after D67238 (take 2)
>>
>> In both Python 2 and Python 3, gdb.Value.string returns a 'str'. We just
>> need to delete a `encode("utf-8")` which would return a 'bytes' in
>> Python 3.
>>
>> Modified:
>>   libcxx/trunk/test/pretty_printers/gdb_pretty_printer_test.py
>>
>> Modified: libcxx/trunk/test/pretty_printers/gdb_pretty_printer_test.py
>> URL:
>> http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/pretty_printers/gdb_pretty_printer_test.py?rev=373570&r1=373569&r2=373570&view=diff
>>
>> ==============================================================================
>> --- libcxx/trunk/test/pretty_printers/gdb_pretty_printer_test.py
>> (original)
>> +++ libcxx/trunk/test/pretty_printers/gdb_pretty_printer_test.py Wed Oct
>>  2 23:19:50 2019
>> @@ -46,12 +46,10 @@ class CheckResult(gdb.Command):
>>            gdb.newest_frame().select()
>>
>>            expectation_val = compare_frame.read_var("expectation")
>> +            check_literal = expectation_val.string(encoding="utf-8")
>>            if "PrettyPrintToRegex" in compare_frame.name():
>> -                check_literal = expectation_val.string()
>>                test_fails = not re.match(check_literal, value)
>>            else:
>> -                check_literal_string =
>> expectation_val.string(encoding="utf-8")
>> -                check_literal = str(check_literal_string.encode("utf-8"))
>>                test_fails = value != check_literal
>>
>>            if test_fails:
>>
>>
>> _______________________________________________
>> libcxx-commits mailing list
>> libcxx-commits at lists.llvm.org
>> https://lists.llvm.org/cgi-bin/mailman/listinfo/libcxx-commits
>>
>>
>> _______________________________________________
>> libcxx-commits mailing list
>> libcxx-commits at lists.llvm.org
>> https://lists.llvm.org/cgi-bin/mailman/listinfo/libcxx-commits
>>
>>
>>
>
> --
> 宋方睿
>


-- 
宋方睿
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/libcxx-commits/attachments/20191004/194ad021/attachment.html>


More information about the libcxx-commits mailing list