Changeset 467 in dev for trunk/ab5.0/abdev/BasicCompiler_Common/Debug.cpp
- Timestamp:
- Mar 27, 2008, 2:29:35 AM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/ab5.0/abdev/BasicCompiler_Common/Debug.cpp
r455 r467 377 377 void DebugProgram(void){ 378 378 extern HWND hMainDlg; 379 extern char OutputFileName[MAX_PATH];380 379 extern DWORD ImageBase; 381 380 extern int MemPos_CodeSection; … … 419 418 420 419 421 extern BOOL bAttach; 422 if(bAttach){ 423 extern DWORD dwAttachProcessId; 424 420 // デバッグをスタート 421 debugger.DebugStart(); 422 423 424 if( program.IsAttach() ) 425 { 425 426 //プロセスIDを元にハンドルを取得 426 427 HANDLE hProcess; 427 hProcess=OpenProcess(PROCESS_ALL_ACCESS,0, dwAttachProcessId);428 hProcess=OpenProcess(PROCESS_ALL_ACCESS,0, program.GetAttachProcessId() ); 428 429 if(!hProcess) goto AttachError; 429 430 … … 434 435 435 436 //実行ファイル名を取得 436 GetModuleFileNameEx(hProcess,hModule,OutputFileName,MAX_PATH); 437 char tempOutputFileName[MAX_PATH]; 438 GetModuleFileNameEx(hProcess,hModule,tempOutputFileName,MAX_PATH); 439 program.SetOutputFilePath( tempOutputFileName ); 437 440 438 441 CloseHandle(hProcess); … … 440 443 /* 441 444 //デバッグ用の拡張情報を取得 442 pobj_DebugSection->load( OutputFileName);*/443 444 if(!DebugActiveProcess( dwAttachProcessId)){445 pobj_DebugSection->load(program.GetOutputFilePath().c_str());*/ 446 447 if(!DebugActiveProcess( program.GetAttachProcessId() )){ 445 448 AttachError: 446 449 DebugMessage("アタッチに失敗しました。"); … … 449 452 } 450 453 else{ 451 /*if(!pobj_DebugSection->load( OutputFileName)){454 /*if(!pobj_DebugSection->load(program.GetOutputFilePath().c_str())){ 452 455 extern BOOL bDebugCompile; 453 456 bDebugCompile=1; 454 457 OutputExe(); 455 pobj_DebugSection->load( OutputFileName);458 pobj_DebugSection->load(program.GetOutputFilePath().c_str()); 456 459 }*/ 457 460 … … 464 467 if( !compiler.IsDll() ){ 465 468 //EXEファイルをデバッグ 466 CreateProcess( OutputFileName,szDebugCmdLine,NULL,NULL,0,NORMAL_PRIORITY_CLASS|DEBUG_ONLY_THIS_PROCESS|CREATE_NEW_CONSOLE,NULL,NULL,&si,&pi);469 CreateProcess(program.GetOutputFilePath().c_str(),szDebugCmdLine,NULL,NULL,0,NORMAL_PRIORITY_CLASS|DEBUG_ONLY_THIS_PROCESS|CREATE_NEW_CONSOLE,NULL,NULL,&si,&pi); 467 470 } 468 471 else{ … … 537 540 538 541 539 /*if(lstrcmpi(temporary, OutputFileName)==0){542 /*if(lstrcmpi(temporary, program.GetOutputFilePath().c_str())==0){ 540 543 ImageBase=(DWORD)de.u.LoadDll.lpBaseOfDll; 541 544 … … 817 820 SetDlgItemText(hMainDlg,IDOK,STRING_CLOSE); 818 821 822 debugger.FinishDebug(); 823 819 824 SendMessage(hOwnerEditor,WM_DESTROYDEBUGGERBASE,0,0); 820 825 }
Note:
See TracChangeset
for help on using the changeset viewer.