xref: /haiku/src/kits/debugger/dwarf/DwarfManager.h (revision 82bfaa954dcfd90582fb2c1a0e918971eea57091)
1 /*
2  * Copyright 2009, Ingo Weinhold, ingo_weinhold@gmx.de.
3  * Copyright 2014, Rene Gollent, rene@gollent.com.
4  * Distributed under the terms of the MIT License.
5  */
6 #ifndef DWARF_MANAGER_H
7 #define DWARF_MANAGER_H
8 
9 #include <Locker.h>
10 
11 #include <util/DoublyLinkedList.h>
12 
13 
14 class DwarfFile;
15 struct DwarfFileLoadingState;
16 
17 
18 class DwarfManager {
19 public:
20 								DwarfManager(uint8 addressSize, bool isBigEndian);
21 								~DwarfManager();
22 
23 			status_t			Init();
24 
25 			bool				Lock()		{ return fLock.Lock(); }
26 			void				Unlock()	{ fLock.Unlock(); }
27 
28 			status_t			LoadFile(const char* fileName,
29 									DwarfFileLoadingState& _loadingState);
30 									// _loadingState receives a reference
31 									// to the corresponding DwarfFile.
32 
33 			status_t			FinishLoading();
34 
35 private:
36 			typedef DoublyLinkedList<DwarfFile> FileList;
37 
38 private:
39 			uint8				fAddressSize;
40 			bool				fIsBigEndian;
41 			BLocker				fLock;
42 			FileList			fFiles;
43 };
44 
45 
46 
47 #endif	// DWARF_MANAGER_H
48