Re: RFC: fix bug with std::terminate handler

Tom Tromey
2010-02-25T19:19:52Z

>>>>> "Pedro" == Pedro Alves <pedro@codesourcery.com> writes:

Tom> call_function_by_hand installs a momentary breakpoint on std::terminate,
Tom> and then deletes it later. However, this can cause a double deletion of
Tom> the breakpoint. In the bug, the called function is dlopen, which causes
Tom> gdb to enter solib_add, which calls breakpoint_re_set, deleting the
Tom> momentary breakpoint.

Pedro> Why doesn't stepping over "dlopen", with "(gdb) next" cause the
Pedro> same problem with step-resume breakpoints?

The step-resume breakpoints have type bp_step_resume, which are handled
specially by breakpoint_re_set_one. The std::terminate breakpoint is
just a plain bp_breakpoint.

I suppose I could add a new bptype, though that seems rather heavy for
this.

If you have a particular approach you think would be best, I would be
happy to implement that.

Tom