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

[CQF] Shorten PolyValue symbols / stack traces

    • Type: Icon: Task Task
    • Resolution: Won't Fix
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: None
    • Component/s: None
    • Labels:
      None
    • QO 2024-02-05, QO 2024-02-19, QO 2024-03-04, QO 2024-03-18, QO 2024-04-01, QO 2024-04-15

      PolyValue is a class template similar to std::variant: it takes any number of parameters. In one case (ABT) we instantiate this template with around 50 type arguments. This is a totally reasonable type to want, but one consequence is that the canonical name of this type is very long. And this means the name of any function whose signature mentions this type also has a very long name. Type aliases (typedef / using) only exist in the source code, so they don't make the true names of these functions (which show up in stack traces) any shorter.

      A partial solution would be to customize gdb to abbreviate these long function names. But gdb is only one tool that deals with function names and stack traces:

      • other debuggers would need a similar workaround
      • many performance tools like linux perf, callgrind record stack traces
      • mongod can print its own stack trace

      Maybe we can tweak the interface to PolyValue (without changing its memory layout or the code it generates) so that its name is not proportional to the number of type arguments.

            Assignee:
            david.percy@mongodb.com David Percy
            Reporter:
            david.percy@mongodb.com David Percy
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved: