Debugger: Add dedicated functions for global {un}init.
[haiku.git] / src / apps / debugger / DebuggerGlobals.cpp
blob68aaf35db3f1a705914af76bfada65e07c794eab
1 /*
2 * Copyright 2009-2016, Ingo Weinhold, ingo_weinhold@gmx.de.
3 * Copyright 2011-2016, Rene Gollent, rene@gollent.com.
4 * Distributed under the terms of the MIT License.
5 */
7 #include "DebuggerGlobals.h"
9 #include "ImageDebugLoadingStateHandlerRoster.h"
10 #include "TargetHostInterface.h"
11 #include "TypeHandlerRoster.h"
14 status_t
15 debugger_global_init(TargetHostInterfaceRoster::Listener* listener)
17 status_t error = TypeHandlerRoster::CreateDefault();
18 if (error != B_OK)
19 return error;
21 error = ImageDebugLoadingStateHandlerRoster::CreateDefault();
22 if (error != B_OK)
23 return error;
25 error = TargetHostInterfaceRoster::CreateDefault(listener);
26 if (error != B_OK)
27 return error;
29 // for now, always create an instance of the local interface
30 // by default
31 TargetHostInterface* hostInterface;
32 TargetHostInterfaceRoster* roster = TargetHostInterfaceRoster::Default();
33 error = roster->CreateInterface(roster->InterfaceInfoAt(0), NULL,
34 hostInterface);
35 if (error != B_OK)
36 return error;
38 return B_OK;
42 void
43 debugger_global_uninit()
45 TargetHostInterfaceRoster::DeleteDefault();
46 ImageDebugLoadingStateHandlerRoster::DeleteDefault();
47 TypeHandlerRoster::DeleteDefault();