Add get_top_cursor debug helper