GDB (xrefs)
Loading...
Searching...
No Matches
tui-location.c
Go to the documentation of this file.
1/* Copyright (C) 2021-2023 Free Software Foundation, Inc.
2
3 This file is part of GDB.
4
5 This program is free software; you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation; either version 3 of the License, or
8 (at your option) any later version.
9
10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details.
14
15 You should have received a copy of the GNU General Public License
16 along with this program. If not, see <http://www.gnu.org/licenses/>. */
17
18#include "defs.h"
19#include "tui/tui.h"
20#include "tui/tui-stack.h"
21#include "tui/tui-data.h"
22#include "tui/tui-location.h"
23#include "symtab.h"
24#include "source.h"
25
26/* See tui/tui-location.h. */
27
29
30/* See tui/tui-location.h. */
31
32bool
34 const struct symtab_and_line &sal,
35 const char *procname)
36{
37 gdb_assert (procname != nullptr);
38
39 bool location_changed_p = set_fullname (sal.symtab);
40 location_changed_p |= procname != m_proc_name;
41 location_changed_p |= sal.line != m_line_no;
42 location_changed_p |= sal.pc != m_addr;
43 location_changed_p |= gdbarch != m_gdbarch;
44
45 m_proc_name = procname;
46 m_line_no = sal.line;
47 m_addr = sal.pc;
49
50 if (location_changed_p)
52
53 return location_changed_p;
54}
55
56/* See tui/tui-location.h. */
57
58bool
60{
61 bool location_changed_p = set_fullname (symtab);
62
63 if (location_changed_p)
65
66 return location_changed_p;
67}
68
69/* See tui/tui-location.h. */
70
71bool
73{
74 const char *fullname = (symtab == nullptr
75 ? "??"
77 bool location_changed_p = fullname != m_full_name;
78 m_full_name = std::string (fullname);
79
80 return location_changed_p;
81}
const char * symtab_to_fullname(struct symtab *s)
Definition source.c:1234
struct symtab * symtab
Definition symtab.h:2328
CORE_ADDR pc
Definition symtab.h:2337
bool set_fullname(struct symtab *symtab)
struct gdbarch * gdbarch() const
std::string m_proc_name
std::string m_full_name
bool set_location(struct gdbarch *gdbarch, const struct symtab_and_line &sal, const char *procname)
struct gdbarch * m_gdbarch
tui_location_tracker tui_location
void tui_show_locator_content()
Definition tui-stack.c:304