-
Type:
Task
-
Resolution: Won't Do
-
Priority:
Major - P3
-
None
-
Affects Version/s: None
-
Component/s: None
-
None
-
Query Execution
-
QE 2023-03-06
-
None
-
3
-
None
-
None
-
None
-
None
-
None
-
None
This is split out of SERVER-72752 for the Python pretty printer used by gdb to print CodeFragments.
Q: Where is the Python pretty printer?
A: Irina Yatsenko: buildscripts/gdb/mongo_printers.py SbeCodeFragmentPrinter
[Originally added by SERVER-62049 via commit
https://github.com/mongodb/mongo/commit/207e7d16e4a24d4a16c2ab594bf5122e50aa8c4e]
[It is a plugin for the GDB debugger.] the pretty printers should be loaded automatically if you are running GDB from the toolchain. however, after the recent toolchain updates there have been issues with pretty printers (not sure exactly about the extent of problems)
you'd need to attach GDB to mongod and get it to breakpoint in code that has a CodeFragment object sitting around. Then you do either "p obj_name" or "p *obj_name" depending on whether 'obj_name' is a value or a pointer
it should printout a nicely formatted sequence of opcodes
from the recent communications flying around, you might need to compile with GDB_INDEX=1 (add it to the scone's command line) to get any decent debugging experience in GDB. it does make the compile/link time longer, though, so you might not want to keep the setting permanently...