This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH] Fix test always passing in python/py-linetable.exp
- From: Joel Brobecker <brobecker at adacore dot com>
- To: Sergio Durigan Junior <sergiodj at redhat dot com>
- Cc: Simon Marchi <simon dot marchi at ericsson dot com>, gdb-patches at sourceware dot org, Phil Muldoon <pmuldoon at redhat dot com>
- Date: Thu, 27 Nov 2014 12:28:56 +0400
- Subject: Re: [PATCH] Fix test always passing in python/py-linetable.exp
- Authentication-results: sourceware.org; auth=none
- References: <1417026912-883-1-git-send-email-simon dot marchi at ericsson dot com> <878uixbrfg dot fsf at redhat dot com>
> This fix makes sense to me. Escaping brackets are always a source of
> confusion in TCL. Thanks for doing that.
>
> > Moreover, both in Python 2.7 and Python 3.3 the numbers don't have the L
> > suffix, so now the test fails because of that. Anybody knows why they
> > were there in the first place? I just tested with Python 2.4 and there
> > are no Ls.
>
> Yeah, I don't know. My wild guess it that it was a thinko because of
> the test just above it:
>
> gdb_test "python list_lines()" \
> "L20 A $hex.*L21 A $hex.*L22 A $hex.*L24 A $hex.*L25 A $hex.*L40 A $hex.*L42 A $hex.*L44 A $hex.*L42 A $hex.*L46 A $hex.*" \
> "test linetable iterator addr"
>
> Phil?
>
> > gdb/testsuite/ChangeLog:
> >
> > * gdb.python/py-linetable.exp: Properly escape sorted(fset)
> > test expected output. Add parentheses for the call to print.
> > Remove L suffix from integers.
>
> Two spaces after periods.
Thanks, Sergio, for your review.
I agree that the escaping is OK.
Regarding the issue of the extra 'L' at the end, I think I understand
what happened: The initial patch was using PyLong_FromUnsignedLongLong
to create the line number which, as it name indicates, returns a
Python Long, hence the 'L'. but then, probably prompted by review,
Phil changed it to use gdb_py_object_from_longest which only uses
a long if the value does not fit in an 'int'. But because of the missing
escaping, the change in output was never noticed, and so the test
never got adjusted.
The patch is approved after applying Sergio's comments.
Thanks!
--
Joel