Rustc compiler debugging to gdb/lldb

Hi all! I wonder that debugger for rust compiler(rustc)

I want to debug the rust compiler but i don`t know how to debug to gdb or llvm. Is it possible to debug the rustc compiler to use debugger? If it was possible, how can i debug the compiler?

Thank you. Have a nice day :slight_smile:

Yes, you can use a regular debugger on rustc. Make sure to compile rustc itself with full debuginfo though. This increases the size of rustc by a lot and as such isn't enabled by default. In the config.toml file you use wihen compiling rustc there is a debug option you can set to true.

1 Like

Thank you for your comment!

Then, I wonder that rustc compiler build process. Before the build process, modify the cargo.toml like below

[rust]
debug = true

Then, as I know, rustc compilation can this commend line. ./x.py build

I wonder if it is possible to debug rustc through the following procedure

Thank you!

That should work.