]> git.ipfire.org Git - thirdparty/binutils-gdb.git/blobdiff - gdb/progspace.c
gdb.base/corefile.exp regression for unix/-m32 on x86_64 (PR 26336)
[thirdparty/binutils-gdb.git] / gdb / progspace.c
index a0b14a6d2eb7cfec0af972e0343a57c11d3f3201..462083ce1f6d444789950434f2b0b8ce556694be 100644 (file)
@@ -198,6 +198,12 @@ program_space::add_objfile (std::shared_ptr<objfile> &&objfile,
 void
 program_space::remove_objfile (struct objfile *objfile)
 {
+  /* Removing an objfile from the objfile list invalidates any frame
+     that was built using frame info found in the objfile.  Reinit the
+     frame cache to get rid of any frame that might otherwise
+     reference stale info.  */
+  reinit_frame_cache ();
+
   auto iter = std::find_if (objfiles_list.begin (), objfiles_list.end (),
                            [=] (const std::shared_ptr<::objfile> &objf)
                            {