[SERVER-62074] Have gdb decorable pretty printers include better decoration identify Created: 15/Dec/21  Updated: 28/Dec/22

Status: In Code Review
Project: Core Server
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Improvement Priority: Major - P3
Reporter: Daniel Gottlieb (Inactive) Assignee: Andy Schwerin
Resolution: Unresolved Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Related
related to SERVER-59856 Hang analyzer gdb script raises gdb.e... Backlog
Participants:

 Description   

Today, printing out a decorable such as the service context or operation context in gdb will iterate its decorations and print them out.

However, the output can be ambiguous due to only outputting the type and value. When the decoration is a complex(named) structure, it's easy to know what it represents. But we sometimes use primitives as a decoration.

It would be an improvement if the gdb output (presumably with some accompanying server change) could include more discriminating information. Ideally this would be a variable name, e.g: getInReplicationRecovery, but that would presumably require macroing which is more invasive than I'm seeking for here. A filename (and maybe line number?) should be sufficient to at least remove the ambiguity.



 Comments   
Comment by Githook User [ 05/Dec/22 ]

Author:

{'name': 'Daniel Moody', 'email': 'daniel.moody@mongodb.com', 'username': 'dmoody256'}

Message: SERVER-62995 SERVER-62074 update pretty printers to work with v4 and add tests
Branch: master
https://github.com/mongodb/mongo/commit/fb23430fd306ff967e64a06c0dabe951927a02ea

Comment by Githook User [ 10/Jan/22 ]

Author:

{'name': 'Andy Schwerin', 'email': 'schwerin@mongodb.com', 'username': 'amschwerin'}

Message: SERVER-62074 De-duplicate Decorable and DecorableCopyable

This change eliminates the DecorableCopyable type in favor of making
Decorable<D> copyable whenever D is copyable. With this change,
Decorable<D>::declareDecorable<T> requires T be copyable if D is copyable.
Branch: master
https://github.com/mongodb/mongo/commit/d9d35bd709dbe4a8981218c2f0500d6bcfecc329

Comment by Githook User [ 06/Jan/22 ]

Author:

{'name': 'Andy Schwerin', 'email': 'schwerin@mongodb.com', 'username': 'amschwerin'}

Message: SERVER-62074 Change decorable_test.cpp to test Decorable directly.

No longer attempts to directly test DecorableContainer or DecorableRegistry, which
are tightly coupled to Decorable and not meaningful to test separately.
Branch: master
https://github.com/mongodb/mongo/commit/c1ea4ac726ee35cfd5774de0816832bc5c016889

Generated at Thu Feb 08 05:54:05 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.