normal practice that should be followed is to compile on host (the
machine that runs debugger also called as development machine ) and
experiment in target viz the vpc you are using
this is recommended because if and when you graduate to a level of
writing critical system drivers that can potentially hose the
operating system you will not be left with ashes instead of your
source code
make it a habit to follow recommended practices learn the rules well
so you know how to break them properly
my normal setup is like this
i make a directory called symbols in some root directory like f:\symbols
i point that directory to Symbol Server via _NT_SYMBOL_PATH
C:\>set _nt_sy
_NT_SYMBOL_PATH=SRV*F:\symbols*http://msdl.microsoft.com/download/symbols
this is for host
in the target if vpc i share the folder f:\symbols and
one more folder say c:\sharedwithvm where i tend to copy the compiled stuff
C:\>wmic logicaldisk get providername , caption /format:list
Caption=Z:
ProviderName=\F:\SYMBOLS
and set the local _nt_symbol path in vpc
C:\>set _nt_sy
_NT_SYMBOL_PATH=SRV*Z:\ (no network access)
some times for os for which i dont have symbols cached in f:\symbols i
set _nt_symbol_path like below so that if i run a lkd session inside
vpc host automatically fetches symbols
C:\>set nt
_NT_SYMBOL_PATH=SRV*Z:*http://msdl.microsoft.com/download/symbols
this probably entails that f:\symbols in host has write access from
virtual environment
which might introduce a security hole so use it with caution
C:\>copy con z:\cianf.txt
hello cianf
^Z
1 file(s) copied.
C:\>
C:\>type f:\SYMBOLS\cianf.txt
hello cianf
C:\>
now when compiling i normally do not use vs projects and go for
compiling and linking with
cl directly by giving args as needed
C:\Documents and Settings\Admin\My Documents\Visual Studio 2008\Projects\WsleTes
tOneAndTwo>cl /Zi WsleTestModOne.cpp /link /release
Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 15.00.30729.01 for 80x86
Copyright (C) Microsoft Corporation. All rights reserved.
WsleTestModOne.cpp
Microsoft (R) Incremental Linker Version 9.00.30729.01
Copyright (C) Microsoft Corporation. All rights reserved.
/out:WsleTestModOne.exe
/debug
/release
WsleTestModOne.obj
C:\Documents and Settings\Admin\My Documents\Visual Studio 2008\Projects\WsleTes
tOneAndTwo>
now i either drag drop the exe to vpc or copy the exe to
c:\sharewithvm and in vpc
why share when i can drag drop ?? it is because when i need to use the
same exe on several os / vm / service packs / either serially are
running parallelly i can simply use one path
C:\Documents and Settings\Admin\My Documents\Visual Studio 2008\Projects\WsleTes
tOneAndTwo>copy WsleTestModOne.exe c:\sharedwithvm. /y
1 file(s) copied.
C:\Documents and Settings\Admin\My Documents\Visual Studio 2008\Projects\WsleTes
tOneAndTwo>
run the executable directly from network share like y:\compiled.exe
kd> g
SXS: BasepSxsCreateFileStream()
NtOpenFile(??\y:\WsleTestModOne.exe.Manifest) failed
Break instruction exception - code 80000003 (first chance)
ntdll!DbgBreakPoint:
001b:7c90120e cc int 3
kd> .process /p /r
Implicit process is now ffb1f020
.cache noforcedecodeptes done
Loading User Symbols
…
kd> kb
ChildEBP RetAddr Args to Child
0012ff6c 00401041 00350000 0012ffc0 0040137c ntdll!DbgBreakPoint
0012ff78 0040137c 00000001 00332ee0 00332f08 WsleTestModOne!main+0x41
[c:\documents and settings\admin\my documents\visual studio
2008\projects\wsletestoneandtwo\wsletestmodone.cpp @ 23]
0012ffc0 7c817067 0000000a 0013f918 7ffdf000
WsleTestModOne!__tmainCRTStartup+0xfb
[f:\dd\vctools\crt_bld\self_x86\crt\src\crt0.c @ 266]
0012fff0 00000000 004013d3 00000000 78746341 kernel32!BaseProcessStart+0x23
beware these practices may not be secure enough
On 5/25/12, xxxxx@alice.it wrote:
> Thanks raj…
>
> I compiled WlseTestOne.exe on target machine itself using MS VC++ as a Debug
> project (AFAIK compiler should insert in the executable itself debugging
> info)
>
> Anyway as you can see on the host (where windbg runs) it seem these
> debugging info are not available…how can i fix this ?
>
> —
> WINDBG is sponsored by OSR
>
> For our schedule of WDF, WDM, debugging and other seminars visit:
> http://www.osr.com/seminars
>
> To unsubscribe, visit the List Server section of OSR Online at
> http://www.osronline.com/page.cfm?name=ListServer
>