top | item 42140541

(no title)

nuudlman | 1 year ago

Not linking debug info must be some kind of sick joke. What is the point of a debug build without symbols?

discuss

order

0x457|1 year ago

Enable them when you need to debug. This is for speeding up "edit-build-run" workflows.

nuudlman|1 year ago

It's a lot faster to add a log point in a debugger than to add a print statement and recompile. Especially with cargo check, I really don't see the point of non-debuggable builds (outside of embedded, but the size of debuginfo already makes that a non-starter).

vbezhenar|1 year ago

1. Skipping some optimizations to build faster.

2. Conditionally compiling some code like logging (not sure if matters for typical Rust projects, but for embedded C projects it's typical).

3. Conditionally compiling assertions to catch more bugs.

I'm using logs, because debugger breaks hardware. Very rarely do I need to reach debugger. Even when hard exception occurs, usually enough info is logged to find out the root cause of the bug.

vlovich123|1 year ago

> because debugger breaks hardware

What? Seems like you’re talking about embedded but I’ve done a lot of embedded projects in my time and I’ve never had a debugger that breaks the HW.

RichardLake|1 year ago

Doesn't rust have overflow checks in debug and skips them in release?

0x457|1 year ago

Rust has compiled time overflow checks enabled by default in any profile. Runtime overflow checks are disabled by default in release profile.