Re: RFC: fix crash when inferior exits during "continue"

Tom Tromey
2012-02-16T14:40:39Z

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

Tom> This makes sense to me if the user entered a background command.
Tom> But why not switch if the last command was a foreground command?

Pedro> Yes, agreed. The lame reason is that the original non-stop work didn't
Pedro> care that much about the CLI (and there's no foreground in MI), and I
Pedro> have an old TODO item for that, that I never got around to. :-P

I'll file a bug.

>> +#include <stdio.h>

Pedro> Doesn't look necessary.

Oops, I missed this comment before check-in.
I'll fix it now.

>> static void
>> @@ -1095,6 +1096,8 @@ do_restore_current_thread_cleanup (void *arg)
>> set_current_inferior (find_inferior_id (old->inf_id));
>> }
>>
>> + current_inferior ()->removable = old->was_removable;

Pedro> This is unnecessary. restore_current_thread_cleanup_dtor
Pedro> is called when either you run or discard the cleanup.

I did manage to make this change before committing.

Tom