#llvmweekly #rant
https://discourse.llvm.org/t/a-bytecode-for-lldb-data-formatters/82696
TL;DR - хочется уметь красиво выводить в отладчике не встроенные типы, для этого предлагается завести секцию, в котороую писать bytecode, который умеет выводить на эран те или иные типы в программе.
Почему не положить туда готовые python форматтеры, которые уже есть, и написаны?
"The logical next step would be to store full Python formatters instead of summary strings, but Python code is larger and more importantly it is potentially dangerous to just load an execute untrusted Python code in LLDB.
To address these problems, I’m proposing a minimal bytecode tailored to running LLDB formatters. It defines a human-readable assembler representation for the language, an efficient binary encoding, a virtual machine for evaluating it, and format for embedding formatters into binary containers"
Объяснение не стоит и выеденного яйца, потому что ТЫ УЖЕ ЗАПУСТИЛ этот бинарь, запусти и Python, в песочнице.
https://discourse.llvm.org/t/a-bytecode-for-lldb-data-formatters/82696/10
Или возьми готовый VM, в который llvm уже умеет (hint - #WebAssembly, #bpf, #ebpf https://discourse.llvm.org/t/a-bytecode-for-lldb-data-formatters/82696/12).
Но нет, это было бы слишком просто, на таком фиолетовое не получить.
Вообще, удивительно, в маленький #harfbuzz тащат большой #WebAssembly (https://t.iss.one/itpgchannel/1201), а в большой LLDB (который уже умеет в #WebAssembly) тащат самопальный байткод...
Где логика-то?
https://discourse.llvm.org/t/a-bytecode-for-lldb-data-formatters/82696
TL;DR - хочется уметь красиво выводить в отладчике не встроенные типы, для этого предлагается завести секцию, в котороую писать bytecode, который умеет выводить на эран те или иные типы в программе.
Почему не положить туда готовые python форматтеры, которые уже есть, и написаны?
"The logical next step would be to store full Python formatters instead of summary strings, but Python code is larger and more importantly it is potentially dangerous to just load an execute untrusted Python code in LLDB.
To address these problems, I’m proposing a minimal bytecode tailored to running LLDB formatters. It defines a human-readable assembler representation for the language, an efficient binary encoding, a virtual machine for evaluating it, and format for embedding formatters into binary containers"
Объяснение не стоит и выеденного яйца, потому что ТЫ УЖЕ ЗАПУСТИЛ этот бинарь, запусти и Python, в песочнице.
https://discourse.llvm.org/t/a-bytecode-for-lldb-data-formatters/82696/10
Или возьми готовый VM, в который llvm уже умеет (hint - #WebAssembly, #bpf, #ebpf https://discourse.llvm.org/t/a-bytecode-for-lldb-data-formatters/82696/12).
Но нет, это было бы слишком просто, на таком фиолетовое не получить.
Вообще, удивительно, в маленький #harfbuzz тащат большой #WebAssembly (https://t.iss.one/itpgchannel/1201), а в большой LLDB (который уже умеет в #WebAssembly) тащат самопальный байткод...
Где логика-то?
LLVM Discussion Forums
A bytecode for (LLDB) data formatters
LLDB provides very rich customization options to display data types (see Variable Formatting - 🐛 LLDB ). To use custom data formatters, developers typically need to edit the global ~/.lldbinit file to make sure they are found and loaded. An example for this…
👍10🐳5🔥3😁2