Fix use-after-free in record_btrace_start_replaying
-fsanitize=address showed a use-after-free in
record_btrace_start_replaying. The bug occurred because
get_thread_current_frame returned a frame_info, but this object was
then invalidated before the return by ~scoped_restore_current_thread.
This patch fixes the problem by renaming get_thread_current_frame and
having it return a frame id.
gdb/ChangeLog
2018-10-23 Tom Tromey <tom@tromey.com>
* record-btrace.c (get_thread_current_frame_id): Rename from
get_thread_current_frame. Return a frame_id.
(record_btrace_start_replaying): Update.