Changeset 76 in dev for BasicCompiler_Common
- Timestamp:
- Mar 21, 2007, 9:26:56 PM (18 years ago)
- Location:
- BasicCompiler_Common
- Files:
-
- 3 added
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
BasicCompiler_Common/Class.cpp
r75 r76 784 784 i+=2; 785 785 //アラインメント修飾子 786 if( _memicmp(basbuf+i,"Align(",6)==0){786 if(memicmp(basbuf+i,"Align(",6)==0){ 787 787 i+=6; 788 788 i=JumpStringInPare(basbuf,i)+1; … … 1130 1130 //アラインメント修飾子 1131 1131 int iAlign=0; 1132 if( _memicmp(basbuf+i,"Align(",6)==0){1132 if(memicmp(basbuf+i,"Align(",6)==0){ 1133 1133 i+=6; 1134 1134 i+=GetStringInPare_RemovePare(temporary,basbuf+i)+1; -
BasicCompiler_Common/DebugMiddleFile.cpp
r75 r76 832 832 //プロセスメモリにコピー 833 833 extern HANDLE hDebugProcess; 834 SIZE_T stAccBytes;834 SIZE_T accessBytes; 835 835 WriteProcessMemory(hDebugProcess,(void *)(ULONG_PTR)(dwImageBase+dwRVA_CodeSection), 836 836 BreakStepCodeBuffer, 837 SizeOf_CodeSection,& stAccBytes);837 SizeOf_CodeSection,&accessBytes); 838 838 839 839 … … 849 849 850 850 extern HANDLE hDebugProcess; 851 SIZE_T stAccBytes;851 SIZE_T accessBytes; 852 852 IMAGE_DOS_HEADER ImageDosHeader; 853 ReadProcessMemory(hDebugProcess,hModule,&ImageDosHeader,sizeof(IMAGE_DOS_HEADER),& stAccBytes);853 ReadProcessMemory(hDebugProcess,hModule,&ImageDosHeader,sizeof(IMAGE_DOS_HEADER),&accessBytes); 854 854 855 855 int pe_size; … … 861 861 pe_size=sizeof(IMAGE_NT_HEADERS); 862 862 #endif 863 ReadProcessMemory(hDebugProcess,(void *)(((ULONG_PTR)hModule)+ImageDosHeader.e_lfanew),&pe_hdr,pe_size,& stAccBytes);863 ReadProcessMemory(hDebugProcess,(void *)(((ULONG_PTR)hModule)+ImageDosHeader.e_lfanew),&pe_hdr,pe_size,&accessBytes); 864 864 865 865 IMAGE_SECTION_HEADER *pSectionHdr; … … 869 869 pSectionHdr, 870 870 pe_hdr.FileHeader.NumberOfSections*sizeof(IMAGE_SECTION_HEADER), 871 & stAccBytes);871 &accessBytes); 872 872 873 873 int i; … … 894 894 buffer, 895 895 length, 896 & stAccBytes);896 &accessBytes); 897 897 buffer[length]=0; 898 898 } … … 913 913 ReadProcessMemory(hDebugProcess, 914 914 (void *)(ULONG_PTR)(dwImageBase+dwRVA_CodeSection),OpBuffer, 915 SizeOf_CodeSection,& stAccBytes);915 SizeOf_CodeSection,&accessBytes); 916 916 917 917 -
BasicCompiler_Common/MakeExe.cpp
r75 r76 182 182 183 183 //グローバル変数に関する情報 184 extern int MaxGlobalVarNum;185 184 extern int AllGlobalVarSize; 186 185 extern int AllInitGlobalVarSize; 187 186 globalVars.clear(); 188 MaxGlobalVarNum=0;189 187 AllGlobalVarSize=0; 190 188 AllInitGlobalVarSize=0; -
BasicCompiler_Common/Procedure.h
r75 r76 1 2 struct VARIABLE;3 1 4 2 class Procedure{ -
BasicCompiler_Common/Type.cpp
r75 r76 173 173 int Type::GetBasicSize() const 174 174 { 175 GetBasicSize( basicType ); 176 return 0; 175 return GetBasicSize( basicType ); 177 176 } 178 177 int Type::GetSize() const -
BasicCompiler_Common/VariableOpe.cpp
r75 r76 770 770 } 771 771 772 if( _memicmp(variable,"This.",5)==0){772 if(memicmp(variable,"This.",5)==0){ 773 773 //Thisオブジェクトのメンバを参照するとき 774 774 SlideString(variable+5,-5); … … 1115 1115 // グローバル変数を追加 1116 1116 ///////////////////////// 1117 extern int MaxGlobalVarNum;1118 1117 extern int AllInitGlobalVarSize; 1119 1118 extern int AllGlobalVarSize; -
BasicCompiler_Common/calculation.cpp
r75 r76 555 555 void *offset; 556 556 DWORD dwData; 557 SIZE_T stAccBytes;557 SIZE_T accessBytes; 558 558 float flt; 559 559 … … 579 579 580 580 if(tempType.IsDouble()){ 581 i3=ReadProcessMemory(hDebugProcess,offset,&nums[pnum],sizeof(double),& stAccBytes);581 i3=ReadProcessMemory(hDebugProcess,offset,&nums[pnum],sizeof(double),&accessBytes); 582 582 } 583 583 else if(tempType.IsSingle()){ 584 if(i3=ReadProcessMemory(hDebugProcess,offset,&flt,sizeof(float),& stAccBytes)){584 if(i3=ReadProcessMemory(hDebugProcess,offset,&flt,sizeof(float),&accessBytes)){ 585 585 nums[pnum]=(double)flt; 586 586 } … … 588 588 else if(tempType.IsPointer()){ 589 589 LONG_PTR lpData; 590 if(i3=ReadProcessMemory(hDebugProcess,offset,&lpData,sizeof(LONG_PTR),& stAccBytes)){590 if(i3=ReadProcessMemory(hDebugProcess,offset,&lpData,sizeof(LONG_PTR),&accessBytes)){ 591 591 i64nums[pnum]=(_int64)lpData; 592 592 } … … 595 595 type[pnum]=DEF_INT64; 596 596 597 i3=ReadProcessMemory(hDebugProcess,offset,&i64nums[pnum],sizeof(_int64),& stAccBytes);597 i3=ReadProcessMemory(hDebugProcess,offset,&i64nums[pnum],sizeof(_int64),&accessBytes); 598 598 } 599 599 600 600 else if(tempType.IsLong()){ 601 601 long lData; 602 if(i3=ReadProcessMemory(hDebugProcess,offset,&lData,sizeof(long),& stAccBytes)){602 if(i3=ReadProcessMemory(hDebugProcess,offset,&lData,sizeof(long),&accessBytes)){ 603 603 i64nums[pnum]=(_int64)lData; 604 604 } 605 605 } 606 606 else if(tempType.IsDWord()){ 607 if(i3=ReadProcessMemory(hDebugProcess,offset,&dwData,sizeof(DWORD),& stAccBytes)){607 if(i3=ReadProcessMemory(hDebugProcess,offset,&dwData,sizeof(DWORD),&accessBytes)){ 608 608 i64nums[pnum]=(_int64)dwData; 609 609 } … … 611 611 else if(tempType.IsInteger()){ 612 612 short shortData; 613 if(i3=ReadProcessMemory(hDebugProcess,offset,&shortData,sizeof(short),& stAccBytes)){613 if(i3=ReadProcessMemory(hDebugProcess,offset,&shortData,sizeof(short),&accessBytes)){ 614 614 i64nums[pnum]=(_int64)shortData; 615 615 } … … 617 617 else if(tempType.IsWord()){ 618 618 WORD wData; 619 if(i3=ReadProcessMemory(hDebugProcess,offset,&wData,sizeof(WORD),& stAccBytes)){619 if(i3=ReadProcessMemory(hDebugProcess,offset,&wData,sizeof(WORD),&accessBytes)){ 620 620 i64nums[pnum]=(_int64)wData; 621 621 } … … 623 623 else if(tempType.IsSByte()){ 624 624 char charData; 625 if(i3=ReadProcessMemory(hDebugProcess,offset,&charData,sizeof(char),& stAccBytes)){625 if(i3=ReadProcessMemory(hDebugProcess,offset,&charData,sizeof(char),&accessBytes)){ 626 626 i64nums[pnum]=(_int64)charData; 627 627 } … … 629 629 else if(tempType.IsByte()){ 630 630 BYTE byteData; 631 if(i3=ReadProcessMemory(hDebugProcess,offset,&byteData,sizeof(BYTE),& stAccBytes)){631 if(i3=ReadProcessMemory(hDebugProcess,offset,&byteData,sizeof(BYTE),&accessBytes)){ 632 632 i64nums[pnum]=(_int64)byteData; 633 633 } … … 635 635 else if(tempType.IsBoolean()){ 636 636 BYTE byteData; 637 if(i3=ReadProcessMemory(hDebugProcess,offset,&byteData,sizeof(BYTE),& stAccBytes)){637 if(i3=ReadProcessMemory(hDebugProcess,offset,&byteData,sizeof(BYTE),&accessBytes)){ 638 638 i64nums[pnum]=(_int64)byteData; 639 639 } -
BasicCompiler_Common/common.h
r75 r76 12 12 #include <vector> 13 13 #include <string> 14 #include <fstream> 14 15 15 16 //boost libraries … … 172 173 int FilesNum; 173 174 int LineOfFile[MAX_LEN]; 174 };175 176 177 //変数178 struct VARIABLE{179 char name[255];180 int type;181 union{182 LONG_PTR index;183 CClass *pobj_c;184 }u;185 186 DWORD fRef;187 188 //定数変数かどうか189 bool bConst;190 191 BOOL bArray;192 int SubScripts[MAX_ARRAYDIM];193 194 //コンストラクタ用パラメータ195 char *ConstractParameter;196 197 /* --- オフセット ---198 199 ※グローバル変数で初期バッファがない場合は最上位ビットに1がセットされ、200 初期バッファの有無が識別される。201 (その後、スケジュール実行により、実際の配置に並び替えられる)*/202 int offset;203 204 205 //レキシカルスコープ用206 int ScopeStartAddress;207 int ScopeEndAddress;208 int ScopeLevel;209 BOOL bLiving;210 211 212 int source_code_address;213 175 }; 214 176 … … 482 444 void DeleteProcPtrInfo(void); 483 445 446 //OldStatement.cpp 447 void Opcode_Input(const char *Parameter); 448 void Opcode_Print(const char *Parameter,BOOL bWrite); 449 484 450 //LoopRefCheck.cpp 485 451 class CLoopRefCheck{ -
BasicCompiler_Common/preprocessor.cpp
r69 r76 171 171 172 172 if(buffer[i-1]=='\n'){ 173 if( _memicmp(buffer+i,"#ifdef",6)==0||_memicmp(buffer+i,"#ifndef",7)==0){173 if(memicmp(buffer+i,"#ifdef",6)==0||memicmp(buffer+i,"#ifndef",7)==0){ 174 174 i=Search_endif(buffer,i+6, pLine); 175 175 if(buffer[i]=='\0') break; 176 176 continue; 177 177 } 178 else if( _memicmp(buffer+i,"#endif",6)==0){178 else if(memicmp(buffer+i,"#endif",6)==0){ 179 179 break; 180 180 } … … 222 222 223 223 if(i==0||buffer[i-1]=='\n'){ 224 if( _memicmp(buffer+i,"#ifdef",6)==0||_memicmp(buffer+i,"#ifndef",7)==0){224 if(memicmp(buffer+i,"#ifdef",6)==0||memicmp(buffer+i,"#ifndef",7)==0){ 225 225 i=Search_endif(buffer,i+6); 226 226 if(buffer[i]=='\0') break; 227 227 continue; 228 228 } 229 else if( _memicmp(buffer+i,"#else",5)==0){229 else if(memicmp(buffer+i,"#else",5)==0){ 230 230 i2=5; 231 231 bElse=1; 232 232 break; 233 233 } 234 else if( _memicmp(buffer+i,"#endif",6)==0){234 else if(memicmp(buffer+i,"#endif",6)==0){ 235 235 i2=6; 236 236 bElse=0; … … 252 252 253 253 if(i2==0||buffer[i2-1]=='\n'){ 254 if( _memicmp(buffer+i2,"#ifdef",6)==0||_memicmp(buffer+i2,"#ifndef",7)==0){254 if(memicmp(buffer+i2,"#ifdef",6)==0||memicmp(buffer+i2,"#ifndef",7)==0){ 255 255 i2=Search_endif(buffer,i2+6, &i3 ); 256 256 if(buffer[i2]=='\0') break; 257 257 continue; 258 258 } 259 if( _memicmp(buffer+i2,"#endif",6)==0){259 if(memicmp(buffer+i2,"#endif",6)==0){ 260 260 i2+=6; 261 261 break; … … 279 279 280 280 if(i2==0||buffer[i2-1]=='\n'){ 281 if( _memicmp(buffer+i2,"#ifdef",6)==0||_memicmp(buffer+i2,"#ifndef",7)==0){281 if(memicmp(buffer+i2,"#ifdef",6)==0||memicmp(buffer+i2,"#ifndef",7)==0){ 282 282 i2=Search_endif(buffer,i2+6, &i3 ); 283 283 if(buffer[i2]=='\0') break; 284 284 continue; 285 285 } 286 else if( _memicmp(buffer+i2,"#else",5)==0){286 else if(memicmp(buffer+i2,"#else",5)==0){ 287 287 i2+=5; 288 288 bElse=1; 289 289 break; 290 290 } 291 else if( _memicmp(buffer+i2,"#endif",6)==0){291 else if(memicmp(buffer+i2,"#endif",6)==0){ 292 292 i2+=6; 293 293 bElse=0; … … 307 307 308 308 if(i==0||buffer[i-1]=='\n'){ 309 if( _memicmp(buffer+i,"#ifdef",6)==0||_memicmp(buffer+i,"#ifndef",7)==0){309 if(memicmp(buffer+i,"#ifdef",6)==0||memicmp(buffer+i,"#ifndef",7)==0){ 310 310 i=Search_endif(buffer,i+6); 311 311 if(buffer[i]=='\0') break; 312 312 continue; 313 313 } 314 else if( _memicmp(buffer+i,"#endif",6)==0){314 else if(memicmp(buffer+i,"#endif",6)==0){ 315 315 i2=6; 316 316 bElse=0; … … 336 336 if(i==0||buffer[i-1]=='\n'){ 337 337 sw=0; 338 if( _memicmp(buffer+i,"#define",7)==0){338 if(memicmp(buffer+i,"#define",7)==0){ 339 339 i2=i+7; 340 340 while(buffer[i2]==' '||buffer[i2]=='\t') i2++; … … 355 355 SlideString(buffer+i+i2,-i2); 356 356 } 357 if( _memicmp(buffer+i,"#undef",6)==0){357 if(memicmp(buffer+i,"#undef",6)==0){ 358 358 i2=i+7; 359 359 while(buffer[i2]==' '||buffer[i2]=='\t') i2++; … … 374 374 SlideString(buffer+i+i2,-i2); 375 375 } 376 else if( _memicmp(buffer+i,"#ifdef",6)==0){376 else if(memicmp(buffer+i,"#ifdef",6)==0){ 377 377 preprocessor_ifdef(buffer+i,false); 378 378 continue; 379 379 } 380 else if( _memicmp(buffer+i,"#ifndef",7)==0){380 else if(memicmp(buffer+i,"#ifndef",7)==0){ 381 381 preprocessor_ifdef(buffer+i,true); 382 382 continue;
Note:
See TracChangeset
for help on using the changeset viewer.