test_midbus: don't leak debug sessions
DebugController is responsible for destroying debug sessions in KDevelop. Register test debug sessions with DebugController to properly clean them up. The following note is present in IDebugSession::breakpointController(), IDebugSession::variableController() and IDebugSession::frameStackModel() documentations: @note Implementations must ensure that a <(controller|model)> always exists (even if it is a dummy stub implementation that does nothing), and that it does not change during the lifetime of a session. DebugController::addSession() asserts that these functions return non-null pointers. Therefore TestDebugSession() creates these objects now. Pure virtual MIDebugSession::breakpointController() overrides IDebugSession::breakpointController() and returns MIBreakpointController, which inherits IBreakpointController. TestBreakpointController inherits IBreakpointController, not MIBreakpointController. Thus TestDebugSession has to create non-dummy MIBreakpointController rather than dummy TestBreakpointController. This commit is a proper debug session leak fix that replaces recently reverted fix in a wrong place 1256df11.