couchdb-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Robert Dionne <dio...@dionne-associates.com>
Subject debugging couchdb with Distel
Date Tue, 11 Nov 2008 12:35:37 GMT
For any couchdb newbies that are distel users, I figured out the  
following tweaks to run couch in the debugger:

Assuming couch is built to run from the sources directory with couch- 
dev.ini

1. run the couchdb script using the -i option, where the script has  
been modified to add a -sname mynodename to the erl command

./bin/couchdb -i -c couch-dev.ini

2. from the erlang shell change to the sources directory:

cd("src/couchdb").

3. compile modules with debug info as needed:

c(couch_btree,[debug_info]).

4. in emacs, rather than starting an erlang shell, attach to the  
running couch:

C-c C-d n   and specify the node name passed into -sname in the  
couchdb script

set breakpoints, load modules, etc... as usual

I find it useful to be able to step through the code and highly  
recommend distel for any emacs users. The M-.  feature alone is worth  
it. Because it attaches to a running erlang node looking up all the  
code sources is free. For more details see http://bc.tech.coop/blog/ 
070528.html


Bob Dionne

http://dionne-associates.com




Mime
View raw message