[SERVER-58633] Add gdb pretty printer for OID Created: 16/Jul/21  Updated: 29/Oct/23  Resolved: 30/Nov/21

Status: Closed
Project: Core Server
Component/s: None
Affects Version/s: None
Fix Version/s: 5.2.0

Type: Improvement Priority: Major - P3
Reporter: Dan Larkin-York Assignee: Daniel Gomez Ferro
Resolution: Fixed Votes: 1
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Backwards Compatibility: Fully Compatible
Sprint: Execution Team 2021-11-29, Execution Team 2021-12-13
Participants:

 Description   

Currently GDB prints OIDs out as byte strings, using ASCII characters for bytes that have simple representations and octal (e.g. "\312") for bytes that don't. This leads to displayed values like "`\260s\347\016\273\376\324\301J\254\304", which don't match the hexadeximal output format in our logs (e.g. "60b073e70ebbfed4c14aacc4").

Having a uniform format between the two could make investigating some bugs easier.



 Comments   
Comment by Daniel Gomez Ferro [ 29/Nov/21 ]

This is how we used to print OIDs:

(gdb) p o1
$1 = {
  _data = "a\245\023\025\313\242(\217\304\202v\260"
}

And this is the format of the new pretty printer:

(gdb) p o1
$1 = "ObjectID('619e6b2cf4075add862954e5')"

Comment by Githook User [ 29/Nov/21 ]

Author:

{'name': 'Daniel Gómez Ferro', 'email': 'daniel.gomezferro@mongodb.com', 'username': 'dgomezferro'}

Message: SERVER-58633 Add gdb pretty printer for OID
Branch: master
https://github.com/mongodb/mongo/commit/dcdf971889b00ef0b98815d8abff54add18cdcbe

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