From 234529260a90b6ac6ed38ddac45d6ed15149e8f8 Mon Sep 17 00:00:00 2001 From: Tom Tromey Date: Fri, 1 Nov 2019 16:42:29 -0600 Subject: Introduce program_space::remove_objfile This introduces a new method, program_space::remove_objfile, and changes the objfile destructor not to unlink an objfile from the program space's list. This is cleaner because, like the previous patch, it treats the program space more like a container for objfiles. Also, this makes it possible to keep an objfile alive even though it has been unlinked from the program space's list, which is important for processing in a worker thread. gdb/ChangeLog 2019-12-12 Tom Tromey * progspace.h (struct program_space) : Declare. * progspace.c (program_space::remove_objfile): New method. * objfiles.c (unlink_objfile): Remove. (objfile::unlink): Call remove_objfile. (objfile): Don't call unlink_objfile. Change-Id: I22f768827723dce21886fae9b3664532c8349e68 --- gdb/progspace.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'gdb/progspace.h') diff --git a/gdb/progspace.h b/gdb/progspace.h index bb10c4b..e1fcc3c 100644 --- a/gdb/progspace.h +++ b/gdb/progspace.h @@ -170,6 +170,8 @@ struct program_space list. */ void add_objfile (struct objfile *objfile, struct objfile *before); + /* Remove OBJFILE from the list of objfiles. */ + void remove_objfile (struct objfile *objfile); /* Pointer to next in linked list. */ struct program_space *next = NULL; -- cgit v1.1