Changeset 279 in dev for trunk/abdev/BasicCompiler_Common/DebugMiddleFile.cpp
- Timestamp:
- Aug 14, 2007, 3:22:02 AM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/abdev/BasicCompiler_Common/DebugMiddleFile.cpp
r268 r279 55 55 } 56 56 void CDebugSection::make(void){ 57 int i2, i3,BufferSize;57 int i2,BufferSize; 58 58 59 59 if(buffer){ … … 81 81 // テキストデータにシリアライズ 82 82 std::string textString; 83 compiler.GetObjectModule().Write TextString( textString );83 compiler.GetObjectModule().WriteString( textString ); 84 84 85 85 // サイズ … … 100 100 memcpy( buffer+i2, textString.c_str(), textString.size() ); 101 101 i2 += (int)textString.size(); 102 }103 104 // ソースコード105 {106 int length = compiler.source.GetLength();107 if(BufferSize<i2+(int)length+32768){108 while( BufferSize<i2+(int)length+32768 )109 {110 BufferSize+=32768;111 }112 113 buffer=(char *)HeapReAlloc(hHeap,0,buffer,BufferSize);114 }115 116 // バッファ117 lstrcpy( buffer + i2, compiler.source.GetBuffer() );118 i2 += lstrlen(buffer + i2) + 1;119 }120 121 //インクルード情報122 extern INCLUDEFILEINFO IncludeFileInfo;123 *(long *)(buffer+i2)=IncludeFileInfo.FilesNum;124 i2+=sizeof(long);125 for(i3=0;i3<IncludeFileInfo.FilesNum;i3++){126 lstrcpy(buffer+i2,IncludeFileInfo.ppFileNames[i3]);127 i2+=lstrlen(buffer+i2)+1;128 }129 for(i3=0;;i3++){130 buffer[i2++]=(char)IncludeFileInfo.LineOfFile[i3];131 if(IncludeFileInfo.LineOfFile[i3]==-1) break;132 133 //バッファが足りない場合は再確保134 if(BufferSize<i2+32768){135 BufferSize+=32768;136 buffer=(char *)HeapReAlloc(hHeap,0,buffer,BufferSize);137 }138 102 } 139 103 … … 226 190 227 191 // テキストデータからシリアライズ 228 this->objectModule.Read TextString( textString );192 this->objectModule.ReadString( textString ); 229 193 230 194 compiler.SelectObjectModule( this->objectModule ); 231 195 } 232 196 233 // ソースコード234 {235 // バッファ236 compiler.source.SetBuffer(buffer+i2);237 i2 += lstrlen( buffer+i2 ) + 1;238 }239 240 //インクルード情報241 _IncludeFileInfo.FilesNum=*(long *)(buffer+i2);242 i2+=sizeof(long);243 _IncludeFileInfo.ppFileNames=(char **)malloc(_IncludeFileInfo.FilesNum*sizeof(char *));244 for(i3=0;i3<_IncludeFileInfo.FilesNum;i3++){245 if(buffer[i2]=='\0') break;246 _IncludeFileInfo.ppFileNames[i3]=(char *)malloc(lstrlen(buffer+i2)+1);247 lstrcpy(_IncludeFileInfo.ppFileNames[i3],buffer+i2);248 i2+=lstrlen(buffer+i2)+1;249 }250 for(i3=0;;i3++){251 _IncludeFileInfo.LineOfFile[i3]=(long)buffer[i2++];252 if(_IncludeFileInfo.LineOfFile[i3]==-1) break;253 }254 197 255 198 //コードと行番号の関係 … … 294 237 // ブレークポイントを適用 295 238 ///////////////////////////// 296 297 //インクルード情報298 extern INCLUDEFILEINFO IncludeFileInfo;299 IncludeFileInfo=this->_IncludeFileInfo;300 239 301 240 //コードと行番号の関係 … … 412 351 compiler.SelectObjectModule( this->objectModule ); 413 352 414 //インクルード情報415 extern INCLUDEFILEINFO IncludeFileInfo;416 IncludeFileInfo=this->_IncludeFileInfo;417 418 353 //コードと行番号の関係 419 354 extern SourceLines oldSourceLines; … … 433 368 434 369 void CDebugSection::DeleteDebugInfo(void){ 435 int i2;436 437 //インクルード情報を解放438 for(i2=0;i2<_IncludeFileInfo.FilesNum;i2++)439 {440 free(_IncludeFileInfo.ppFileNames[i2]);441 }442 free(_IncludeFileInfo.ppFileNames);443 444 370 //コードバッファを解放 445 371 free(OpBuffer);
Note:
See TracChangeset
for help on using the changeset viewer.