aboutsummaryrefslogtreecommitdiff
path: root/gdb/linespec.c
diff options
context:
space:
mode:
authorTom Tromey <tom@tromey.com>2023-03-07 18:16:29 -0700
committerTom Tromey <tom@tromey.com>2023-03-11 08:48:10 -0700
commit977a0c161de83a5e5397f9f7950d58173c4b4be2 (patch)
tree5264db12f959dba8dfddaac35b4008ee02a4253a /gdb/linespec.c
parent1acc9dca423f78e44553928f0de839b618c13766 (diff)
downloadgdb-977a0c161de83a5e5397f9f7950d58173c4b4be2.zip
gdb-977a0c161de83a5e5397f9f7950d58173c4b4be2.tar.gz
gdb-977a0c161de83a5e5397f9f7950d58173c4b4be2.tar.bz2
Constify linetables
Linetables no longer change after they are created. This patch applies const to them. Note there is one hack to cast away const in mdebugread.c. This code allocates a linetable using 'malloc', then later copies it to the obstack. While this could be cleaned up, I chose not to do so because I have no way of testing it. Approved-By: Simon Marchi <simon.marchi@efficios.com>
Diffstat (limited to 'gdb/linespec.c')
-rw-r--r--gdb/linespec.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/gdb/linespec.c b/gdb/linespec.c
index 36f2ef4..7d969f3 100644
--- a/gdb/linespec.c
+++ b/gdb/linespec.c
@@ -403,7 +403,7 @@ static std::vector<symtab_and_line> decode_digits_ordinary
(struct linespec_state *self,
linespec *ls,
int line,
- linetable_entry **best_entry);
+ const linetable_entry **best_entry);
static std::vector<symtab_and_line> decode_digits_list_mode
(struct linespec_state *self,
@@ -2079,7 +2079,7 @@ create_sals_line_offset (struct linespec_state *self,
values = decode_digits_list_mode (self, ls, val);
else
{
- struct linetable_entry *best_entry = NULL;
+ const linetable_entry *best_entry = NULL;
int i, j;
std::vector<symtab_and_line> intermediate_results
@@ -4026,7 +4026,7 @@ static std::vector<symtab_and_line>
decode_digits_ordinary (struct linespec_state *self,
linespec *ls,
int line,
- struct linetable_entry **best_entry)
+ const linetable_entry **best_entry)
{
std::vector<symtab_and_line> sals;
for (const auto &elt : ls->file_symtabs)