7 Copyright (C) 2009, Nicolas VIVIEN
9 This program is free software; you can redistribute it and/or modify
10 it under the terms of the GNU General Public License as published by
11 the Free Software Foundation; either version 2 of the License, or
12 (at your option) any later version.
14 This program is distributed in the hope that it will be useful,
15 but WITHOUT ANY WARRANTY; without even the implied warranty of
16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
18 See the GNU General Public License in the COPYING file at the
19 root directory of this project for more details.
22 #ifndef __BARRYJDG_CODINFO_H__
23 #define __BARRYJDG_CODINFO_H__
38 class BXEXPORT DebugFileEntry
48 void Dump(std::ostream
&os
) const;
52 class BXEXPORT DebugFileList
: public std::vector
<DebugFileEntry
>
55 typedef std::vector
<DebugFileEntry
> base_type
;
56 typedef base_type::iterator iterator
;
57 typedef base_type::const_iterator const_iterator
;
60 void AddElement(uint32_t uniqueid
, const std::string
&appname
, const std::string
&filename
);
61 void Dump(std::ostream
&os
) const;
63 inline std::ostream
& operator<<(std::ostream
&os
, const DebugFileList
&list
) {
69 class BXEXPORT ClassEntry
78 // Read from the ".debug" file
79 std::string className
;
80 std::string classPath
;
81 std::string sourceFile
;
92 std::string
GetFullClassName() { return classPath
+ "." + className
; };
96 class BXEXPORT ClassList
: public std::vector
<ClassEntry
>
99 typedef std::vector
<ClassEntry
> base_type
;
100 typedef base_type::iterator iterator
;
101 typedef base_type::const_iterator const_iterator
;
104 void CreateDefaultEntries();
111 class BXEXPORT CodInfo
114 uint32_t ParseNextHeaderField(std::istream
&input
);
115 uint32_t ParseNextTypeField(std::istream
&input
);
117 void ParseAppName(std::istream
&input
);
118 void ParseUniqueId(std::istream
&input
);
120 void ParseBoolean(std::istream
&input
);
121 void ParseByte(std::istream
&input
);
122 void ParseChar(std::istream
&input
);
123 void ParseShort(std::istream
&input
);
124 void ParseInt(std::istream
&input
);
125 void ParseLong(std::istream
&input
);
126 void ParseClass(std::istream
&input
);
127 void ParseArray(std::istream
&input
);
128 void ParseVoid(std::istream
&input
);
129 void ParseDouble(std::istream
&input
);
138 bool LoadDebugFile(const char *filename
);
140 void ParseHeaderSection(std::istream
&input
);
141 void ParseTypeSection(std::istream
&input
);
142 void ParseResourceSection(std::istream
&input
);
144 uint32_t GetUniqueId();
145 std::string
GetAppName();
149 BXEXPORT
void SearchDebugFile(DebugFileList
&list
);
150 BXEXPORT
bool LoadDebugInfo(const DebugFileList
&list
, const char *filename
, CodInfo
&info
);
151 BXEXPORT
bool LoadDebugInfo(const DebugFileList
&list
, const uint32_t uniqueId
, const std::string module
, CodInfo
&info
);