GDB (xrefs)
Loading...
Searching...
No Matches
frame-info.c
Go to the documentation of this file.
1/* Frame info pointer
2
3 Copyright (C) 2022-2023 Free Software Foundation, Inc.
4
5 This file is part of GDB.
6
7 This program is free software; you can redistribute it and/or modify
8 it under the terms of the GNU General Public License as published by
9 the Free Software Foundation; either version 3 of the License, or
10 (at your option) any later version.
11
12 This program is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 GNU General Public License for more details.
16
17 You should have received a copy of the GNU General Public License
18 along with this program. If not, see <http://www.gnu.org/licenses/>. */
19
20#include "defs.h"
21
22#include "frame-info.h"
23#include "frame.h"
24
25/* See frame-info-ptr.h. */
26
27intrusive_list<frame_info_ptr> frame_info_ptr::frame_list;
28
29/* See frame-info-ptr.h. */
30
31void
33{
35
36 if (m_cached_level != 0)
37 m_cached_id = get_frame_id (*this);
38}
39
40/* See frame-info-ptr.h. */
41
42void
44{
45 /* Ensure we have a valid frame level (sentinel frame or above), indicating
46 prepare_reinflate was called. */
47 gdb_assert (m_cached_level >= -1);
48
49 if (m_ptr != nullptr)
50 {
51 /* The frame_info wasn't invalidated, no need to reinflate. */
52 return;
53 }
54
55 /* Frame #0 needs special handling, see comment in select_frame. */
56 if (m_cached_level == 0)
58 else
59 {
60 gdb_assert (frame_id_p (m_cached_id));
62 }
63
64 gdb_assert (m_ptr != nullptr);
65}
static intrusive_list< frame_info_ptr > frame_list
Definition frame-info.h:169
void prepare_reinflate()
Definition frame-info.c:32
frame_info * m_ptr
Definition frame-info.h:158
void reinflate()
Definition frame-info.c:43
frame_info * get() const
Definition frame-info.h:120
frame_id m_cached_id
Definition frame-info.h:161
int frame_relative_level(frame_info_ptr fi)
Definition frame.c:2826
bool frame_id_p(frame_id l)
Definition frame.c:735
frame_info_ptr frame_find_by_id(struct frame_id id)
Definition frame.c:868
frame_info_ptr get_current_frame(void)
Definition frame.c:1615
struct frame_id get_frame_id(frame_info_ptr fi)
Definition frame.c:607