amoeba commented on issue #46343:
URL: https://github.com/apache/arrow/issues/46343#issuecomment-2864302717

   It looks like the failing job is using gdb 16.3. In the 16.3 NEWS file, I 
see [only one 
change](https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;a=blob_plain;f=gdb/NEWS;hb=gdb-16.3-release)
 that looks related,
   
   > * GDB now has support for multi-byte and wide character sets on the 
target.  Strings whose character type is wchar_t, char16_t, or char32_t are now 
correctly printed.  GDB supports wide- and unicode- literals in C, that is, 
L'x', L"string", u'x', u"string", U'x', and U"string" syntax.  And, GDB allows 
the "%ls" and "%lc" formats in `printf'.  This feature requires iconv to work 
properly; if your system does not have a working iconv, GDB can use GNU 
libiconv.  See the installation instructions for more information.
   
   From @bkietz's 
[comment](https://github.com/apache/arrow/pull/46180#issuecomment-2863366684) 
in #46180, is what this patch does technically more correct and worth testing?
   
   ```patch
   diff --git i/python/pyarrow/src/arrow/python/gdb.cc 
w/python/pyarrow/src/arrow/python/gdb.cc
   index 7c58bae334..9251dedfdd 100644
   --- i/python/pyarrow/src/arrow/python/gdb.cc
   +++ w/python/pyarrow/src/arrow/python/gdb.cc
   @@ -307,12 +307,12 @@ void TestSession() {
      StringScalar string_scalar_null{};
      StringScalar string_scalar_unallocated{std::shared_ptr<Buffer>{nullptr}};
      StringScalar string_scalar_empty{Buffer::FromString("")};
   -  StringScalar string_scalar_hehe{Buffer::FromString("héhé")};
   +  StringScalar string_scalar_hehe{Buffer::FromString(u8"héhé")};
      StringScalar string_scalar_invalid_chars{
          Buffer::FromString(std::string("abc") + '\x00' + "def\xffghi")};
   
      LargeBinaryScalar large_binary_scalar_abc{Buffer::FromString("abc")};
   -  LargeStringScalar large_string_scalar_hehe{Buffer::FromString("héhé")};
   +  LargeStringScalar large_string_scalar_hehe{Buffer::FromString(u8"héhé")};
   
      FixedSizeBinaryScalar fixed_size_binary_scalar{Buffer::FromString("abc"),
                                                     fixed_size_binary(3)};
   @@ -458,7 +458,7 @@ void TestSession() {
      const char* json_binary_array = "[null, \"abcd\", 
\"\\u0000\\u001f\xff\"]";
      auto heap_binary_array = SliceArrayFromJSON(binary(), json_binary_array);
      auto heap_large_binary_array = SliceArrayFromJSON(large_binary(), 
json_binary_array);
   -  const char* json_string_array = "[null, \"héhé\", \"invalid \xff char\"]";
   +  const char* json_string_array = u8"[null, \"héhé\", \"invalid \xff 
char\"]";
      auto heap_string_array = SliceArrayFromJSON(utf8(), json_string_array);
      auto heap_large_string_array = SliceArrayFromJSON(large_utf8(), 
json_string_array);
      auto heap_binary_array_sliced = heap_binary_array->Slice(1, 1);
   ```
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to