Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add a GDB plugin (written in Python) that registers custom printers for common Arrow C++ types, and makes their values much more readable when printed on the GDB prompt. Currently covered types are: - `string_view`, `optional`, `Variant` - `Status`, `Result` - `Buffer` (and subclasses) - `BasicDecimal{128,256}` (and subclasses) - `DataType` (and subclasses), `Field`, `Schema`, `KeyValueMetadata` - `Scalar` (and subclasses) - `ArrayData`, `Array` (and subclasses) - `ChunkedArray`, `RecordBatch`, `Table`, `Datum` The plugin is tested using a test harness in PyArrow, for convenience. Here is for example `arrow::util::Variant<int, bool, std::string>`: * with the GDB plugin: ```gdb (gdb) p int_variant $1 = arrow::util::Variant of index 0 (actual type int), value 42 ``` * without the GDB plugin: ```gdb (gdb) p int_variant $1 = { <arrow::util::detail::VariantImpl<arrow::util::Variant<int, bool, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, int, bool, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >> = { <arrow::util::detail::VariantImpl<arrow::util::Variant<int, bool, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, bool, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >> = { <arrow::util::detail::VariantImpl<arrow::util::Variant<int, bool, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >> = { <arrow::util::detail::VariantImpl<arrow::util::Variant<int, bool, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > >> = { <arrow::util::detail::VariantStorage<int, bool, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >> = { [ snip more lines of inscrutable implementation details ] ``` Closes #12092 from pitrou/ARROW-12735-gdb Authored-by: Antoine Pitrou <antoine@python.org> Signed-off-by: Antoine Pitrou <antoine@python.org>
- Loading branch information