Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-94540

Improve C++ backtrace usability during local development

    • Type: Icon: Improvement Improvement
    • Resolution: Unresolved
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: None
    • Component/s: None
    • None
    • Server Programmability
    • SP Prioritized List

      Note: this ticket should only result in changes to output in local development where we have the source code and debug info available. It should not affect production behavior at all. It also generally shouldn't affect evergreen behavior, although we may want to treat unittest runs as-if they are local development since unlike most tests, they run with the code and debug symbols locally available.

      Right now it is a bit of a pain to copy the stacktrace and run it through mongosymb.py then load those locations into an editor to look at the code. At the very least, we should try to print a nice useful backtrace. I suggest bypassing structured logging for this in order to improve readability (again, this isn't for production usage, so readability is more important than analytics). backward-cpp is even better and directly includes the relevant source lines. In many cases, that will be enough to understand the bug and know what to fix. We should consider using that library directly if that is the easiest way to get the desired features. We might want to adjust its formatting to a) include column information, not just line, b) add a carrot under the current line to show the column, and c) ensure the file:line:column is in a format that VSCode terminal detects and makes a clickable link out of.

            Assignee:
            Unassigned Unassigned
            Reporter:
            mathias@mongodb.com Mathias Stearn
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

              Created:
              Updated: