This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [RFA 1/2] Fix two regressions in scalar printing
- From: Tom Tromey <tom at tromey dot com>
- To: Pedro Alves <palves at redhat dot com>
- Cc: Tom Tromey <tom at tromey dot com>, gdb-patches at sourceware dot org
- Date: Mon, 14 Aug 2017 09:21:38 -0600
- Subject: Re: [RFA 1/2] Fix two regressions in scalar printing
- Authentication-results: sourceware.org; auth=none
- References: <20170713123400.28917-1-tom@tromey.com> <20170713123400.28917-2-tom@tromey.com> <22c48f9e-ec2c-850d-91d3-c6a3ea8cdb11@redhat.com> <871spjufnv.fsf@pokyo> <e341effa-cdc4-a876-9f19-f2ad4d3fe0ff@redhat.com> <871sow9scp.fsf@tromey.com> <707a03e4-46ef-cea9-f098-cc687b02d31e@redhat.com>
>>>>> "Pedro" == Pedro Alves <palves@redhat.com> writes:
Pedro> Sorry for dropping the ball on this. I wanted to be sure that
Pedro> we have tests for the
Pedro> (gdb) p /u -1
Pedro> $1 = 4294967295
Pedro> (gdb) p /d (unsigned long long) -1
Pedro> $2 = -1
Pedro> etc. issues discussed earlier. Do you know whether there's some tests for
Pedro> that already somewhere, but might have simply been missed before for
Pedro> running both patches together?
Good question. I think what happened is that this change had some
fallout elsewhere, which is why there are also some test changes in the
patch.
However, these are kind of indirect, so I added tests for
"print/d (unsigned char) -1" and "print/u (char) -1".
>> +# Regression test for PR gdb/21675
>> +proc test_radices {} {
>> + gdb_test "print/o 16777211" " = 077777773"
>> + gdb_test "print/d 1.5" " = 1\[^.\]"
>> + gdb_test "print/u 1.5" " = 1\[^.\]"
Pedro> What's the reason for the "\[^.\]" part of the regexes?
Pedro> What's that trying to match? Why not simply " = 1" ?
I was worried that this would erroneously match "1.5" or the like; but I
tried it and I see my fears are unfounded. So, I changed these to " = 1".
Tom