Changeset 263 in dev for trunk/abdev/BasicCompiler_Common/include
- Timestamp:
- Aug 5, 2007, 3:47:49 AM (17 years ago)
- Location:
- trunk/abdev/BasicCompiler_Common/include
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/abdev/BasicCompiler_Common/include/CodeGenerator.h
r262 r263 238 238 } 239 239 pNativeCode = &nativeCode; 240 } 241 242 void NextSourceLine() 243 { 244 pNativeCode->NextSourceLine(); 240 245 } 241 246 -
trunk/abdev/BasicCompiler_Common/include/Linker.h
r258 r263 41 41 } 42 42 43 const NativeCode &GetNativeCode() const 44 { 45 return nativeCode; 46 } 47 43 48 void SetImageBase( DWORD imageBase ) 44 49 { -
trunk/abdev/BasicCompiler_Common/include/NativeCode.h
r258 r263 112 112 typedef std::vector<Schedule> Schedules; 113 113 114 #define CODETYPE_SYSTEMPROC 0x0001 115 #define CODETYPE_DEBUGPROC 0x0002 116 class SourceLine 117 { 118 int lineNum; 119 long nativeCodePos; 120 long sourceCodePos; 121 DWORD codeType; 122 123 // XMLシリアライズ用 124 private: 125 friend class boost::serialization::access; 126 template<class Archive> void serialize(Archive& ar, const unsigned int version) 127 { 128 trace_for_serialize( "serializing - SourceLine" ); 129 130 ar & BOOST_SERIALIZATION_NVP( lineNum ); 131 ar & BOOST_SERIALIZATION_NVP( nativeCodePos ); 132 ar & BOOST_SERIALIZATION_NVP( sourceCodePos ); 133 ar & BOOST_SERIALIZATION_NVP( codeType ); 134 } 135 136 public: 137 SourceLine( int lineNum, int nativeCodePos, int sourceCodePos, DWORD codeType ) 138 : lineNum( lineNum ) 139 , nativeCodePos( nativeCodePos ) 140 , sourceCodePos( sourceCodePos ) 141 , codeType( codeType ) 142 { 143 } 144 SourceLine() 145 { 146 } 147 148 int GetLineNum() const 149 { 150 return lineNum; 151 } 152 long GetNativeCodePos() const 153 { 154 return nativeCodePos; 155 } 156 long GetSourceCodePos() const 157 { 158 return sourceCodePos; 159 } 160 void SetSourceCodePos( int sourceCodePos ) 161 { 162 this->sourceCodePos = sourceCodePos; 163 } 164 DWORD GetCodeType() const 165 { 166 return codeType; 167 } 168 bool IsInSystemProc() const 169 { 170 return ( (codeType&CODETYPE_SYSTEMPROC) != 0 ); 171 } 172 bool IsInDebugProc() const 173 { 174 return ( (codeType&CODETYPE_DEBUGPROC) != 0 ); 175 } 176 }; 177 typedef std::vector<SourceLine> SourceLines; 178 114 179 class NativeCode 115 180 { … … 118 183 int size; 119 184 185 // リンカで解決しなければならないスケジュール 120 186 Schedules schedules; 187 188 // ソースコード行番号とネイティブコード位置の対応情報 189 SourceLines sourceLines; 121 190 122 191 // XMLシリアライズ用 … … 132 201 ar & BOOST_SERIALIZATION_NVP( size ); 133 202 ar & BOOST_SERIALIZATION_NVP( schedules ); 203 ar & BOOST_SERIALIZATION_NVP( sourceLines ); 134 204 135 205 // 読み込み後の処理 … … 163 233 ar & BOOST_SERIALIZATION_NVP( size ); 164 234 ar & BOOST_SERIALIZATION_NVP( schedules ); 235 ar & BOOST_SERIALIZATION_NVP( sourceLines ); 165 236 } 166 237 … … 192 263 Put( nativeCode, isOpBuffer ); 193 264 } 194 NativeCode( const char *codeBuffer, int size )265 NativeCode( const char *codeBuffer, int size, bool isOpBuffer ) 195 266 : allocateSize( 8192 ) 196 267 , codeBuffer( (char *)malloc( allocateSize ) ) 197 268 , size( 0 ) 198 269 { 199 Put( codeBuffer, size );270 Put( codeBuffer, size, isOpBuffer ); 200 271 } 201 272 ~NativeCode() … … 214 285 } 215 286 287 const char *GetCodeBuffer() const 288 { 289 return codeBuffer; 290 } 216 291 int GetSize() const 217 292 { … … 332 407 ObpPlus(); 333 408 } 409 410 void NextSourceLine(); 334 411 };
Note:
See TracChangeset
for help on using the changeset viewer.