Issue while setting breakpoints using GDB (MongoDB 3.2.7)

101 views
Skip to first unread message

chav...@umn.edu

unread,
Jul 13, 2016, 3:18:14 PM7/13/16
to mongodb-dev
Hello,

I have recently started looking into the code of MongoDB 3.2.7 and I am struggling with using GDB for debugging a query path.

I used following scons options while bulding the source (referred to an earlier post): /mongodb-src-r3.2.7$ scons --dbg=on --opt=off -j 8 core

with gcc (GCC) 4.9.2.

When I start the process from GDB and attempt to put a breakpoint, I get following error:

~/mongodb/mongodb-src-r3.2.7/build/debug/mongo$ gdb mongod
GNU gdb (Ubuntu 7.7.1-0ubuntu5~14.04.2) 7.7.1
Copyright (C) 2014 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
Find the GDB manual and other documentation resources online at:
For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from mongod...done.
(gdb) run
...
...
(gdb) break Box::intersects
Function "Box::intersects" not defined.
Make breakpoint pending on future shared library load? (y or [n])

(This breakpoint is never hit.)

I also tried starting the server outside gdb and attaching gdb to the mongod process, only to observe similar issue.

Please let me know if I am missing something here. My objective is to be able to debug mongodb code.

Thanks,
Harshada

Andrew Morrow

unread,
Jul 13, 2016, 3:19:37 PM7/13/16
to mongodb-dev

Hi -

That function is within the 'mongo' namespace. Try setting a breakpoint at mongo::Box::intersects. Alternatively, set the breakpoint by file and line number, rather than symbolic name.

Andrew

--
You received this message because you are subscribed to the Google Groups "mongodb-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mongodb-dev...@googlegroups.com.
To post to this group, send email to mongo...@googlegroups.com.
Visit this group at https://groups.google.com/group/mongodb-dev.
For more options, visit https://groups.google.com/d/optout.

Harshada Chavan

unread,
Jul 13, 2016, 3:37:57 PM7/13/16
to mongodb-dev
Thank for your help Andrew. It works with "mongo::Box::intersects".

-Harshada
Reply all
Reply to author
Forward
0 new messages