Re: [PATCH] Switch the inferior too in switch_to_program_space_and_thread (Re: [PATCH v2 08/24] Introduce switch_to_inferior_no_thread)

Tom Tromey
2020-01-10T14:41:11Z

>>>>> "Pedro" == Pedro Alves <palves@redhat.com> writes:

Pedro> The crash happens while doing a breakpoint re-set, called by
Pedro> clear_symtab_users at the tail end of (3). That is, while recreating
Pedro> breakpoints for the current program space, which is the program space
Pedro> we're tearing down. During breakpoint re-set, we try to switch to the
Pedro> new location's pspace (the current pspace set in (1), so the pspace
Pedro> we're tearing down) with switch_to_program_space_and_thread, and that
Pedro> hits the failed assertion.

Whatever happened to fine-grained breakpoint resetting?
Among other things maybe that would help with this sort of problem.

Pedro> I'm not hard set on this approach though; I can go with adding the
Pedro> symfile_add_flags parameter to program_space::free_all_objfiles if
Pedro> people prefer that.

This approach seems fine.
Longer term I would like to get rid of clear_symtab_users. Maybe it
could be replaced with more precisely targeted observers instead.

thanks,
Tom