Stream: t-compiler/help

Topic: Attach GDB to x.py test


achan1989 (Sep 09 2019 at 19:19, on Zulip):

Hello, I'm new to hacking on the compiler. I've got to the stage where I'm running x.py test src/test/ui/whateverand trying to figure out why my change to the parser isn't working properly.

I thought it might be helpful to step through the parser while it's building one of the test source files. What's the best way to run an x.py test under a debugger?

Vadim Petrochenkov (Sep 09 2019 at 20:36, on Zulip):

I usually do something like gdb --args ./build/x86_64-pc-windows-gnu/stage1/bin/rustc src/test/ui/name.rs, but that becomes more annoying when there are dependencies in auxiliary, so integrating that into x.py test would be really great.

Santiago Pastorino (Sep 09 2019 at 20:38, on Zulip):

btw, I wonder if this is explained on rustc-guide, because otherwise seems like an interesting thing to explain

achan1989 (Sep 09 2019 at 20:49, on Zulip):

As far as I could see, the rustc-guide only mentions using backtraces or debug logging.

Santiago Pastorino (Sep 09 2019 at 20:55, on Zulip):

https://github.com/rust-lang/rustc-guide/issues/443 :)

Last update: Nov 11 2019 at 21:55UTC