-
-
Notifications
You must be signed in to change notification settings - Fork 75
change CLI around --force-backtrace and --max-backtrace-len #198
Comments
makes sense. I'm wondering, is there a case where one might not want any backtraces ever? |
we also print the backtrace to stdout, right? perhaps if you want to grep for something in the logs but not in the backtrace then it may be useful to completely disable the backtrace. this use case would be best served by the proposed JSON output (#178), IMO |
IMO it makes sense to reject |
that sounds like 'some way to disable the backtrace' is a desirable thing. perhaps we can harmonize this to work like Cargo's THEN OR we don't restrict mixing Also, I'd like the default to be "no limit on backtrace length" (e.g. if the backtrace is the result of a hard to reproduce condition then you want all the info you can get your hands on; not just some arbitrary number of frames). Right now, the backtrace is limited to 50 frames and there's no good way to undo it -- I mean you can use We could make the default be 'the number of backtrace frames is not limited' OR we could make |
We could also rename it to |
OK, let me more concretely propose this:
The interaction between these flags is specified in the table below:
Additionally,
(+) rationale on setting a default limit: bugs in debug info (DWARF) generation can result in infinite backtraces that even the mature GDB can't handle / detect #127 (comment) so err on the side of caution and set a limit to avoid spamming frames to the console in presence of these bugs. @jonas-schievink , @Lotterleben can I get a 'sounds good to me' / 'I have a concern' reaction on the above proposal as a comment -- I don't get notified about emoji reactions to comments so that would be easy to miss. Changelog
|
I agree in principle, but we've seen programs that even resulted in an infinite backtrace in GDB, so I don't think this is realistic (#127 (comment)). Everything else sounds good to me though! |
Fair, I can compromise on keeping the |
+1 to what Jonas says. We also picked the 50 line limit quite arbitrarily, so I'd be OK with increasing it. |
OK. That's two approvals. I'll amend my proposal; link it from the issue description as accepted and change this ticket status to 'needs PR' |
--max-backtrace-len=0
into a CLI parsing error547: Migration guide `v0.2.x` to `v0.3.0` r=japaric a=Urhengulas Migration guide from `defmt v0.2.x` to version `v0.3.0`. https://deploy-preview-547--admiring-dubinsky-56dff5.netlify.app/migration-02-03.html Fixes #530. ### TODO - [x] #505: Logger trait v2 - [x] #521: [3/n] Remove u24 - [x] #522: Replace `µs` hint with `us` - [x] (no adaption needed) ~~#508: [5/n] Format trait v2~~ - [x] #519: `DEFMT_LOG` - [x] #550: `defmt::flush()` - [x] knurling-rs/probe-run#198, knurling-rs/probe-run#250, Co-authored-by: Johann Hemmann <[email protected]>
We are going to change the CLI around
--force-backtrace
and--max-backtrace-len
. The accepted proposal is #198 (comment) . This is only waiting on a PR to implement that proposal.Original ticket:
(this is technically a breaking change so it should wait until v0.3.0)
--max-backtrace-len=0
is currently allowed. While working on PR #197 it wasn't clear to me what the semantics of--force-backtrace --max-backtrace-len=0
should be but I made--max-backtrace-len=0
never print a backtrace regardless of other flags and the presence of stack overflows or exceptions.IMO, it'd be better to reject
--max-backtrace-len=0
and only accepts lengths equal or greater than 1; that avoids the above ambiguity.cc @Lotterleben
The text was updated successfully, but these errors were encountered: