aboutsummaryrefslogtreecommitdiff
path: root/gdb/symmisc.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/symmisc.c
parent1acc9dca423f78e44553928f0de839b618c13766 (diff)
downloadfsf-binutils-gdb-977a0c161de83a5e5397f9f7950d58173c4b4be2.zip
fsf-binutils-gdb-977a0c161de83a5e5397f9f7950d58173c4b4be2.tar.gz
fsf-binutils-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/symmisc.c')
-rw-r--r--gdb/symmisc.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/gdb/symmisc.c b/gdb/symmisc.c
index 3579bf0..2f1e4f5 100644
--- a/gdb/symmisc.c
+++ b/gdb/symmisc.c
@@ -237,7 +237,7 @@ dump_symtab_1 (struct symtab *symtab, struct ui_file *outfile)
struct objfile *objfile = symtab->compunit ()->objfile ();
struct gdbarch *gdbarch = objfile->arch ();
struct mdict_iterator miter;
- struct linetable *l;
+ const struct linetable *l;
struct symbol *sym;
int depth;
@@ -948,7 +948,7 @@ block_depth (const struct block *block)
static int
maintenance_print_one_line_table (struct symtab *symtab, void *data)
{
- struct linetable *linetable;
+ const struct linetable *linetable;
struct objfile *objfile;
objfile = symtab->compunit ()->objfile ();
@@ -986,7 +986,7 @@ maintenance_print_one_line_table (struct symtab *symtab, void *data)
for (int i = 0; i < linetable->nitems; ++i)
{
- struct linetable_entry *item;
+ const linetable_entry *item;
item = &linetable->item [i];
ui_out_emit_tuple tuple_emitter (uiout, nullptr);