[RFC 2/6] Avoid missing char before incomplete sequence in wchar_iterate.

Pierre Muller pierre.muller@ics-cnrs.unistra.fr
Fri Nov 8 11:21:00 GMT 2013


Hi Tom,

> -----Message d'origine-----
> De : gdb-patches-owner@sourceware.org [mailto:gdb-patches-
> owner@sourceware.org] De la part de Tom Tromey
> Envoyé : mercredi 6 novembre 2013 22:35
> À : Pierre Muller
> Cc : 'Keith Seitz'; 'gdb-patches'
> Objet : Re: [RFC 2/6] Avoid missing char before incomplete sequence in
> wchar_iterate.
> 
> >>>>> "Pierre" == Pierre Muller <pierre.muller@ics-cnrs.unistra.fr>
> writes:
> 
> Pierre> 2013-10-01  Pierre Muller  <muller@sourceware.org>
> Pierre> 	charset.c (wchar_iterate): Also handle converted characters
> Pierre>  	when EINVAL is returned by iconv call.
> Pierre> 2013-10-01  Pierre Muller  <muller@sourceware.org>
> Pierre> 	* gdb.base/printcmds.c: Add strings with incomplete
> sequence.
> Pierre> 	* gdb.base/printcmds.exp (test_repeat_bytes): Check output
> of
> Pierre> 	strings containing incomplete sequence.
> 
> This looks good to me, but Keith had reported some additional
> regressions from this patch in gdb.python.
> Do you see those?

  I had big troubles getting a gdb with mingw32 python library
included (still had to tweak the configure script to
convert Windows style paths to cygwin style..)

  Anyhow, I did see indeed two failures that seem
to be related to that change: 
"print estring" and "print estring2"
The second is easily fixed by adding the 'x' char as Keith suggested,
but the first is also a problem of different starting charset
for mingw versus linux.
  The solution for that one probably is as Keith suggested to 
force the value of the charset by setting the encoding explicitly before.

  Moving the line
     gdb_test_no_output "python pp_ls_encoding = 'UTF-8'"
  before "print estring" test seems to remove the failure,
but shouldn't these be invalid sequences for UFT-8?


Pierre



diff --git a/gdb/testsuite/gdb.python/py-prettyprint.exp
b/gdb/testsuite/gdb.python/py-prettyprint.exp
index adbe88d..76e7ad2 100644
--- a/gdb/testsuite/gdb.python/py-prettyprint.exp
+++ b/gdb/testsuite/gdb.python/py-prettyprint.exp
@@ -91,7 +91,7 @@ proc run_lang_tests {exefile lang} {
     gdb_test "print estring" " = \"embedded
x\\\\201\\\\202\\\\203\\\\204\""

     gdb_test_no_output "python pp_ls_encoding = 'UTF-8'"
-    gdb_test "print estring2" "\"embedded \", <incomplete sequence
\\\\302>"
+    gdb_test "print estring2" "\"embedded x\", <incomplete sequence
\\\\302>"

     gdb_test_no_output "set python print-stack full"
     gdb_test "print hint_error" "Exception: hint failed\r\nhint_error_val"



More information about the Gdb-patches mailing list