我下载mongodb源代码并使用scons --nostrip mongod
选项进行编译,然后我使用emacs
gud-gdb
启动它。
它在Reading symbols from /Users/zhifan/github/mongo/mongod...
中持续20分钟,但仍在进行中。
是否可以加快速度?
有趣的是我发现gdb进程的内存大小已经停止了2489MB一段时间了,这有什么硬性限制吗?因为它正在读取,假设如果没有限制,内存大小应该增加吗?PID COMMAND %CPU TIME #TH #WQ #PORT MEM PURG CMPRS PGRP PPID STATE BOOSTS %CPU_ME %CPU_OTHRS UID FAULTS COW MSGSENT MSGRECV SYSBSD SYSMACH CSW PAGEIN IDLEW POWER
5706 gdb 74.5 20:15.49 1/1 0 11 2489M 0B 0B 5706 1698 running *0[1] 0.00000 0.00000 110079271 899329 225 179712485+ 18608+ 546535786+ 1903 179995118+ 3385 0 74.5
当我使用dtruss -p {pid of gdb}
时,我可以一直看到以下输出。
sigaction(0x8, 0x7FFF5FBFF018, 0x7FFF5FBFF040) = 0 0
sigreturn(0x7FFF5FBFF508, 0x1E, 0x7FFF5FBFF040) = 0 Err#-2
write(0xF, "\0", 0x1) = -1 Err#35
sigaction(0x8, 0x7FFF5FBFF018, 0x7FFF5FBFF040) = 0 0
sigreturn(0x7FFF5FBFF508, 0x1E, 0x7FFF5FBFF040) = 0 Err#-2
write(0xF, "\0", 0x1) = -1 Err#35
GDB版本:
LM-SHC-16502651:mongo zhifan$ gdb -v
GNU gdb (GDB) 8.0.1
Copyright (C) 2017 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-apple-darwin16.7.0".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
<http://www.gnu.org/software/gdb/documentation/>.
For help, type "help".
Type "apropos word" to search for commands related to "word".
更新
我在 Ubuntu 16.06 上尝试了gdb 7.11.1,但它确实有效。
这可能是关于macos **问题的** gdb。
更新2:
最后,我去了Ubuntu 16,一切顺利。