- µð¹ö°Å¿¡¼ º¯¼ö°ª ¿©·¯ Çü½ÄÀ¸·Î º¸±â
- Custom Visualizer
- ½ÇÇà ÆÄÀÏ Å©±â ÁÙÀ̱â
- °£´ÜÇÑ ÄÜ¼Ö ÇÁ·Î±×·¥À» À§ÇÑ Makefile
- VC 8.0 - RC1107 ¿¡·¯ ÇØ°áÇϱâ
- ÇÁ·Î¼¼½º¿¡ µð¹ö°Å ºÙÀ̱â
- dumpbin »ç¿ë¹ý
1 µð¹ö°Å¿¡¼ º¯¼ö°ª ¿©·¯ Çü½ÄÀ¸·Î º¸±â
int i = 0x12345678;
ÀÌ·± °ªÀÌ ÀÖÀ» ¶§ µð¹ö°Å â¿¡¼ ÇØ´ç º¯¼ö À̸§ ¾Õ¿¡´Ù by, wo, dwÀ» ºÙÀÌ¸é º¯¼öÀÇ °ªÀ» BYTE, WORD, DWORD Çü½ÄÀ¸·Î º¼ ¼ö ÀÖ´Ù. ·¹Áö½ºÅͰªµµ ¸¶Âù°¡Áö.
i | 0x12345678 | int
by i | 0x78 'x' | unsigned char
wo i | 0x5678 | unsigned short
dw i | 0x12345678 | unsigned long
º¯¼ö¸¦ 8Áø¼ö, 10Áø¼ö, 16Áø¼ö·Î º¸±â À§Çؼ´Â Æ÷¸Ë ÁöÁ¤ÀÚ¸¦ ÀÌ¿ëÇÑ´Ù.
i | 42 | int
i,o | 052 | int
i,d | 42 | int
i,x | 0x0000002a | int
Æ÷ÀÎÅÍ º¯¼ö¸¦ ¹®ÀÚ¿ ÇüÅ·Πº¸·Á¸é "s", "s8", "su"¸¦ ÀÌ¿ëÇÑ´Ù. °¢°¢ ±×³É ¹®ÀÚ¿, UTF-8 ¹®ÀÚ¿, À¯´ÏÄÚµå ¹®ÀÚ¿À» ÀǹÌÇÑ´Ù.
char str[] = "hello";
wchar_t str2[] = L"world";
str | 0x0012ff00 "hello" | char [6]
str,s | "hello" | char [6]
str2 | 0x0012fee8 "world" | wchar_t [6]
(void*)str2,su | "world" | void *
"m" ±ÛÀÚ¸¦ ºÙÀ̸é ÇØ´ç º¯¼öÀÇ ÁּҷκÎÅÍ 64 ¹ÙÀÌÆ®±îÁö¸¦ Âß º¼ ¼ö ÀÖ´Ù.
str,m | 0x0012ff00 68 65 6c 6c 6f 00 cc cc cc cc cc cc cc cc cc cc hello. | char [6]
str,mb | 0x0012ff00 68 65 6c 6c 6f 00 cc cc cc cc cc cc cc cc cc cc hello. | char [6]
str,mw | 0x0012ff00 6568 6c6c 006f cccc cccc cccc cccc cccc | char [6]
str,md | 0x0012ff00 6c6c6568 cccc006f cccccccc cccccccc | char [6]
str2,mu | 0x0012feec 0077 006f 0072 006c 0064 0000 cccc cccc world.?? | wchar_t [6]
str,mq | 0x0012ff00 cccc006f6c6c6568 cccccccccccccccc | char [6]
str,ma | 0x0012ff00 hello.(..(......T.. | char [6]
"wc", "wm", "hr"Àº °¢°¢ À©µµ¿ì Ŭ·¡½º, À©µµ¿ì ¸Þ½ÃÁö, HRESULT¸¦ ÀǹÌÇÑ´Ù.
0x00400000,wc | WS_OVERLAPPEDWINDOW | int
0x10,wm | WM_CLOSE | int
0x10,hr | 0x00000010 The directory cannot be removed. | int
"!" ¿¬»êÀÚ¸¦ ÀÌ¿ëÇϸé STL VisualizationÀ» ²ø ¼ö ÀÖ´Ù.
str | "hello world" | std::basic_string< ... >
str,! | {_Bx={...} _Mysize=0x0000000b _Myres=0x0000000f} | std::basic_string<...>
2 Custom Visualizer
3 ½ÇÇà ÆÄÀÏ Å©±â ÁÙÀ̱â
4 °£´ÜÇÑ ÄÜ¼Ö ÇÁ·Î±×·¥À» À§ÇÑ Makefile
°£´ÜÇÑ Å×½ºÆ® ÇÁ·Î±×·¥ ÀÛ¼ºÇϴµ¥, ÀÏÀÏÀÌ ¼Ö·ç¼Ç ¸¸µå´Â °Íµµ Áö±ßÁö±ßÇØ¼ Çѹø ¸¸µé¾îºÃ´Ù. ÇÁ·ÎÁ§Æ® ÅÛÇø´ ¸¸µå´Â °Íµµ ÇϳªÀÇ ¹æ¹ýÀ̰ÚÁö¸¸...
VCDIR = C:\Program Files\Microsoft Visual Studio 8\VC
#------------------------------------------------------------
# Compiler Settings
#------------------------------------------------------------
CL = "$(VCDIR)\bin\cl.exe"
DEFS = /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS"
CLFLAGS = /Od /EHsc /MTd /W4 /c /nologo /TP /Wp64
INCLUDES = /I "$(VCDIR)\include" /I "$(VCDIR)\PlatformSDK\Include"
#------------------------------------------------------------
# Linker Settings
#------------------------------------------------------------
LINK = "$(VCDIR)\bin\link.exe"
LINKFLAGS = /SUBSYSTEM:console
LIBPATH = /LIBPATH:"$(VCDIR)\lib" /LIBPATH:"$(VCDIR)\PlatformSDK\Lib"
LIBS = libcmtd.lib
#------------------------------------------------------------
# Targets
#------------------------------------------------------------
OBJS = main.obj
TARGET = main.exe
main.exe: $(OBJS)
$(LINK) $(LIBPATH) $(LINKFLAGS) $(LIBS) $(OBJS) /out:$(TARGET)
clean:
-@erase *.obj
-@erase $(TARGET)
.cpp.obj:
$(CL) $(DEFS) $(CLFLAGS) $(INCLUDES) $<
Ä¿¸Çµå ¶óÀο¡¼ ºôµå¸¦ Çϱâ À§Çؼ´Â ¸î°¡Áö ȯ°æ º¯¼ö¸¦ ¼³Á¤ÇØÁà¾ßÇÑ´Ù. À̸¦ À§ÇÑ ½ºÅ©¸³Æ®¸¦ ¸¸µé¾îºÃ´Ù.
vsvars.vbs
Const HKLM = &H80000002
Const strKeyPath = "SYSTEM\CurrentControlSet\Control\Session Manager\Environment"
Const strVsInstallDir = "C:\Program Files\Microsoft Visual Studio 8"
Set objReg = GetObject("winmgmts:{impersonationLevel=impersonate}!\\" & _
"." & "\root\default:StdRegProv")
Set objValues = CreateObject("Scripting.Dictionary")
Set objTargetValues = CreateObject("Scripting.Dictionary")
objTargetValues.Add "Path", _
strVsInstallDir & "\Common7\IDE;" & _
strVsInstallDir & "\Common7\Tools;" & _
strVsInstallDir & "\Common7\Tools\bin;" & _
strVsInstallDir & "\SDK\v2.0\bin;" & _
strVsInstallDir & "\VC\BIN;" & _
strVsInstallDir & "\VC\PlatformSDK\bin;" & _
strVsInstallDir & "\VC\VCPackages;" & _
"C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727;"
objTargetValues.Add "INCLUDE", _
strVsInstallDir & "\VC\ATLMFC\INCLUDE;" & _
strVsInstallDir & "\VC\INCLUDE;" & _
strVsInstallDir & "\VC\PlatformSDK\include;" & _
strVsInstallDir & "\SDK\v2.0\include;"
objTargetValues.Add "LIB", _
strVsInstallDir & "\VC\ATLMFC\LIB;" & _
strVsInstallDir & "\VC\LIB;" & _
strVsInstallDir & "\VC\PlatformSDK\lib;" & _
strVsInstallDir & "\SDK\v2.0\lib;"
objTargetValues.Add "LIBPATH", _
strVsInstallDir & "\VC\ATLMFC\LIB;" & _
"C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727;"
objTargetValues.Add "VSINSTALLDIR", strVsInstallDir
objTargetValues.Add "VCINSTALLDIR", strVsInstallDir & "\VC"
objTargetValues.Add "FrameworkDir", "C:\WINDOWS\Microsoft.NET\Framework"
objTargetValues.Add "FrameworkVersion", "v2.0.50727"
objTargetValues.Add "FrameworkSDKDir", strVsInstallDir & "\SDK\v2.0"
objTargetValues.Add "DevEnvDir", strVsInstallDir & "\Common7\IDE"
objReg.EnumValues HKLM, strKeyPath, arrNames
For Each name In arrNames
If name = "Path" or name = "INCLUDE" or name = "LIB" or name = "LIBPATH" Then
objReg.GetStringValue HKLM, strKeyPath, name, strValue
If Right(strValue, 1) <> ";" Then
strValue = strValue & ";"
End If
objValues.Add name, strValue & objTargetValues.Item(name)
End If
Next
Keys = objTargetValues.Keys
For Each name in Keys
If Not objValues.Exists(name) Then
objValues.Add name, objTargetValues.Item(name)
End If
Next
Keys = objValues.Keys
For Each name in Keys
If name = "Path" or name = "INCLUDE" or name = "LIB" or name = "LIBPATH" Then
value = RemoveDuplicate(objValues.Item(name), ";")
objValues.Item(name) = value
End If
Next
Keys = objValues.Keys
For Each name in Keys
value = objValues.Item(name)
output = value
If name = "Path" or name = "INCLUDE" or name = "LIB" or name = "LIBPATH" Then
value = RemoveDuplicate(objValues.Item(name), ";")
output = Replace(value, ";", ";" & vbLf)
End If
'WScript.Echo name & vbLf & vbLf & output
objReg.SetStringValue HKLM, strKeyPath, name, objValues.Item(name)
Next
WScript.Echo "Finished"
Function RemoveDuplicate(text, seperator)
Set objPathDic = CreateObject("Scripting.Dictionary")
arrPath = Split(text, seperator)
For i = LBound(arrPath) to UBound(arrPath)
key = Trim(LCase(arrPath(i)))
value = Trim(arrPath(i))
If not objPathDic.Exists(key) Then
objPathDic.Add key, value
End If
Next
result = ""
For Each key in objPathDic.Keys
result = result & objPathDic.Item(key) & seperator
Next
If result <> "" Then
RemoveDuplicate = Left(result, Len(result)-1)
Else
RemoveDuplicate = result
End If
End Function
5 VC 8.0 - RC1107 ¿¡·¯ ÇØ°áÇϱâ
6 ÇÁ·Î¼¼½º¿¡ µð¹ö°Å ºÙÀ̱â
- Visual Studio 2003 (VisualCpp 7.1) ±âÁØ
- µð¹ö±× -> ÇÁ·Î¼¼½º -> ÇÁ·Î¼¼½º ¼±Åà -> ¿¬°á.
- ÇÁ·Î¼¼½º ¼±ÅÃÇÑ ´ÙÀ½¿¡ ¿¬°á ¹öưÀ» ´©¸£±â Àü¿¡ CTRL ۸¦ ´©¸£°í ÀÖÀ¸¸é, "µð¹ö±ëÇÒ ÇÁ·Î±×·¥ Á¾·ù ¼±ÅÃ" ´ÙÀ̾ó·Î±×°¡ ¶ßÁö ¾Ê´Â´Ù.
- Ä¿¸Çµå ¶óÀο¡¼ ÇÁ·Î¼¼½º À̸§À» ÀÌ¿ëÇÏ¿© µð¹ö°Å ºÙÀ̱â
attach.bat
rem from http://blogs.msdn.com/greggm/archive/2004/04/22/118475.aspx
@echo off
if "%1"=="-?" goto help
if "%1"=="/?" goto help
if "%1"=="" echo The syntax of the command is incorrect.& exit /b -1
if NOT "%2"=="" echo The syntax of the command is incorrect.& exit /b -1
call :find_file tlist.exe
if NOT %ERRORLEVEL%==0 exit /b %ERRORLEVEL%
if not exist "%CommonProgramFiles%\Microsoft Shared\VS7Debug\vs7jit.exe" echo Could not find vs7jit.exe & exit /b 1
setlocal
set __found=0
for /f "tokens=1,2" %%d in ('tlist.exe') do call :parse_process %1 %%e %%d
if %__found%==0 echo Process '%1' is not running
endlocal
exit /b 0
:parse_process
if /i "%1"=="%2" goto run_command
if /i "%1.exe"=="%2" goto run_command
exit /b 0
:run_command
set __found=1
call "%CommonProgramFiles%\Microsoft Shared\VS7Debug\vs7jit.exe" -p %3
exit /b 0
:find_file
if "%~$PATH:1"=="" if "%~z1" == "" echo Error! Could not find %1. & exit /b -1
exit /b 0
:help
echo attach.bat ^<process_name^>
echo.
echo Debug a process with VS7/VS7.1.
echo example: attach.cmd notepad.exe
echo.
Native Debugging ¿¡¼¸¸ µ¿ÀÛÇÑ´Ù.
7 dumpbin »ç¿ë¹ý
dumpbinÀº ºñÁÖ¾ó ½ºÆ©µð¿À¶û °°ÀÌ µþ·Á¿À´Â ½ÇÇà ÆÄÀÏ ºÐ¼®¿ë À¯Æ¿¸®Æ¼´Ù. Dependency Walker ÀÖÀ¸¸é º°·Î ¾µ ÀÏ ¾ø´Ù¸¸... 2003 ¹öÀüÀÇ °æ¿ì ...vc7/bin µð·ºÅ丮¿¡ Àִµ¥ °æ·Î°¡ ÀâÇôÀÖÁö ¾ÊÀ¸¹Ç·Î Àâ¾ÆÁà¾ßÇÑ´Ù.
»ç¿ë¹ý
dumpbin /dependents ½ÇÇàÆÄÀÏ
ÆÄÀÏÀ» ½ÇÇàÇϱâ À§Çؼ ÇÊ¿äÇÑ DLLÀÇ ¸ñ·ÏÀ» ¾Ë ¼ö ÀÖ´Ù.
dumpbin /imports ½ÇÇàÆÄÀÏ
ÆÄÀÏÀ» ½ÇÇàÇϱâ À§Çؼ ÇÊ¿äÇÑ DLLÀÇ ¸ñ·Ï°ú °¢°¢ÀÇ DLL¿¡¼ ÀÓÆ÷Æ®ÇØ¿À´Â ÇÔ¼öÀÇ ¸ñ·ÏÀ» ¾Ë ¼ö ÀÖ´Ù.
SeriousMoin v1 (koMoinMoin 1.0a4 Modified)