rust-lang / rustc_codegen_cranelift

Cranelift based backend for rustc
Apache License 2.0
1.52k stars 94 forks source link

Implement #![debugger_visualizer] #1386

Open bjorn3 opened 11 months ago

bjorn3 commented 11 months ago

https://doc.rust-lang.org/nightly/reference/attributes/debugger.html#using-debugger_visualizer-with-gdb https://github.com/rust-lang/rust/blob/ab0f3e680e4fd50218914b8afa6900a67377721c/compiler/rustc_codegen_llvm/src/debuginfo/gdb.rs

The .debug_gdb_scripts section should contain \x01gdb_load_rust_pretty_printers.py followed by for each #![debugger_visualizer(gdb_script_file = "...")] the pretty printer inlined into the executable. Except if one of the conditions to omit .debug_gdb_scripts is true.

bjorn3 commented 4 months ago

The function to insert this section is called at https://github.com/rust-lang/rust/blob/8c0b4f67c9b4bf477df38c16669fd576d46a2b3d/compiler/rustc_codegen_ssa/src/base.rs#L464

DesmondWillowbrook commented 4 months ago

I'm interested in working on this issue.

The code you've linked (https://github.com/rust-lang/rust/blob/ab0f3e680e4fd50218914b8afa6900a67377721c/compiler/rustc_codegen_llvm/src/debuginfo/gdb.rs) seems to already contain logic to add pretty-printers. What exactly is the issue here?

bjorn3 commented 4 months ago

That is the implementation in the LLVM backend. We need a separate implementation in rustc_codegen_cranelift.

kernel-loophole commented 3 days ago

@bjorn3 is this issue still open .wanted to work on this .Looking forward to hear from you .

bjorn3 commented 3 days ago

Yes, this change is still wanted. However someone else also asked if they could pick it up at https://github.com/rust-lang/rustc_codegen_cranelift/pull/1462#issuecomment-2191170590 a couple of days ago, so I would like to give them a chance first.

kernel-loophole commented 2 days ago

thanks for your response ,i also add the comment on #1462 if the person wanted to work ,i can help.