Giter Site home page Giter Site logo

Comments (8)

mark-i-m avatar mark-i-m commented on June 6, 2024

cc #78

from rustc-dev-guide.

nikomatsakis avatar nikomatsakis commented on June 6, 2024

I just noticed that there is a page on forge on this topic:

https://forge.rust-lang.org/debugging.html

So, as a start, moving that content into the rustc-guide and removing the page from forge would be easy enough!

from rustc-dev-guide.

cg-cnu avatar cg-cnu commented on June 6, 2024

Hey @nikomatsakis A rust beginner here and first time contributor to rust project. Might need some help in making the PR, but definitely interested in putting the time and working on it. Can I work on it 🙂

from rustc-dev-guide.

mark-i-m avatar mark-i-m commented on June 6, 2024

@cg-cnu Definitely! Thanks! Let us know if you need help :)

from rustc-dev-guide.

gnzlbg avatar gnzlbg commented on June 6, 2024

I just tried to debug the compiler using debug!. There is such a huge amount of noise that's pretty much useless. Tons of lines of:

DEBUG 2019-02-12T02:35:41Z: syntax::source_map: byte pos BytePos(0) is on the line at byte pos BytePos(0)
DEBUG 2019-02-12T02:35:41Z: syntax::source_map: char pos CharPos(0) is on the line at char pos CharPos(0)
DEBUG 2019-02-12T02:35:41Z: syntax::source_map: byte is on line: 1
DEBUG 2019-02-12T02:35:41Z: syntax::source_map: byte pos BytePos(0) is on the line at byte pos BytePos(0)
DEBUG 2019-02-12T02:35:41Z: syntax::source_map: char pos CharPos(0) is on the line at char pos CharPos(0)
DEBUG 2019-02-12T02:35:41Z: syntax::source_map: byte is on line: 1

I wish there was an easy way to just use eprintln! or something without noise. Or do I have to go through the compiler and remove all debug! statements to be able to see the output of mine ?

from rustc-dev-guide.

Mark-Simulacrum avatar Mark-Simulacrum commented on June 6, 2024

Generally the intent is to be more specific than just RUST_LOG=syntax=debug; where you trying to debug something in syntax::source_map specifically? Otherwise I would expect you to not include it in the logging at all...

from rustc-dev-guide.

gnzlbg avatar gnzlbg commented on June 6, 2024

Generally the intent is to be more specific than just RUST_LOG=syntax=debug; where you trying to debug something in syntax::source_map specifically? No, it was late and I forgot that you could RUST_LOG=modulename too. Maybe it would be worth calling that out specifically in the guide.

from rustc-dev-guide.

eddyb avatar eddyb commented on June 6, 2024

We should really tell people to use RUST_LOG=rustc_foo::bar::baz, with the smallest module(s) (comma-separated if multiple) necessary for the debug!s they want.

IIRC RUST_LOG=syntax=debug and RUST_LOG=syntax does the same thing, but I could be wrong. Either way, the logging level should not be the important bit, but rather the relevant module.

from rustc-dev-guide.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.