.\" Man page generated from reStructuredText. . . .nr rst2man-indent-level 0 . .de1 rstReportMargin \\$1 \\n[an-margin] level \\n[rst2man-indent-level] level margin: \\n[rst2man-indent\\n[rst2man-indent-level]] - \\n[rst2man-indent0] \\n[rst2man-indent1] \\n[rst2man-indent2] .. .de1 INDENT .\" .rstReportMargin pre: . RS \\$1 . nr rst2man-indent\\n[rst2man-indent-level] \\n[an-margin] . nr rst2man-indent-level +1 .\" .rstReportMargin post: .. .de UNINDENT . RE .\" indent \\n[an-margin] .\" old: \\n[rst2man-indent\\n[rst2man-indent-level]] .nr rst2man-indent-level -1 .\" new: \\n[rst2man-indent\\n[rst2man-indent-level]] .in \\n[rst2man-indent\\n[rst2man-indent-level]]u .. .TH "MONGOC_DEBUGGING" "3" "May 07, 2024" "1.27.1" "libmongoc" .SH GDB .sp This repository contains a \fB\&.gdbinit\fP file that contains helper functions to aid debugging of data structures. GDB will load this file \fI\%automatically\fP if you have added the directory which contains the \fI\&.gdbinit\fP file to GDB\(aqs \fI\%auto\-load safe\-path\fP, \fIand\fP you start GDB from the directory which holds the \fI\&.gdbinit\fP file. .sp You can see the safe\-path with \fBshow auto\-load safe\-path\fP on a GDB prompt. You can configure it by setting it in \fB~/.gdbinit\fP with: .INDENT 0.0 .INDENT 3.5 .sp .EX add\-auto\-load\-safe\-path /path/to/mongo\-c\-driver .EE .UNINDENT .UNINDENT .sp If you haven\(aqt added the path to your auto\-load safe\-path, or start GDB in another directory, load the file with: .INDENT 0.0 .INDENT 3.5 .sp .EX source path/to/mongo\-c\-driver/.gdbinit .EE .UNINDENT .UNINDENT .sp The \fB\&.gdbinit\fP file defines the \fBprintbson\fP function, which shows the contents of a \fBbson_t *\fP variable. If you have a local \fBbson_t\fP, then you must prefix the variable with a \fI&\fP\&. .sp An example GDB session looks like: .INDENT 0.0 .INDENT 3.5 .sp .EX (gdb) printbson bson ALLOC [0x555556cd7310 + 0] (len=475) { \(aqbool\(aq : true, \(aqint32\(aq : NumberInt(\(dq42\(dq), \(aqint64\(aq : NumberLong(\(dq3000000042\(dq), \(aqstring\(aq : \(dqStŕìñg\(dq, \(aqobjectId\(aq : ObjectID(\(dq5A1442F3122D331C3C6757E1\(dq), \(aqutcDateTime\(aq : UTCDateTime(1511277299031), \(aqarrayOfInts\(aq : [ \(aq0\(aq : NumberInt(\(dq1\(dq), \(aq1\(aq : NumberInt(\(dq2\(dq) ], \(aqembeddedDocument\(aq : { \(aqarrayOfStrings\(aq : [ \(aq0\(aq : \(dqone\(dq, \(aq1\(aq : \(dqtwo\(dq ], \(aqdouble\(aq : 2.718280, \(aqnotherDoc\(aq : { \(aqtrue\(aq : NumberInt(\(dq1\(dq), \(aqfalse\(aq : false } }, \(aqbinary\(aq : Binary(\(dq02\(dq, \(dq3031343532333637\(dq), \(aqregex\(aq : Regex(\(dq@[a\-z]+@\(dq, \(dqim\(dq), \(aqnull\(aq : null, \(aqjs\(aq : JavaScript(\(dqprint foo\(dq), \(aqjsws\(aq : JavaScript(\(dqprint foo\(dq) with scope: { \(aqf\(aq : NumberInt(\(dq42\(dq), \(aqa\(aq : [ \(aq0\(aq : 3.141593, \(aq1\(aq : 2.718282 ] }, \(aqtimestamp\(aq : Timestamp(4294967295, 4294967295), \(aqdouble\(aq : 3.141593 } .EE .UNINDENT .UNINDENT .SH LLDB .sp The mongo\-c\-driver repository contains a script \fBlldb_bson.py\fP that can be imported into an LLDB sessions and allows rich inspection of BSON values. .sp \fBNOTE:\fP .INDENT 0.0 .INDENT 3.5 The \fBlldb_bson.py\fP module requires an LLDB with Python 3.8 or newer. .UNINDENT .UNINDENT .sp To activate the script, import it from the LLDB command line: .INDENT 0.0 .INDENT 3.5 .sp .EX (lldb) command script import /path/to/mongo\-c\-driver/lldb_bson.py .EE .UNINDENT .UNINDENT .sp Upon success, the message \fBlldb_bson is ready\fP will be printed to the LLDB console. .sp The import of this script can be made automatic by adding the command to an \fB\&.lldbinit\fP file. For example: Create a file \fB~/.lldbinit\fP containing: .INDENT 0.0 .INDENT 3.5 .sp .EX command script import /path/to/mongo\-c\-driver/lldb_bson.py .EE .UNINDENT .UNINDENT .sp The docstring at the top of the \fBlldb_bson.py\fP file contains more information on the capabilities of the module. .SH DEBUG ASSERTIONS .sp To enable runtime debug assertions, configure with \fB\-DENABLE_DEBUG_ASSERTIONS=ON\fP\&. .SH AUTHOR MongoDB, Inc .SH COPYRIGHT 2017-present, MongoDB, Inc .\" Generated by docutils manpage writer. .