This way if we're linking against an old KF5, we still generate a backtrace
Details
- Reviewers
broulik sitter - Group Reviewers
Frameworks - Commits
- R871:cfa43ed278c8: Read the new message string after rather than before
Diff Detail
- Repository
- R871 DrKonqi
- Lint
Automatic diff as part of commit; lint not applicable. - Unit
Automatic diff as part of commit; unit tests not applicable.
Quick recap from what we talked about on telegram: putting the print after the bt is most definitely going to throw off the backtrace parsing logic, so doing it this way would require extensive changes there, which is a dangerous place to make extensive changes.
Or we could define a simple function to ignore errors https://stackoverflow.com/questions/17923865/gdb-stops-in-a-command-file-if-there-is-an-error-how-to-continue-despite-the-er but that's also a bit faffy.
Another completely standalone approach would be to change BacktraceGenerator (I think?) to invoke the print in a completely independent gdb invocation i.e. separate the print call from the regular batchcommands and have drkonqi assemble it back into the final report. That way the actual tracing batch command couldn't fail on the print.
Mh. Not quite what I had in mind but I suppose it makes sense this way.
I think we need a test case for the highlighter though :| It totally blows up in my face when I trace a running dolphin because toskip isn't quite right.
src/backtracegenerator.cpp | ||
---|---|---|
95 | This is leaking the file, is it not? It never deletes this object. | |
src/gdbhighlighter.cpp | ||
59 ↗ | (On Diff #78117) | lineNr is initialized to currentBlock().firstLineNumber() that is not necessarily 0, so toskip needs to be Should also be camel toSkip. |
65 ↗ | (On Diff #78117) | Isn't this off-by-one versus the original code? |
76 ↗ | (On Diff #78117) | The assert below fails when I trace a running dolphin, I am not super sure why but I am guessing it's because the toskip init being bugged vis a vis the lineNr being an offset. |
Mind the comment about the +2 please.
Other than that looks reasonable.
src/parser/backtraceparsergdb.cpp | ||
---|---|---|
215 | Please add a comment on what that +2 is, or better yet give it a var so it has an explicit name in code. |