write_debug_record should dump info recursively; close #1581
Merge branch 'master' into iij