debugging the mongodb server

瀏覽次數:124 次
跳到第一則未讀訊息

Ananya

未讀,
2015年3月2日 下午1:29:152015/3/2
收件者:mongo...@googlegroups.com
Hi,
I wanted to know how I can debug the mongodb server. I have built it from the source and am working on linux.

Kaloian Manassiev

未讀,
2015年3月4日 上午9:36:082015/3/4
收件者:mongo...@googlegroups.com
Hi Ananya,

The easiest way to step through the server code is to build the server with no optimizations (--dbg=on --opt=off) and start it under gdb. Another option is lldb.

Hope this helps.

-Kal.

Harshada Chavan

未讀,
2016年7月13日 下午3:18:142016/7/13
收件者:mongodb-dev
Hi Kal,

I am trying to debug MongoDB 3.2.7 using GDB.

I did build my source as: scons --dbg=on --opt=off -j 8 core

and trying to start the server under GDB as:

~/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) break parseArrayOfCoordinates
Function "parseArrayOfCoordinates" not defined.
Make breakpoint pending on future shared library load? (y or [n])

This breakpoint is never hit. I also tried starting mongodb outside of GDB and attaching GDB to the mongod process.. No success there as well.

Am I missing anything here? I greatly appreciate any help.

Thanks in advance.
-Harsgada

Andrew Morrow

未讀,
2016年7月13日 下午3:22:012016/7/13
收件者:mongodb-dev

Hi -

Please see my other reply to your email about setting breakpoints. You need to qualify the name with 'mongo::' since that function is within the 'mongo' namespace. Please note that some functions, particularly those within unnamed namespaces, cannot easily be named as symbols, and need to have the breakpoint set by file and line (e.g. break foo.cpp:42). In the case of mongo::parseArrayOfCoordinates, the function is file-scoped static, so it may or may not have a symbolic existence, depending on the compiler and optimization options.

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

未讀,
2016年7月13日 下午3:37:582016/7/13
收件者:mongodb-dev
Hi Andrew,

Thanks for the information. I ll be mindful of this. I could set the breakpoint with "mongo::".

Thanks,
Harshada
回覆所有人
回覆作者
轉寄
0 則新訊息