MonetDB 调试

MonetDB can run in different platform,including linux’s and window’s series.Because I want to learn how to use gdb to debug,thus, MonetDB’s installed on Unbuntu12.10 and –debug–init set on true

Now,use command ” gdb mserver5” to debug, or use command “ps -aux | grep mserver” to find pid,thus, “gdb pid”

MonetDB is a multiprocess and multithread program, and has a daemon process “monetdbd” listen on 5000. when mclient connect the server, based on which database will be accessed, if no process is processing the database,the daemon process fork a process to process the request.otherwise,the daemon process doesn’t fork a process and use lock to contorl simultaneous access.

If we want to use gdb to debug such complicated program. we should get familar with gdb.

use comand “help” in gdb. it will list the classes of command.

breakpoints –Making program stop at certain point.

data –Examining data

running –Running the program

stack –Examing the stack

在调试MonetDB的时候,学会使用gdb去调试比较关键。譬如,要看函数的调用关系,用bt;输出某结构,set print pretty on, print struct,动态数组还需print struct@max_index。使用了gdb调试,觉得gdb比有界面的调试器强大好多。

Comments