#68provide LLDB pretty print functions for easier debugging

  • avatar~clovercommented · 2 years ago
    Author
    Owner

    This is a sort of halfway solution for #61. To be clear that issue should still be done, it's a very clear goal that will motivate getting the language somewhere usable, while providing direct utility to the project itself.

    In the meantime, look at this (was shown to me by user ippsav on twitter)

    https://github.com/ziglang/zig/blob/master/tools/lldb_pretty_printers.py

    It looks amazing. this is how you make sense of packed structs. LLDB is extensible via Python.

    Packed structs in the compiler:

    • [ ] Air.Inst.Ref
    • [ ] @TypeOf(@as(NodeGen.MapEntry, undefined).block)
    • [ ] Js.Tree.ObjectLiteral.Key
    • [ ] Js.Tree.StmtIf.Key
    • [ ] InternPool.Capture (unused)

    In addition, the enum(u32) pattern to represent type-safe indexes is used all over the place.

    • [ ] InternPool.Value
    • [ ] InternPool.Type
    • [ ] NullTerminatedString (few instances of these)
    • [ ] Teg.Inst.Index
    • [ ] Air.Inst.Index
    • [ ] Tree.Node.Index
    • [ ] InternPool.DeclIndex
    • [ ] InternPool.NamespaceIndex
    • [ ] InternPool.String

    And some others on my mind

    • [ ] InternPool.String.WithLen
    • [ ] <all of the Extra.Store stuff>

    This would also be a good time to make Ast use the Store struct and typed indices.


    Milestone: later.

  • avatar~clover changed the status to Todo · 2 years ago