[SERVER-56626] GDB pretty printer for RecordId Created: 04/May/21 Updated: 29/Oct/23 Resolved: 15/Jun/21 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | 5.0.0-rc2, 5.1.0-rc0 |
| Type: | Improvement | Priority: | Major - P3 |
| Reporter: | Louis Williams | Assignee: | Louis Williams |
| Resolution: | Fixed | Votes: | 1 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||
| Backwards Compatibility: | Fully Compatible | ||||
| Backport Requested: |
v5.0
|
||||
| Sprint: | Execution Team 2021-06-28 | ||||
| Participants: | |||||
| Description |
|
The internal format of RecordId is an encoded char array and it isn't very readable. Create a pretty printer to aid in debugging. |
| Comments |
| Comment by Vivian Ge (Inactive) [ 06/Oct/21 ] |
|
Updating the fixversion since branching activities occurred yesterday. This ticket will be in rc0 when it’s been triggered. For more active release information, please keep an eye on #server-release. Thank you! |
| Comment by Githook User [ 16/Jun/21 ] |
|
Author: {'name': 'Louis Williams', 'email': 'louis.williams@mongodb.com', 'username': 'louiswilliams'}Message: (cherry picked from commit 6abf79a4a8ae87059fb6a1fdc14d34a4bc59d1ff) |
| Comment by Githook User [ 16/Jun/21 ] |
|
Author: {'name': 'Louis Williams', 'email': 'louis.williams@mongodb.com', 'username': 'louiswilliams'}Message: |
| Comment by Githook User [ 15/Jun/21 ] |
|
Author: {'name': 'Louis Williams', 'email': 'louis.williams@mongodb.com', 'username': 'louiswilliams'}Message: |
| Comment by Kaloian Manassiev [ 06/May/21 ] |
|
Yes, only the fields that are named in the structure would be pretty-printed, but the rest would still stay as binary. So I guess pretty-printing at GDB level is the most suitable approach. |
| Comment by Louis Williams [ 05/May/21 ] |
|
kaloian.manassiev I didn't consider that, but I think only the format byte (the last byte) would be capable of using bit fields, right? As far as other alternatives, I did use a union in the first iteration of the implementation. However, I settled on the char array because it made the code implementation slightly less complex. More importantly, since the size of RecordId matters considerably (it's passed by value everywhere), it made it easier to guarantee the size of the struct without having to use #pragma pack everywhere to force the layout. Additionally, even with a union, RecordIds that store a byte string would still be char arrays, so pretty printing would still be desired. |
| Comment by Kaloian Manassiev [ 05/May/21 ] |
|
Just curious, instead of adding a pretty-printer, does it make more sense to convert that byte array into a bit-fields structure instead of using bit arithmetic? That way the debugger will print it nicely naturally. |