Add function to get stack dump