refactored dump_xaddr and implemented dump_stack