halide / Halide

a language for fast, portable data-parallel computation
https://halide-lang.org
Other
5.91k stars 1.07k forks source link

Add LLDB pretty-printing #8460

Open alexreinking opened 2 weeks ago

alexreinking commented 2 weeks ago

Pulling out changes from my rfactor work...

This PR adds some features for visualizing Halide's types in LLDB, which my IDE (CLion) uses. The IR printer supports a "summary" mode that replaces certain subexpressions / blocks with ellipses. This has greatly improved my debugging experience. I encourage others to add to this and tweak it.

steven-johnson commented 2 weeks ago

Any idea how this works with "naked" LLDB? If so, adding a comment would be nice.

alexreinking commented 2 weeks ago

This just installs pretty printers. So after loading the script via command script import ./tools/lldbhalide.py, it should just start using the IRPrinter functions to render Exprs and Stmts

zvookin commented 2 weeks ago

Can you add some documentation mention so folks know it exists? Perhaps in the README or maybe an added page in the Doxygen? I guess it's Halide internal devr only, but having a couple lines on it in docs means it will get used. Probably also worth writing down the command line flags to use it with straight command line lldb.

alexreinking commented 2 weeks ago

Can you add some documentation mention so folks know it exists? Perhaps in the README or maybe an added page in the Doxygen? I guess it's Halide internal devr only, but having a couple lines on it in docs means it will get used. Probably also worth writing down the command line flags to use it with straight command line lldb.

Of course -- I'll do that as I fix the indents I broke

abadams commented 2 weeks ago

Can you post some example lldb output with this enabled?

steven-johnson commented 3 days ago

Status?

alexreinking commented 2 days ago

Still in progress. I added a bunch more rules in a private branch and will need to update this PR