- Timestamp:
- Sep 15, 2008, 5:25:08 PM (16 years ago)
- Location:
- trunk/ab5.0
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/ab5.0/abdev/BasicCompiler_Common/VarList.cpp
r743 r748 57 57 } 58 58 else{ 59 if(type.GetBasicType()==MAKE_PTR_TYPE(DEF_SBYTE,1)||type.GetBasicType()==MAKE_PTR_TYPE(DEF_BYTE,1)){ 60 if(ReadProcessMemory(hDebugProcess,(void *)offset,&pData,sizeof(void *),&accessBytes)){ 61 for(i2=0;;i2++){ 62 if(!ReadProcessMemory(hDebugProcess,(void *)(pData+i2),&temporary[i2],1,&accessBytes)){ 59 if(type.GetBasicType()==MAKE_PTR_TYPE(DEF_SBYTE,1)||type.GetBasicType()==MAKE_PTR_TYPE(DEF_BYTE,1)) 60 { 61 // マルチバイト文字列 62 if(ReadProcessMemory(hDebugProcess,(void *)offset,&pData,sizeof(void *),&accessBytes)) 63 { 64 for(i2=0;;i2++) 65 { 66 if(!ReadProcessMemory(hDebugProcess,(void *)(pData+i2),&temporary[i2],sizeof(char),&accessBytes)) 67 { 63 68 i2=-1; 64 69 break; 65 70 } 66 71 if(temporary[i2]=='\0') break; 67 if(i2==64){ 72 if(i2==64) 73 { 68 74 lstrcpy(temporary+i2,"..."); 69 75 break; … … 72 78 if(i2==-1) sprintf(lptv->item.pszText,"%s %d(&H%X)",VarName,(ULONG_PTR)pData,(ULONG_PTR)pData); 73 79 else sprintf(lptv->item.pszText,"%s %d(&H%X) \"%s\"",VarName,(ULONG_PTR)pData,(ULONG_PTR)pData,temporary); 80 } 81 else sprintf(lptv->item.pszText,"%s %s",VarName,STRING_CANNOTACCESS); 82 } 83 else if( type.GetBasicType()==MAKE_PTR_TYPE(DEF_WORD,1) ) 84 { 85 // Unicode文字列 86 if(ReadProcessMemory(hDebugProcess,(void *)offset,&pData,sizeof(void *),&accessBytes)) 87 { 88 WCHAR wstr[255]; 89 for(i2=0;;i2++) 90 { 91 if(!ReadProcessMemory(hDebugProcess,(void *)(pData+i2*sizeof(WCHAR)),&wstr[i2],sizeof(WCHAR),&accessBytes)) 92 { 93 i2=-1; 94 break; 95 } 96 if(wstr[i2]=='\0') break; 97 if(i2==64) 98 { 99 lstrcpyW(wstr+i2,L"..."); 100 break; 101 } 102 } 103 std::string str = Jenga::Common::ToString( std::wstring( wstr ) ); 104 if(i2==-1) sprintf(lptv->item.pszText,"%s %d(&H%X)",VarName,(ULONG_PTR)pData,(ULONG_PTR)pData); 105 else sprintf(lptv->item.pszText,"%s %d(&H%X) \"%s\"",VarName,(ULONG_PTR)pData,(ULONG_PTR)pData,str.c_str()); 74 106 } 75 107 else sprintf(lptv->item.pszText,"%s %s",VarName,STRING_CANNOTACCESS); -
trunk/ab5.0/jenga/src/common/String.cpp
r747 r748 35 35 std::string Jenga::Common::ToString( const std::wstring &wstr ) 36 36 { 37 char *pstr = (char *)malloc( wstr.length() + 1 ); 38 39 WideCharToMultiByte( 40 CP_ACP, 37 int needSize = WideCharToMultiByte( 38 CP_THREAD_ACP, 41 39 0, 42 40 wstr.c_str(), -1, 43 pstr, static_cast<int>(wstr.length()) + 1, 41 NULL, NULL, 42 NULL, NULL ); 43 44 char *pstr = (char *)calloc( needSize + 1, 1 ); 45 WideCharToMultiByte( 46 CP_THREAD_ACP, 47 0, 48 wstr.c_str(), -1, 49 pstr, needSize, 44 50 NULL, NULL ); 45 51
Note:
See TracChangeset
for help on using the changeset viewer.