aboutsummaryrefslogtreecommitdiff
path: root/gdb/maint.c
diff options
context:
space:
mode:
authorSimon Marchi <simon.marchi@efficios.com>2023-10-19 20:40:52 +0000
committerSimon Marchi <simon.marchi@polymtl.ca>2023-10-20 22:00:23 -0400
commit0e17d3fc080f543d81e6c2520ba0bd8046ea3a95 (patch)
tree2f0a495b079cc9edb11114028e480890a1c1f866 /gdb/maint.c
parent4a6daabb94982ccc17ea45ebb6f6e8efa8f86399 (diff)
downloadgdb-0e17d3fc080f543d81e6c2520ba0bd8046ea3a95.zip
gdb-0e17d3fc080f543d81e6c2520ba0bd8046ea3a95.tar.gz
gdb-0e17d3fc080f543d81e6c2520ba0bd8046ea3a95.tar.bz2
gdb: fix owner passed to remove_target_sections in clear_solib
Commit 8971d2788e7 ("gdb: link so_list using intrusive_list") introduced a bug in clear_solib. Instead of passing an `so_list *` to remove_target_sections, it passed an `so_list **`. This was not caught by the compiler, because remove_target_sections takes a `void *` as the "owner", so you can pass it any pointer and it won't complain. This happened because I previously had a patch to change the type of the disposer parameter to be a reference rather than a pointer, so had to change `so` to `&so`. When dropping that patch, I forgot to revert this bit and / or it got re-introduced when handling subsequent merge conflicts. And I didn't properly retest. Fix that, but try to make things less error prone. Add a union to represent the possible owner kinds for a target_section. Trying to pass a pointer to another type than those will not compile. Change-Id: I600cab5ea0408ccc5638467b760768161ca3036c
Diffstat (limited to 'gdb/maint.c')
-rw-r--r--gdb/maint.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/gdb/maint.c b/gdb/maint.c
index e0dc5bc..0635af3 100644
--- a/gdb/maint.c
+++ b/gdb/maint.c
@@ -509,7 +509,7 @@ maintenance_info_target_sections (const char *arg, int from_tty)
(8 + digits), "",
hex_string_custom (sec.addr, addr_size),
hex_string_custom (sec.endaddr, addr_size),
- sec.owner);
+ sec.owner.v ());
}
}